8 Commits

Author SHA1 Message Date
Adriaan de Groot
5704e146a0 Changes: pre-release housekeeping 2021-11-16 13:10:36 +01:00
Adriaan de Groot
85eb434b57 Merge branch 'fsarchiver' into calamares 2021-11-16 13:07:14 +01:00
Adriaan de Groot
4b2ea61aa3 [unpackfs] Document that fsarchiver uses savedir/restdir 2021-11-16 13:04:54 +01:00
Adriaan de Groot
39d25eef1c [unpackfsc] Reduce number of status updates in fsarchiver 2021-11-16 13:00:00 +01:00
Adriaan de Groot
e82d32fe66 [unpackfsc] Use restdir instead of restfs 2021-11-16 12:58:17 +01:00
Adriaan de Groot
a50ab49c22 [unpackfsc] Add test-configs for fsarchiver-unpack 2021-11-16 12:52:34 +01:00
Adriaan de Groot
a66ab99ce8 [unpackfsc] Report fsarchiver progress, too 2021-11-16 12:24:33 +01:00
Adriaan de Groot
c3170a9dfb Changes: post-release housekeeping 2021-11-16 12:12:21 +01:00
8 changed files with 65 additions and 5 deletions

25
CHANGES
View File

@@ -6,6 +6,31 @@ This is the changelog for Calamares-Extensions. For each release, the major
changes and contributors are listed. Note that Calamares-Extensions does not
have a historical changelog -- this log starts with version 1.0.0.
# 1.2.1 (2021-11-16)
The 1.2.0 release had no release-notes for that version, and failed to
credit Anke and Otus.
Changes and new modules in this release:
- *unpackfsc* can use `fsarchiver` and unpack that, instead of squashfs;
a distro might choose one tool or the other. Currently, only *savedir* /
*restdir* mode (i.e. directories, not block-devices) are supported.
# 1.2.0 (2021-11-16)
This release contains contributions from (alphabetically by first name):
- Anke Boersma
- Otus9051
Changes and new modules in this release:
- *refind* is a new module that installs the rEFInd bootloader. It can
be used instead of the *bootloader* module from core Calamares. (Thanks Anke)
- *unpackfsc* is a new module that uses `unsquashfs` directly. This may
be faster or more convenient than the *unpackfs* module from core Calamares.
The configuration file supports only one entry, but is otherwise easy to
adapt from an existing `unpackfs.conf`.
# 1.1.2 (2021-05-14)
This release contains contributions from (alphabetically by first name):

View File

@@ -40,7 +40,7 @@
#
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
set( CALAMARES_EXTENSIONS_VERSION 1.2.0 )
set( CALAMARES_EXTENSIONS_VERSION 1.2.1 )
include( ${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake )
if ( CMAKE_SCRIPT_MODE_FILE )

View File

@@ -14,6 +14,7 @@
#include <QProcess>
static constexpr const int chunk_size = 137;
Calamares::JobResult
FSArchiverRunner::run()
@@ -37,11 +38,20 @@ FSArchiverRunner::run()
Calamares::JobResult::MissingRequirements );
}
const QString destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination );
if ( destinationPath.isEmpty() )
{
return Calamares::JobResult::internalError(
tr( "Invalid fsarchiver configuration" ),
tr( "No destination could be found for <i>%1</i>." ).arg( m_destination ),
Calamares::JobResult::InvalidConfiguration );
}
Calamares::Utils::Runner r( { fsarchiverExecutable,
QStringLiteral( "-v" ),
QStringLiteral( "restfs" ),
QStringLiteral( "restdir" ),
m_source,
QStringLiteral( "id=0,dest=%1" ).arg( m_destination ) } );
destinationPath } );
r.setLocation( Calamares::Utils::RunLocation::RunInHost ).enableOutputProcessing();
connect( &r, &decltype( r )::output, this, &FSArchiverRunner::fsarchiverProgress );
return r.run().explainProcess( toolName, std::chrono::seconds( 0 ) );
@@ -50,5 +60,15 @@ FSArchiverRunner::run()
void
FSArchiverRunner::fsarchiverProgress( QString line )
{
cDebug() << Logger::SubEntry << line;
m_since++;
// Typical line of output is this:
// -[00][ 99%][REGFILEM] /boot/thing
// 5 9 ^21
if (m_since >= chunk_size && line.length() > 21 && line[5] == '[' && line[9] == '%')
{
m_since = 0;
double p = double(line.mid(6,3).toInt()) / 100.0;
const QString filename = line.mid(22);
Q_EMIT progress(p, filename);
}
}

View File

@@ -22,6 +22,9 @@ public:
protected Q_SLOTS:
void fsarchiverProgress( QString line );
private:
int m_since = 0;
};
#endif

View File

@@ -30,6 +30,8 @@ typeNames()
{ "fsarchiver", T::FSArchive },
{ "fsarchive", T::FSArchive },
{ "fsa", T::FSArchive },
{ "fsa-dir", T::FSArchive },
// TODO: support fsa-block, savefs/restfs format
{ "squashfs", T::Squashfs },
{ "squash", T::Squashfs },
{ "unsquash", T::Squashfs },

View File

@@ -0,0 +1,2 @@
---
rootMountPoint: /tmp/fstest

View File

@@ -0,0 +1,4 @@
---
source: /tmp/src.fsa
sourcefs: fsarchive
destination: "/calasrc"

View File

@@ -2,7 +2,7 @@
# SPDX-License-Identifier: CC0-1.0
#
# Unpack a filesystem. Supported ways to "pack" the filesystem are:
# - fsarchiver
# - fsarchiver in *savedir/restdir* mode (directories, not block devices)
# - squashfs
#
# Configuration:
@@ -21,11 +21,15 @@
# - *sourcefs* the type of the source files; valid entries are
# - `none` (this entry is ignored; kind of useless)
# - `fsarchiver`
# Aliases of this are `fsarchive`, `fsa` and `fsa-dir`.
# - `squashfs`
# Aliases of this are `squash` and `unsquash`.
# - *destination* path relative to rootMountPoint (so in the target
# system) where this filesystem is unpacked. It may be an
# empty string, which effectively is / (the root) of the target
# system.
#
# TODO: add `fsa-block` and support for *savefs/restfs* mode.
source: /data/rootfs.fsa
sourcefs: fsarchiver
destination: "/"