Merge branch 'development' into 3.2.x-stable

This commit is contained in:
Philip Müller 2019-10-15 10:22:14 +02:00
commit 7eca163385
22 changed files with 839 additions and 98 deletions

15
CHANGES
View File

@ -3,14 +3,27 @@ contributors are listed. Note that Calamares does not have a historical
changelog -- this log starts with version 3.2.0. The release notes on the
website will have to do for older versions.
# 3.2.15 (unreleased) #
# 3.2.15 (2019-10-11) #
This release contains contributions from (alphabetically by first name):
- No other contributors this time around.
## Core ##
- No changes to core functionality
## Modules ##
- *displaymanager* module now treats *sysconfig* as a regular entry in the
*displaymanagers* list, and the *sysconfigSetup* key is used as a
shorthand to force **only** that entry in the list. #1253
- *machineid* module has been re-written in C++ and extended with
a new configuration key to generate urandom pool data. #1252
- *unpackfs* now supports a special *sourcefs* value of `file`
for copying single files (optionally with renaming) or directory
trees to the target system.
- *unpackfs* now support an *exclude* and *excludeFile* setting for
excluding particular files or patters from unpacking. #1229
# 3.2.14 (2019-09-30) #

View File

@ -114,6 +114,10 @@ Name[mk]=Инсталирај го системот
Icon[mk]=calamares
GenericName[mk]=Системен Инсталер
Comment[mk]=Calamares - Системен Инсталер
Name[ml]=ി
Icon[ml]=
GenericName[ml]=ി
Comment[ml]= - ി
Name[nb]=Installer System
Icon[nb]=calamares
GenericName[nb]=Systeminstallatør

View File

@ -159,12 +159,12 @@
<message>
<location filename="../src/libcalamares/ProcessJob.cpp" line="52"/>
<source>Run command &apos;%1&apos; in target system.</source>
<translation>Paleisti paskirties sistemoje komandą &quot;%1&quot;.</translation>
<translation>Paleisti paskirties sistemoje komandą %1.</translation>
</message>
<message>
<location filename="../src/libcalamares/ProcessJob.cpp" line="52"/>
<source> Run command &apos;%1&apos;.</source>
<translation>Paleisti komandą &quot;%1&quot;.</translation>
<translation>Paleisti komandą %1.</translation>
</message>
<message>
<location filename="../src/libcalamares/ProcessJob.cpp" line="59"/>
@ -882,7 +882,7 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti.</translation>
<message>
<location filename="../src/modules/partition/jobs/CreateVolumeGroupJob.cpp" line="65"/>
<source>The installer failed to create a volume group named &apos;%1&apos;.</source>
<translation>Diegimo programai nepavyko sukurti tomų grupės, pavadinimu &quot;%1&quot;.</translation>
<translation>Diegimo programai nepavyko sukurti tomų grupės pavadinimu %1.</translation>
</message>
</context>
<context>
@ -1575,7 +1575,7 @@ Diegimo programa užbaigs darbą ir visi pakeitimai bus prarasti.</translation>
<message>
<location filename="../src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp" line="200"/>
<source>Could not create LUKS key file for root partition %1.</source>
<translation>Nepavyko šaknies skaidiniui %1 sukurti LUKS rakto failo. </translation>
<translation>Nepavyko šakniniam skaidiniui %1 sukurti LUKS rakto failo. </translation>
</message>
<message>
<location filename="../src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp" line="208"/>
@ -2597,7 +2597,7 @@ Išvestis:
<location filename="../src/modules/fsresizer/ResizeFSJob.cpp" line="237"/>
<location filename="../src/modules/fsresizer/ResizeFSJob.cpp" line="254"/>
<source>Resize Failed</source>
<translation>Dydžio keitimas patyrė nesėkmę</translation>
<translation>Dydžio pakeisti nepavyko</translation>
</message>
<message>
<location filename="../src/modules/fsresizer/ResizeFSJob.cpp" line="207"/>
@ -2679,7 +2679,7 @@ Išvestis:
<message>
<location filename="../src/modules/partition/jobs/ResizeVolumeGroupJob.cpp" line="70"/>
<source>The installer failed to resize a volume group named &apos;%1&apos;.</source>
<translation>Diegimo programai nepavyko pakeisti tomų grupės, pavadinimu &quot;%1&quot;, dydį.</translation>
<translation>Diegimo programai nepavyko pakeisti tomų grupės, kurios pavadinimas %1, dydžio.</translation>
</message>
</context>
<context>

View File

@ -1360,12 +1360,12 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/keyboard/KeyboardPage.cpp" line="219"/>
<source>Set keyboard model to %1.&lt;br/&gt;</source>
<translation type="unfinished"/>
<translation> %1 ി ി.&lt;br/&gt;</translation>
</message>
<message>
<location filename="../src/modules/keyboard/KeyboardPage.cpp" line="223"/>
<source>Set keyboard layout to %1/%2.</source>
<translation type="unfinished"/>
<translation> ി %1%2 ി ി.</translation>
</message>
</context>
<context>
@ -1446,7 +1446,7 @@ The installer will quit and all changes will be lost.</source>
<location filename="../src/modules/license/LicenseWidget.cpp" line="123"/>
<source>&lt;strong&gt;%1 driver&lt;/strong&gt;&lt;br/&gt;by %2</source>
<extracomment>%1 is an untranslatable product name, example: Creative Audigy driver</extracomment>
<translation type="unfinished"/>
<translation>&lt;strong&gt;%1 &lt;/strong&gt;&lt;br/&gt;%2 </translation>
</message>
<message>
<location filename="../src/modules/license/LicenseWidget.cpp" line="130"/>
@ -1552,7 +1552,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp" line="39"/>
<source>Configuring LUKS key file.</source>
<translation type="unfinished"/>
<translation>LUKS ി.</translation>
</message>
<message>
<location filename="../src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp" line="156"/>
@ -1570,17 +1570,17 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp" line="193"/>
<source>Root partition %1 is LUKS but no passphrase has been set.</source>
<translation type="unfinished"/>
<translation> %1 LUKS ിിി.</translation>
</message>
<message>
<location filename="../src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp" line="200"/>
<source>Could not create LUKS key file for root partition %1.</source>
<translation type="unfinished"/>
<translation> %1 ി LUKS ിിി.</translation>
</message>
<message>
<location filename="../src/modules/luksbootkeyfile/LuksBootKeyFileJob.cpp" line="208"/>
<source>Could configure LUKS key file on partition %1.</source>
<translation type="unfinished"/>
<translation> %1 LUKS ി.</translation>
</message>
</context>
<context>
@ -1670,7 +1670,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/users/CheckPWQuality.cpp" line="176"/>
<source>Memory allocation error when setting &apos;%1&apos;</source>
<translation type="unfinished"/>
<translation>&apos;%1&apos; ിി ി ി</translation>
</message>
<message>
<location filename="../src/modules/users/CheckPWQuality.cpp" line="180"/>
@ -2247,12 +2247,12 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/partition/gui/PartitionViewStep.cpp" line="429"/>
<source>EFI system partition flag not set</source>
<translation type="unfinished"/>
<translation> ി ിിി</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/PartitionViewStep.cpp" line="430"/>
<source>An EFI system partition is necessary to start %1.&lt;br/&gt;&lt;br/&gt;A partition was configured with mount point &lt;strong&gt;%2&lt;/strong&gt; but its &lt;strong&gt;esp&lt;/strong&gt; flag is not set.&lt;br/&gt;To set the flag, go back and edit the partition.&lt;br/&gt;&lt;br/&gt;You can continue without setting the flag but your system may fail to start.</source>
<translation type="unfinished"/>
<translation>%1 ിിി .&lt;br/&gt;&lt;br/&gt; ി &lt;strong&gt;%2 -&lt;/strong&gt;ി ിിി, ി &lt;strong&gt;esp&lt;/strong&gt; ിിി.&lt;br/&gt; ിി ിി ി ി.&lt;br/&gt;&lt;br/&gt; ി , ി ിി.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/PartitionViewStep.cpp" line="465"/>
@ -2267,7 +2267,7 @@ The installer will quit and all changes will be lost.</source>
<message>
<location filename="../src/modules/partition/gui/PartitionViewStep.cpp" line="650"/>
<source>has at least one disk device available.</source>
<translation type="unfinished"/>
<translation> ി ിി .</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/PartitionViewStep.cpp" line="651"/>
@ -2339,14 +2339,17 @@ The installer will quit and all changes will be lost.</source>
<location filename="../src/libcalamares/utils/CalamaresUtilsSystem.cpp" line="407"/>
<source>
There was no output from the command.</source>
<translation type="unfinished"/>
<translation>
ി ി ി.</translation>
</message>
<message>
<location filename="../src/libcalamares/utils/CalamaresUtilsSystem.cpp" line="408"/>
<source>
Output:
</source>
<translation type="unfinished"/>
<translation>
</translation>
</message>
<message>
<location filename="../src/libcalamares/utils/CalamaresUtilsSystem.cpp" line="412"/>
@ -2356,7 +2359,7 @@ Output:
<message>
<location filename="../src/libcalamares/utils/CalamaresUtilsSystem.cpp" line="413"/>
<source>Command &lt;i&gt;%1&lt;/i&gt; crashed.</source>
<translation type="unfinished"/>
<translation> &lt;i&gt;%1&lt;/i&gt; ിി.</translation>
</message>
<message>
<location filename="../src/libcalamares/utils/CalamaresUtilsSystem.cpp" line="418"/>
@ -2371,7 +2374,7 @@ Output:
<message>
<location filename="../src/libcalamares/utils/CalamaresUtilsSystem.cpp" line="423"/>
<source>Internal error when starting command.</source>
<translation type="unfinished"/>
<translation> ിി ി ി.</translation>
</message>
<message>
<location filename="../src/libcalamares/utils/CalamaresUtilsSystem.cpp" line="424"/>
@ -2425,17 +2428,17 @@ Output:
<message>
<location filename="../src/modules/partition/core/KPMHelpers.cpp" line="211"/>
<source>unformatted</source>
<translation type="unfinished"/>
<translation> </translation>
</message>
<message>
<location filename="../src/modules/partition/core/KPMHelpers.cpp" line="213"/>
<source>swap</source>
<translation type="unfinished"/>
<translation></translation>
</message>
<message>
<location filename="../src/modules/partition/gui/PartitionLabelsView.cpp" line="51"/>
<source>Unpartitioned space or unknown partition table</source>
<translation type="unfinished"/>
<translation> ി ിി ി</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/PartitionDialogHelpers.cpp" line="47"/>
@ -2445,7 +2448,7 @@ Output:
<message>
<location filename="../src/libcalamaresui/modulesystem/RequirementsChecker.cpp" line="65"/>
<source>Requirements checking for module &lt;i&gt;%1&lt;/i&gt; is complete.</source>
<translation type="unfinished"/>
<translation>&lt;i&gt;%1&lt;/i&gt;ി ിി ിിി.</translation>
</message>
<message>
<location filename="../src/libcalamares/locale/Label.cpp" line="46"/>
@ -2493,27 +2496,27 @@ Output:
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="135"/>
<source>Select where to install %1.&lt;br/&gt;&lt;font color=&quot;red&quot;&gt;Warning: &lt;/font&gt;this will delete all files on the selected partition.</source>
<translation type="unfinished"/>
<translation>%1 ി ി.&lt;br/&gt;&lt;font color=&quot;red&quot;&gt;ിി: &lt;/font&gt; ി ി .</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="161"/>
<source>The selected item does not appear to be a valid partition.</source>
<translation type="unfinished"/>
<translation>ി ി ി.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="169"/>
<source>%1 cannot be installed on empty space. Please select an existing partition.</source>
<translation type="unfinished"/>
<translation>%1 ിി. ി ിി ി.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="179"/>
<source>%1 cannot be installed on an extended partition. Please select an existing primary or logical partition.</source>
<translation type="unfinished"/>
<translation>%1 ി ിി. ി ിി ി ി ി ി.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="189"/>
<source>%1 cannot be installed on this partition.</source>
<translation type="unfinished"/>
<translation>%1 ി ിി.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="195"/>
@ -2533,19 +2536,19 @@ Output:
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="228"/>
<source>&lt;strong&gt;%4&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;The partition %1 is too small for %2. Please select a partition with capacity at least %3 GiB.</source>
<translation type="unfinished"/>
<translation>&lt;strong&gt;%4&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt; %1 %2 . ി %3ിി ി.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="251"/>
<source>&lt;strong&gt;%2&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1.</source>
<translation type="unfinished"/>
<translation>&lt;strong&gt;%2&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt; ിി ി ി ി. %1 ിി ി ിിി ി ി.</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="262"/>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="279"/>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="303"/>
<source>&lt;strong&gt;%3&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;%1 will be installed on %2.&lt;br/&gt;&lt;font color=&quot;red&quot;&gt;Warning: &lt;/font&gt;all data on partition %2 will be lost.</source>
<translation type="unfinished"/>
<translation>&lt;strong&gt;%3&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;%1 %2 .&lt;br/&gt;&lt;font color=&quot;red&quot;&gt;ിി:&lt;/font&gt; %2 .</translation>
</message>
<message>
<location filename="../src/modules/partition/gui/ReplaceWidget.cpp" line="271"/>
@ -2777,7 +2780,7 @@ Output:
<location filename="../src/modules/keyboard/SetKeyboardLayoutJob.cpp" line="326"/>
<location filename="../src/modules/keyboard/SetKeyboardLayoutJob.cpp" line="332"/>
<source>Failed to write to %1</source>
<translation type="unfinished"/>
<translation>%1 ി </translation>
</message>
<message>
<location filename="../src/modules/keyboard/SetKeyboardLayoutJob.cpp" line="325"/>
@ -2795,27 +2798,27 @@ Output:
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="49"/>
<source>Set flags on partition %1.</source>
<translation type="unfinished"/>
<translation> %1 ി.</translation>
</message>
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="52"/>
<source>Set flags on %1MiB %2 partition.</source>
<translation type="unfinished"/>
<translation>%1ി %2 ി.</translation>
</message>
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="56"/>
<source>Set flags on new partition.</source>
<translation type="unfinished"/>
<translation>ി ി ി.</translation>
</message>
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="67"/>
<source>Clear flags on partition &lt;strong&gt;%1&lt;/strong&gt;.</source>
<translation type="unfinished"/>
<translation>&lt;strong&gt;%1&lt;/strong&gt; ി .</translation>
</message>
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="71"/>
<source>Clear flags on %1MiB &lt;strong&gt;%2&lt;/strong&gt; partition.</source>
<translation type="unfinished"/>
<translation>%1ി &lt;strong&gt;%2&lt;/strong&gt; ി ി.</translation>
</message>
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="85"/>
@ -2835,7 +2838,7 @@ Output:
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="75"/>
<source>Clear flags on new partition.</source>
<translation type="unfinished"/>
<translation>ി ി .</translation>
</message>
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="79"/>
@ -2850,12 +2853,12 @@ Output:
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="103"/>
<source>Clearing flags on partition &lt;strong&gt;%1&lt;/strong&gt;.</source>
<translation type="unfinished"/>
<translation> &lt;strong&gt;%1&lt;/strong&gt; .</translation>
</message>
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="111"/>
<source>Clearing flags on new partition.</source>
<translation type="unfinished"/>
<translation>ി ി .</translation>
</message>
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="115"/>
@ -2870,7 +2873,7 @@ Output:
<message>
<location filename="../src/modules/partition/jobs/SetPartitionFlagsJob.cpp" line="144"/>
<source>The installer failed to set flags on partition %1.</source>
<translation type="unfinished"/>
<translation> %1 ിി .</translation>
</message>
</context>
<context>
@ -2908,7 +2911,7 @@ Output:
<message>
<location filename="../src/modules/users/SetPasswordJob.cpp" line="139"/>
<source>Cannot set password for user %1.</source>
<translation type="unfinished"/>
<translation> %1ി ിി.</translation>
</message>
<message>
<location filename="../src/modules/users/SetPasswordJob.cpp" line="141"/>

View File

@ -2979,7 +2979,7 @@ Saída de Dados:
<message>
<location filename="../src/modules/summary/SummaryPage.cpp" line="57"/>
<source>This is an overview of what will happen once you start the setup procedure.</source>
<translation type="unfinished"/>
<translation>Isto é uma visão geral do que acontecerá assim que iniciar o procedimento de configuração.</translation>
</message>
<message>
<location filename="../src/modules/summary/SummaryPage.cpp" line="60"/>

Binary file not shown.

View File

@ -5,6 +5,7 @@
#
# Translators:
# Moo, 2019
# Mindaugas <opensuse.lietuviu.kalba@gmail.com>, 2019
#
#, fuzzy
msgid ""
@ -13,7 +14,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-09-15 21:54+0200\n"
"PO-Revision-Date: 2017-08-09 10:34+0000\n"
"Last-Translator: Moo, 2019\n"
"Last-Translator: Mindaugas <opensuse.lietuviu.kalba@gmail.com>, 2019\n"
"Language-Team: Lithuanian (https://www.transifex.com/calamares/teams/20061/lt/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -103,7 +104,7 @@ msgstr "rsync patyrė nesėkmę su klaidos kodu {}."
#: src/modules/unpackfs/main.py:221 src/modules/unpackfs/main.py:239
msgid "Failed to unpack image \"{}\""
msgstr "Nepavyko išpakuoti atvaizdį \"{}\""
msgstr "Nepavyko išpakuoti atvaizdį „{}“"
#: src/modules/unpackfs/main.py:222
msgid ""
@ -119,7 +120,7 @@ msgstr "Nėra prijungimo taško šaknies skaidiniui"
#: src/modules/unpackfs/main.py:322
msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing"
msgstr "globalstorage viduje nėra \"rootMountPoint\" rakto, nieko nedaroma"
msgstr "globalstorage viduje nėra „rootMountPoint“ rakto, nieko nedaroma"
#: src/modules/unpackfs/main.py:327
msgid "Bad mount point for root partition"
@ -127,7 +128,7 @@ msgstr "Blogas šaknies skaidinio prijungimo taškas"
#: src/modules/unpackfs/main.py:328
msgid "rootMountPoint is \"{}\", which does not exist, doing nothing"
msgstr "rootMountPoint yra \"{}\", kurio nėra, nieko nedaroma"
msgstr "rootMountPoint yra „{}“, kurio nėra, nieko nedaroma"
#: src/modules/unpackfs/main.py:341 src/modules/unpackfs/main.py:348
#: src/modules/unpackfs/main.py:353
@ -136,15 +137,15 @@ msgstr "Bloga unsquash konfigūracija"
#: src/modules/unpackfs/main.py:342
msgid "The filesystem for \"{}\" ({}) is not supported"
msgstr "\"{}\" ({}) failų sistema yra nepalaikoma"
msgstr "„{}“ ({}) failų sistema yra nepalaikoma"
#: src/modules/unpackfs/main.py:349
msgid "The source filesystem \"{}\" does not exist"
msgstr "Šaltinio failų sistemos \"{}\" nėra"
msgstr "Šaltinio failų sistemos „{}“ nėra"
#: src/modules/unpackfs/main.py:354
msgid "The destination \"{}\" in the target system is not a directory"
msgstr "Paskirties vieta \"{}\", esanti paskirties sistemoje, nėra katalogas"
msgstr "Paskirties vieta „{}“, esanti paskirties sistemoje, nėra katalogas"
#: src/modules/displaymanager/main.py:401
msgid "Cannot write KDM configuration file"
@ -176,7 +177,7 @@ msgstr "Nepavyksta konfigūruoti LightDM"
#: src/modules/displaymanager/main.py:623
msgid "No LightDM greeter installed."
msgstr "Nėra įdiegtas joks LightDM sveikintojas."
msgstr "Neįdiegtas joks LightDM pasisveikinimas."
#: src/modules/displaymanager/main.py:654
msgid "Cannot write SLIM configuration file"

View File

@ -46,11 +46,16 @@ public:
InvalidConfiguration = 2
};
// Can't copy, but you can keep a temporary
JobResult( const JobResult& rhs ) = delete;
JobResult( JobResult&& rhs );
virtual ~JobResult() {}
/** @brief Is this JobResult a success?
*
* Equivalent to errorCode() == 0, might be named isValid().
*/
virtual operator bool() const;
virtual QString message() const;
@ -63,9 +68,16 @@ public:
/// @brief an "ok status" result
static JobResult ok();
/// @brief an "error" result resulting from the execution of the job
/** @brief an "error" result resulting from the execution of the job
*
* The error code is set to GenericError.
*/
static JobResult error( const QString& message, const QString& details = QString() );
/// @brief an "internal error" meaning the job itself has a problem (usually for python)
/** @brief an "internal error" meaning the job itself has a problem (usually for python)
*
* Pass in a suitable error code; using 0 (which would normally mean "ok") instead
* gives you a GenericError code.
*/
static JobResult internalError( const QString&, const QString& details, int errorCode );
protected:

View File

@ -1,9 +1,17 @@
# Configure one or more display managers (e.g. SDDM)
# with a "best effort" approach.
#
# This module also sets up autologin, if the feature is enabled in
# globalstorage (where it would come from the users page).
---
#The DM module attempts to set up all the DMs found in this list, in that precise order.
#It also sets up autologin, if the feature is enabled in globalstorage.
#The displaymanagers list can also be set in globalstorage, and in that case it overrides anything set up here.
# The DM module attempts to set up all the DMs found in this list, in the
# precise order listed. The displaymanagers list can also be set in
# globalstorage, and in that case it overrides the setting here.
#
# If *sysconfigSetup* is set to *true* (see below, only relevant for
# openSUSE derivatives) then this list is ignored and only sysconfig
# is attempted. You can also list "sysconfig" in this list instead.
#
displaymanagers:
- slim
- sddm
@ -43,4 +51,8 @@ basicSetup: false
# If true, setup autologin for openSUSE. This only makes sense on openSUSE
# derivatives or other systems where /etc/sysconfig/displaymanager exists.
#
# The preferred way to pick sysconfig is to just list it in the
# *displaymanagers* list (as the only one).
#
sysconfigSetup: false

View File

@ -850,6 +850,13 @@ class DMsysconfig(DisplayManager):
def greeter_setup(self):
pass
# For openSUSE-derivatives, there is only sysconfig to configure,
# and no special DM configuration for it. Instead, check that
# sysconfig is available in the target.
def have_dm(self):
config = "{!s}/etc/sysconfig/displaymanager".format(self.root_mount_point)
return os.path.exists(config)
# Collect all the subclasses of DisplayManager defined above,
# and index them based on the name property of each class.
@ -879,6 +886,10 @@ def run():
if libcalamares.globalstorage.contains("displayManagers"):
displaymanagers = libcalamares.globalstorage.value("displayManagers")
if ("sysconfigSetup" in libcalamares.job.configuration
and libcalamares.job.configuration["sysconfigSetup"]):
displaymanagers = ["sysconfig"]
if not displaymanagers:
return (
_("No display managers selected for the displaymanager module."),
@ -890,9 +901,6 @@ def run():
root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
dm_impl = []
dm_names = displaymanagers[:]
if ("sysconfigSetup" in libcalamares.job.configuration
and libcalamares.job.configuration["sysconfigSetup"]):
dm_names.append("sysconfig")
for dm in dm_names:
# Find the implementation class
dm_instance = None

View File

@ -3,13 +3,17 @@
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Balasankar C <balasankarc@autistici.org>, 2019
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-08-30 13:38+0200\n"
"POT-Creation-Date: 2019-09-15 21:54+0200\n"
"PO-Revision-Date: 2016-12-16 12:18+0000\n"
"Last-Translator: Balasankar C <balasankarc@autistici.org>, 2019\n"
"Language-Team: Malayalam (https://www.transifex.com/calamares/teams/20061/ml/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@ -19,11 +23,11 @@ msgstr ""
#: src/modules/dummypythonqt/main.py:84
msgid "Click me!"
msgstr ""
msgstr "എന്നെ ക്ലിക്ക് ചെയ്യൂ!"
#: src/modules/dummypythonqt/main.py:94
msgid "A new QLabel."
msgstr ""
msgstr "ഒരു പുതിയ QLabel."
#: src/modules/dummypythonqt/main.py:97
msgid "Dummy PythonQt ViewStep"

View File

@ -0,0 +1,24 @@
calamares_add_plugin( machineid
TYPE job
EXPORT_MACRO PLUGINDLLEXPORT_PRO
SOURCES
MachineIdJob.cpp
Workers.cpp
LINK_PRIVATE_LIBRARIES
calamares
SHARED_LIB
)
if ( ECM_FOUND AND BUILD_TESTING )
ecm_add_test(
Tests.cpp
Workers.cpp
TEST_NAME
machineidtest
LINK_LIBRARIES
calamares
Qt5::Core
Qt5::Test
)
calamares_automoc( machineidtest )
endif()

View File

@ -0,0 +1,153 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
* Copyright 2016, Philip Müller <philm@manjaro.org>
* Copyright 2017, Alf Gaida <agaida@siduction.org>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#include "MachineIdJob.h"
#include "Workers.h"
#include "utils/CalamaresUtilsSystem.h"
#include "utils/Logger.h"
#include "utils/Variant.h"
#include "GlobalStorage.h"
#include "JobQueue.h"
#include <QFile>
MachineIdJob::MachineIdJob( QObject* parent )
: Calamares::CppJob( parent )
{
}
MachineIdJob::~MachineIdJob() {}
QString
MachineIdJob::prettyName() const
{
return tr( "Generate machine-id." );
}
Calamares::JobResult
MachineIdJob::exec()
{
QString root;
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
if ( gs && gs->contains( "rootMountPoint" ) )
{
root = gs->value( "rootMountPoint" ).toString();
}
else
{
cWarning() << "No *rootMountPoint* defined.";
return Calamares::JobResult::internalError( tr( "Configuration Error" ),
tr( "No root mount point is set for MachineId." ),
Calamares::JobResult::InvalidConfiguration );
}
QString target_systemd_machineid_file = QStringLiteral( "/etc/machine-id" );
QString target_dbus_machineid_file = QStringLiteral( "/var/lib/dbus/machine-id" );
QString target_entropy_file = QStringLiteral( "/var/lib/urandom/random-seed" );
// Clear existing files
if ( m_entropy )
{
MachineId::removeFile( root, target_entropy_file );
}
if ( m_dbus )
{
MachineId::removeFile( root, target_dbus_machineid_file );
}
if ( m_systemd )
{
MachineId::removeFile( root, target_systemd_machineid_file );
}
//Create new files
if ( m_entropy )
{
auto r = MachineId::createEntropy( m_entropy_copy ? MachineId::EntropyGeneration::CopyFromHost
: MachineId::EntropyGeneration::New,
root,
target_entropy_file );
if ( !r )
{
return r;
}
}
if ( m_systemd )
{
auto r = MachineId::createSystemdMachineId( root, target_systemd_machineid_file );
if ( !r )
{
return r;
}
}
if ( m_dbus )
{
if ( m_dbus_symlink && QFile::exists( root + target_systemd_machineid_file ) )
{
auto r = MachineId::createDBusLink( root, target_dbus_machineid_file, target_systemd_machineid_file );
if ( !r )
{
return r;
}
}
else
{
auto r = MachineId::createDBusMachineId( root, target_dbus_machineid_file );
if ( !r )
{
return r;
}
}
}
return Calamares::JobResult::ok();
}
void
MachineIdJob::setConfigurationMap( const QVariantMap& map )
{
m_systemd = CalamaresUtils::getBool( map, "systemd", false );
m_dbus = CalamaresUtils::getBool( map, "dbus", false );
if ( map.contains( "dbus-symlink" ) )
{
m_dbus_symlink = CalamaresUtils::getBool( map, "dbus-symlink", false );
}
else if ( map.contains( "symlink" ) )
{
m_dbus_symlink = CalamaresUtils::getBool( map, "symlink", false );
cWarning() << "MachineId: configuration setting *symlink* is deprecated, use *dbus-symlink*.";
}
// else it's still false from the constructor
// ignore it, though, if dbus is false
m_dbus_symlink = m_dbus && m_dbus_symlink;
m_entropy = CalamaresUtils::getBool( map, "entropy", false );
m_entropy_copy = CalamaresUtils::getBool( map, "entropy-copy", false );
}
CALAMARES_PLUGIN_FACTORY_DEFINITION( MachineIdJobFactory, registerPlugin< MachineIdJob >(); )

View File

@ -0,0 +1,57 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2019, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MACHINEIDJOB_H
#define MACHINEIDJOB_H
#include <QObject>
#include <QVariantMap>
#include <CppJob.h>
#include <utils/PluginFactory.h>
#include <PluginDllMacro.h>
class PLUGINDLLEXPORT MachineIdJob : public Calamares::CppJob
{
Q_OBJECT
public:
explicit MachineIdJob( QObject* parent = nullptr );
virtual ~MachineIdJob() override;
QString prettyName() const override;
Calamares::JobResult exec() override;
void setConfigurationMap( const QVariantMap& configurationMap ) override;
private:
bool m_systemd = false; ///< write systemd's files
bool m_dbus = false; ///< write dbus files
bool m_dbus_symlink = false; ///< .. or just symlink to systemd
bool m_entropy = false; ///< write an entropy file
bool m_entropy_copy = false; ///< copy from host system
};
CALAMARES_PLUGIN_FACTORY_DECLARATION( MachineIdJobFactory )
#endif // MACHINEIDJOB_H

View File

@ -0,0 +1,108 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2019, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Workers.h"
#include "utils/Logger.h"
#include <QDir>
#include <QFile>
#include <QtTest/QtTest>
class MachineIdTests : public QObject
{
Q_OBJECT
public:
MachineIdTests() {}
virtual ~MachineIdTests() {}
private Q_SLOTS:
void initTestCase();
void testRemoveFile();
void testCopyFile();
void testPoolSize();
};
void
MachineIdTests::initTestCase()
{
Logger::setupLogLevel( Logger::LOGDEBUG );
}
void
MachineIdTests::testCopyFile()
{
QTemporaryDir tempRoot( QDir::tempPath() + QStringLiteral( "/test-root-XXXXXX" ) );
cDebug() << "Temporary files as" << QDir::tempPath();
cDebug() << "Temp dir file at " << tempRoot.path();
QVERIFY( !tempRoot.path().isEmpty() );
// This will pretend to be the host system
QTemporaryDir tempISOdir( QDir::tempPath() + QStringLiteral( "/test-live-XXXXXX" ) );
QVERIFY( QDir( tempRoot.path() ).mkpath( tempRoot.path() + tempISOdir.path() ) );
QFile source( tempRoot.filePath( "example" ) );
QVERIFY( !source.exists() );
source.open( QIODevice::WriteOnly );
source.write( "Derp" );
source.close();
QCOMPARE( source.size(), 4 );
QVERIFY( source.exists() );
// This should fail since "example" isn't standard in our test directory
auto r0 = MachineId::copyFile( tempRoot.path(), "example" );
QVERIFY( !r0 );
const QString sampleFile = QStringLiteral( "CMakeCache.txt" );
if ( QFile::exists( sampleFile ) )
{
auto r1 = MachineId::copyFile( tempRoot.path(), sampleFile );
// Also fail, because it's not an absolute path
QVERIFY( !r1 );
QVERIFY( QFile::copy( sampleFile, tempISOdir.path() + '/' + sampleFile ) );
auto r2 = MachineId::copyFile( tempRoot.path(), tempISOdir.path() + '/' + sampleFile );
QVERIFY( r2 );
}
}
void
MachineIdTests::testRemoveFile()
{
}
void
MachineIdTests::testPoolSize()
{
#ifdef Q_OS_FREEBSD
// It hardly makes sense, but also the /proc entry is missing
QCOMPARE( MachineId::getUrandomPoolSize(), 512 );
#else
// Based on a sample size of 1, Netrunner
QCOMPARE( MachineId::getUrandomPoolSize(), 4096 );
#endif
}
QTEST_GUILESS_MAIN( MachineIdTests )
#include "Tests.moc"
#include "utils/moc-warnings.h"

View File

@ -0,0 +1,199 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Kevin Kofler <kevin.kofler@chello.at>
* Copyright 2016, Philip Müller <philm@manjaro.org>
* Copyright 2017, Alf Gaida <agaida@siduction.org>
* Copyright 2019, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#include "Workers.h"
#include "utils/CalamaresUtilsSystem.h"
#include "utils/Logger.h"
#include <QFile>
namespace MachineId
{
static inline bool
isAbsolutePath( const QString& fileName )
{
return fileName.startsWith( '/' );
}
// might need to use a helper to remove the file
void
removeFile( const QString& rootMountPoint, const QString& fileName )
{
if ( isAbsolutePath( fileName ) )
{
QFile::remove( rootMountPoint + fileName );
}
// Otherwise, do nothing
}
Calamares::JobResult
copyFile( const QString& rootMountPoint, const QString& fileName )
{
if ( !isAbsolutePath( fileName ) )
{
return Calamares::JobResult::internalError(
QObject::tr( "File not found" ),
QObject::tr( "Path <pre>%1</pre> must be an absolute path." ).arg( fileName ),
0 );
}
QFile f( fileName );
if ( !f.exists() )
{
return Calamares::JobResult::error( QObject::tr( "File not found" ), fileName );
}
if ( !f.copy( rootMountPoint + fileName ) )
{
return Calamares::JobResult::error( QObject::tr( "File not found" ), rootMountPoint + fileName );
}
return Calamares::JobResult::ok();
}
int
getUrandomPoolSize()
{
QFile f( "/proc/sys/kernel/random/poolsize" );
constexpr const int minimumPoolSize = 512;
int poolSize = minimumPoolSize;
if ( f.exists() && f.open( QIODevice::ReadOnly | QIODevice::Text ) )
{
QByteArray v = f.read( 16 );
if ( v.length() > 2 )
{
if ( v.endsWith( '\n' ) )
{
v.chop(1);
}
bool ok = false;
poolSize = v.toInt( &ok );
if ( !ok )
{
poolSize = minimumPoolSize;
}
}
}
return (poolSize >= minimumPoolSize) ? poolSize : minimumPoolSize;
}
Calamares::JobResult
createNewEntropy( int poolSize, const QString& rootMountPoint, const QString& fileName )
{
QFile urandom( "/dev/urandom" );
if ( urandom.exists() && urandom.open( QIODevice::ReadOnly ) )
{
QByteArray data = urandom.read( poolSize );
urandom.close();
QFile entropyFile( rootMountPoint + fileName );
if ( entropyFile.exists() )
{
cWarning() << "Entropy file" << ( rootMountPoint + fileName ) << "already exists.";
return Calamares::JobResult::ok(); // .. anyway
}
if ( !entropyFile.open( QIODevice::WriteOnly ) )
{
return Calamares::JobResult::error(
QObject::tr( "File not found" ),
QObject::tr( "Could not create new random file <pre>%1</pre>." ).arg( fileName ) );
}
entropyFile.write( data );
entropyFile.close();
if ( entropyFile.size() < data.length() )
{
cWarning() << "Entropy file is" << entropyFile.size() << "bytes, random data was" << data.length();
}
if ( data.length() < poolSize )
{
cWarning() << "Entropy data is" << data.length() << "bytes, rather than poolSize" << poolSize;
}
}
return Calamares::JobResult::error(
QObject::tr( "File not found" ),
QObject::tr( "Could not read random file <pre>%1</pre>." ).arg( QStringLiteral( "/dev/urandom" ) ) );
}
Calamares::JobResult
createEntropy( const EntropyGeneration kind, const QString& rootMountPoint, const QString& fileName )
{
if ( kind == EntropyGeneration::CopyFromHost )
{
if ( QFile::exists( fileName ) )
{
auto r = copyFile( rootMountPoint, fileName );
if ( r )
{
return r;
}
else
{
cWarning() << "Could not copy" << fileName << "for entropy, generating new.";
}
}
else
{
cWarning() << "Host system entropy does not exist at" << fileName;
}
}
int poolSize = getUrandomPoolSize();
return createNewEntropy( poolSize, rootMountPoint, fileName );
}
static Calamares::JobResult
runCmd( const QStringList& cmd )
{
auto r = CalamaresUtils::System::instance()->targetEnvCommand( cmd );
if ( r.getExitCode() )
{
return r.explainProcess( cmd, std::chrono::seconds( 0 ) );
}
return Calamares::JobResult::ok();
}
Calamares::JobResult
createSystemdMachineId( const QString& rootMountPoint, const QString& fileName )
{
Q_UNUSED( rootMountPoint )
Q_UNUSED( fileName )
return runCmd( QStringList { QStringLiteral( "systemd-machine-id-setup" ) } );
}
Calamares::JobResult
createDBusMachineId( const QString& rootMountPoint, const QString& fileName )
{
Q_UNUSED( rootMountPoint )
Q_UNUSED( fileName )
return runCmd( QStringList { QStringLiteral( "dbus-uuidgen" ), QStringLiteral( "--ensure" ) } );
}
Calamares::JobResult
createDBusLink( const QString& rootMountPoint, const QString& fileName, const QString& systemdFileName )
{
Q_UNUSED( rootMountPoint );
return runCmd( QStringList { QStringLiteral( "ln" ), QStringLiteral( "-s" ), systemdFileName, fileName } );
}
} // namespace MachineId

View File

@ -0,0 +1,82 @@
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2019, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef WORKERS_H
#define WORKERS_H
#include "Job.h"
/// @brief Utility functions for doing the random-data stuff for MachineId
namespace MachineId
{
/** @brief Utility functions
*
* These probably belong in libcalamares, since they're general utilities
* for moving files around in the target system.
*/
/// @brief Remove @p fileName from the target system at @p rootMountPoint
void removeFile( const QString& rootMountPoint, const QString& fileName );
/// @brief Copy @p fileName from host into target system at @p rootMountPoint
Calamares::JobResult copyFile( const QString& rootMountPoint, const QString& fileName );
/** @brief Entropy functions
*
* The target system may want to pre-seed the entropy pool with a suitable
* chunk of entropy data. During installation we have lots of disk access
* so plenty of entropy -- this is used mostly be Debian.
*/
/// @brief How to generate entropy (bool-like)
enum class EntropyGeneration
{
New,
CopyFromHost
};
/// @brief Returns a recommended size for the entropy pool (in bytes)
int getUrandomPoolSize();
/// @brief Creates a new entropy file @p fileName in the target system at @p rootMountPoint
Calamares::JobResult createNewEntropy( int poolSize, const QString& rootMountPoint, const QString& fileName );
/// @brief Create an entropy file @p fileName in the target system at @p rootMountPoint
Calamares::JobResult
createEntropy( const EntropyGeneration kind, const QString& rootMountPoint, const QString& fileName );
/** @brief MachineID functions
*
* Creating UUIDs for DBUS and SystemD.
*/
/// @brief Create a new DBus UUID file
Calamares::JobResult createDBusMachineId( const QString& rootMountPoint, const QString& fileName );
/// @brief Symlink DBus UUID file to the one from systemd (which must exist already)
Calamares::JobResult
createDBusLink( const QString& rootMountPoint, const QString& fileName, const QString& systemdFileName );
Calamares::JobResult createSystemdMachineId( const QString& rootMountPoint, const QString& fileName );
} // namespace MachineId
#endif // WORKERS_H

View File

@ -1,8 +1,24 @@
# Machine-ID and other random data on the target system.
#
# This module can create a number of "random" things on the target:
# - a systemd machine-id file (hence the name of the Calamares module)
# with a random UUID.
# - a dbus machine-id file (or, optionally, link to the one from systemd)
# - an entropy file
#
---
# Whether to create /etc/machine-id for systemd.
systemd: true
# Whether to create /var/lib/dbus/machine-id for D-Bus.
dbus: true
# Whether /var/lib/dbus/machine-id should be a symlink to /etc/machine-id
# (ignored if dbus is false, or if there is no /etc/machine-id to point to).
dbus-symlink: true
# this is a deprecated form of *dbus-symlink*
symlink: true
# Whether to create an entropy file
entropy: false
# Whether to copy entropy from the host
entropy-copy: false

View File

@ -1,5 +0,0 @@
---
type: "job"
name: "machineid"
interface: "python"
script: "main.py"

View File

@ -49,12 +49,25 @@ class UnpackEntry:
:param sourcefs:
:param destination:
"""
__slots__ = ['source', 'sourcefs', 'destination', 'copied', 'total']
__slots__ = ['source', 'sourcefs', 'destination', 'copied', 'total', 'exclude', 'excludeFile']
def __init__(self, source, sourcefs, destination):
"""
@p source is the source file name (might be an image file, or
a directory, too)
@p sourcefs is a type indication; "file" is special, as is
"squashfs".
@p destination is where the files from the source go. This is
**already** prefixed by rootMountPoint, so should be a
valid absolute path within the host system.
The members copied and total are filled in by the copying process.
"""
self.source = source
self.sourcefs = sourcefs
self.destination = destination
self.exclude = None
self.excludeFile = None
self.copied = 0
self.total = 0
@ -65,12 +78,9 @@ class UnpackEntry:
ON_POSIX = 'posix' in sys.builtin_module_names
def list_excludes(destination):
def global_excludes():
"""
List excludes for rsync.
:param destination:
:return:
"""
lst = []
extra_mounts = globalstorage.value("extraMounts")
@ -85,16 +95,18 @@ def list_excludes(destination):
return lst
def file_copy(source, dest, progress_cb):
def file_copy(source, entry, progress_cb):
"""
Extract given image using rsync.
:param source:
:param dest:
:param progress_cb:
:return:
:param source: Source file. This may be the place the entry's
image is mounted, or if it's a single file, the entry's source value.
:param entry: The UnpackEntry being copied.
:param progress_cb: A callback function for progress reporting.
Takes a number and a total-number.
"""
dest = entry.destination
# Environment used for executing rsync properly
# Setting locale to C (fix issue with tr_TR locale)
at_env = os.environ
@ -110,7 +122,12 @@ def file_copy(source, dest, progress_cb):
num_files_copied = 0 # Gets updated through rsync output
args = ['rsync', '-aHAXr']
args.extend(list_excludes(dest))
args.extend(global_excludes())
if entry.excludeFile:
args.extend(["--exclude-from=" + entry.excludeFile])
if entry.exclude:
for f in entry.exclude:
args.extend(["--exclude", f])
args.extend(['--progress', source, dest])
process = subprocess.Popen(
args, env=at_env, bufsize=1, stdout=subprocess.PIPE, close_fds=ON_POSIX
@ -306,7 +323,7 @@ class UnpackOperation:
else:
source = imgmountdir
return file_copy(source, entry.destination, progress_cb)
return file_copy(source, entry, progress_cb)
finally:
if not entry.is_file():
subprocess.check_call(["umount", "-l", imgmountdir])
@ -374,17 +391,28 @@ def run():
unpack = list()
is_first = True
for entry in job.configuration["unpack"]:
source = os.path.abspath(entry["source"])
sourcefs = entry["sourcefs"]
destination = os.path.abspath(root_mount_point + entry["destination"])
if not os.path.isdir(destination):
if not os.path.isdir(destination) and sourcefs != "file":
utils.warning(("The destination \"{}\" in the target system is not a directory").format(destination))
if is_first:
return (_("Bad unsquash configuration"),
_("The destination \"{}\" in the target system is not a directory").format(destination))
else:
utils.debug(".. assuming that the previous targets will create that directory.")
unpack.append(UnpackEntry(source, sourcefs, destination))
# Optional settings
if entry.get("exclude", None):
unpack[-1].exclude = entry["exclude"]
if entry.get("excludeFile", None):
unpack[-1].excludeFile = entry["excludeFile"]
is_first = False
unpackop = UnpackOperation(unpack)

View File

@ -11,28 +11,40 @@
---
# Each list item is unpacked, in order, to the target system.
#
# Each list item has the following attributes:
# source: path relative to the live / intstalling system to the image
# sourcefs: the type of the source files; valid entries are
# - *ext4* (copies the filesystem contents)
# - *squashfs* (unsquashes)
# - *file* (copies a file or directory)
# Each list item has the following **mandatory** attributes:
# - *source* path relative to the live / intstalling system to the image
# - *sourcefs* the type of the source files; valid entries are
# - `ext4` (copies the filesystem contents)
# - `squashfs` (unsquashes)
# - `file` (copies a file or directory)
# - (may be others if mount supports it)
# destination: path relative to rootMountPoint (so in the target
# - *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.
#
# Each list item **optionally** can include the following attributes:
# - *exclude* is a list of values that is expanded into --exclude
# arguments for rsync (each entry in exclude gets its own --exclude).
# - *excludeFile* is a single file that is passed to rsync as an
# --exclude-file argument. This should be a full pathname
# inside the **host** filesystem.
#
# EXAMPLES
#
# Usually you list a filesystem image to unpack; you can use
# squashfs or an ext4 image.
# squashfs or an ext4 image. An empty destination is equivalent to "/",
# the root of the target system. The destination directory must exist
# in the target system.
#
# - source: "/path/to/filesystem.sqfs"
# sourcefs: "squashfs"
# destination: ""
#
# Multiple entries are unpacked in-order
# Multiple entries are unpacked in-order; if there is more than one
# item then only the first must exist beforehand -- it's ok to
# create directories with one unsquash and then to use those
# directories as a target from a second unsquash.
#
# - source: "/path/to/another/filesystem.img"
# sourcefs: "ext4"
@ -60,8 +72,18 @@
# - source: ../src/modules/dummycpp
# sourcefs: file
# destination: "/tmp/derp"
#
# The *destination* and *source* are handed off to rsync, so the semantics
# of trailing slashes apply. In order to *rename* a file as it is
# copied, specify one single file (e.g. CHANGES) and a full pathname
# for its destination name, as in the example below.
unpack:
- source: ../CHANGES
sourcefs: file
destination: "/tmp"
destination: "/tmp/changes.txt"
- source: src/qml/calamares/slideshow
sourcefs: file
destination: "/tmp/slideshow/"
exclude: [ "*.qmlc", "qmldir" ]
# excludeFile: /etc/calamares/modules/unpackfs/exclude-list.txt