diff --git a/CHANGES-3.2 b/CHANGES-3.2 index 52342e95b..cf02ff29d 100644 --- a/CHANGES-3.2 +++ b/CHANGES-3.2 @@ -7,22 +7,55 @@ 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.50 (unreleased) # +# 3.2.51 (unreleased) # This release contains contributions from (alphabetically by first name): - - Erik Dubois + - No external contributors yet ## Core ## - No core changes yet ## Modules ## + - The *umount* module has been re-written in C++. The copy-a-log-file + functionality has been removed. Use the *preservefiles* module for that. + + +# 3.2.50 (2022-01-18) # + +This release contains contributions from (alphabetically by first name): + - Anke Boersma + - Erik Dubois + - Evan James + - Johannes Kamprad + - Taejun Park (new contributor, welcome!) + +**Replacement notice:** The *umount* module will be replaced by a C++ +implementation in the next release. The "preserve log file" feature +will be removed in that release. Use the *preservefiles* module instead. + +## Core ## + - No core changes yet + +## Modules ## + - *initcpiocfg* mentioned a special kernel-name "all", which did not work, + and a special kernel-name "$uname" which cannot work. Fixed the former + and removed the "$uname" special key. (Thanks Evan) + - *luksswaphookcfg* has been converted to a C++ module. - *networkcfg* could fail to update the NetworkManager configuration if the SSID or username contained non-ASCII characters **and** the default Python text-file encoding was set to ASCII. The files are now read and written in UTF-8, explicitly. #1848 + - *partition* always sets *bigtime* option on XFS filesystems, if possible. + Requires sufficiently-recent xfsprogs. #1874 - *preservefiles* was missing some necessary features, needed for it to replace the deprecated log-file-saving functionality in the *umount* module. (Thanks Erik and Joe for testing) #1851 + - *umount* is now marked as an emergency module in the example configuration, + since it should **probably** be run as a cleanup. (Thanks Evan) + - *welcome* and *locale* could be confusing, together, and configure + the target system with a language that does not match the installer + language, even though the user did not make any explicit choice. + (Thanks Taejun) #1864 # 3.2.49.1 (2021-12-11) # diff --git a/CMakeLists.txt b/CMakeLists.txt index c8b233f50..aec04f315 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,7 @@ # TODO:3.3: Require CMake 3.12 cmake_minimum_required( VERSION 3.3 FATAL_ERROR ) project( CALAMARES - VERSION 3.2.50 + VERSION 3.2.51 LANGUAGES C CXX ) diff --git a/ci/RELEASE.sh b/ci/RELEASE.sh index f09285fb7..e46ca2cc2 100755 --- a/ci/RELEASE.sh +++ b/ci/RELEASE.sh @@ -75,7 +75,7 @@ fi # # BUILDDIR=$(mktemp -d --suffix=-build --tmpdir=.) -KEY_ID="CFDDC96F12B1915C" +KEY_ID="328D742D8807A435" # Try to make gpg cache the signing key, so we can leave the process # to run and sign. diff --git a/lang/calamares_cs_CZ.ts b/lang/calamares_cs_CZ.ts index 4525d7418..b61f36b81 100644 --- a/lang/calamares_cs_CZ.ts +++ b/lang/calamares_cs_CZ.ts @@ -693,27 +693,27 @@ Instalační program bude ukončen a všechny změny ztraceny. Successfully unmounted %1. - + Úspěšně odpojeno %1. Successfully disabled swap %1. - + Úspěšně vypnut swap %1. Successfully cleared swap %1. - + Úspěšně vyčištěn swap %1. Successfully closed mapper device %1. - + Úspěšně zavřeno mapper zařízení %1. Successfully disabled volume group %1. - + Úspěšně vypnuta skupina svazků %1. diff --git a/lang/calamares_ja-Hira.ts b/lang/calamares_ja-Hira.ts new file mode 100644 index 000000000..ce8d59bf4 --- /dev/null +++ b/lang/calamares_ja-Hira.ts @@ -0,0 +1,4366 @@ + + + + + AutoMountManagementJob + + + Manage auto-mount settings + + + + + BootInfoWidget + + + The <strong>boot environment</strong> of this system.<br><br>Older x86 systems only support <strong>BIOS</strong>.<br>Modern systems usually use <strong>EFI</strong>, but may also show up as BIOS if started in compatibility mode. + + + + + This system was started with an <strong>EFI</strong> boot environment.<br><br>To configure startup from an EFI environment, this installer must deploy a boot loader application, like <strong>GRUB</strong> or <strong>systemd-boot</strong> on an <strong>EFI System Partition</strong>. This is automatic, unless you choose manual partitioning, in which case you must choose it or create it on your own. + + + + + This system was started with a <strong>BIOS</strong> boot environment.<br><br>To configure startup from a BIOS environment, this installer must install a boot loader, like <strong>GRUB</strong>, either at the beginning of a partition or on the <strong>Master Boot Record</strong> near the beginning of the partition table (preferred). This is automatic, unless you choose manual partitioning, in which case you must set it up on your own. + + + + + BootLoaderModel + + + Master Boot Record of %1 + + + + + Boot Partition + + + + + System Partition + + + + + Do not install a boot loader + + + + + %1 (%2) + + + + + Calamares::BlankViewStep + + + Blank Page + + + + + Calamares::DebugWindow + + + Form + + + + + GlobalStorage + + + + + JobQueue + + + + + Modules + + + + + Type: + + + + + + none + + + + + Interface: + + + + + Crashes Calamares, so that Dr. Konqui can look at it. + + + + + Reloads the stylesheet from the branding directory. + + + + + Uploads the session log to the configured pastebin. + + + + + Send Session Log + + + + + Reload Stylesheet + + + + + Displays the tree of widget names in the log (for stylesheet debugging). + + + + + Widget Tree + + + + + Debug information + + + + + Calamares::ExecutionViewStep + + + Set up + + + + + Install + + + + + Calamares::FailJob + + + Job failed (%1) + + + + + Programmed job failure was explicitly requested. + + + + + Calamares::JobThread + + + Done + + + + + Calamares::NamedJob + + + Example job (%1) + + + + + Calamares::ProcessJob + + + Run command '%1' in target system. + + + + + Run command '%1'. + + + + + Running command %1 %2 + + + + + Calamares::PythonJob + + + Running %1 operation. + + + + + Bad working directory path + + + + + Working directory %1 for python job %2 is not readable. + + + + + Bad main script file + + + + + Main script file %1 for python job %2 is not readable. + + + + + Boost.Python error in job "%1". + + + + + Calamares::QmlViewStep + + + Loading ... + + + + + QML Step <i>%1</i>. + + + + + Loading failed. + + + + + Calamares::RequirementsChecker + + + Requirements checking for module <i>%1</i> is complete. + + + + + Waiting for %n module(s). + + + + + + + (%n second(s)) + + + + + + + System-requirements checking is complete. + + + + + Calamares::ViewManager + + + Setup Failed + + + + + Installation Failed + + + + + Would you like to paste the install log to the web? + + + + + Error + + + + + &Yes + + + + + &No + + + + + &Close + + + + + Install Log Paste URL + + + + + The upload was unsuccessful. No web-paste was done. + + + + + Install log posted to + +%1 + +Link copied to clipboard + + + + + Calamares Initialization Failed + + + + + %1 can not be installed. Calamares was unable to load all of the configured modules. This is a problem with the way Calamares is being used by the distribution. + + + + + <br/>The following modules could not be loaded: + + + + + Continue with setup? + + + + + Continue with installation? + + + + + The %1 setup program is about to make changes to your disk in order to set up %2.<br/><strong>You will not be able to undo these changes.</strong> + + + + + The %1 installer is about to make changes to your disk in order to install %2.<br/><strong>You will not be able to undo these changes.</strong> + + + + + &Set up now + + + + + &Install now + + + + + Go &back + + + + + &Set up + + + + + &Install + + + + + Setup is complete. Close the setup program. + + + + + The installation is complete. Close the installer. + + + + + Cancel setup without changing the system. + + + + + Cancel installation without changing the system. + + + + + &Next + + + + + &Back + + + + + &Done + + + + + &Cancel + + + + + Cancel setup? + + + + + Cancel installation? + + + + + Do you really want to cancel the current setup process? +The setup program will quit and all changes will be lost. + + + + + Do you really want to cancel the current install process? +The installer will quit and all changes will be lost. + + + + + CalamaresPython::Helper + + + Unknown exception type + + + + + unparseable Python error + + + + + unparseable Python traceback + + + + + Unfetchable Python error. + + + + + CalamaresWindow + + + %1 Setup Program + + + + + %1 Installer + + + + + ChangeFilesystemLabelJob + + + Set filesystem label on %1. + + + + + Set filesystem label <strong>%1</strong> to partition <strong>%2</strong>. + + + + + The installer failed to update partition table on disk '%1'. + + + + + CheckerContainer + + + Gathering system information... + + + + + ChoicePage + + + Form + + + + + Select storage de&vice: + + + + + + + + Current: + + + + + After: + + + + + <strong>Manual partitioning</strong><br/>You can create or resize partitions yourself. + + + + + Reuse %1 as home partition for %2. + + + + + <strong>Select a partition to shrink, then drag the bottom bar to resize</strong> + + + + + %1 will be shrunk to %2MiB and a new %3MiB partition will be created for %4. + + + + + Boot loader location: + + + + + <strong>Select a partition to install on</strong> + + + + + An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1. + + + + + The EFI system partition at %1 will be used for starting %2. + + + + + EFI system partition: + + + + + This storage device does not seem to have an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. + + + + + + + + <strong>Erase disk</strong><br/>This will <font color="red">delete</font> all data currently present on the selected storage device. + + + + + + + + <strong>Install alongside</strong><br/>The installer will shrink a partition to make room for %1. + + + + + + + + <strong>Replace a partition</strong><br/>Replaces a partition with %1. + + + + + This storage device has %1 on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. + + + + + This storage device already has an operating system on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. + + + + + This storage device has multiple operating systems on it. What would you like to do?<br/>You will be able to review and confirm your choices before any change is made to the storage device. + + + + + This storage device already has an operating system on it, but the partition table <strong>%1</strong> is different from the needed <strong>%2</strong>.<br/> + + + + + This storage device has one of its partitions <strong>mounted</strong>. + + + + + This storage device is a part of an <strong>inactive RAID</strong> device. + + + + + No Swap + + + + + Reuse Swap + + + + + Swap (no Hibernate) + + + + + Swap (with Hibernate) + + + + + Swap to file + + + + + ClearMountsJob + + + Successfully unmounted %1. + + + + + Successfully disabled swap %1. + + + + + Successfully cleared swap %1. + + + + + Successfully closed mapper device %1. + + + + + Successfully disabled volume group %1. + + + + + Clear mounts for partitioning operations on %1 + + + + + Clearing mounts for partitioning operations on %1. + + + + + Cleared all mounts for %1 + + + + + ClearTempMountsJob + + + Clear all temporary mounts. + + + + + Clearing all temporary mounts. + + + + + Cannot get list of temporary mounts. + + + + + Cleared all temporary mounts. + + + + + CommandList + + + + Could not run command. + + + + + The command runs in the host environment and needs to know the root path, but no rootMountPoint is defined. + + + + + The command needs to know the user's name, but no username is defined. + + + + + Config + + + Set keyboard model to %1.<br/> + + + + + Set keyboard layout to %1/%2. + + + + + Set timezone to %1/%2. + + + + + The system language will be set to %1. + + + + + The numbers and dates locale will be set to %1. + + + + + Network Installation. (Disabled: Incorrect configuration) + + + + + Network Installation. (Disabled: Received invalid groups data) + + + + + Network Installation. (Disabled: Internal error) + + + + + Network Installation. (Disabled: No package list) + + + + + Package selection + + + + + Network Installation. (Disabled: Unable to fetch package lists, check your network connection) + + + + + This computer does not satisfy the minimum requirements for setting up %1.<br/>Setup cannot continue. <a href="#details">Details...</a> + + + + + This computer does not satisfy the minimum requirements for installing %1.<br/>Installation cannot continue. <a href="#details">Details...</a> + + + + + This computer does not satisfy some of the recommended requirements for setting up %1.<br/>Setup can continue, but some features might be disabled. + + + + + This computer does not satisfy some of the recommended requirements for installing %1.<br/>Installation can continue, but some features might be disabled. + + + + + This program will ask you some questions and set up %2 on your computer. + + + + + <h1>Welcome to the Calamares setup program for %1</h1> + + + + + <h1>Welcome to %1 setup</h1> + + + + + <h1>Welcome to the Calamares installer for %1</h1> + + + + + <h1>Welcome to the %1 installer</h1> + + + + + Your username is too long. + + + + + '%1' is not allowed as username. + + + + + Your username must start with a lowercase letter or underscore. + + + + + Only lowercase letters, numbers, underscore and hyphen are allowed. + + + + + Your hostname is too short. + + + + + Your hostname is too long. + + + + + '%1' is not allowed as hostname. + + + + + Only letters, numbers, underscore and hyphen are allowed. + + + + + Your passwords do not match! + + + + + OK! + + + + + Setup Failed + + + + + Installation Failed + + + + + The setup of %1 did not complete successfully. + + + + + The installation of %1 did not complete successfully. + + + + + Setup Complete + + + + + Installation Complete + + + + + The setup of %1 is complete. + + + + + The installation of %1 is complete. + + + + + Package Selection + + + + + Please pick a product from the list. The selected product will be installed. + + + + + Install option: <strong>%1</strong> + + + + + None + + + + + Summary + + + + + This is an overview of what will happen once you start the setup procedure. + + + + + This is an overview of what will happen once you start the install procedure. + + + + + ContextualProcessJob + + + Contextual Processes Job + + + + + CreatePartitionDialog + + + Create a Partition + + + + + Si&ze: + + + + + MiB + + + + + Partition &Type: + + + + + &Primary + + + + + E&xtended + + + + + Fi&le System: + + + + + LVM LV name + + + + + &Mount Point: + + + + + Flags: + + + + + Label for the filesystem + + + + + FS Label: + + + + + En&crypt + + + + + Logical + + + + + Primary + + + + + GPT + + + + + Mountpoint already in use. Please select another one. + + + + + CreatePartitionJob + + + Create new %1MiB partition on %3 (%2) with entries %4. + + + + + Create new %1MiB partition on %3 (%2). + + + + + Create new %2MiB partition on %4 (%3) with file system %1. + + + + + Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2) with entries <em>%4</em>. + + + + + Create new <strong>%1MiB</strong> partition on <strong>%3</strong> (%2). + + + + + Create new <strong>%2MiB</strong> partition on <strong>%4</strong> (%3) with file system <strong>%1</strong>. + + + + + + Creating new %1 partition on %2. + + + + + The installer failed to create partition on disk '%1'. + + + + + CreatePartitionTableDialog + + + Create Partition Table + + + + + Creating a new partition table will delete all existing data on the disk. + + + + + What kind of partition table do you want to create? + + + + + Master Boot Record (MBR) + + + + + GUID Partition Table (GPT) + + + + + CreatePartitionTableJob + + + Create new %1 partition table on %2. + + + + + Create new <strong>%1</strong> partition table on <strong>%2</strong> (%3). + + + + + Creating new %1 partition table on %2. + + + + + The installer failed to create a partition table on %1. + + + + + CreateUserJob + + + Create user %1 + + + + + Create user <strong>%1</strong>. + + + + + Preserving home directory + + + + + + Creating user %1 + + + + + Configuring user %1 + + + + + Setting file permissions + + + + + CreateVolumeGroupDialog + + + Create Volume Group + + + + + CreateVolumeGroupJob + + + Create new volume group named %1. + + + + + Create new volume group named <strong>%1</strong>. + + + + + Creating new volume group named %1. + + + + + The installer failed to create a volume group named '%1'. + + + + + DeactivateVolumeGroupJob + + + + Deactivate volume group named %1. + + + + + Deactivate volume group named <strong>%1</strong>. + + + + + The installer failed to deactivate a volume group named %1. + + + + + DeletePartitionJob + + + Delete partition %1. + + + + + Delete partition <strong>%1</strong>. + + + + + Deleting partition %1. + + + + + The installer failed to delete partition %1. + + + + + DeviceInfoWidget + + + This device has a <strong>%1</strong> partition table. + + + + + This is a <strong>loop</strong> device.<br><br>It is a pseudo-device with no partition table that makes a file accessible as a block device. This kind of setup usually only contains a single filesystem. + + + + + This installer <strong>cannot detect a partition table</strong> on the selected storage device.<br><br>The device either has no partition table, or the partition table is corrupted or of an unknown type.<br>This installer can create a new partition table for you, either automatically, or through the manual partitioning page. + + + + + <br><br>This is the recommended partition table type for modern systems which start from an <strong>EFI</strong> boot environment. + + + + + <br><br>This partition table type is only advisable on older systems which start from a <strong>BIOS</strong> boot environment. GPT is recommended in most other cases.<br><br><strong>Warning:</strong> the MBR partition table is an obsolete MS-DOS era standard.<br>Only 4 <em>primary</em> partitions may be created, and of those 4, one can be an <em>extended</em> partition, which may in turn contain many <em>logical</em> partitions. + + + + + The type of <strong>partition table</strong> on the selected storage device.<br><br>The only way to change the partition table type is to erase and recreate the partition table from scratch, which destroys all data on the storage device.<br>This installer will keep the current partition table unless you explicitly choose otherwise.<br>If unsure, on modern systems GPT is preferred. + + + + + DeviceModel + + + %1 - %2 (%3) + device[name] - size[number] (device-node[name]) + + + + + %1 - (%2) + device[name] - (device-node[name]) + + + + + DracutLuksCfgJob + + + Write LUKS configuration for Dracut to %1 + + + + + Skip writing LUKS configuration for Dracut: "/" partition is not encrypted + + + + + Failed to open %1 + + + + + DummyCppJob + + + Dummy C++ Job + + + + + EditExistingPartitionDialog + + + Edit Existing Partition + + + + + Content: + + + + + &Keep + + + + + Format + + + + + Warning: Formatting the partition will erase all existing data. + + + + + &Mount Point: + + + + + Si&ze: + + + + + MiB + + + + + Fi&le System: + + + + + Flags: + + + + + Label for the filesystem + + + + + FS Label: + + + + + Mountpoint already in use. Please select another one. + + + + + EncryptWidget + + + Form + + + + + En&crypt system + + + + + Passphrase + + + + + Confirm passphrase + + + + + + Please enter the same passphrase in both boxes. + + + + + FillGlobalStorageJob + + + Set partition information + + + + + Install %1 on <strong>new</strong> %2 system partition with features <em>%3</em> + + + + + Install %1 on <strong>new</strong> %2 system partition. + + + + + Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong> and features <em>%3</em>. + + + + + Set up <strong>new</strong> %2 partition with mount point <strong>%1</strong>%3. + + + + + Install %2 on %3 system partition <strong>%1</strong> with features <em>%4</em>. + + + + + Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong> and features <em>%4</em>. + + + + + Set up %3 partition <strong>%1</strong> with mount point <strong>%2</strong>%4. + + + + + Install %2 on %3 system partition <strong>%1</strong>. + + + + + Install boot loader on <strong>%1</strong>. + + + + + Setting up mount points. + + + + + FinishedPage + + + Form + + + + + &Restart now + + + + + <h1>All done.</h1><br/>%1 has been set up on your computer.<br/>You may now start using your new system. + + + + + <html><head/><body><p>When this box is checked, your system will restart immediately when you click on <span style="font-style:italic;">Done</span> or close the setup program.</p></body></html> + + + + + <h1>All done.</h1><br/>%1 has been installed on your computer.<br/>You may now restart into your new system, or continue using the %2 Live environment. + + + + + <html><head/><body><p>When this box is checked, your system will restart immediately when you click on <span style="font-style:italic;">Done</span> or close the installer.</p></body></html> + + + + + <h1>Setup Failed</h1><br/>%1 has not been set up on your computer.<br/>The error message was: %2. + + + + + <h1>Installation Failed</h1><br/>%1 has not been installed on your computer.<br/>The error message was: %2. + + + + + FinishedQmlViewStep + + + Finish + + + + + FinishedViewStep + + + Finish + + + + + FormatPartitionJob + + + Format partition %1 (file system: %2, size: %3 MiB) on %4. + + + + + Format <strong>%3MiB</strong> partition <strong>%1</strong> with file system <strong>%2</strong>. + + + + + Formatting partition %1 with file system %2. + + + + + The installer failed to format partition %1 on disk '%2'. + + + + + GeneralRequirements + + + has at least %1 GiB available drive space + + + + + There is not enough drive space. At least %1 GiB is required. + + + + + has at least %1 GiB working memory + + + + + The system does not have enough working memory. At least %1 GiB is required. + + + + + is plugged in to a power source + + + + + The system is not plugged in to a power source. + + + + + is connected to the Internet + + + + + The system is not connected to the Internet. + + + + + is running the installer as an administrator (root) + + + + + The setup program is not running with administrator rights. + + + + + The installer is not running with administrator rights. + + + + + has a screen large enough to show the whole installer + + + + + The screen is too small to display the setup program. + + + + + The screen is too small to display the installer. + + + + + HostInfoJob + + + Collecting information about your machine. + + + + + IDJob + + + + + + OEM Batch Identifier + + + + + Could not create directories <code>%1</code>. + + + + + Could not open file <code>%1</code>. + + + + + Could not write to file <code>%1</code>. + + + + + InitcpioJob + + + Creating initramfs with mkinitcpio. + + + + + InitramfsJob + + + Creating initramfs. + + + + + InteractiveTerminalPage + + + Konsole not installed + + + + + Please install KDE Konsole and try again! + + + + + Executing script: &nbsp;<code>%1</code> + + + + + InteractiveTerminalViewStep + + + Script + + + + + KeyboardQmlViewStep + + + Keyboard + + + + + KeyboardViewStep + + + Keyboard + + + + + LCLocaleDialog + + + System locale setting + + + + + The system locale setting affects the language and character set for some command line user interface elements.<br/>The current setting is <strong>%1</strong>. + + + + + &Cancel + + + + + &OK + + + + + LicensePage + + + Form + + + + + <h1>License Agreement</h1> + + + + + I accept the terms and conditions above. + + + + + Please review the End User License Agreements (EULAs). + + + + + This setup procedure will install proprietary software that is subject to licensing terms. + + + + + If you do not agree with the terms, the setup procedure cannot continue. + + + + + This setup procedure can install proprietary software that is subject to licensing terms in order to provide additional features and enhance the user experience. + + + + + If you do not agree with the terms, proprietary software will not be installed, and open source alternatives will be used instead. + + + + + LicenseViewStep + + + License + + + + + LicenseWidget + + + URL: %1 + + + + + <strong>%1 driver</strong><br/>by %2 + %1 is an untranslatable product name, example: Creative Audigy driver + + + + + <strong>%1 graphics driver</strong><br/><font color="Grey">by %2</font> + %1 is usually a vendor name, example: Nvidia graphics driver + + + + + <strong>%1 browser plugin</strong><br/><font color="Grey">by %2</font> + + + + + <strong>%1 codec</strong><br/><font color="Grey">by %2</font> + + + + + <strong>%1 package</strong><br/><font color="Grey">by %2</font> + + + + + <strong>%1</strong><br/><font color="Grey">by %2</font> + + + + + File: %1 + + + + + Hide license text + + + + + Show the license text + + + + + Open license agreement in browser. + + + + + LocalePage + + + Region: + + + + + Zone: + + + + + + &Change... + + + + + LocaleQmlViewStep + + + Location + + + + + LocaleTests + + + Quit + + + + + LocaleViewStep + + + Location + + + + + LuksBootKeyFileJob + + + Configuring LUKS key file. + + + + + + No partitions are defined. + + + + + + + Encrypted rootfs setup error + + + + + Root partition %1 is LUKS but no passphrase has been set. + + + + + Could not create LUKS key file for root partition %1. + + + + + Could not configure LUKS key file on partition %1. + + + + + MachineIdJob + + + Generate machine-id. + + + + + Configuration Error + + + + + No root mount point is set for MachineId. + + + + + Map + + + Timezone: %1 + + + + + Please select your preferred location on the map so the installer can suggest the locale + and timezone settings for you. You can fine-tune the suggested settings below. Search the map by dragging + to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming. + + + + + NetInstallViewStep + + + Package selection + + + + + Office software + + + + + Office package + + + + + Browser software + + + + + Browser package + + + + + Web browser + + + + + Kernel + + + + + Services + + + + + Login + + + + + Desktop + + + + + Applications + + + + + Communication + + + + + Development + + + + + Office + + + + + Multimedia + + + + + Internet + + + + + Theming + + + + + Gaming + + + + + Utilities + + + + + NotesQmlViewStep + + + Notes + + + + + OEMPage + + + Ba&tch: + + + + + <html><head/><body><p>Enter a batch-identifier here. This will be stored in the target system.</p></body></html> + + + + + <html><head/><body><h1>OEM Configuration</h1><p>Calamares will use OEM settings while configuring the target system.</p></body></html> + + + + + OEMViewStep + + + OEM Configuration + + + + + Set the OEM Batch Identifier to <code>%1</code>. + + + + + Offline + + + Select your preferred Region, or use the default settings. + + + + + + + Timezone: %1 + + + + + Select your preferred Zone within your Region. + + + + + Zones + + + + + You can fine-tune Language and Locale settings below. + + + + + PWQ + + + Password is too short + + + + + Password is too long + + + + + Password is too weak + + + + + Memory allocation error when setting '%1' + + + + + Memory allocation error + + + + + The password is the same as the old one + + + + + The password is a palindrome + + + + + The password differs with case changes only + + + + + The password is too similar to the old one + + + + + The password contains the user name in some form + + + + + The password contains words from the real name of the user in some form + + + + + The password contains forbidden words in some form + + + + + The password contains too few digits + + + + + The password contains too few uppercase letters + + + + + The password contains fewer than %n lowercase letters + + + + + + + The password contains too few lowercase letters + + + + + The password contains too few non-alphanumeric characters + + + + + The password is too short + + + + + The password does not contain enough character classes + + + + + The password contains too many same characters consecutively + + + + + The password contains too many characters of the same class consecutively + + + + + The password contains fewer than %n digits + + + + + + + The password contains fewer than %n uppercase letters + + + + + + + The password contains fewer than %n non-alphanumeric characters + + + + + + + The password is shorter than %n characters + + + + + + + The password is a rotated version of the previous one + + + + + The password contains fewer than %n character classes + + + + + + + The password contains more than %n same characters consecutively + + + + + + + The password contains more than %n characters of the same class consecutively + + + + + + + The password contains monotonic sequence longer than %n characters + + + + + + + The password contains too long of a monotonic character sequence + + + + + No password supplied + + + + + Cannot obtain random numbers from the RNG device + + + + + Password generation failed - required entropy too low for settings + + + + + The password fails the dictionary check - %1 + + + + + The password fails the dictionary check + + + + + Unknown setting - %1 + + + + + Unknown setting + + + + + Bad integer value of setting - %1 + + + + + Bad integer value + + + + + Setting %1 is not of integer type + + + + + Setting is not of integer type + + + + + Setting %1 is not of string type + + + + + Setting is not of string type + + + + + Opening the configuration file failed + + + + + The configuration file is malformed + + + + + Fatal failure + + + + + Unknown error + + + + + Password is empty + + + + + PackageChooserPage + + + Form + + + + + Product Name + + + + + TextLabel + + + + + Long Product Description + + + + + Package Selection + + + + + Please pick a product from the list. The selected product will be installed. + + + + + PackageChooserQmlViewStep + + + Packages + + + + + PackageChooserViewStep + + + Packages + + + + + PackageModel + + + Name + + + + + Description + + + + + Page_Keyboard + + + Form + + + + + Keyboard Model: + + + + + Type here to test your keyboard + + + + + Page_UserSetup + + + Form + + + + + What is your name? + + + + + Your Full Name + + + + + What name do you want to use to log in? + + + + + login + + + + + What is the name of this computer? + + + + + <small>This name will be used if you make the computer visible to others on a network.</small> + + + + + Computer Name + + + + + Choose a password to keep your account safe. + + + + + + <small>Enter the same password twice, so that it can be checked for typing errors. A good password will contain a mixture of letters, numbers and punctuation, should be at least eight characters long, and should be changed at regular intervals.</small> + + + + + + Password + + + + + + Repeat Password + + + + + When this box is checked, password-strength checking is done and you will not be able to use a weak password. + + + + + Require strong passwords. + + + + + Log in automatically without asking for the password. + + + + + Use the same password for the administrator account. + + + + + Choose a password for the administrator account. + + + + + + <small>Enter the same password twice, so that it can be checked for typing errors.</small> + + + + + PartitionLabelsView + + + Root + + + + + Home + + + + + Boot + + + + + EFI system + + + + + Swap + + + + + New partition for %1 + + + + + New partition + + + + + %1 %2 + size[number] filesystem[name] + + + + + PartitionModel + + + + Free Space + + + + + + New partition + + + + + Name + + + + + File System + + + + + File System Label + + + + + Mount Point + + + + + Size + + + + + PartitionPage + + + Form + + + + + Storage de&vice: + + + + + &Revert All Changes + + + + + New Partition &Table + + + + + Cre&ate + + + + + &Edit + + + + + &Delete + + + + + New Volume Group + + + + + Resize Volume Group + + + + + Deactivate Volume Group + + + + + Remove Volume Group + + + + + I&nstall boot loader on: + + + + + Are you sure you want to create a new partition table on %1? + + + + + Can not create new partition + + + + + The partition table on %1 already has %2 primary partitions, and no more can be added. Please remove one primary partition and add an extended partition, instead. + + + + + PartitionViewStep + + + Gathering system information... + + + + + Partitions + + + + + Current: + + + + + After: + + + + + No EFI system partition configured + + + + + EFI system partition configured incorrectly + + + + + An EFI system partition is necessary to start %1.<br/><br/>To configure an EFI system partition, go back and select or create a suitable filesystem. + + + + + The filesystem must be mounted on <strong>%1</strong>. + + + + + The filesystem must have type FAT32. + + + + + The filesystem must be at least %1 MiB in size. + + + + + The filesystem must have flag <strong>%1</strong> set. + + + + + You can continue without setting up an EFI system partition but your system may fail to start. + + + + + Option to use GPT on BIOS + + + + + A GPT partition table is the best option for all systems. This installer supports such a setup for BIOS systems too.<br/><br/>To configure a GPT partition table on BIOS, (if not done so already) go back and set the partition table to GPT, next create a 8 MB unformatted partition with the <strong>bios_grub</strong> flag enabled.<br/><br/>An unformatted 8 MB partition is necessary to start %1 on a BIOS system with GPT. + + + + + Boot partition not encrypted + + + + + A separate boot partition was set up together with an encrypted root partition, but the boot partition is not encrypted.<br/><br/>There are security concerns with this kind of setup, because important system files are kept on an unencrypted partition.<br/>You may continue if you wish, but filesystem unlocking will happen later during system startup.<br/>To encrypt the boot partition, go back and recreate it, selecting <strong>Encrypt</strong> in the partition creation window. + + + + + has at least one disk device available. + + + + + There are no partitions to install on. + + + + + PlasmaLnfJob + + + Plasma Look-and-Feel Job + + + + + + Could not select KDE Plasma Look-and-Feel package + + + + + PlasmaLnfPage + + + Form + + + + + Please choose a look-and-feel for the KDE Plasma Desktop. You can also skip this step and configure the look-and-feel once the system is set up. Clicking on a look-and-feel selection will give you a live preview of that look-and-feel. + + + + + Please choose a look-and-feel for the KDE Plasma Desktop. You can also skip this step and configure the look-and-feel once the system is installed. Clicking on a look-and-feel selection will give you a live preview of that look-and-feel. + + + + + PlasmaLnfViewStep + + + Look-and-Feel + + + + + PreserveFiles + + + Saving files for later ... + + + + + No files configured to save for later. + + + + + Not all of the configured files could be preserved. + + + + + ProcessResult + + + +There was no output from the command. + + + + + +Output: + + + + + + External command crashed. + + + + + Command <i>%1</i> crashed. + + + + + External command failed to start. + + + + + Command <i>%1</i> failed to start. + + + + + Internal error when starting command. + + + + + Bad parameters for process job call. + + + + + External command failed to finish. + + + + + Command <i>%1</i> failed to finish in %2 seconds. + + + + + External command finished with errors. + + + + + Command <i>%1</i> finished with exit code %2. + + + + + QObject + + + %1 (%2) + + + + + unknown + + + + + extended + + + + + unformatted + + + + + swap + + + + + + Default + + + + + + + + File not found + + + + + Path <pre>%1</pre> must be an absolute path. + + + + + Directory not found + + + + + + Could not create new random file <pre>%1</pre>. + + + + + No product + + + + + No description provided. + + + + + (no mount point) + + + + + Unpartitioned space or unknown partition table + + + + + Recommended + + + <p>This computer does not satisfy some of the recommended requirements for setting up %1.<br/> + Setup can continue, but some features might be disabled.</p> + + + + + RemoveUserJob + + + Remove live user from target system + + + + + RemoveVolumeGroupJob + + + + Remove Volume Group named %1. + + + + + Remove Volume Group named <strong>%1</strong>. + + + + + The installer failed to remove a volume group named '%1'. + + + + + ReplaceWidget + + + Form + + + + + Select where to install %1.<br/><font color="red">Warning: </font>this will delete all files on the selected partition. + + + + + The selected item does not appear to be a valid partition. + + + + + %1 cannot be installed on empty space. Please select an existing partition. + + + + + %1 cannot be installed on an extended partition. Please select an existing primary or logical partition. + + + + + %1 cannot be installed on this partition. + + + + + Data partition (%1) + + + + + Unknown system partition (%1) + + + + + %1 system partition (%2) + + + + + <strong>%4</strong><br/><br/>The partition %1 is too small for %2. Please select a partition with capacity at least %3 GiB. + + + + + <strong>%2</strong><br/><br/>An EFI system partition cannot be found anywhere on this system. Please go back and use manual partitioning to set up %1. + + + + + + + <strong>%3</strong><br/><br/>%1 will be installed on %2.<br/><font color="red">Warning: </font>all data on partition %2 will be lost. + + + + + The EFI system partition at %1 will be used for starting %2. + + + + + EFI system partition: + + + + + Requirements + + + <p>This computer does not satisfy the minimum requirements for installing %1.<br/> + Installation cannot continue.</p> + + + + + <p>This computer does not satisfy some of the recommended requirements for setting up %1.<br/> + Setup can continue, but some features might be disabled.</p> + + + + + ResizeFSJob + + + Resize Filesystem Job + + + + + Invalid configuration + + + + + The file-system resize job has an invalid configuration and will not run. + + + + + KPMCore not Available + + + + + Calamares cannot start KPMCore for the file-system resize job. + + + + + + + + + Resize Failed + + + + + The filesystem %1 could not be found in this system, and cannot be resized. + + + + + The device %1 could not be found in this system, and cannot be resized. + + + + + + The filesystem %1 cannot be resized. + + + + + + The device %1 cannot be resized. + + + + + The filesystem %1 must be resized, but cannot. + + + + + The device %1 must be resized, but cannot + + + + + ResizePartitionJob + + + Resize partition %1. + + + + + Resize <strong>%2MiB</strong> partition <strong>%1</strong> to <strong>%3MiB</strong>. + + + + + Resizing %2MiB partition %1 to %3MiB. + + + + + The installer failed to resize partition %1 on disk '%2'. + + + + + ResizeVolumeGroupDialog + + + Resize Volume Group + + + + + ResizeVolumeGroupJob + + + + Resize volume group named %1 from %2 to %3. + + + + + Resize volume group named <strong>%1</strong> from <strong>%2</strong> to <strong>%3</strong>. + + + + + The installer failed to resize a volume group named '%1'. + + + + + ResultsListDialog + + + For best results, please ensure that this computer: + + + + + System requirements + + + + + ScanningDialog + + + Scanning storage devices... + + + + + Partitioning + + + + + SetHostNameJob + + + Set hostname %1 + + + + + Set hostname <strong>%1</strong>. + + + + + Setting hostname %1. + + + + + + Internal Error + + + + + + Cannot write hostname to target system + + + + + SetKeyboardLayoutJob + + + Set keyboard model to %1, layout to %2-%3 + + + + + Failed to write keyboard configuration for the virtual console. + + + + + + + Failed to write to %1 + + + + + Failed to write keyboard configuration for X11. + + + + + Failed to write keyboard configuration to existing /etc/default directory. + + + + + SetPartFlagsJob + + + Set flags on partition %1. + + + + + Set flags on %1MiB %2 partition. + + + + + Set flags on new partition. + + + + + Clear flags on partition <strong>%1</strong>. + + + + + Clear flags on %1MiB <strong>%2</strong> partition. + + + + + Clear flags on new partition. + + + + + Flag partition <strong>%1</strong> as <strong>%2</strong>. + + + + + Flag %1MiB <strong>%2</strong> partition as <strong>%3</strong>. + + + + + Flag new partition as <strong>%1</strong>. + + + + + Clearing flags on partition <strong>%1</strong>. + + + + + Clearing flags on %1MiB <strong>%2</strong> partition. + + + + + Clearing flags on new partition. + + + + + Setting flags <strong>%2</strong> on partition <strong>%1</strong>. + + + + + Setting flags <strong>%3</strong> on %1MiB <strong>%2</strong> partition. + + + + + Setting flags <strong>%1</strong> on new partition. + + + + + The installer failed to set flags on partition %1. + + + + + SetPasswordJob + + + Set password for user %1 + + + + + Setting password for user %1. + + + + + Bad destination system path. + + + + + rootMountPoint is %1 + + + + + Cannot disable root account. + + + + + passwd terminated with error code %1. + + + + + Cannot set password for user %1. + + + + + usermod terminated with error code %1. + + + + + SetTimezoneJob + + + Set timezone to %1/%2 + + + + + Cannot access selected timezone path. + + + + + Bad path: %1 + + + + + Cannot set timezone. + + + + + Link creation failed, target: %1; link name: %2 + + + + + Cannot set timezone, + + + + + Cannot open /etc/timezone for writing + + + + + SetupGroupsJob + + + Preparing groups. + + + + + + Could not create groups in target system + + + + + These groups are missing in the target system: %1 + + + + + SetupSudoJob + + + Configure <pre>sudo</pre> users. + + + + + Cannot chmod sudoers file. + + + + + Cannot create sudoers file for writing. + + + + + ShellProcessJob + + + Shell Processes Job + + + + + SlideCounter + + + %L1 / %L2 + slide counter, %1 of %2 (numeric) + + + + + StandardButtons + + + &OK + + + + + &Yes + + + + + &No + + + + + &Cancel + + + + + &Close + + + + + TrackingInstallJob + + + Installation feedback + + + + + Sending installation feedback. + + + + + Internal error in install-tracking. + + + + + HTTP request timed out. + + + + + TrackingKUserFeedbackJob + + + KDE user feedback + + + + + Configuring KDE user feedback. + + + + + + Error in KDE user feedback configuration. + + + + + Could not configure KDE user feedback correctly, script error %1. + + + + + Could not configure KDE user feedback correctly, Calamares error %1. + + + + + TrackingMachineUpdateManagerJob + + + Machine feedback + + + + + Configuring machine feedback. + + + + + + Error in machine feedback configuration. + + + + + Could not configure machine feedback correctly, script error %1. + + + + + Could not configure machine feedback correctly, Calamares error %1. + + + + + TrackingPage + + + Form + + + + + Placeholder + + + + + <html><head/><body><p>Click here to send <span style=" font-weight:600;">no information at all</span> about your installation.</p></body></html> + + + + + <html><head/><body><p><a href="placeholder"><span style=" text-decoration: underline; color:#2980b9;">Click here for more information about user feedback</span></a></p></body></html> + + + + + Tracking helps %1 to see how often it is installed, what hardware it is installed on and which applications are used. To see what will be sent, please click the help icon next to each area. + + + + + By selecting this you will send information about your installation and hardware. This information will only be sent <b>once</b> after the installation finishes. + + + + + By selecting this you will periodically send information about your <b>machine</b> installation, hardware and applications, to %1. + + + + + By selecting this you will regularly send information about your <b>user</b> installation, hardware, applications and application usage patterns, to %1. + + + + + TrackingViewStep + + + Feedback + + + + + UsersPage + + + <small>If more than one person will use this computer, you can create multiple accounts after setup.</small> + + + + + <small>If more than one person will use this computer, you can create multiple accounts after installation.</small> + + + + + UsersQmlViewStep + + + Users + + + + + UsersViewStep + + + Users + + + + + VariantModel + + + Key + Column header for key/value + + + + + Value + Column header for key/value + + + + + VolumeGroupBaseDialog + + + Create Volume Group + + + + + List of Physical Volumes + + + + + Volume Group Name: + + + + + Volume Group Type: + + + + + Physical Extent Size: + + + + + MiB + + + + + Total Size: + + + + + Used Size: + + + + + Total Sectors: + + + + + Quantity of LVs: + + + + + WelcomePage + + + Form + + + + + + Select application and system language + + + + + &About + + + + + Open donations website + + + + + &Donate + + + + + Open help and support website + + + + + &Support + + + + + Open issues and bug-tracking website + + + + + &Known issues + + + + + Open release notes website + + + + + &Release notes + + + + + <h1>Welcome to the Calamares setup program for %1.</h1> + + + + + <h1>Welcome to %1 setup.</h1> + + + + + <h1>Welcome to the Calamares installer for %1.</h1> + + + + + <h1>Welcome to the %1 installer.</h1> + + + + + %1 support + + + + + About %1 setup + + + + + About %1 installer + + + + + <h1>%1</h1><br/><strong>%2<br/>for %3</strong><br/><br/>Copyright 2014-2017 Teo Mrnjavac &lt;teo@kde.org&gt;<br/>Copyright 2017-2020 Adriaan de Groot &lt;groot@kde.org&gt;<br/>Thanks to <a href="https://calamares.io/team/">the Calamares team</a> and the <a href="https://www.transifex.com/calamares/calamares/">Calamares translators team</a>.<br/><br/><a href="https://calamares.io/">Calamares</a> development is sponsored by <br/><a href="http://www.blue-systems.com/">Blue Systems</a> - Liberating Software. + + + + + WelcomeQmlViewStep + + + Welcome + + + + + WelcomeViewStep + + + Welcome + + + + + about + + + <h1>%1</h1><br/> + <strong>%2<br/> + for %3</strong><br/><br/> + Copyright 2014-2017 Teo Mrnjavac &lt;teo@kde.org&gt;<br/> + Copyright 2017-2020 Adriaan de Groot &lt;groot@kde.org&gt;<br/> + Thanks to <a href='https://calamares.io/team/'>the Calamares team</a> + and the <a href='https://www.transifex.com/calamares/calamares/'>Calamares + translators team</a>.<br/><br/> + <a href='https://calamares.io/'>Calamares</a> + development is sponsored by <br/> + <a href='http://www.blue-systems.com/'>Blue Systems</a> - + Liberating Software. + + + + + Back + + + + + calamares-sidebar + + + Show debug information + + + + + finishedq + + + Installation Completed + + + + + %1 has been installed on your computer.<br/> + You may now restart into your new system, or continue using the Live environment. + + + + + Close Installer + + + + + Restart System + + + + + <p>A full log of the install is available as installation.log in the home directory of the Live user.<br/> + This log is copied to /var/log/installation.log of the target system.</p> + + + + + i18n + + + <h1>Languages</h1> </br> + The system locale setting affects the language and character set for some command line user interface elements. The current setting is <strong>%1</strong>. + + + + + <h1>Locales</h1> </br> + The system locale setting affects the numbers and dates format. The current setting is <strong>%1</strong>. + + + + + Back + + + + + keyboardq + + + To activate keyboard preview, select a layout. + + + + + Keyboard Model: + + + + + Layouts + + + + + Type here to test your keyboard + + + + + Variants + + + + + localeq + + + Change + + + + + notesqml + + + <h3>%1</h3> + <p>These are example release notes.</p> + + + + + packagechooserq + + + LibreOffice is a powerful and free office suite, used by millions of people around the world. It includes several applications that make it the most versatile Free and Open Source office suite on the market.<br/> + Default option. + + + + + LibreOffice + + + + + If you don't want to install an office suite, just select No Office Suite. You can always add one (or more) later on your installed system as the need arrives. + + + + + No Office Suite + + + + + Create a minimal Desktop install, remove all extra applications and decide later on what you would like to add to your system. Examples of what won't be on such an install, there will be no Office Suite, no media players, no image viewer or print support. It will be just a desktop, file browser, package manager, text editor and simple web-browser. + + + + + Minimal Install + + + + + Please select an option for your install, or use the default: LibreOffice included. + + + + + release_notes + + + <h3>%1</h3> + <p>This an example QML file, showing options in RichText with Flickable content.</p> + + <p>QML with RichText can use HTML tags, Flickable content is useful for touchscreens.</p> + + <p><b>This is bold text</b></p> + <p><i>This is italic text</i></p> + <p><u>This is underlined text</u></p> + <p><center>This text will be center-aligned.</center></p> + <p><s>This is strikethrough</s></p> + + <p>Code example: + <code>ls -l /home</code></p> + + <p><b>Lists:</b></p> + <ul> + <li>Intel CPU systems</li> + <li>AMD CPU systems</li> + </ul> + + <p>The vertical scrollbar is adjustable, current width set to 10.</p> + + + + + Back + + + + + usersq + + + Pick your user name and credentials to login and perform admin tasks + + + + + What is your name? + + + + + Your Full Name + + + + + What name do you want to use to log in? + + + + + Login Name + + + + + If more than one person will use this computer, you can create multiple accounts after installation. + + + + + Only lowercase letters, numbers, underscore and hyphen are allowed. + + + + + root is not allowed as username. + + + + + What is the name of this computer? + + + + + Computer Name + + + + + This name will be used if you make the computer visible to others on a network. + + + + + localhost is not allowed as hostname. + + + + + Choose a password to keep your account safe. + + + + + Password + + + + + Repeat Password + + + + + Enter the same password twice, so that it can be checked for typing errors. A good password will contain a mixture of letters, numbers and punctuation, should be at least eight characters long, and should be changed at regular intervals. + + + + + Validate passwords quality + + + + + When this box is checked, password-strength checking is done and you will not be able to use a weak password. + + + + + Log in automatically without asking for the password + + + + + Only letters, numbers, underscore and hyphen are allowed, minimal of two characters. + + + + + Reuse user password as root password + + + + + Use the same password for the administrator account. + + + + + Choose a root password to keep your account safe. + + + + + Root Password + + + + + Repeat Root Password + + + + + Enter the same password twice, so that it can be checked for typing errors. + + + + + welcomeq + + + <h3>Welcome to the %1 <quote>%2</quote> installer</h3> + <p>This program will ask you some questions and set up %1 on your computer.</p> + + + + + About + + + + + Support + + + + + Known issues + + + + + Release notes + + + + + Donate + + + + diff --git a/lang/calamares_pt_PT.ts b/lang/calamares_pt_PT.ts index 951645ab1..3ec8b295e 100644 --- a/lang/calamares_pt_PT.ts +++ b/lang/calamares_pt_PT.ts @@ -2014,7 +2014,7 @@ O instalador será encerrado e todas as alterações serão perdidas.Please select your preferred location on the map so the installer can suggest the locale and timezone settings for you. You can fine-tune the suggested settings below. Search the map by dragging to move and using the +/- buttons to zoom in/out or use mouse scrolling for zooming. - Por favor selecione o seu local preferido no mapa para que o instalador possa sugerir a localização + Selecione o seu local preferido no mapa para que o instalador possa sugerir a localização e fuso horário para si. Pode ajustar as definições sugeridas abaixo. Procure no mapa arrastando para mover e utilizando os botões +/- para aumentar/diminuir ou utilize a roda do rato para dar zoom. @@ -4003,7 +4003,7 @@ Saída de Dados: <h1>%1</h1><br/><strong>%2<br/>for %3</strong><br/><br/>Copyright 2014-2017 Teo Mrnjavac &lt;teo@kde.org&gt;<br/>Copyright 2017-2020 Adriaan de Groot &lt;groot@kde.org&gt;<br/>Thanks to <a href="https://calamares.io/team/">the Calamares team</a> and the <a href="https://www.transifex.com/calamares/calamares/">Calamares translators team</a>.<br/><br/><a href="https://calamares.io/">Calamares</a> development is sponsored by <br/><a href="http://www.blue-systems.com/">Blue Systems</a> - Liberating Software. - <h1>%1</h1><br/><strong>%2<br/>para %3</strong><br/><br/>Copyright 2014-2017 Teo Mrnjavac &lt;teo@kde.org&gt;<br/>Copyright 2017-2020 Adriaan de Groot &lt;groot@kde.org&gt;<br/>Obrigado à <a href="https://calamares.io/team/">equipa Calamares</a> e à <a href="https://www.transifex.com/calamares/calamares/">equipa de tradutores do Calamares</a>.<br/><br/>O desenvolvimento do <a href="https://calamares.io/">Calamares</a> é patrocinado pela <br/><a href="http://www.blue-systems.com/">Blue Systems</a> - Liberating Software. + <h1>%1</h1><br/><strong>%2<br/>para o %3</strong><br/><br/>Copyright 2014-2017 Teo Mrnjavac &lt;teo@kde.org&gt;<br/>Copyright 2017-2020 Adriaan de Groot &lt;groot@kde.org&gt;<br/>Obrigado à <a href="https://calamares.io/team/">equipa Calamares</a> e à <a href="https://www.transifex.com/calamares/calamares/">equipa de tradutores do Calamares</a>.<br/><br/>O desenvolvimento do <a href="https://calamares.io/">Calamares</a> é patrocinado pela <br/><a href="http://www.blue-systems.com/">Blue Systems</a> - Liberating Software. diff --git a/lang/calamares_ro.ts b/lang/calamares_ro.ts index 39573886d..a4ac28ce6 100644 --- a/lang/calamares_ro.ts +++ b/lang/calamares_ro.ts @@ -104,17 +104,17 @@ Crashes Calamares, so that Dr. Konqui can look at it. - + Dă crash lui Calamares, pentru ca doctorul Konqui să se uite la el. Reloads the stylesheet from the branding directory. - + Reîncarcă foaia de stil din directorul branding. Uploads the session log to the configured pastebin. - + Încarcă jurnalul sesiunii pe pastebin-ul configurat. @@ -134,7 +134,7 @@ Widget Tree - Lista widget + Arborele de widget diff --git a/lang/calamares_tg.ts b/lang/calamares_tg.ts index 1c64c5d8c..b4124be17 100644 --- a/lang/calamares_tg.ts +++ b/lang/calamares_tg.ts @@ -6,7 +6,7 @@ Manage auto-mount settings - + Идора кардани танзимоти васлкунии худкор diff --git a/lang/calamares_zh_CN.ts b/lang/calamares_zh_CN.ts index 5b58024ad..df04d1dd6 100644 --- a/lang/calamares_zh_CN.ts +++ b/lang/calamares_zh_CN.ts @@ -688,27 +688,27 @@ The installer will quit and all changes will be lost. Successfully unmounted %1. - + 成功卸载了 %1。 Successfully disabled swap %1. - + 成功禁用了交换空间 %1。 Successfully cleared swap %1. - + 成功清理了交换空间 %1。 Successfully closed mapper device %1. - + 成功关闭了映射设备 %1。 Successfully disabled volume group %1. - + 成功禁用了卷组 %1。 diff --git a/lang/python/cs_CZ/LC_MESSAGES/python.po b/lang/python/cs_CZ/LC_MESSAGES/python.po index 70e9d5b77..23737551a 100644 --- a/lang/python/cs_CZ/LC_MESSAGES/python.po +++ b/lang/python/cs_CZ/LC_MESSAGES/python.po @@ -6,7 +6,7 @@ # Translators: # pavelrz, 2017 # LiberteCzech , 2020 -# Pavel Borecki , 2021 +# Pavel Borecki , 2022 # #, fuzzy msgid "" @@ -15,7 +15,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-02 15:45+0100\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: Pavel Borecki , 2021\n" +"Last-Translator: Pavel Borecki , 2022\n" "Language-Team: Czech (Czech Republic) (https://www.transifex.com/calamares/teams/20061/cs_CZ/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -331,7 +331,7 @@ msgstr "Nedaří se zapnout systemd službu {name!s}." #: src/modules/services-systemd/main.py:67 msgid "Cannot enable systemd timer {name!s}." -msgstr "" +msgstr "Nedaří se zapnout systemd časovač {name!s}." #: src/modules/services-systemd/main.py:71 msgid "Cannot disable systemd target {name!s}." @@ -413,6 +413,8 @@ msgid "" "Failed to find unsquashfs, make sure you have the squashfs-tools package " "installed." msgstr "" +"Nepodařilo se nalézt nástroj unsquashfs – ověřte, že je nainstalovaný " +"balíček squashfs-tools." #: src/modules/unpackfs/main.py:479 msgid "The destination \"{}\" in the target system is not a directory" diff --git a/lang/python/ja-Hira/LC_MESSAGES/python.po b/lang/python/ja-Hira/LC_MESSAGES/python.po new file mode 100644 index 000000000..9a869c5bc --- /dev/null +++ b/lang/python/ja-Hira/LC_MESSAGES/python.po @@ -0,0 +1,385 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-02 15:45+0100\n" +"PO-Revision-Date: 2017-08-09 10:34+0000\n" +"Language-Team: Japanese (Hiragana) (https://www.transifex.com/calamares/teams/20061/ja-Hira/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: ja-Hira\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: src/modules/initramfscfg/main.py:32 +msgid "Configuring initramfs." +msgstr "" + +#: src/modules/initramfscfg/main.py:85 src/modules/initramfscfg/main.py:89 +#: src/modules/fstab/main.py:355 src/modules/fstab/main.py:361 +#: src/modules/fstab/main.py:388 src/modules/networkcfg/main.py:105 +#: src/modules/initcpiocfg/main.py:227 src/modules/initcpiocfg/main.py:231 +#: src/modules/localecfg/main.py:135 src/modules/mount/main.py:144 +#: src/modules/rawfs/main.py:164 src/modules/openrcdmcryptcfg/main.py:72 +#: src/modules/openrcdmcryptcfg/main.py:76 +#: src/modules/luksopenswaphookcfg/main.py:86 +#: src/modules/luksopenswaphookcfg/main.py:90 +msgid "Configuration Error" +msgstr "" + +#: src/modules/initramfscfg/main.py:86 src/modules/fstab/main.py:356 +#: src/modules/initcpiocfg/main.py:228 src/modules/mount/main.py:145 +#: src/modules/rawfs/main.py:165 src/modules/openrcdmcryptcfg/main.py:73 +#: src/modules/luksopenswaphookcfg/main.py:87 +msgid "No partitions are defined for
{!s}
to use." +msgstr "" + +#: src/modules/initramfscfg/main.py:90 src/modules/fstab/main.py:362 +#: src/modules/networkcfg/main.py:106 src/modules/initcpiocfg/main.py:232 +#: src/modules/localecfg/main.py:136 src/modules/openrcdmcryptcfg/main.py:77 +#: src/modules/luksopenswaphookcfg/main.py:91 +msgid "No root mount point is given for
{!s}
to use." +msgstr "" + +#: src/modules/grubcfg/main.py:28 +msgid "Configure GRUB." +msgstr "" + +#: src/modules/bootloader/main.py:43 +msgid "Install bootloader." +msgstr "" + +#: src/modules/bootloader/main.py:508 +msgid "Bootloader installation error" +msgstr "" + +#: src/modules/bootloader/main.py:509 +msgid "" +"The bootloader could not be installed. The installation command " +"
{!s}
returned error code {!s}." +msgstr "" + +#: src/modules/fstab/main.py:29 +msgid "Writing fstab." +msgstr "" + +#: src/modules/fstab/main.py:389 +msgid "No
{!s}
configuration is given for
{!s}
to use." +msgstr "" + +#: src/modules/dracut/main.py:27 +msgid "Creating initramfs with dracut." +msgstr "" + +#: src/modules/dracut/main.py:49 +msgid "Failed to run dracut on the target" +msgstr "" + +#: src/modules/dracut/main.py:50 src/modules/mkinitfs/main.py:50 +msgid "The exit code was {}" +msgstr "" + +#: src/modules/displaymanager/main.py:526 +msgid "Cannot write KDM configuration file" +msgstr "" + +#: src/modules/displaymanager/main.py:527 +msgid "KDM config file {!s} does not exist" +msgstr "" + +#: src/modules/displaymanager/main.py:588 +msgid "Cannot write LXDM configuration file" +msgstr "" + +#: src/modules/displaymanager/main.py:589 +msgid "LXDM config file {!s} does not exist" +msgstr "" + +#: src/modules/displaymanager/main.py:672 +msgid "Cannot write LightDM configuration file" +msgstr "" + +#: src/modules/displaymanager/main.py:673 +msgid "LightDM config file {!s} does not exist" +msgstr "" + +#: src/modules/displaymanager/main.py:747 +msgid "Cannot configure LightDM" +msgstr "" + +#: src/modules/displaymanager/main.py:748 +msgid "No LightDM greeter installed." +msgstr "" + +#: src/modules/displaymanager/main.py:779 +msgid "Cannot write SLIM configuration file" +msgstr "" + +#: src/modules/displaymanager/main.py:780 +msgid "SLIM config file {!s} does not exist" +msgstr "" + +#: src/modules/displaymanager/main.py:906 +msgid "No display managers selected for the displaymanager module." +msgstr "" + +#: src/modules/displaymanager/main.py:907 +msgid "" +"The displaymanagers list is empty or undefined in both globalstorage and " +"displaymanager.conf." +msgstr "" + +#: src/modules/displaymanager/main.py:989 +msgid "Display manager configuration was incomplete" +msgstr "" + +#: src/modules/services-openrc/main.py:29 +msgid "Configure OpenRC services" +msgstr "" + +#: src/modules/services-openrc/main.py:57 +msgid "Cannot add service {name!s} to run-level {level!s}." +msgstr "" + +#: src/modules/services-openrc/main.py:59 +msgid "Cannot remove service {name!s} from run-level {level!s}." +msgstr "" + +#: src/modules/services-openrc/main.py:61 +msgid "" +"Unknown service-action {arg!s} for service {name!s} in run-" +"level {level!s}." +msgstr "" + +#: src/modules/services-openrc/main.py:93 +#: src/modules/services-systemd/main.py:59 +msgid "Cannot modify service" +msgstr "" + +#: src/modules/services-openrc/main.py:94 +msgid "" +"rc-update {arg!s} call in chroot returned error code {num!s}." +msgstr "" + +#: src/modules/services-openrc/main.py:101 +msgid "Target runlevel does not exist" +msgstr "" + +#: src/modules/services-openrc/main.py:102 +msgid "" +"The path for runlevel {level!s} is {path!s}, which does not " +"exist." +msgstr "" + +#: src/modules/services-openrc/main.py:110 +msgid "Target service does not exist" +msgstr "" + +#: src/modules/services-openrc/main.py:111 +msgid "" +"The path for service {name!s} is {path!s}, which does not " +"exist." +msgstr "" + +#: src/modules/networkcfg/main.py:29 +msgid "Saving network configuration." +msgstr "" + +#: src/modules/packages/main.py:50 src/modules/packages/main.py:59 +#: src/modules/packages/main.py:69 +msgid "Install packages." +msgstr "" + +#: src/modules/packages/main.py:57 +#, python-format +msgid "Processing packages (%(count)d / %(total)d)" +msgstr "" + +#: src/modules/packages/main.py:62 +#, python-format +msgid "Installing one package." +msgid_plural "Installing %(num)d packages." +msgstr[0] "" + +#: src/modules/packages/main.py:65 +#, python-format +msgid "Removing one package." +msgid_plural "Removing %(num)d packages." +msgstr[0] "" + +#: src/modules/packages/main.py:638 src/modules/packages/main.py:650 +#: src/modules/packages/main.py:678 +msgid "Package Manager error" +msgstr "" + +#: src/modules/packages/main.py:639 +msgid "" +"The package manager could not prepare updates. The command
{!s}
" +"returned error code {!s}." +msgstr "" + +#: src/modules/packages/main.py:651 +msgid "" +"The package manager could not update the system. The command
{!s}
" +" returned error code {!s}." +msgstr "" + +#: src/modules/packages/main.py:679 +msgid "" +"The package manager could not make changes to the installed system. The " +"command
{!s}
returned error code {!s}." +msgstr "" + +#: src/modules/plymouthcfg/main.py:27 +msgid "Configure Plymouth theme" +msgstr "" + +#: src/modules/initcpiocfg/main.py:28 +msgid "Configuring mkinitcpio." +msgstr "" + +#: src/modules/localecfg/main.py:30 +msgid "Configuring locales." +msgstr "" + +#: src/modules/mount/main.py:30 +msgid "Mounting partitions." +msgstr "" + +#: src/modules/rawfs/main.py:26 +msgid "Installing data." +msgstr "" + +#: src/modules/dummypython/main.py:35 +msgid "Dummy python job." +msgstr "" + +#: src/modules/dummypython/main.py:37 src/modules/dummypython/main.py:93 +#: src/modules/dummypython/main.py:94 +msgid "Dummy python step {}" +msgstr "" + +#: src/modules/hwclock/main.py:26 +msgid "Setting hardware clock." +msgstr "" + +#: src/modules/umount/main.py:31 +msgid "Unmount file systems." +msgstr "" + +#: src/modules/openrcdmcryptcfg/main.py:26 +msgid "Configuring OpenRC dmcrypt service." +msgstr "" + +#: src/modules/services-systemd/main.py:26 +msgid "Configure systemd services" +msgstr "" + +#: src/modules/services-systemd/main.py:60 +msgid "" +"systemctl {arg!s} call in chroot returned error code {num!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:63 +#: src/modules/services-systemd/main.py:69 +msgid "Cannot enable systemd service {name!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:65 +msgid "Cannot enable systemd target {name!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:67 +msgid "Cannot enable systemd timer {name!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:71 +msgid "Cannot disable systemd target {name!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:73 +msgid "Cannot mask systemd unit {name!s}." +msgstr "" + +#: src/modules/services-systemd/main.py:75 +msgid "" +"Unknown systemd commands {command!s} and " +"{suffix!s} for unit {name!s}." +msgstr "" + +#: src/modules/mkinitfs/main.py:27 +msgid "Creating initramfs with mkinitfs." +msgstr "" + +#: src/modules/mkinitfs/main.py:49 +msgid "Failed to run mkinitfs on the target" +msgstr "" + +#: src/modules/unpackfs/main.py:34 +msgid "Filling up filesystems." +msgstr "" + +#: src/modules/unpackfs/main.py:254 +msgid "rsync failed with error code {}." +msgstr "" + +#: src/modules/unpackfs/main.py:299 +msgid "Unpacking image {}/{}, file {}/{}" +msgstr "" + +#: src/modules/unpackfs/main.py:314 +msgid "Starting to unpack {}" +msgstr "" + +#: src/modules/unpackfs/main.py:323 src/modules/unpackfs/main.py:465 +msgid "Failed to unpack image \"{}\"" +msgstr "" + +#: src/modules/unpackfs/main.py:430 +msgid "No mount point for root partition" +msgstr "" + +#: src/modules/unpackfs/main.py:431 +msgid "globalstorage does not contain a \"rootMountPoint\" key, doing nothing" +msgstr "" + +#: src/modules/unpackfs/main.py:436 +msgid "Bad mount point for root partition" +msgstr "" + +#: src/modules/unpackfs/main.py:437 +msgid "rootMountPoint is \"{}\", which does not exist, doing nothing" +msgstr "" + +#: src/modules/unpackfs/main.py:453 src/modules/unpackfs/main.py:457 +#: src/modules/unpackfs/main.py:463 src/modules/unpackfs/main.py:478 +msgid "Bad unsquash configuration" +msgstr "" + +#: src/modules/unpackfs/main.py:454 +msgid "The filesystem for \"{}\" ({}) is not supported by your current kernel" +msgstr "" + +#: src/modules/unpackfs/main.py:458 +msgid "The source filesystem \"{}\" does not exist" +msgstr "" + +#: src/modules/unpackfs/main.py:464 +msgid "" +"Failed to find unsquashfs, make sure you have the squashfs-tools package " +"installed." +msgstr "" + +#: src/modules/unpackfs/main.py:479 +msgid "The destination \"{}\" in the target system is not a directory" +msgstr "" + +#: src/modules/luksopenswaphookcfg/main.py:26 +msgid "Configuring encrypted swap." +msgstr "" diff --git a/lang/python/zh_CN/LC_MESSAGES/python.po b/lang/python/zh_CN/LC_MESSAGES/python.po index 706b02d24..c6972b0f5 100644 --- a/lang/python/zh_CN/LC_MESSAGES/python.po +++ b/lang/python/zh_CN/LC_MESSAGES/python.po @@ -9,6 +9,7 @@ # Feng Chao , 2020 # Bobby Rong , 2020 # 玉堂白鹤 , 2021 +# Giovanni Schiano-Moriello, 2022 # #, fuzzy msgid "" @@ -17,7 +18,7 @@ msgstr "" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-11-02 15:45+0100\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n" -"Last-Translator: 玉堂白鹤 , 2021\n" +"Last-Translator: Giovanni Schiano-Moriello, 2022\n" "Language-Team: Chinese (China) (https://www.transifex.com/calamares/teams/20061/zh_CN/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -305,7 +306,7 @@ msgstr "无法启用 systemd 目标 {name!s}." #: src/modules/services-systemd/main.py:67 msgid "Cannot enable systemd timer {name!s}." -msgstr "" +msgstr "无法启用 systemd 计时器 {name!s}。" #: src/modules/services-systemd/main.py:71 msgid "Cannot disable systemd target {name!s}." @@ -384,7 +385,7 @@ msgstr "源文件系统 \"{}\" 不存在" msgid "" "Failed to find unsquashfs, make sure you have the squashfs-tools package " "installed." -msgstr "" +msgstr "寻找 unsquashfs 失败,请确定您已安装 squashfs-tools 软体包。" #: src/modules/unpackfs/main.py:479 msgid "The destination \"{}\" in the target system is not a directory" diff --git a/src/libcalamares/Job.h b/src/libcalamares/Job.h index 33965e15f..dc89f1c49 100644 --- a/src/libcalamares/Job.h +++ b/src/libcalamares/Job.h @@ -47,7 +47,7 @@ public: /** @brief Is this JobResult a success? * - * Equivalent to errorCode() == 0, might be named isValid(). + * Equivalent to errorCode() == 0, see succeeded(). */ virtual operator bool() const; @@ -58,6 +58,11 @@ public: virtual void setDetails( const QString& details ); int errorCode() const { return m_number; } + /** @brief Is this JobResult a success? + * + * Equivalent to errorCode() == 0. + */ + bool succeeded() const { return this->operator bool(); } /// @brief an "ok status" result static JobResult ok(); diff --git a/src/libcalamares/PythonJob.cpp b/src/libcalamares/PythonJob.cpp index b1373f5f3..ec17c31f3 100644 --- a/src/libcalamares/PythonJob.cpp +++ b/src/libcalamares/PythonJob.cpp @@ -100,7 +100,7 @@ BOOST_PYTHON_MODULE( libcalamares ) bp::args( "s" ), "Writes the given string to the Calamares warning stream." ); bp::def( - "error", &CalamaresPython::warning, bp::args( "s" ), "Writes the given string to the Calamares error stream." ); + "error", &CalamaresPython::error, bp::args( "s" ), "Writes the given string to the Calamares error stream." ); // .. YAML functions diff --git a/src/libcalamares/partition/Mount.cpp b/src/libcalamares/partition/Mount.cpp index 89e17a885..6bc3a7cd2 100644 --- a/src/libcalamares/partition/Mount.cpp +++ b/src/libcalamares/partition/Mount.cpp @@ -14,6 +14,7 @@ #include "partition/Sync.h" #include "utils/CalamaresUtilsSystem.h" #include "utils/Logger.h" +#include "utils/String.h" #include #include @@ -92,7 +93,7 @@ struct TemporaryMount::Private TemporaryMount::TemporaryMount( const QString& devicePath, const QString& filesystemName, const QString& options ) - : m_d( std::make_unique() ) + : m_d( std::make_unique< Private >() ) { m_d->m_devicePath = devicePath; m_d->m_mountDir.setAutoRemove( false ); @@ -123,5 +124,32 @@ TemporaryMount::path() const return m_d ? m_d->m_mountDir.path() : QString(); } +QList< MtabInfo > +MtabInfo::fromMtabFilteredByPrefix( const QString& mountPrefix, const QString& mtabPath ) +{ + QFile f( mtabPath.isEmpty() ? "/etc/mtab" : mtabPath ); + if ( !f.open( QIODevice::ReadOnly ) ) + { + return {}; + } + + QTextStream in( &f ); + QList< MtabInfo > l; + while ( !f.atEnd() ) + { + QStringList line = in.readLine().split( ' ', SplitSkipEmptyParts ); + if ( line.length() == 3 && !line[ 0 ].startsWith( '#' ) ) + { + // Lines have format: , so check + // the mountpoint field. Everything starts with an empty string. + if ( line[ 1 ].startsWith( mountPrefix ) ) + { + l.append( { line[ 0 ], line[ 1 ] } ); + } + } + } + return l; +} + } // namespace Partition } // namespace CalamaresUtils diff --git a/src/libcalamares/partition/Mount.h b/src/libcalamares/partition/Mount.h index d088b108f..f772c33a4 100644 --- a/src/libcalamares/partition/Mount.h +++ b/src/libcalamares/partition/Mount.h @@ -14,6 +14,7 @@ #include "DllMacro.h" +#include #include #include @@ -50,6 +51,13 @@ DLLEXPORT int mount( const QString& devicePath, */ DLLEXPORT int unmount( const QString& path, const QStringList& options = QStringList() ); + +/** @brief Mount and automatically unmount a device + * + * The TemporaryMount object mounts a filesystem, and is like calling + * the mount() function, above. When the object is destroyed, unmount() + * is called with suitable options to undo the original mount. + */ class DLLEXPORT TemporaryMount { public: @@ -68,6 +76,36 @@ private: std::unique_ptr< Private > m_d; }; + +/** @brief Information about a mount point from /etc/mtab + * + * Entries in /etc/mtab are of the form: + * This struct only stores device and mountpoint. + * + * The main way of getting these structs is to call fromMtab() to read + * an /etc/mtab-like file and storing all of the entries from it. + */ +struct DLLEXPORT MtabInfo +{ + QString device; + QString mountPoint; + + /** @brief Reads an mtab-like file and returns the entries from it + * + * When @p mtabPath is given, that file is read. If the given name is + * empty (e.g. the default) then /etc/mtab is read, instead. + * + * If @p mountPrefix is given, then only entries that have a mount point + * that starts with that prefix are returned. + */ + static QList< MtabInfo > fromMtabFilteredByPrefix( const QString& mountPrefix = QString(), + const QString& mtabPath = QString() ); + /// @brief Predicate to sort MtabInfo objects by device-name + static bool deviceOrder( const MtabInfo& a, const MtabInfo& b ) { return a.device > b.device; } + /// @brief Predicate to sort MtabInfo objects by mount-point + static bool mountPointOrder( const MtabInfo& a, const MtabInfo& b ) { return a.mountPoint > b.mountPoint; } +}; + } // namespace Partition } // namespace CalamaresUtils diff --git a/src/modules/README.md b/src/modules/README.md index 09696e66b..97a8556a1 100644 --- a/src/modules/README.md +++ b/src/modules/README.md @@ -67,7 +67,7 @@ Note that process modules are not recommended. Module descriptors **may** have the following keys: - *emergency* (a boolean value, set to true to mark the module - as an emergency module) + as an emergency module; see the section *Emergency Modules*, below) - *noconfig* (a boolean value, set to true to state that the module has no configuration file; defaults to false) - *requiredModules* (a list of modules which are required for this module @@ -102,8 +102,14 @@ to generate a suitable `module.desc`. For Python modules, manually add A module that is marked as an emergency module in its module.desc must **also** set the *emergency* key to *true* in its configuration file (see below). If it does not, the module is not considered to be an emergency -module after all (this is so that you can have modules that have several -instances, only some of which are actually needed for emergencies). +module after all. This is so that you can have modules that have several +instances, only some of which are actually needed for emergencies. + +In summary: +- in `module.desc`, write `emergency: true` to make it **possible** to + run the module in emergency mode, +- in `.conf`, write `emergency: true` to make that specific + module run in emergency mode. ### Module-specific configuration @@ -112,6 +118,10 @@ named `.conf`. If such a file is present in the module's directory, it can be shipped as a *default* configuration file. This only happens if the CMake-time option `INSTALL_CONFIG` is on. +The name of the configuration file for a given module can be +influenced by the `settings.conf` of the overall Calamares configuration. +By default, though, the module's own name is used. + Modules that have *noconfig* set to true will not attempt to read a configuration file, and will not warn that one is missing; conversely if *noconfig* is set to false (or is missing, since diff --git a/src/modules/bootloader/bootloader.conf b/src/modules/bootloader/bootloader.conf index 9f9ad84aa..b28412b0f 100644 --- a/src/modules/bootloader/bootloader.conf +++ b/src/modules/bootloader/bootloader.conf @@ -46,6 +46,16 @@ efiBootMgr: "efibootmgr" # setting the option here, keep in mind that the name is sanitized # (problematic characters, see above, are replaced). # +# There are some special words possible at the end of *efiBootloaderId*: +# @@SERIAL@@ can be used to obtain a uniquely-numbered suffix +# that is added to the Id (yielding, e.g., `dirname1` or `dirname72`) +# @@RANDOM@@ can be used to obtain a unique 4-digit hex suffix +# @@PHRASE@@ can be used to obtain a unique 1-to-3-word suffix +# from a dictionary of space-themed words +# Note that these must be at the **end** of the *efiBootloaderId* value. +# There must also be at most one of them. If there is none, no suffix- +# processing is done and the *efiBootloaderId* is used unchanged. +# # efiBootloaderId: "dirname" # Optionally install a copy of the GRUB EFI bootloader as the EFI diff --git a/src/modules/bootloader/main.py b/src/modules/bootloader/main.py index 0182d1110..81e271a71 100644 --- a/src/modules/bootloader/main.py +++ b/src/modules/bootloader/main.py @@ -268,10 +268,166 @@ def create_loader(loader_path, entry): loader_file.write(line) -def efi_label(): +class suffix_iterator(object): + """ + Wrapper for one of the "generator" classes below to behave like + a proper Python iterator. The iterator is initialized with a + maximum number of attempts to generate a new suffix. + """ + def __init__(self, attempts, generator): + self.generator = generator + self.attempts = attempts + self.counter = 0 + + def __iter__(self): + return self + + def __next__(self): + self.counter += 1 + if self.counter <= self.attempts: + return self.generator.next() + raise StopIteration + + +class serialEfi(object): + """ + EFI Id generator that appends a serial number to the given name. + """ + def __init__(self, name): + self.name = name + # So the first call to next() will bump it to 0 + self.counter = -1 + + def next(self): + self.counter += 1 + if self.counter > 0: + return "{!s}{!s}".format(self.name, self.counter) + else: + return self.name + + +def render_in_base(value, base_values, length=-1): + """ + Renders @p value in base-N, where N is the number of + items in @p base_values. When rendering, use the items + of @p base_values (e.g. use "0123456789" to get regular decimal + rendering, or "ABCDEFGHIJ" for letters-as-numbers 'encoding'). + + If length is positive, pads out to at least that long with + leading "zeroes", whatever base_values[0] is. + """ + if value < 0: + raise ValueError("Cannot render negative values") + if len(base_values) < 2: + raise ValueError("Insufficient items for base-N rendering") + if length < 1: + length = 1 + digits = [] + base = len(base_values) + while value > 0: + place = value % base + value = value // base + digits.append(base_values[place]) + while len(digits) < length: + digits.append(base_values[0]) + return "".join(reversed(digits)) + + +class randomEfi(object): + """ + EFI Id generator that appends a random 4-digit hex number to the given name. + """ + def __init__(self, name): + self.name = name + # So the first call to next() will bump it to 0 + self.counter = -1 + + def next(self): + self.counter += 1 + if self.counter > 0: + import random + v = random.randint(0, 65535) # 16 bits + return "{!s}{!s}".format(self.name, render_in_base(v, "0123456789ABCDEF", 4)) + else: + return self.name + + +class phraseEfi(object): + """ + EFI Id generator that appends a random phrase to the given name. + """ + words = ("Sun", "Moon", "Mars", "Soyuz", "Falcon", "Kuaizhou", "Gaganyaan") + + def __init__(self, name): + self.name = name + # So the first call to next() will bump it to 0 + self.counter = -1 + + def next(self): + self.counter += 1 + if self.counter > 0: + import random + desired_length = 1 + self.counter // 5 + v = random.randint(0, len(self.words) ** desired_length) + return "{!s}{!s}".format(self.name, render_in_base(v, self.words)) + else: + return self.name + + +def get_efi_suffix_generator(name): + """ + Handle EFI bootloader Ids with @@@@ for suffix-processing. + """ + if "@@" not in name: + raise ValueError("Misplaced call to get_efi_suffix_generator, no @@") + parts = name.split("@@") + if len(parts) != 3: + raise ValueError("EFI Id {!r} is malformed".format(name)) + if parts[2]: + # Supposed to be empty because the string ends with "@@" + raise ValueError("EFI Id {!r} is malformed".format(name)) + if parts[1] not in ("SERIAL", "RANDOM", "PHRASE"): + raise ValueError("EFI suffix {!r} is unknown".format(parts[1])) + + generator = None + if parts[1] == "SERIAL": + generator = serialEfi(parts[0]) + elif parts[1] == "RANDOM": + generator = randomEfi(parts[0]) + elif parts[1] == "PHRASE": + generator = phraseEfi(parts[0]) + if generator is None: + raise ValueError("EFI suffix {!r} is unsupported".format(parts[1])) + + return generator + + +def change_efi_suffix(efi_directory, bootloader_id): + """ + Returns a label based on @p bootloader_id that is usable within + @p efi_directory. If there is a @@@@ suffix marker + in the given id, tries to generate a unique label. + """ + if bootloader_id.endswith("@@"): + # Do 10 attempts with any suffix generator + g = suffix_iterator(10, get_efi_suffix_generator(bootloader_id)) + else: + # Just one attempt + g = [bootloader_id] + + for candidate_name in g: + if not os.path.exists(os.path.join(efi_directory, candidate_name)): + return candidate_name + return bootloader_id + + +def efi_label(efi_directory): + """ + Returns a sanitized label, possibly unique, that can be + used within @p efi_directory. + """ if "efiBootloaderId" in libcalamares.job.configuration: - efi_bootloader_id = libcalamares.job.configuration[ - "efiBootloaderId"] + efi_bootloader_id = change_efi_suffix( efi_directory, calamares.job.configuration["efiBootloaderId"] ) else: branding = libcalamares.globalstorage.value("branding") efi_bootloader_id = branding["bootloaderEntryName"] @@ -390,7 +546,7 @@ def run_grub_mkconfig(partitions, output_file): check_target_env_call([libcalamares.job.configuration["grubMkconfig"], "-o", output_file]) -def run_grub_install(fw_type, partitions, efi_directory=None): +def run_grub_install(fw_type, partitions, efi_directory): """ Runs grub-install in the target environment @@ -407,7 +563,7 @@ def run_grub_install(fw_type, partitions, efi_directory=None): check_target_env_call(["sh", "-c", "echo ZPOOL_VDEV_NAME_PATH=1 >> /etc/environment"]) if fw_type == "efi": - efi_bootloader_id = efi_label() + efi_bootloader_id = efi_label(efi_directory) efi_target, efi_grub_file, efi_boot_file = get_grub_efi_parameters() if is_zfs: @@ -462,7 +618,7 @@ def install_grub(efi_directory, fw_type): if not os.path.isdir(install_efi_directory): os.makedirs(install_efi_directory) - efi_bootloader_id = efi_label() + efi_bootloader_id = efi_label(efi_directory) efi_target, efi_grub_file, efi_boot_file = get_grub_efi_parameters() @@ -506,7 +662,7 @@ def install_secureboot(efi_directory): """ Installs the secureboot shim in the system by calling efibootmgr. """ - efi_bootloader_id = efi_label() + efi_bootloader_id = efi_label(efi_directory) install_path = libcalamares.globalstorage.value("rootMountPoint") install_efi_directory = install_path + efi_directory diff --git a/src/modules/bootloader/tests/CMakeTests.txt b/src/modules/bootloader/tests/CMakeTests.txt new file mode 100644 index 000000000..5b16d5009 --- /dev/null +++ b/src/modules/bootloader/tests/CMakeTests.txt @@ -0,0 +1,7 @@ +# We have tests to exercise some of the module internals. +# Those tests conventionally live in Python files here in the tests/ directory. Add them. +add_test( + NAME test-bootloader-efiname + COMMAND env PYTHONPATH=.: python3 ${CMAKE_CURRENT_LIST_DIR}/test-bootloader-efiname.py + WORKING_DIRECTORY ${CMAKE_BINARY_DIR} +) diff --git a/src/modules/bootloader/tests/test-bootloader-efiname.py b/src/modules/bootloader/tests/test-bootloader-efiname.py new file mode 100644 index 000000000..67cb91747 --- /dev/null +++ b/src/modules/bootloader/tests/test-bootloader-efiname.py @@ -0,0 +1,64 @@ +# Calamares Boilerplate +import libcalamares +libcalamares.globalstorage = libcalamares.GlobalStorage(None) +libcalamares.globalstorage.insert("testing", True) + +# Module prep-work +from src.modules.bootloader import main + +# Specific Bootloader test +g = main.get_efi_suffix_generator("derp@@SERIAL@@") +assert g is not None +assert g.next() == "derp" # First time, no suffix +for n in range(9): + print(g.next()) +# We called next() 10 times in total, starting from 0 +assert g.next() == "derp10" + +g = main.get_efi_suffix_generator("derp@@RANDOM@@") +assert g is not None +for n in range(10): + print(g.next()) +# it's random, nothing to assert + +g = main.get_efi_suffix_generator("derp@@PHRASE@@") +assert g is not None +for n in range(10): + print(g.next()) +# it's random, nothing to assert + +# Check invalid things +try: + g = main.get_efi_suffix_generator("derp") + raise TypeError("Shouldn't get generator (no indicator)") +except ValueError as e: + pass + +try: + g = main.get_efi_suffix_generator("derp@@HEX@@") + raise TypeError("Shouldn't get generator (unknown indicator)") +except ValueError as e: + pass + +try: + g = main.get_efi_suffix_generator("derp@@SERIAL@@x") + raise TypeError("Shouldn't get generator (trailing garbage)") +except ValueError as e: + pass + +try: + g = main.get_efi_suffix_generator("derp@@SERIAL@@@@RANDOM@@") + raise TypeError("Shouldn't get generator (multiple indicators)") +except ValueError as e: + pass + + +# Try the generator (assuming no calamares- test files exist in /tmp) +import os +assert "calamares-single" == main.change_efi_suffix("/tmp", "calamares-single") +assert "calamares-serial" == main.change_efi_suffix("/tmp", "calamares-serial@@SERIAL@@") +try: + os.makedirs("/tmp/calamares-serial", exist_ok=True) + assert "calamares-serial1" == main.change_efi_suffix("/tmp", "calamares-serial@@SERIAL@@") +finally: + os.rmdir("/tmp/calamares-serial") diff --git a/src/modules/initcpio/InitcpioJob.cpp b/src/modules/initcpio/InitcpioJob.cpp index b96f3b316..df995ccbf 100644 --- a/src/modules/initcpio/InitcpioJob.cpp +++ b/src/modules/initcpio/InitcpioJob.cpp @@ -1,6 +1,7 @@ /* === This file is part of Calamares - === * * SPDX-FileCopyrightText: 2019 Adriaan de Groot + * SPDX-FileCopyrightText: 2022 Evan James * SPDX-License-Identifier: GPL-3.0-or-later * * Calamares is Free Software: see the License-Identifier above. @@ -31,15 +32,22 @@ InitcpioJob::prettyName() const return tr( "Creating initramfs with mkinitcpio." ); } +/** @brief Sets secure permissions on each initramfs + * + * Iterates over each initramfs contained directly in the directory @p d. + * For each initramfs found, the permissions are set to owner read/write only. + * + */ void fixPermissions( const QDir& d ) { - for ( const auto& fi : d.entryInfoList( { "initramfs*" }, QDir::Files ) ) + const auto initramList = d.entryInfoList( { "initramfs*" }, QDir::Files ); + for ( const auto& fi : initramList ) { QFile f( fi.absoluteFilePath() ); if ( f.exists() ) { - cDebug() << "initcpio fixing permissions for" << f.fileName(); + cDebug() << "initcpio setting permissions for" << f.fileName(); f.setPermissions( QFileDevice::ReadOwner | QFileDevice::WriteOwner ); } } @@ -63,9 +71,19 @@ InitcpioJob::exec() } } + // If the kernel option isn't set to a specific kernel, run mkinitcpio on all kernels + QStringList command = { "mkinitcpio" }; + if ( m_kernel.isEmpty() || m_kernel == "all" ) + { + command.append( "-P" ); + } + else + { + command.append( { "-p", m_kernel } ); + } + cDebug() << "Updating initramfs with kernel" << m_kernel; - auto r = CalamaresUtils::System::instance()->targetEnvCommand( - { "mkinitcpio", "-p", m_kernel }, QString(), QString() /* no timeout , 0 */ ); + auto r = CalamaresUtils::System::instance()->targetEnvCommand( command, QString(), QString() /* no timeout , 0 */ ); return r.explainProcess( "mkinitcpio", std::chrono::seconds( 10 ) /* fake timeout */ ); } @@ -73,28 +91,6 @@ void InitcpioJob::setConfigurationMap( const QVariantMap& configurationMap ) { m_kernel = CalamaresUtils::getString( configurationMap, "kernel" ); - if ( m_kernel.isEmpty() ) - { - m_kernel = QStringLiteral( "all" ); - } - else if ( m_kernel == "$uname" ) - { - auto r = CalamaresUtils::System::runCommand( CalamaresUtils::System::RunLocation::RunInHost, - { "/bin/uname", "-r" }, - QString(), - QString(), - std::chrono::seconds( 3 ) ); - if ( r.getExitCode() == 0 ) - { - m_kernel = r.getOutput(); - cDebug() << "*initcpio* using running kernel" << m_kernel; - } - else - { - cWarning() << "*initcpio* could not determine running kernel, using 'all'." << Logger::Continuation - << r.getExitCode() << r.getOutput(); - } - } m_unsafe = CalamaresUtils::getBool( configurationMap, "be_unsafe", false ); } diff --git a/src/modules/initcpio/initcpio.conf b/src/modules/initcpio/initcpio.conf index 717a511df..d2a126864 100644 --- a/src/modules/initcpio/initcpio.conf +++ b/src/modules/initcpio/initcpio.conf @@ -5,21 +5,22 @@ --- # This key defines the kernel to be loaded. # It can have the following values: -# - empty or unset, interpreted as "all" -# - the literal string "$uname" (without quotes, with dollar), -# which will use the output of `uname -r` to determine the -# running kernel, and use that. -# - any other string. +# - the name of a single mkinitcpio preset +# - empty or unset +# - the literal string "all" # -# Whatever is set, that string is passed as *preset* argument to the -# `-p` option of *mkinitcpio*. Take care that both "$uname" operates -# in the host system, and might not be correct if the target system is -# updated (to a newer kernel) as part of the installation. +# If kernel is set to "all" or empty/unset then mkinitpio is called for all +# kernels. Otherwise it is called with a single preset with the value +# contained in kernel. # -# Note that "all" is probably not a good preset to use either. -kernel: linux312 +kernel: linux # Set this to true to turn off mitigations for lax file # permissions on initramfs (which, in turn, can compromise # your LUKS encryption keys, CVS-2019-13179). +# +# If your initramfs are stored in the EFI partition or another non-POSIX +# filesystem, this has no effect as the file permissions cannot be changed. +# In this case, ensure the partition is mounted securely. +# be_unsafe: false diff --git a/src/modules/initcpiocfg/main.py b/src/modules/initcpiocfg/main.py index 8fc305829..1fd4af714 100644 --- a/src/modules/initcpiocfg/main.py +++ b/src/modules/initcpiocfg/main.py @@ -180,7 +180,8 @@ def find_initcpio_features(partitions, root_mount_point): if partition["fs"] == "btrfs": uses_btrfs = True - if partition["fs"] == "zfs": + # In addition to checking the filesystem, check to ensure that zfs is enabled + if partition["fs"] == "zfs" and libcalamares.globalstorage.contains("zfsPoolInfo"): uses_zfs = True if "lvm2" in partition["fs"]: diff --git a/src/modules/initramfs/InitramfsJob.cpp b/src/modules/initramfs/InitramfsJob.cpp index 1b10a1a05..d83b4673c 100644 --- a/src/modules/initramfs/InitramfsJob.cpp +++ b/src/modules/initramfs/InitramfsJob.cpp @@ -81,6 +81,7 @@ InitramfsJob::setConfigurationMap( const QVariantMap& configurationMap ) } else { + m_kernel = QStringLiteral( "all" ); cWarning() << "*initramfs* could not determine running kernel, using 'all'." << Logger::Continuation << r.getExitCode() << r.getOutput(); } diff --git a/src/modules/locale/Config.cpp b/src/modules/locale/Config.cpp index ce48edd82..8593f8385 100644 --- a/src/modules/locale/Config.cpp +++ b/src/modules/locale/Config.cpp @@ -221,6 +221,11 @@ Config::setCurrentLocation() { setCurrentLocation( m_startingTimezone.first, m_startingTimezone.second ); } + if ( !m_selectedLocaleConfiguration.explicit_lang ) + { + auto newLocale = automaticLocaleConfiguration(); + setLanguage( newLocale.language() ); + } } void @@ -252,15 +257,21 @@ Config::setCurrentLocation( const QString& regionName, const QString& zoneName ) void Config::setCurrentLocation( const CalamaresUtils::Locale::TimeZoneData* location ) { - if ( location != m_currentLocation ) + const bool updateLocation = ( location != m_currentLocation ); + if ( updateLocation ) { m_currentLocation = location; - // Overwrite those settings that have not been made explicit. - auto newLocale = automaticLocaleConfiguration(); - if ( !m_selectedLocaleConfiguration.explicit_lang ) - { - setLanguage( newLocale.language() ); - } + } + + // lang should be always be updated + auto newLocale = automaticLocaleConfiguration(); + if ( !m_selectedLocaleConfiguration.explicit_lang ) + { + setLanguage( newLocale.language() ); + } + + if ( updateLocation ) + { if ( !m_selectedLocaleConfiguration.explicit_lc ) { m_selectedLocaleConfiguration.lc_numeric = newLocale.lc_numeric; diff --git a/src/modules/packages/main.py b/src/modules/packages/main.py index 10371777e..59777cedb 100644 --- a/src/modules/packages/main.py +++ b/src/modules/packages/main.py @@ -382,7 +382,7 @@ class PMPacman(PackageManager): def line_cb(line): if line.startswith(":: "): - self.in_package_changes = "package changes" in line + self.in_package_changes = "package" in line or "hooks" in line else: if self.in_package_changes and line.endswith("...\n"): # Update the message, untranslated; do not change the @@ -392,7 +392,7 @@ class PMPacman(PackageManager): global custom_status_message custom_status_message = "pacman: " + line.strip() libcalamares.job.setprogress(self.progress_fraction) - libcalamares.utils.debug(line) + libcalamares.utils.debug(line) self.in_package_changes = False self.line_cb = line_cb @@ -444,8 +444,12 @@ class PMPacman(PackageManager): else: command.append("-S") + # Don't ask for user intervention, take the default action command.append("--noconfirm") + # Don't report download progress for each file + command.append("--noprogressbar") + if self.pacman_needed_only is True: command.append("--needed") diff --git a/src/modules/partition/jobs/ClearTempMountsJob.cpp b/src/modules/partition/jobs/ClearTempMountsJob.cpp index ffbc35044..6219de004 100644 --- a/src/modules/partition/jobs/ClearTempMountsJob.cpp +++ b/src/modules/partition/jobs/ClearTempMountsJob.cpp @@ -9,6 +9,7 @@ #include "ClearTempMountsJob.h" +#include "partition/Mount.h" #include "utils/Logger.h" #include "utils/String.h" @@ -45,51 +46,23 @@ ClearTempMountsJob::exec() { Logger::Once o; // Fetch a list of current mounts to Calamares temporary directories. - QList< QPair< QString, QString > > lst; - QFile mtab( "/etc/mtab" ); - if ( !mtab.open( QFile::ReadOnly | QFile::Text ) ) - { - return Calamares::JobResult::error( tr( "Cannot get list of temporary mounts." ) ); - } + using MtabInfo = CalamaresUtils::Partition::MtabInfo; + auto targetMounts = MtabInfo::fromMtabFilteredByPrefix( QStringLiteral( "/tmp/calamares-" ) ); - cVerbose() << o << "Opened mtab. Lines:"; - QTextStream in( &mtab ); - QString lineIn = in.readLine(); - while ( !lineIn.isNull() ) - { - QStringList line = lineIn.split( ' ', SplitSkipEmptyParts ); - cVerbose() << o << line.join( ' ' ); - QString device = line.at( 0 ); - QString mountPoint = line.at( 1 ); - if ( mountPoint.startsWith( "/tmp/calamares-" ) ) - { - lst.append( qMakePair( device, mountPoint ) ); - } - lineIn = in.readLine(); - } - - if ( lst.empty() ) + if ( targetMounts.isEmpty() ) { return Calamares::JobResult::ok(); } - - std::sort( - lst.begin(), lst.end(), []( const QPair< QString, QString >& a, const QPair< QString, QString >& b ) -> bool { - return a.first > b.first; - } ); + std::sort( targetMounts.begin(), targetMounts.end(), MtabInfo::mountPointOrder ); QStringList goodNews; - QProcess process; - - for ( const auto& line : qAsConst( lst ) ) + for ( const auto& m : qAsConst( targetMounts ) ) { - QString partPath = line.second; - cDebug() << o << "Will try to umount path" << partPath; - process.start( "umount", { "-lv", partPath } ); - process.waitForFinished(); - if ( process.exitCode() == 0 ) + cDebug() << o << "Will try to umount path" << m.mountPoint; + if ( CalamaresUtils::Partition::unmount( m.mountPoint, { "-lv" } ) == 0 ) { - goodNews.append( QString( "Successfully unmounted %1." ).arg( partPath ) ); + // Returns the program's exit code, so 0 is success + goodNews.append( QString( "Successfully unmounted %1." ).arg( m.mountPoint ) ); } } diff --git a/src/modules/partition/jobs/FormatPartitionJob.cpp b/src/modules/partition/jobs/FormatPartitionJob.cpp index 1ccc6e617..63d233426 100644 --- a/src/modules/partition/jobs/FormatPartitionJob.cpp +++ b/src/modules/partition/jobs/FormatPartitionJob.cpp @@ -14,6 +14,7 @@ #include "core/KPMHelpers.h" #include "partition/FileSystem.h" +#include "utils/CalamaresUtilsSystem.h" #include "utils/Logger.h" #include @@ -67,7 +68,18 @@ FormatPartitionJob::prettyStatusMessage() const Calamares::JobResult FormatPartitionJob::exec() { - return KPMHelpers::execute( CreateFileSystemOperation( *m_device, *m_partition, m_partition->fileSystem().type() ), - tr( "The installer failed to format partition %1 on disk '%2'." ) - .arg( m_partition->partitionPath(), m_device->name() ) ); + const auto fsType = m_partition->fileSystem().type(); + auto r = KPMHelpers::execute( CreateFileSystemOperation( *m_device, *m_partition, fsType ), + tr( "The installer failed to format partition %1 on disk '%2'." ) + .arg( m_partition->partitionPath(), m_device->name() ) ); + if ( fsType == FileSystem::Xfs && r.succeeded() ) + { + // We are going to try to set modern timestamps for the filesystem, + // (ignoring whether this succeeds). Requires a sufficiently-new + // xfs_admin and xfs_repair and might be made obsolete by newer + // kpmcore releases. + CalamaresUtils::System::runCommand( { "xfs_admin", "-O", "bigtime=1", m_partition->partitionPath() }, + std::chrono::seconds( 60 ) ); + } + return r; } diff --git a/src/modules/umount/CMakeLists.txt b/src/modules/umount/CMakeLists.txt new file mode 100644 index 000000000..d72847007 --- /dev/null +++ b/src/modules/umount/CMakeLists.txt @@ -0,0 +1,19 @@ +# === This file is part of Calamares - === +# +# SPDX-FileCopyrightText: 2021 Adriaan de Groot +# SPDX-License-Identifier: BSD-2-Clause +# +calamares_add_plugin( umount + TYPE job + EXPORT_MACRO PLUGINDLLEXPORT_PRO + SOURCES + UmountJob.cpp + SHARED_LIB + EMERGENCY +) + +calamares_add_test( + umounttest + SOURCES + Tests.cpp +) diff --git a/src/modules/umount/Tests.cpp b/src/modules/umount/Tests.cpp new file mode 100644 index 000000000..dc0198619 --- /dev/null +++ b/src/modules/umount/Tests.cpp @@ -0,0 +1,52 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#include "UmountJob.h" + +#include "GlobalStorage.h" +#include "JobQueue.h" +#include "utils/CalamaresUtilsSystem.h" +#include "utils/Logger.h" + +#include +#include +#include + +// Internals of UmountJob.cpp + +// Actual tests +class UmountTests : public QObject +{ + Q_OBJECT +public: + UmountTests() {} + ~UmountTests() override {} + +private Q_SLOTS: + void initTestCase(); + void testTrue(); +}; + +void +UmountTests::initTestCase() +{ + Logger::setupLogLevel( Logger::LOGDEBUG ); +} + +void +UmountTests::testTrue() +{ + QVERIFY( true ); +} + +QTEST_GUILESS_MAIN( UmountTests ) + +#include "utils/moc-warnings.h" + +#include "Tests.moc" diff --git a/src/modules/umount/UmountJob.cpp b/src/modules/umount/UmountJob.cpp new file mode 100644 index 000000000..b9d92fa87 --- /dev/null +++ b/src/modules/umount/UmountJob.cpp @@ -0,0 +1,158 @@ +/* === This file is part of Calamares - === + * + * Tags from the Python version of this module: + * SPDX-FileCopyrightText: 2014 Aurélien Gâteau + * SPDX-FileCopyrightText: 2016 Anke Boersma + * SPDX-FileCopyrightText: 2018 Adriaan de Groot + * Tags for the C++ version of this module: + * SPDX-FileCopyrightText: 2021 Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#include "UmountJob.h" + +#include "partition/Mount.h" +#include "utils/CalamaresUtilsSystem.h" +#include "utils/Logger.h" +#include "utils/Variant.h" + +#include "GlobalStorage.h" +#include "JobQueue.h" + +#include +#include +#include + +UmountJob::UmountJob( QObject* parent ) + : Calamares::CppJob( parent ) +{ +} + +UmountJob::~UmountJob() {} + +QString +UmountJob::prettyName() const +{ + return tr( "Unmount file systems." ); +} + +static Calamares::JobResult +unmountTargetMounts( const QString& rootMountPoint ) +{ + QDir targetMount( rootMountPoint ); + if ( !targetMount.exists() ) + { + return Calamares::JobResult::internalError( + QCoreApplication::translate( UmountJob::staticMetaObject.className(), "Could not unmount target system." ), + QCoreApplication::translate( UmountJob::staticMetaObject.className(), + "The target system is not mounted at '%1'." ) + .arg( rootMountPoint ), + Calamares::JobResult::GenericError ); + } + QString targetMountPath = targetMount.absolutePath(); + if ( !targetMountPath.endsWith( '/' ) ) + { + targetMountPath.append( '/' ); + } + + using MtabInfo = CalamaresUtils::Partition::MtabInfo; + auto targetMounts = MtabInfo::fromMtabFilteredByPrefix( targetMountPath ); + std::sort( targetMounts.begin(), targetMounts.end(), MtabInfo::mountPointOrder ); + + for ( const auto& m : qAsConst( targetMounts ) ) + { + if ( CalamaresUtils::Partition::unmount( m.mountPoint, { "-lv" } ) ) + { + // Returns the program's exit code, so 0 is success + return Calamares::JobResult::error( + QCoreApplication::translate( UmountJob::staticMetaObject.className(), + "Could not unmount target system." ), + QCoreApplication::translate( UmountJob::staticMetaObject.className(), + "The device '%1' is mounted in the target system. It is mounted at '%2'. " + "The device could not be unmounted." ) + .arg( m.device, m.mountPoint ) ); + } + } + return Calamares::JobResult::ok(); +} + +static Calamares::JobResult +exportZFSPools( const QString& rootMountPoint ) +{ + auto* gs = Calamares::JobQueue::instance()->globalStorage(); + QStringList poolNames; + { + // The pools are dictionaries / VariantMaps + auto zfs_pool_list = gs->value( "zfsPoolInfo" ).toList(); + for ( const auto& v : zfs_pool_list ) + { + auto m = v.toMap(); + QString poolName = m.value( "poolName" ).toString(); + if ( !poolName.isEmpty() ) + { + poolNames.append( poolName ); + } + } + poolNames.sort(); + } + + for ( const auto& poolName : poolNames ) + { + auto result = CalamaresUtils::System::runCommand( { "zpool", "export", poolName }, std::chrono::seconds( 30 ) ); + if ( result.getExitCode() ) + { + cWarning() << "Failed to export pool" << result.getOutput(); + } + } + // Exporting ZFS pools does not cause the install to fail + return Calamares::JobResult::ok(); +} + + +Calamares::JobResult +UmountJob::exec() +{ + const auto* sys = CalamaresUtils::System::instance(); + if ( !sys ) + { + return Calamares::JobResult::internalError( + "UMount", tr( "No target system available." ), Calamares::JobResult::InvalidConfiguration ); + } + + Calamares::GlobalStorage* gs + = Calamares::JobQueue::instance() ? Calamares::JobQueue::instance()->globalStorage() : nullptr; + if ( !gs || gs->value( "rootMountPoint" ).toString().isEmpty() ) + { + return Calamares::JobResult::internalError( + "UMount", tr( "No rootMountPoint is set." ), Calamares::JobResult::InvalidConfiguration ); + } + + // Do the unmounting of target-system filesystems + { + auto r = unmountTargetMounts( gs->value( "rootMountPoint" ).toString() ); + if ( !r ) + { + return r; + } + } + // For ZFS systems, export the pools + { + auto r = exportZFSPools( gs->value( "rootMountPoint" ).toString() ); + if ( !r ) + { + return r; + } + } + + return Calamares::JobResult::ok(); +} + +void +UmountJob::setConfigurationMap( const QVariantMap& map ) +{ +} + +CALAMARES_PLUGIN_FACTORY_DEFINITION( UmountJobFactory, registerPlugin< UmountJob >(); ) diff --git a/src/modules/umount/UmountJob.h b/src/modules/umount/UmountJob.h new file mode 100644 index 000000000..6ca5428bc --- /dev/null +++ b/src/modules/umount/UmountJob.h @@ -0,0 +1,41 @@ +/* === This file is part of Calamares - === + * + * SPDX-FileCopyrightText: 2021 Adriaan de Groot + * SPDX-License-Identifier: GPL-3.0-or-later + * + * Calamares is Free Software: see the License-Identifier above. + * + */ + +#ifndef UMOUNTJOB_H +#define UMOUNTJOB_H + +#include "CppJob.h" +#include "DllMacro.h" +#include "utils/PluginFactory.h" + +#include +#include +#include + +/** @brief Write 'random' data: machine id, entropy, UUIDs + * + */ +class PLUGINDLLEXPORT UmountJob : public Calamares::CppJob +{ + Q_OBJECT + +public: + explicit UmountJob( QObject* parent = nullptr ); + ~UmountJob() override; + + QString prettyName() const override; + + Calamares::JobResult exec() override; + + void setConfigurationMap( const QVariantMap& configurationMap ) override; +}; + +CALAMARES_PLUGIN_FACTORY_DECLARATION( UmountJobFactory ) + +#endif // UMOUNTJOB_H diff --git a/src/modules/umount/main.py b/src/modules/umount/main.py deleted file mode 100644 index 5fdb36014..000000000 --- a/src/modules/umount/main.py +++ /dev/null @@ -1,123 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -# -# === This file is part of Calamares - === -# -# SPDX-FileCopyrightText: 2014 Aurélien Gâteau -# SPDX-FileCopyrightText: 2016 Anke Boersma -# SPDX-FileCopyrightText: 2018 Adriaan de Groot -# SPDX-License-Identifier: GPL-3.0-or-later -# -# Calamares is Free Software: see the License-Identifier above. -# - -import os -import subprocess -import shutil - -import libcalamares -from libcalamares.utils import gettext_path, gettext_languages - -import gettext -_translation = gettext.translation("calamares-python", - localedir=gettext_path(), - languages=gettext_languages(), - fallback=True) -_ = _translation.gettext -_n = _translation.ngettext - - -def pretty_name(): - return _( "Unmount file systems." ) - - -def list_mounts(root_mount_point): - """ List mount points. - - :param root_mount_point: - :return: - """ - lst = [] - - root_mount_point = os.path.normpath(root_mount_point) - for line in open("/etc/mtab").readlines(): - device, mount_point, _ = line.split(" ", 2) - - if os.path.commonprefix([root_mount_point, mount_point]) == root_mount_point: - lst.append((device, mount_point)) - - return lst - - -def export_zpools(root_mount_point): - """ Exports the zpools if defined in global storage - - :param root_mount_point: The absolute path to the root of the install - :return: - """ - try: - zfs_pool_list = libcalamares.globalstorage.value("zfsPoolInfo") - zfs_pool_list.sort(reverse=True, key=lambda x: x["poolName"]) - if zfs_pool_list: - for zfs_pool in zfs_pool_list: - try: - libcalamares.utils.host_env_process_output(['zpool', 'export', zfs_pool["poolName"]]) - except subprocess.CalledProcessError: - libcalamares.utils.warning("Failed to export zpool") - except Exception as e: - # If this fails it shouldn't cause the installation to fail - libcalamares.utils.warning("Received exception while exporting zpools: " + format(e)) - pass - - -def run(): - """ Unmounts given mountpoints in decreasing order. - - :return: - """ - root_mount_point = libcalamares.globalstorage.value("rootMountPoint") - - if(libcalamares.job.configuration and - "srcLog" in libcalamares.job.configuration and - "destLog" in libcalamares.job.configuration): - libcalamares.utils.warning("Log-file preserving is **deprecated** in the *umount* module") - log_source = libcalamares.job.configuration["srcLog"] - log_destination = libcalamares.job.configuration["destLog"] - # Relocate log_destination into target system - log_destination = '{!s}/{!s}'.format(root_mount_point, log_destination) - # Make sure source is a string - log_source = '{!s}'.format(log_source) - - # copy installation log before umount - if os.path.exists(log_source): - try: - shutil.copy2(log_source, log_destination) - except Exception as e: - libcalamares.utils.warning("Could not preserve file {!s}, " - "error {!s}".format(log_source, e)) - - if not root_mount_point: - return ("No mount point for root partition in globalstorage", - "globalstorage does not contain a \"rootMountPoint\" key, " - "doing nothing") - - if not os.path.exists(root_mount_point): - return ("Bad mount point for root partition in globalstorage", - "globalstorage[\"rootMountPoint\"] is \"{}\", which does not " - "exist, doing nothing".format(root_mount_point)) - - lst = list_mounts(root_mount_point) - # Sort the list by mount point in decreasing order. This way we can be sure - # we unmount deeper dirs first. - lst.sort(key=lambda x: x[1], reverse=True) - - for device, mount_point in lst: - # On success, no output; if the command fails, its output is - # in the exception object. - subprocess.check_output(["umount", "-lv", mount_point], stderr=subprocess.STDOUT) - - export_zpools(root_mount_point) - - os.rmdir(root_mount_point) - - return None diff --git a/src/modules/umount/module.desc b/src/modules/umount/module.desc deleted file mode 100644 index a1c189a62..000000000 --- a/src/modules/umount/module.desc +++ /dev/null @@ -1,7 +0,0 @@ -# SPDX-FileCopyrightText: no -# SPDX-License-Identifier: CC0-1.0 ---- -type: "job" -name: "umount" -interface: "python" -script: "main.py" diff --git a/src/modules/umount/umount.conf b/src/modules/umount/umount.conf index 7c11f4db6..9fb922740 100644 --- a/src/modules/umount/umount.conf +++ b/src/modules/umount/umount.conf @@ -4,27 +4,11 @@ ### Umount Module # # This module represents the last part of the installation, the unmounting -# of partitions used for the install. It is also the last place where it -# is possible to copy files to the target system. -# -# The "copy log files" functionality is deprecated; use the *preservefiles* -# module instead, which is more flexible. -# +# of partitions used for the install. After this, there is no regular way +# to modify the target system anymore. # --- -# This is a **deprecated** example. Use the *preservefiles* module -# instead, where the equivalent configuration is this: -# -# files: -# - from: log -# dest: /var/log/installation.log -# -# Note that the "equivalent configuration" always finds the log, -# and is not dependent on specific user names or the vagaries of -# polkit configuration -- so it is a **better** "equivalent". -# -# example when using a log created by `sudo calamares -d`: -#srcLog: "/home/live/installation.log" -#destLog: "/var/log/installation.log" -srcLog: "/bogus/just/do/not/use/this/anymore.txt" +# Setting emergency to true will make it so this module is still run +# when a prior module fails +emergency: false diff --git a/src/modules/umount/umount.schema.yaml b/src/modules/umount/umount.schema.yaml index 9b81db3d9..37771e5f6 100644 --- a/src/modules/umount/umount.schema.yaml +++ b/src/modules/umount/umount.schema.yaml @@ -6,5 +6,4 @@ $id: https://calamares.io/schemas/umount additionalProperties: false type: object properties: - srcLog: { type: string } - destLog: { type: string } + emergency: { type: boolean } diff --git a/src/modules/unpackfs/main.py b/src/modules/unpackfs/main.py index 9f1bd822c..033073881 100644 --- a/src/modules/unpackfs/main.py +++ b/src/modules/unpackfs/main.py @@ -428,14 +428,16 @@ def run(): if not root_mount_point: libcalamares.utils.warning("No mount point for root partition") return (_("No mount point for root partition"), - _("globalstorage does not contain a \"rootMountPoint\" key, " - "doing nothing")) - + _("globalstorage does not contain a \"rootMountPoint\" key.")) if not os.path.exists(root_mount_point): libcalamares.utils.warning("Bad root mount point \"{}\"".format(root_mount_point)) return (_("Bad mount point for root partition"), - _("rootMountPoint is \"{}\", which does not " - "exist, doing nothing").format(root_mount_point)) + _("rootMountPoint is \"{}\", which does not exist.".format(root_mount_point))) + + if libcalamares.job.configuration.get("unpack", None) is None: + libcalamares.utils.warning("No *unpack* key in job configuration.") + return (_("Bad unpackfs configuration"), + _("There is no configuration information.")) supported_filesystems = get_supported_filesystems() @@ -450,17 +452,17 @@ def run(): if sourcefs not in supported_filesystems: libcalamares.utils.warning("The filesystem for \"{}\" ({}) is not supported by your current kernel".format(source, sourcefs)) libcalamares.utils.warning(" ... modprobe {} may solve the problem".format(sourcefs)) - return (_("Bad unsquash configuration"), + return (_("Bad unpackfs configuration"), _("The filesystem for \"{}\" ({}) is not supported by your current kernel").format(source, sourcefs)) if not os.path.exists(source): libcalamares.utils.warning("The source filesystem \"{}\" does not exist".format(source)) - return (_("Bad unsquash configuration"), + return (_("Bad unpackfs configuration"), _("The source filesystem \"{}\" does not exist").format(source)) if sourcefs == "squashfs": if shutil.which("unsquashfs") is None: libcalamares.utils.warning("Failed to find unsquashfs") - return (_("Bad unsquash configuration"), + return (_("Bad unpackfs configuration"), _("Failed to find unsquashfs, make sure you have the squashfs-tools package installed.") + " " + _("Failed to unpack image \"{}\"").format(source)) @@ -475,7 +477,7 @@ def run(): if not os.path.isdir(destination) and sourcefs != "file": libcalamares.utils.warning(("The destination \"{}\" in the target system is not a directory").format(destination)) if is_first: - return (_("Bad unsquash configuration"), + return (_("Bad unpackfs configuration"), _("The destination \"{}\" in the target system is not a directory").format(destination)) else: libcalamares.utils.debug(".. assuming that the previous targets will create that directory.")