forked from artix/calamares-extensions
		
	Compare commits
	
		
			8 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 5704e146a0 | ||
|   | 85eb434b57 | ||
|   | 4b2ea61aa3 | ||
|   | 39d25eef1c | ||
|   | e82d32fe66 | ||
|   | a50ab49c22 | ||
|   | a66ab99ce8 | ||
|   | c3170a9dfb | 
							
								
								
									
										25
									
								
								CHANGES
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								CHANGES
									
									
									
									
									
								
							| @@ -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): | ||||
|   | ||||
| @@ -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 ) | ||||
|   | ||||
| @@ -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); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -22,6 +22,9 @@ public: | ||||
|  | ||||
| protected Q_SLOTS: | ||||
|     void fsarchiverProgress( QString line ); | ||||
|  | ||||
| private: | ||||
|     int m_since = 0; | ||||
| }; | ||||
|  | ||||
| #endif | ||||
|   | ||||
| @@ -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 }, | ||||
|   | ||||
							
								
								
									
										2
									
								
								modules/unpackfsc/tests/1.global
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								modules/unpackfsc/tests/1.global
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| --- | ||||
| rootMountPoint: /tmp/fstest | ||||
							
								
								
									
										4
									
								
								modules/unpackfsc/tests/1.job
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								modules/unpackfsc/tests/1.job
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,4 @@ | ||||
| --- | ||||
| source: /tmp/src.fsa | ||||
| sourcefs: fsarchive | ||||
| destination: "/calasrc" | ||||
| @@ -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: "/" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user