Merge remote-tracking branch 'origin/calamares' into work-3.3

This commit is contained in:
Adriaan de Groot 2021-09-22 11:51:14 +02:00
commit cf6c930df5
36 changed files with 355 additions and 306 deletions

View File

@ -141,14 +141,14 @@ set( CALAMARES_DESCRIPTION_SUMMARY
# `txstats.py -e`. See also # `txstats.py -e`. See also
# #
# Total 79 languages # Total 79 languages
set( _tx_complete az az_AZ ca de fi_FI he hi hr ja ko lt pt_BR sq set( _tx_complete az az_AZ ca fi_FI he hi ja ko lt pt_PT sq sv uk
sv uk zh_TW ) zh_CN zh_TW )
set( _tx_good as be ca@valencia cs_CZ da fr fur it_IT ml nl pt_PT set( _tx_good as be ca@valencia cs_CZ da de fr fur hr it_IT ml nl
ru sk tg tr_TR vi zh_CN ) pt_BR ru sk tg tr_TR vi )
set( _tx_ok ar ast bg bn el en_GB es es_MX es_PR et eu fa gl hu id set( _tx_ok ar ast bg bn el en_GB es es_MX et eu fa gl hu id is mr
is mr nb pl ro si sl sr sr@latin th ) nb pl ro si sl sr sr@latin th )
set( _tx_incomplete eo es_PE fr_CH gu id_ID ie kk kn ko_KR lo lv mk set( _tx_incomplete eo es_PE es_PR fr_CH gu id_ID ie kk kn ko_KR lo
ne ne_NP ru_RU te ur uz ) lv mk ne ne_NP ru_RU te ur uz zh zh_HK )
### Required versions ### Required versions
# #

View File

@ -134,7 +134,7 @@
<message> <message>
<location filename="../src/calamares/DebugWindow.ui" line="131"/> <location filename="../src/calamares/DebugWindow.ui" line="131"/>
<source>Widget Tree</source> <source>Widget Tree</source>
<translation>Strom widgetu</translation> <translation>Strom ovládacích prvků</translation>
</message> </message>
<message> <message>
<location filename="../src/calamares/DebugWindow.cpp" line="221"/> <location filename="../src/calamares/DebugWindow.cpp" line="221"/>
@ -217,7 +217,7 @@
<message> <message>
<location filename="../src/libcalamares/PythonJob.cpp" line="224"/> <location filename="../src/libcalamares/PythonJob.cpp" line="224"/>
<source>Working directory %1 for python job %2 is not readable.</source> <source>Working directory %1 for python job %2 is not readable.</source>
<translation>Pracovní složku %1 pro Python skript %2 se nedaří otevřít pro čtení.</translation> <translation>Pracovní složka %1 pro Python skript %2 není přístupná pro čtení.</translation>
</message> </message>
<message> <message>
<location filename="../src/libcalamares/PythonJob.cpp" line="230"/> <location filename="../src/libcalamares/PythonJob.cpp" line="230"/>
@ -227,7 +227,7 @@
<message> <message>
<location filename="../src/libcalamares/PythonJob.cpp" line="231"/> <location filename="../src/libcalamares/PythonJob.cpp" line="231"/>
<source>Main script file %1 for python job %2 is not readable.</source> <source>Main script file %1 for python job %2 is not readable.</source>
<translation>Hlavní soubor s python skriptem %1 pro úlohu %2 se nedaří otevřít pro čtení..</translation> <translation>Hlavní soubor Python skriptu %1 pro úlohu %2 není přístupný pro čtení.</translation>
</message> </message>
<message> <message>
<location filename="../src/libcalamares/PythonJob.cpp" line="304"/> <location filename="../src/libcalamares/PythonJob.cpp" line="304"/>
@ -504,7 +504,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/calamares/CalamaresWindow.cpp" line="371"/> <location filename="../src/calamares/CalamaresWindow.cpp" line="371"/>
<source>%1 Installer</source> <source>%1 Installer</source>
<translation>%1 instalátor</translation> <translation>Instalátor %1</translation>
</message> </message>
</context> </context>
<context> <context>
@ -660,7 +660,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1514"/> <location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1514"/>
<source>This storage device is a part of an &lt;strong&gt;inactive RAID&lt;/strong&gt; device.</source> <source>This storage device is a part of an &lt;strong&gt;inactive RAID&lt;/strong&gt; device.</source>
<translation>Toto úložné zařízení je součástí &lt;strong&gt;Neaktivního RAID&lt;/strong&gt; zařízení.</translation> <translation>Toto úložné zařízení je součástí &lt;strong&gt;neaktivního RAID&lt;/strong&gt; zařízení.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1641"/> <location filename="../src/modules/partition/gui/ChoicePage.cpp" line="1641"/>
@ -758,7 +758,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/keyboard/Config.cpp" line="361"/> <location filename="../src/modules/keyboard/Config.cpp" line="361"/>
<source>Set keyboard layout to %1/%2.</source> <source>Set keyboard layout to %1/%2.</source>
<translation>Nastavit rozložení klávesnice na %1/%2.</translation> <translation>Nastavit rozvržení klávesnice na %1/%2.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/locale/Config.cpp" line="342"/> <location filename="../src/modules/locale/Config.cpp" line="342"/>
@ -808,7 +808,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/welcome/Config.cpp" line="55"/> <location filename="../src/modules/welcome/Config.cpp" line="55"/>
<source>This computer does not satisfy the minimum requirements for setting up %1.&lt;br/&gt;Setup cannot continue. &lt;a href="#details"&gt;Details...&lt;/a&gt;</source> <source>This computer does not satisfy the minimum requirements for setting up %1.&lt;br/&gt;Setup cannot continue. &lt;a href="#details"&gt;Details...&lt;/a&gt;</source>
<translation>Počítač nesplňuje minimální požadavky pro instalaci %1.&lt;br/&gt;Instalace nemůže pokračovat &lt;a href="#details"&gt;Podrobnosti&lt;/a&gt;</translation> <translation>Počítač nesplňuje minimální požadavky pro instalaci %1.&lt;br/&gt;Nastavování nemůže pokračovat &lt;a href="#details"&gt;Podrobnosti&lt;/a&gt;</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/welcome/Config.cpp" line="59"/> <location filename="../src/modules/welcome/Config.cpp" line="59"/>
@ -953,7 +953,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/packagechooser/Config.cpp" line="177"/> <location filename="../src/modules/packagechooser/Config.cpp" line="177"/>
<source>Install option: &lt;strong&gt;%1&lt;/strong&gt;</source> <source>Install option: &lt;strong&gt;%1&lt;/strong&gt;</source>
<translation>Možnost instalace: &lt;strong&gt;%1&lt;/strong&gt;</translation> <translation>Volba instalace: &lt;strong&gt;%1&lt;/strong&gt;</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooser/Config.cpp" line="177"/> <location filename="../src/modules/packagechooser/Config.cpp" line="177"/>
@ -1182,7 +1182,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/users/CreateUserJob.cpp" line="126"/> <location filename="../src/modules/users/CreateUserJob.cpp" line="126"/>
<source>Preserving home directory</source> <source>Preserving home directory</source>
<translation>Zachovádomovské složky</translation> <translation>Zachováse domovská složka</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/users/CreateUserJob.cpp" line="50"/> <location filename="../src/modules/users/CreateUserJob.cpp" line="50"/>
@ -1198,7 +1198,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/users/CreateUserJob.cpp" line="159"/> <location filename="../src/modules/users/CreateUserJob.cpp" line="159"/>
<source>Setting file permissions</source> <source>Setting file permissions</source>
<translation>Nastavení oprávnění souboru</translation> <translation>Nastavují se přístupová práva k souboru</translation>
</message> </message>
</context> </context>
<context> <context>
@ -1755,7 +1755,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/locale/LCLocaleDialog.cpp" line="23"/> <location filename="../src/modules/locale/LCLocaleDialog.cpp" line="23"/>
<source>System locale setting</source> <source>System locale setting</source>
<translation>Místní a jazykové nastavení systému</translation> <translation>Místní a jazyková nastavení systému</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/locale/LCLocaleDialog.cpp" line="30"/> <location filename="../src/modules/locale/LCLocaleDialog.cpp" line="30"/>
@ -1986,7 +1986,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/localeq/Map.qml" line="243"/> <location filename="../src/modules/localeq/Map.qml" line="243"/>
<source>Timezone: %1</source> <source>Timezone: %1</source>
<translation>Časová zóna: %1</translation> <translation>Časové pásmo: %1</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/localeq/Map.qml" line="264"/> <location filename="../src/modules/localeq/Map.qml" line="264"/>
@ -2152,12 +2152,12 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/localeq/Offline.qml" line="115"/> <location filename="../src/modules/localeq/Offline.qml" line="115"/>
<source>Select your preferred Zone within your Region.</source> <source>Select your preferred Zone within your Region.</source>
<translation>Vyberte preferovanou zónu ve vašem regionu.</translation> <translation>Vyberte upřednostňované pásmo ve svém regionu.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/localeq/Offline.qml" line="186"/> <location filename="../src/modules/localeq/Offline.qml" line="186"/>
<source>Zones</source> <source>Zones</source>
<translation>Zóny</translation> <translation>Pásma</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/localeq/Offline.qml" line="233"/> <location filename="../src/modules/localeq/Offline.qml" line="233"/>
@ -2283,7 +2283,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<translation> <translation>
<numerusform>Heslo obsahuje méně než %1 číslici</numerusform> <numerusform>Heslo obsahuje méně než %1 číslici</numerusform>
<numerusform>Heslo obsahuje méně než %1 číslice</numerusform> <numerusform>Heslo obsahuje méně než %1 číslice</numerusform>
<numerusform>Heslo obsahuje méně než %1 číslice</numerusform> <numerusform>Heslo obsahuje méně než %1 číslic</numerusform>
<numerusform>Heslo obsahuje méně než %1 číslice</numerusform> <numerusform>Heslo obsahuje méně než %1 číslice</numerusform>
</translation> </translation>
</message> </message>
@ -2463,7 +2463,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/packagechooser/page_package.ui" line="24"/> <location filename="../src/modules/packagechooser/page_package.ui" line="24"/>
<source>Form</source> <source>Form</source>
<translation>Form</translation> <translation>Formulář</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooser/page_package.ui" line="44"/> <location filename="../src/modules/packagechooser/page_package.ui" line="44"/>
@ -2724,7 +2724,7 @@ Instalační program bude ukončen a všechny změny ztraceny.</translation>
<message> <message>
<location filename="../src/modules/partition/gui/PartitionPage.ui" line="18"/> <location filename="../src/modules/partition/gui/PartitionPage.ui" line="18"/>
<source>Form</source> <source>Form</source>
<translation>Form</translation> <translation>Formulář</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/partition/gui/PartitionPage.ui" line="26"/> <location filename="../src/modules/partition/gui/PartitionPage.ui" line="26"/>
@ -3609,7 +3609,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/users/MiscJobs.cpp" line="184"/> <location filename="../src/modules/users/MiscJobs.cpp" line="184"/>
<source>These groups are missing in the target system: %1</source> <source>These groups are missing in the target system: %1</source>
<translation>Tyto skupiny chybí v cílovém systému chybí: %1</translation> <translation>Tyto skupiny v cílovém systému chybí: %1</translation>
</message> </message>
</context> </context>
<context> <context>
@ -3703,7 +3703,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="187"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="187"/>
<source>KDE user feedback</source> <source>KDE user feedback</source>
<translation>Zpětná vazba uživatele KDE</translation> <translation>Zpětná vazba od uživatele pro KDE</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="193"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="193"/>
@ -3719,12 +3719,12 @@ Výstup:
<message> <message>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="216"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="216"/>
<source>Could not configure KDE user feedback correctly, script error %1.</source> <source>Could not configure KDE user feedback correctly, script error %1.</source>
<translation>Nepodařilo se správně nastavit zpětnou vazbu KDE uživatele, chyba ve skriptu %1.</translation> <translation>Nepodařilo se správně nastavit zpětnou vazbu od uživatele pro KDE, chyba ve skriptu %1.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="222"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="222"/>
<source>Could not configure KDE user feedback correctly, Calamares error %1.</source> <source>Could not configure KDE user feedback correctly, Calamares error %1.</source>
<translation>Nepodařilo se správně nastavit zpětnou vazbu KDE uživatele, chyba Calamares %1.</translation> <translation>Nepodařilo se správně nastavit zpětnou vazbu od uživatel pro KDE, chyba Calamares %1.</translation>
</message> </message>
</context> </context>
<context> <context>
@ -3732,28 +3732,28 @@ Výstup:
<message> <message>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="136"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="136"/>
<source>Machine feedback</source> <source>Machine feedback</source>
<translation>Zpětná vazba stroje</translation> <translation>Zpětná vazba ze stroje</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="142"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="142"/>
<source>Configuring machine feedback.</source> <source>Configuring machine feedback.</source>
<translation>Nastavování zpětné vazby stroje</translation> <translation>Nastavování zpětné vazby ze stroje</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="165"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="165"/>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="171"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="171"/>
<source>Error in machine feedback configuration.</source> <source>Error in machine feedback configuration.</source>
<translation>Chyba v nastavení zpětné vazby stroje.</translation> <translation>Chyba v nastavení zpětné vazby ze stroje.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="166"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="166"/>
<source>Could not configure machine feedback correctly, script error %1.</source> <source>Could not configure machine feedback correctly, script error %1.</source>
<translation>Nepodařilo se správně nastavit zpětnou vazbu stroje, chyba skriptu %1.</translation> <translation>Nepodařilo se správně nastavit zpětnou vazbu ze stroje, chyba skriptu %1.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/tracking/TrackingJobs.cpp" line="172"/> <location filename="../src/modules/tracking/TrackingJobs.cpp" line="172"/>
<source>Could not configure machine feedback correctly, Calamares error %1.</source> <source>Could not configure machine feedback correctly, Calamares error %1.</source>
<translation>Nepodařilo se správně nastavit zpětnou vazbu stroje, chyba Calamares %1.</translation> <translation>Nepodařilo se správně nastavit zpětnou vazbu ze stroje, chyba Calamares %1.</translation>
</message> </message>
</context> </context>
<context> <context>
@ -3786,7 +3786,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/tracking/TrackingPage.cpp" line="91"/> <location filename="../src/modules/tracking/TrackingPage.cpp" line="91"/>
<source>By selecting this you will send information about your installation and hardware. This information will only be sent &lt;b&gt;once&lt;/b&gt; after the installation finishes.</source> <source>By selecting this you will send information about your installation and hardware. This information will only be sent &lt;b&gt;once&lt;/b&gt; after the installation finishes.</source>
<translation>Výběrem tohoto pošlete informace o své instalaci a hardware. Tyto údaje budou poslány &lt;b&gt;pouze jednorázově&lt;/b&gt; po dokončení instalace.</translation> <translation>Výběrem tohoto pošlete informace o své instalaci a hardware. Tyto údaje budou odeslány &lt;b&gt;pouze jednorázově&lt;/b&gt; po dokončení instalace.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/tracking/TrackingPage.cpp" line="94"/> <location filename="../src/modules/tracking/TrackingPage.cpp" line="94"/>
@ -3975,7 +3975,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/welcome/WelcomePage.cpp" line="222"/> <location filename="../src/modules/welcome/WelcomePage.cpp" line="222"/>
<source>&lt;h1&gt;Welcome to the Calamares installer for %1.&lt;/h1&gt;</source> <source>&lt;h1&gt;Welcome to the Calamares installer for %1.&lt;/h1&gt;</source>
<translation>&lt;h1&gt;Vítejte v Calamares, instalačním programu (nejen) pro %1.&lt;/h1&gt;</translation> <translation>&lt;h1&gt;Vítejte v Calamares, instalačním programu (nejen) pro %1.&lt;/h1&gt;</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/welcome/WelcomePage.cpp" line="223"/> <location filename="../src/modules/welcome/WelcomePage.cpp" line="223"/>
@ -4121,7 +4121,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/keyboardq/keyboardq.qml" line="60"/> <location filename="../src/modules/keyboardq/keyboardq.qml" line="60"/>
<source>To activate keyboard preview, select a layout.</source> <source>To activate keyboard preview, select a layout.</source>
<translation type="unfinished"/> <translation>Pokud chcete aktivovat náhled klávesnice, vyberte rozvržení.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/keyboardq/keyboardq.qml" line="86"/> <location filename="../src/modules/keyboardq/keyboardq.qml" line="86"/>
@ -4131,7 +4131,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/keyboardq/keyboardq.qml" line="254"/> <location filename="../src/modules/keyboardq/keyboardq.qml" line="254"/>
<source>Layouts</source> <source>Layouts</source>
<translation>Rovzržení</translation> <translation>Rozvržení</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/keyboardq/keyboardq.qml" line="263"/> <location filename="../src/modules/keyboardq/keyboardq.qml" line="263"/>
@ -4179,7 +4179,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/packagechooserq/packagechooserq.qml" line="108"/> <location filename="../src/modules/packagechooserq/packagechooserq.qml" line="108"/>
<source>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.</source> <source>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.</source>
<translation>Pokud nechcete nainstalovat žádnou sadu kancelářských aplikací, stačí jen zvolit Žádná sada kancelářských aplikací. V případě potřeby je možné kdykoli nějakou přidat na nainstalovaný systém.</translation> <translation>Pokud nechcete nainstalovat žádnou sadu kancelářských aplikací, stačí jen zvolit Žádná sada kancelářských aplikací. V případě potřeby je možné kdykoli nějakou přidat do nainstalovaného systému.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooserq/packagechooserq.qml" line="121"/> <location filename="../src/modules/packagechooserq/packagechooserq.qml" line="121"/>
@ -4310,7 +4310,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="178"/> <location filename="../src/modules/usersq/usersq.qml" line="178"/>
<source>This name will be used if you make the computer visible to others on a network.</source> <source>This name will be used if you make the computer visible to others on a network.</source>
<translation>Tento název se použije, pokud počítač zviditelníte ostatním v síti.</translation> <translation>Pod tímto názvem se bude počítač případně zobrazovat ostatním počítačům v síti.</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="198"/> <location filename="../src/modules/usersq/usersq.qml" line="198"/>
@ -4335,7 +4335,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="261"/> <location filename="../src/modules/usersq/usersq.qml" line="261"/>
<source>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.</source> <source>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.</source>
<translation>Zadejte dvakrát stejné heslo, aby bylo možné zkontrolovat chyby při psaní. Dobré heslo by mělo obsahovat směs písmen, čísel a interpunkce a mělo by mít alespoň osm znaků. Zvažte také jeho pravidelnou změnu.</translation> <translation>Zadání hesla zopakujte i do kontrolní kolonky, abyste měli jistotu, že jste napsali, co zamýšleli (že nedošlo k překlepu). Dobré heslo se bude skládat z písmen, číslic a interpunkce a mělo by být alespoň osm znaků dlouhé. Heslo byste také měli pravidelně měnit (prevence škod z jeho případného prozrazení).</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="406"/> <location filename="../src/modules/usersq/usersq.qml" line="406"/>
@ -4350,7 +4350,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="398"/> <location filename="../src/modules/usersq/usersq.qml" line="398"/>
<source>Log in automatically without asking for the password</source> <source>Log in automatically without asking for the password</source>
<translation>Přihlaste se automaticky bez zadávání hesla</translation> <translation>Přihlašovat se automaticky bez zadávání hesla</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="190"/> <location filename="../src/modules/usersq/usersq.qml" line="190"/>
@ -4360,7 +4360,7 @@ Výstup:
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="293"/> <location filename="../src/modules/usersq/usersq.qml" line="293"/>
<source>Reuse user password as root password</source> <source>Reuse user password as root password</source>
<translation>Použijte uživatelské heslo zároveň jako heslo root</translation> <translation>Použijte heslo uživatele i pro účet správce (root)</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="301"/> <location filename="../src/modules/usersq/usersq.qml" line="301"/>
@ -4380,12 +4380,12 @@ Výstup:
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="342"/> <location filename="../src/modules/usersq/usersq.qml" line="342"/>
<source>Repeat Root Password</source> <source>Repeat Root Password</source>
<translation>Opakujte root heslo</translation> <translation>Zopakujte zadání hesla pro správce systému (root)</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/usersq/usersq.qml" line="368"/> <location filename="../src/modules/usersq/usersq.qml" line="368"/>
<source>Enter the same password twice, so that it can be checked for typing errors.</source> <source>Enter the same password twice, so that it can be checked for typing errors.</source>
<translation>Zadejte dvakrát stejné heslo, aby bylo možné zkontrolovat chyby při psaní.</translation> <translation>Zadání hesla zopakujte i do kontrolní kolonky, abyste měli jistotu, že jste napsali, co zamýšleli (že nedošlo k překlepu).</translation>
</message> </message>
</context> </context>
<context> <context>

View File

@ -949,12 +949,12 @@ The installer will quit and all changes will be lost.</source>
<message> <message>
<location filename="../src/modules/packagechooser/Config.cpp" line="177"/> <location filename="../src/modules/packagechooser/Config.cpp" line="177"/>
<source>Install option: &lt;strong&gt;%1&lt;/strong&gt;</source> <source>Install option: &lt;strong&gt;%1&lt;/strong&gt;</source>
<translation type="unfinished"/> <translation> ि : &lt;strong&gt;%1&lt;/strong&gt;</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooser/Config.cpp" line="177"/> <location filename="../src/modules/packagechooser/Config.cpp" line="177"/>
<source>None</source> <source>None</source>
<translation type="unfinished"/> <translation> </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/summary/Config.cpp" line="82"/> <location filename="../src/modules/summary/Config.cpp" line="82"/>
@ -2805,37 +2805,37 @@ The installer will quit and all changes will be lost.</source>
<message> <message>
<location filename="../src/modules/partition/PartitionViewStep.cpp" line="534"/> <location filename="../src/modules/partition/PartitionViewStep.cpp" line="534"/>
<source>EFI system partition configured incorrectly</source> <source>EFI system partition configured incorrectly</source>
<translation type="unfinished"/> <translation>EFI ि ि ि ि </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/partition/PartitionViewStep.cpp" line="539"/> <location filename="../src/modules/partition/PartitionViewStep.cpp" line="539"/>
<source>An EFI system partition is necessary to start %1.&lt;br/&gt;&lt;br/&gt;To configure an EFI system partition, go back and select or create a suitable filesystem.</source> <source>An EFI system partition is necessary to start %1.&lt;br/&gt;&lt;br/&gt;To configure an EFI system partition, go back and select or create a suitable filesystem.</source>
<translation type="unfinished"/> <translation>%1 EFI ि ि &lt;br/&gt;&lt;br/&gt; EFI ि ि ि , ि </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/partition/PartitionViewStep.cpp" line="550"/> <location filename="../src/modules/partition/PartitionViewStep.cpp" line="550"/>
<source>The filesystem must be mounted on &lt;strong&gt;%1&lt;/strong&gt;.</source> <source>The filesystem must be mounted on &lt;strong&gt;%1&lt;/strong&gt;.</source>
<translation type="unfinished"/> <translation> ि &lt;strong&gt;%1&lt;/strong&gt; </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/partition/PartitionViewStep.cpp" line="556"/> <location filename="../src/modules/partition/PartitionViewStep.cpp" line="556"/>
<source>The filesystem must have type FAT32.</source> <source>The filesystem must have type FAT32.</source>
<translation type="unfinished"/> <translation> ि FAT32 </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/partition/PartitionViewStep.cpp" line="562"/> <location filename="../src/modules/partition/PartitionViewStep.cpp" line="562"/>
<source>The filesystem must be at least %1 MiB in size.</source> <source>The filesystem must be at least %1 MiB in size.</source>
<translation type="unfinished"/> <translation> ि -- %1 </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/partition/PartitionViewStep.cpp" line="569"/> <location filename="../src/modules/partition/PartitionViewStep.cpp" line="569"/>
<source>The filesystem must have flag &lt;strong&gt;%1&lt;/strong&gt; set.</source> <source>The filesystem must have flag &lt;strong&gt;%1&lt;/strong&gt; set.</source>
<translation type="unfinished"/> <translation> ि &lt;strong&gt;%1&lt;/strong&gt; </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/partition/PartitionViewStep.cpp" line="575"/> <location filename="../src/modules/partition/PartitionViewStep.cpp" line="575"/>
<source>You can continue without setting up an EFI system partition but your system may fail to start.</source> <source>You can continue without setting up an EFI system partition but your system may fail to start.</source>
<translation type="unfinished"/> <translation> ि EFI ि ि ि ि </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/partition/PartitionViewStep.cpp" line="592"/> <location filename="../src/modules/partition/PartitionViewStep.cpp" line="592"/>
@ -4099,7 +4099,7 @@ Output:
<message> <message>
<location filename="../src/modules/keyboardq/keyboardq.qml" line="60"/> <location filename="../src/modules/keyboardq/keyboardq.qml" line="60"/>
<source>To activate keyboard preview, select a layout.</source> <source>To activate keyboard preview, select a layout.</source>
<translation type="unfinished"/> <translation> ि ि </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/keyboardq/keyboardq.qml" line="86"/> <location filename="../src/modules/keyboardq/keyboardq.qml" line="86"/>
@ -4114,7 +4114,7 @@ Output:
<message> <message>
<location filename="../src/modules/keyboardq/keyboardq.qml" line="263"/> <location filename="../src/modules/keyboardq/keyboardq.qml" line="263"/>
<source>Type here to test your keyboard</source> <source>Type here to test your keyboard</source>
<translation> ि </translation> <translation> ि </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/keyboardq/keyboardq.qml" line="179"/> <location filename="../src/modules/keyboardq/keyboardq.qml" line="179"/>
@ -4146,37 +4146,38 @@ Output:
<location filename="../src/modules/packagechooserq/packagechooserq.qml" line="45"/> <location filename="../src/modules/packagechooserq/packagechooserq.qml" line="45"/>
<source>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.&lt;br/&gt; <source>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.&lt;br/&gt;
Default option.</source> Default option.</source>
<translation type="unfinished"/> <translation>ि-ि ि ि ि ि िि ि ि ि &lt;br/&gt;
ि ि</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooserq/packagechooserq.qml" line="59"/> <location filename="../src/modules/packagechooserq/packagechooserq.qml" line="59"/>
<source>LibreOffice</source> <source>LibreOffice</source>
<translation type="unfinished"/> <translation>ि-ि</translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooserq/packagechooserq.qml" line="108"/> <location filename="../src/modules/packagechooserq/packagechooserq.qml" line="108"/>
<source>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.</source> <source>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.</source>
<translation type="unfinished"/> <translation>ि ि , ि ि ि ि ( ि) </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooserq/packagechooserq.qml" line="121"/> <location filename="../src/modules/packagechooserq/packagechooserq.qml" line="121"/>
<source>No Office Suite</source> <source>No Office Suite</source>
<translation type="unfinished"/> <translation> ि </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooserq/packagechooserq.qml" line="172"/> <location filename="../src/modules/packagechooserq/packagechooserq.qml" line="172"/>
<source>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.</source> <source>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.</source>
<translation type="unfinished"/> <translation> ि , िि ि ि ि , ि , ि ि , , , - </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooserq/packagechooserq.qml" line="185"/> <location filename="../src/modules/packagechooserq/packagechooserq.qml" line="185"/>
<source>Minimal Install</source> <source>Minimal Install</source>
<translation type="unfinished"/> <translation>ि </translation>
</message> </message>
<message> <message>
<location filename="../src/modules/packagechooserq/packagechooserq.qml" line="233"/> <location filename="../src/modules/packagechooserq/packagechooserq.qml" line="233"/>
<source>Please select an option for your install, or use the default: LibreOffice included.</source> <source>Please select an option for your install, or use the default: LibreOffice included.</source>
<translation type="unfinished"/> <translation> ि ि ि करें : इसमें ि-ि िि </translation>
</message> </message>
</context> </context>
<context> <context>

View File

@ -4,7 +4,7 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
# Translators: # Translators:
# xxmn77 <xxmn77@gmail.com>, 2021 # Xəyyam Qocayev <xxmn77@gmail.com>, 2021
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
@ -13,7 +13,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-08 13:31+0200\n" "POT-Creation-Date: 2021-09-08 13:31+0200\n"
"PO-Revision-Date: 2017-08-09 10:34+0000\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n"
"Last-Translator: xxmn77 <xxmn77@gmail.com>, 2021\n" "Last-Translator: Xəyyam Qocayev <xxmn77@gmail.com>, 2021\n"
"Language-Team: Azerbaijani (https://www.transifex.com/calamares/teams/20061/az/)\n" "Language-Team: Azerbaijani (https://www.transifex.com/calamares/teams/20061/az/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"

View File

@ -4,7 +4,7 @@
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
# #
# Translators: # Translators:
# xxmn77 <xxmn77@gmail.com>, 2021 # Xəyyam Qocayev <xxmn77@gmail.com>, 2021
# #
#, fuzzy #, fuzzy
msgid "" msgid ""
@ -13,7 +13,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-09-08 13:31+0200\n" "POT-Creation-Date: 2021-09-08 13:31+0200\n"
"PO-Revision-Date: 2017-08-09 10:34+0000\n" "PO-Revision-Date: 2017-08-09 10:34+0000\n"
"Last-Translator: xxmn77 <xxmn77@gmail.com>, 2021\n" "Last-Translator: Xəyyam Qocayev <xxmn77@gmail.com>, 2021\n"
"Language-Team: Azerbaijani (Azerbaijan) (https://www.transifex.com/calamares/teams/20061/az_AZ/)\n" "Language-Team: Azerbaijani (Azerbaijan) (https://www.transifex.com/calamares/teams/20061/az_AZ/)\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"

View File

@ -206,8 +206,8 @@ msgid ""
"The displaymanagers list is empty or undefined in both globalstorage and " "The displaymanagers list is empty or undefined in both globalstorage and "
"displaymanager.conf." "displaymanager.conf."
msgstr "" msgstr ""
"Seznam správců displejů je prázdný nebo není definován v jak " "Seznam správců displejů je prázdný nebo není definován v jak globalstorage, "
"bothglobalstorage, tak v displaymanager.conf." "tak v displaymanager.conf."
#: src/modules/displaymanager/main.py:989 #: src/modules/displaymanager/main.py:989
msgid "Display manager configuration was incomplete" msgid "Display manager configuration was incomplete"
@ -343,7 +343,7 @@ msgid ""
"The package manager could not make changes to the installed system. The " "The package manager could not make changes to the installed system. The "
"command <pre>{!s}</pre> returned error code {!s}." "command <pre>{!s}</pre> returned error code {!s}."
msgstr "" msgstr ""
"Nástroji pro správu balíčků se nepodařilo udělat změny v nainstalovaném " "Nástroji pro správu balíčků se nepodařilo udělat změny v instalovaném "
"systému. Příkaz <pre>{!s}</pre> vrátil chybový kód {!s}." "systému. Příkaz <pre>{!s}</pre> vrátil chybový kód {!s}."
#: src/modules/bootloader/main.py:43 #: src/modules/bootloader/main.py:43

View File

@ -112,17 +112,19 @@ public:
QString message; ///< Filled in with errors QString message; ///< Filled in with errors
QString details; QString details;
Logger::Once o;
m_jobIndex = 0; m_jobIndex = 0;
for ( const auto& jobitem : *m_runningJobs ) for ( const auto& jobitem : *m_runningJobs )
{ {
if ( failureEncountered && !jobitem.job->isEmergency() ) if ( failureEncountered && !jobitem.job->isEmergency() )
{ {
cDebug() << "Skipping non-emergency job" << jobitem.job->prettyName(); cDebug() << o << "Skipping non-emergency job" << jobitem.job->prettyName();
} }
else else
{ {
cDebug() << "Starting" << ( failureEncountered ? "EMERGENCY JOB" : "job" ) << jobitem.job->prettyName() cDebug() << o << "Starting" << ( failureEncountered ? "EMERGENCY JOB" : "job" ) << jobitem.job->prettyName()
<< '(' << ( m_jobIndex + 1 ) << '/' << m_runningJobs->count() << ')'; << '(' << ( m_jobIndex + 1 ) << '/' << m_runningJobs->count() << ')';
o.refresh(); // So next time it shows the function header again
emitProgress( 0.0 ); // 0% for *this job* emitProgress( 0.0 ); // 0% for *this job*
connect( jobitem.job.data(), &Job::progress, this, &JobThread::emitProgress ); connect( jobitem.job.data(), &Job::progress, this, &JobThread::emitProgress );
auto result = jobitem.job->exec(); auto result = jobitem.job->exec();

View File

@ -16,6 +16,7 @@
#include "partition/Mount.h" #include "partition/Mount.h"
#include "utils/CalamaresUtilsSystem.h" #include "utils/CalamaresUtilsSystem.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/RAII.h"
#include "utils/String.h" #include "utils/String.h"
#include <QCoreApplication> #include <QCoreApplication>
@ -147,7 +148,7 @@ debug( const std::string& s )
void void
warning( const std::string& s ) warning( const std::string& s )
{ {
Logger::CDebug( Logger::LOGWARNING ) << output_prefix << QString::fromStdString( s ); Logger::CDebug( Logger::LOGWARNING ) << output_prefix << QString::fromStdString( s );
} }
PythonJobInterface::PythonJobInterface( Calamares::PythonJob* parent ) PythonJobInterface::PythonJobInterface( Calamares::PythonJob* parent )
@ -241,6 +242,10 @@ _add_localedirs( QStringList& pathList, const QString& candidate )
bp::object bp::object
gettext_path() gettext_path()
{ {
// Going to log informatively just once
static bool first_time = true;
cScopedAssignment( &first_time, false );
// TODO: distinguish between -d runs and normal runs // TODO: distinguish between -d runs and normal runs
// TODO: can we detect DESTDIR-installs? // TODO: can we detect DESTDIR-installs?
QStringList candidatePaths QStringList candidatePaths
@ -257,21 +262,26 @@ gettext_path()
} }
_add_localedirs( candidatePaths, QDir().canonicalPath() ); // . _add_localedirs( candidatePaths, QDir().canonicalPath() ); // .
cDebug() << "Determining gettext path from" << candidatePaths; if ( first_time )
{
cDebug() << "Determining gettext path from" << candidatePaths;
}
QStringList candidateLanguages = _gettext_languages(); QStringList candidateLanguages = _gettext_languages();
for ( const auto& lang : candidateLanguages ) for ( const auto& lang : candidateLanguages )
{
for ( auto localedir : candidatePaths ) for ( auto localedir : candidatePaths )
{ {
QDir ldir( localedir ); QDir ldir( localedir );
if ( ldir.cd( lang ) ) if ( ldir.cd( lang ) )
{ {
cDebug() << Logger::SubEntry << "Found" << lang << "in" << ldir.canonicalPath(); Logger::CDebug( Logger::LOGDEBUG )
<< output_prefix << "Found gettext" << lang << "in" << ldir.canonicalPath();
return bp::object( localedir.toStdString() ); return bp::object( localedir.toStdString() );
} }
} }
cDebug() << Logger::SubEntry << "No translation found for languages" << candidateLanguages; }
cWarning() << "No translation found for languages" << candidateLanguages;
return bp::object(); // None return bp::object(); // None
} }

View File

@ -101,7 +101,7 @@ Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::E
YAML::Node doc = YAML::Load( ba.constData() ); YAML::Node doc = YAML::Load( ba.constData() );
if ( doc.IsNull() ) if ( doc.IsNull() )
{ {
cDebug() << "Found empty module configuration" << path; cWarning() << "Found empty module configuration" << path;
// Special case: empty config files are valid, // Special case: empty config files are valid,
// but aren't a map. // but aren't a map.
return; return;
@ -112,14 +112,13 @@ Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::E
return; return;
} }
cDebug() << "Loaded module configuration" << path;
m_configurationMap = CalamaresUtils::yamlMapToVariant( doc ); m_configurationMap = CalamaresUtils::yamlMapToVariant( doc );
m_emergency = m_maybe_emergency && m_configurationMap.contains( EMERGENCY ) m_emergency = m_maybe_emergency && m_configurationMap.contains( EMERGENCY )
&& m_configurationMap[ EMERGENCY ].toBool(); && m_configurationMap[ EMERGENCY ].toBool();
return; return;
} }
} }
cDebug() << "No config file for" << name() << "found anywhere at" << Logger::DebugList( configCandidates ); cWarning() << "No config file for" << name() << "found anywhere at" << Logger::DebugList( configCandidates );
} }

View File

@ -100,12 +100,10 @@ getInternal()
KPMManager::KPMManager() KPMManager::KPMManager()
: m_d( getInternal() ) : m_d( getInternal() )
{ {
cDebug() << "KPMManager" << s_backend.use_count() << "created.";
} }
KPMManager::~KPMManager() KPMManager::~KPMManager()
{ {
cDebug() << "KPMManager" << s_backend.use_count() << "being destroyed.";
} }
KPMManager::operator bool() const KPMManager::operator bool() const

View File

@ -169,7 +169,7 @@ System::runCommand( System::RunLocation location,
} }
} }
cDebug() << "Running" << program << RedactedList( arguments ); cDebug() << Logger::SubEntry << "Running" << program << RedactedList( arguments );
process.start(); process.start();
if ( !process.waitForStarted() ) if ( !process.waitForStarted() )
{ {
@ -208,10 +208,6 @@ System::runCommand( System::RunLocation location,
{ {
cDebug() << Logger::SubEntry << "Finished. Exit code:" << r << "output:\n" << Logger::NoQuote << output; cDebug() << Logger::SubEntry << "Finished. Exit code:" << r << "output:\n" << Logger::NoQuote << output;
} }
else
{
cDebug() << Logger::SubEntry << "Finished. Exit code:" << r;
}
} }
else // if ( r != 0 ) else // if ( r != 0 )
{ {

View File

@ -18,15 +18,17 @@
CalamaresUtils::EntropySource CalamaresUtils::EntropySource
CalamaresUtils::getEntropy( int size, QByteArray& b ) CalamaresUtils::getEntropy( int size, QByteArray& b )
{ {
constexpr const char filler = char( 0xcb );
b.fill( filler );
b.clear(); b.clear();
if ( size < 1 ) if ( size < 1 )
{ {
return EntropySource::None; return EntropySource::None;
} }
b.resize( size ); b.fill( filler, size );
char* buffer = b.data(); char* buffer = b.data();
std::fill( buffer, buffer + size, 0xcb );
qint64 readSize = 0; qint64 readSize = 0;
QFile urandom( "/dev/urandom" ); QFile urandom( "/dev/urandom" );

View File

@ -310,6 +310,14 @@ public:
} }
friend CDebug& operator<<( CDebug&&, const Once& ); friend CDebug& operator<<( CDebug&&, const Once& );
/** @brief Restore the object to "fresh" state
*
* It may be necessary to allow the Once object to stream the
* function header again -- for instance, after logging an error,
* any following debug log might want to re-introduce the header.
*/
void refresh() { m = true; }
private: private:
mutable bool m = false; mutable bool m = false;
}; };

View File

@ -42,30 +42,17 @@ struct cqDeleter
} }
}; };
/// @brief Sets a bool to @p value and resets to !value on destruction
template < bool value >
struct cBoolSetter
{
bool& m_b;
cBoolSetter( bool& b )
: m_b( b )
{
m_b = value;
}
~cBoolSetter() { m_b = !value; }
};
/// @brief Blocks signals on a QObject until destruction /// @brief Blocks signals on a QObject until destruction
using cSignalBlocker = QSignalBlocker; using cSignalBlocker = QSignalBlocker;
/** @brief Writes a value on destruction to a pointed-to location. /** @brief Writes a value on destruction to a pointed-to location.
* *
* If the pointer is non-null, write the last-given-value if there * If the pointer is non-null, write the last-given-value if there
* is one to the pointed-to object. * is one to the pointed-to object. This is called the "then-value".
*
*/ */
template < typename T > template < typename T >
struct cPointerSetter struct cScopedAssignment
{ {
std::optional< T > m_value; std::optional< T > m_value;
T* m_pointer; T* m_pointer;
@ -76,22 +63,36 @@ struct cPointerSetter
* will do nothing on destruction, leaving the pointed-to * will do nothing on destruction, leaving the pointed-to
* value unchanged. * value unchanged.
*/ */
cPointerSetter( T* p ) cScopedAssignment( T* p )
: m_pointer( p ) : m_pointer( p )
{ {
} }
/** @brief Create a setter with a value already set /** @brief Create a setter with a then-value already set
* *
* This ensures that on destruction, the value @p v will be written; * This ensures that on destruction, the value @p v will be written;
* it is equivalent to assigning @p v immediately. The pointed-to * it is equivalent to assigning @p v immediately. The pointed-to
* value is **not** changed (until destruction). * value is **not** changed (until destruction).
*/ */
cPointerSetter( T* p, T v ) cScopedAssignment( T* p, T then )
: m_value( v ) : m_value( then )
, m_pointer( p ) , m_pointer( p )
{ {
} }
~cPointerSetter() /** @brief Create a setter with a then-value and assign a new value now
*
* As above, but also assign @p now to the thing pointed-to.
*/
cScopedAssignment( T* p, T now, T then )
: m_value( then )
, m_pointer( p )
{
if ( p )
{
*p = now;
}
}
~cScopedAssignment()
{ {
if ( m_pointer && m_value.has_value() ) if ( m_pointer && m_value.has_value() )
{ {
@ -99,13 +100,13 @@ struct cPointerSetter
} }
} }
const T& operator=( const T& v ) const T& operator=( const T& then )
{ {
m_value = v; m_value = then;
return v; return then;
} }
}; };
template < typename T > template < typename T >
cPointerSetter( T p )->cPointerSetter< decltype( *p ) >; cScopedAssignment( T p )->cScopedAssignment< decltype( *p ) >;
#endif #endif

View File

@ -55,7 +55,6 @@ private Q_SLOTS:
void testOddSizedPrintable(); void testOddSizedPrintable();
/** @section Tests the RAII bits. */ /** @section Tests the RAII bits. */
void testBoolSetter();
void testPointerSetter(); void testPointerSetter();
/** @section Tests the Traits bits. */ /** @section Tests the Traits bits. */
@ -340,28 +339,6 @@ LibCalamaresTests::testOddSizedPrintable()
} }
} }
void
LibCalamaresTests::testBoolSetter()
{
bool b = false;
QVERIFY( !b );
{
QVERIFY( !b );
cBoolSetter< true > x( b );
QVERIFY( b );
}
QVERIFY( !b );
QVERIFY( !b );
{
QVERIFY( !b );
cBoolSetter< false > x( b );
QVERIFY( !b ); // Still!
}
QVERIFY( b );
}
void void
LibCalamaresTests::testPointerSetter() LibCalamaresTests::testPointerSetter()
{ {
@ -369,35 +346,35 @@ LibCalamaresTests::testPointerSetter()
QCOMPARE( special, 17 ); QCOMPARE( special, 17 );
{ {
cPointerSetter p( &special ); cScopedAssignment p( &special );
} }
QCOMPARE( special, 17 ); QCOMPARE( special, 17 );
{ {
cPointerSetter p( &special ); cScopedAssignment p( &special );
p = 18; p = 18;
} }
QCOMPARE( special, 18 ); QCOMPARE( special, 18 );
{ {
cPointerSetter p( &special ); cScopedAssignment p( &special );
p = 20; p = 20;
p = 3; p = 3;
} }
QCOMPARE( special, 3 ); QCOMPARE( special, 3 );
{ {
cPointerSetter<int> p( nullptr ); cScopedAssignment< int > p( nullptr );
} }
QCOMPARE( special, 3 ); QCOMPARE( special, 3 );
{ {
// "don't do this" .. order of destructors is important // "don't do this" .. order of destructors is important
cPointerSetter p( &special ); cScopedAssignment p( &special );
cPointerSetter q( &special ); cScopedAssignment q( &special );
p = 17; p = 17;
} }
QCOMPARE( special, 17 ); QCOMPARE( special, 17 );
{ {
// "don't do this" .. order of destructors is important // "don't do this" .. order of destructors is important
cPointerSetter p( &special ); cScopedAssignment p( &special );
cPointerSetter q( &special ); cScopedAssignment q( &special );
p = 34; p = 34;
q = 2; q = 2;
// q destroyed first, then p // q destroyed first, then p
@ -490,8 +467,7 @@ LibCalamaresTests::testVariantStringListCode()
QStringList { "astring" } ); // A single string **can** be considered a stringlist! QStringList { "astring" } ); // A single string **can** be considered a stringlist!
m.insert( key, QString( "more strings" ) ); m.insert( key, QString( "more strings" ) );
QCOMPARE( getStringList( m, key ).count(), 1 ); QCOMPARE( getStringList( m, key ).count(), 1 );
QCOMPARE( getStringList( m, key ), QCOMPARE( getStringList( m, key ), QStringList { "more strings" } );
QStringList { "more strings" } );
m.insert( key, QString() ); m.insert( key, QString() );
QCOMPARE( getStringList( m, key ).count(), 1 ); QCOMPARE( getStringList( m, key ).count(), 1 );
QCOMPARE( getStringList( m, key ), QStringList { QString() } ); QCOMPARE( getStringList( m, key ), QStringList { QString() } );

View File

@ -27,35 +27,84 @@ def pretty_name():
return _("Configuring mkinitcpio.") return _("Configuring mkinitcpio.")
def cpuinfo(): def detect_plymouth():
""" """
Return the information in /proc/cpuinfo as a dictionary in the following Checks existence (runnability) of plymouth in the target system.
format:
cpu_info['proc0']={...} @return True if plymouth exists in the target, False otherwise
cpu_info['proc1']={...}
""" """
cpu_info = OrderedDict() # Used to only check existence of path /usr/bin/plymouth in target
procinfo = OrderedDict() return target_env_call(["sh", "-c", "which plymouth"]) == 0
nprocs = 0
with open("/proc/cpuinfo") as cpuinfo_file: class cpuinfo(object):
for line in cpuinfo_file: """
if not line.strip(): Object describing the current CPU's characteristics. It may be
# end of one processor be considered a named tuple, there's no behavior here.
cpu_info["proc{!s}".format(nprocs)] = procinfo
nprocs += 1 Fields in the object:
# Reset - is_intel (if it's definitely an Intel CPU)
procinfo = OrderedDict() - is_amd (if it's definitely an AMD CPU)
else: - number_of_cores
if len(line.split(":")) == 2: It is possible for both is_* fields to be False.
splitted_line = line.split(":")[1].strip() """
procinfo[line.split(":")[0].strip()] = splitted_line def __init__(self):
self.is_intel = False
self.is_amd = False
self.number_of_cores = 0
cpu = self._cpuinfo()
self.is_intel = cpu['proc0']['vendor_id'].lower() == "genuineintel"
self.is_amd = cpu['proc0']['vendor_id'].lower() == "authenticamd"
self.number_of_cores = len(cpu)
@staticmethod
def _cpuinfo():
"""
Return the information in /proc/cpuinfo as a dictionary in the following
format:
cpu_info['proc0']={...}
cpu_info['proc1']={...}
"""
cpu_info = OrderedDict()
procinfo = OrderedDict()
nprocs = 0
with open('/proc/cpuinfo') as cpuinfo_file:
for line in cpuinfo_file:
if not line.strip():
# end of one processor
cpu_info["proc{!s}".format(nprocs)] = procinfo
nprocs += 1
# Reset
procinfo = OrderedDict()
else: else:
procinfo[line.split(":")[0].strip()] = "" if len(line.split(':')) == 2:
splitted_line = line.split(':')[1].strip()
procinfo[line.split(':')[0].strip()] = splitted_line
else:
procinfo[line.split(':')[0].strip()] = ''
return cpu_info return cpu_info
def get_host_initcpio():
"""
Reads the host system mkinitcpio.conf and returns all
the lines from that file, or an empty list if it does
not exist.
"""
hostfile = "/etc/mkinitcpio.conf"
try:
with open(hostfile, "r") as mkinitcpio_file:
mklins = [x.strip() for x in mkinitcpio_file.readlines()]
except FileNotFoundError:
libcalamares.utils.debug(f"Could not open host file {hostfile}")
mklins = []
return mklins
def write_mkinitcpio_lines(hooks, modules, files, root_mount_point): def write_mkinitcpio_lines(hooks, modules, files, root_mount_point):
@ -67,52 +116,33 @@ def write_mkinitcpio_lines(hooks, modules, files, root_mount_point):
:param files: :param files:
:param root_mount_point: :param root_mount_point:
""" """
hostfile = "/etc/mkinitcpio.conf" mklins = get_host_initcpio()
try:
with open(hostfile, "r") as mkinitcpio_file:
mklins = [x.strip() for x in mkinitcpio_file.readlines()]
except FileNotFoundError:
libcalamares.utils.debug(f"Could not open host file {hostfile}")
mklins = []
for i in range(len(mklins)): target_path = os.path.join(root_mount_point, "etc/mkinitcpio.conf")
if mklins[i].startswith("HOOKS"): with open(target_path, "w") as mkinitcpio_file:
joined_hooks = " ".join(hooks) for line in mklins:
mklins[i] = 'HOOKS="{!s}"'.format(joined_hooks) # Replace HOOKS, MODULES and FILES lines with what we
elif mklins[i].startswith("MODULES"): # have found via find_initcpio_features()
joined_modules = ' '.join(modules) if line.startswith("HOOKS"):
mklins[i] = 'MODULES="{!s}"'.format(joined_modules) line = 'HOOKS="{!s}"'.format(' '.join(hooks))
elif mklins[i].startswith("FILES"): elif line.startswith("MODULES"):
joined_files = ' '.join(files) line = 'MODULES="{!s}"'.format(' '.join(modules))
mklins[i] = 'FILES="{!s}"'.format(joined_files) elif lines.startswith("FILES"):
line = 'FILES="{!s}"'.format(' '.join(files))
path = os.path.join(root_mount_point, "etc/mkinitcpio.conf") mkinitcpio_file.write(line + "\n")
with open(path, "w") as mkinitcpio_file:
mkinitcpio_file.write("\n".join(mklins) + "\n")
def detect_plymouth(): def find_initcpio_features(partitions, root_mount_point):
""" """
Checks existence (runnability) of plymouth in the target system. Returns a tuple (hooks, modules, files) needed to support
the given @p partitions (filesystems types, encryption, etc)
in the target.
@return True if plymouth exists in the target, False otherwise :param partitions: (from GS)
:param root_mount_point: (from GS)
:return 3-tuple of lists
""" """
# Used to only check existence of path /usr/bin/plymouth in target
return target_env_call(["sh", "-c", "which plymouth"]) == 0
def modify_mkinitcpio_conf(partitions, root_mount_point):
"""
Modifies mkinitcpio.conf
:param partitions:
:param root_mount_point:
"""
cpu = cpuinfo()
swap_uuid = ""
btrfs = False
lvm2 = False
hooks = [ hooks = [
"base", "base",
"udev", "udev",
@ -124,10 +154,13 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
] ]
modules = [] modules = []
files = [] files = []
swap_uuid = ""
uses_btrfs = False
uses_lvm2 = False
encrypt_hook = False encrypt_hook = False
openswap_hook = False openswap_hook = False
unencrypted_separate_boot = False unencrypted_separate_boot = False
is_cpu_intel = cpu["proc0"]["vendor_id"].lower() == "genuineintel"
# It is important that the plymouth hook comes before any encrypt hook # It is important that the plymouth hook comes before any encrypt hook
if detect_plymouth(): if detect_plymouth():
@ -146,10 +179,10 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
openswap_hook = True openswap_hook = True
if partition["fs"] == "btrfs": if partition["fs"] == "btrfs":
btrfs = True uses_btrfs = True
if "lvm2" in partition["fs"]: if "lvm2" in partition["fs"]:
lvm2 = True uses_lvm2 = True
if partition["mountPoint"] == "/" and "luksMapperName" in partition: if partition["mountPoint"] == "/" and "luksMapperName" in partition:
encrypt_hook = True encrypt_hook = True
@ -172,7 +205,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
): ):
files.append(f"/{crypto_file}") files.append(f"/{crypto_file}")
if lvm2: if uses_lvm2:
hooks.append("lvm2") hooks.append("lvm2")
if swap_uuid != "": if swap_uuid != "":
@ -180,16 +213,12 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
if encrypt_hook and openswap_hook: if encrypt_hook and openswap_hook:
hooks.extend(["openswap"]) hooks.extend(["openswap"])
if btrfs and not is_cpu_intel: if uses_btrfs:
modules.append("crc32c") modules.append("crc32c-intel" if cpuinfo().is_intel else "crc32c")
else:
elif btrfs and is_cpu_intel:
modules.append("crc32c-intel")
elif not btrfs:
hooks.append("fsck") hooks.append("fsck")
write_mkinitcpio_lines(hooks, modules, files, root_mount_point) return (hooks, modules, files)
def run(): def run():
@ -210,6 +239,7 @@ def run():
return (_("Configuration Error"), return (_("Configuration Error"),
_("No root mount point for <pre>initcpiocfg</pre>.")) _("No root mount point for <pre>initcpiocfg</pre>."))
modify_mkinitcpio_conf(partitions, root_mount_point) hooks, modules, files = find_initcpio_features(partitions, root_mount_point)
write_mkinitcpio_lines(hooks, modules, files, root_mount_point)
return None return None

View File

@ -1,7 +1,13 @@
# SPDX-FileCopyrightText: no # SPDX-FileCopyrightText: no
# SPDX-License-Identifier: CC0-1.0 # SPDX-License-Identifier: CC0-1.0
#
# Writes a mkinitcpio.conf into the target system. It copies
# the host system's /etc/mkinitcpio.conf, and replaces any
# HOOKS, MODULES, and FILES lines with calculated values
# based on what the installation (seems to) need.
--- ---
type: "job" type: "job"
name: "initcpiocfg" name: "initcpiocfg"
interface: "python" interface: "python"
script: "main.py" script: "main.py"
noconfig: true

View File

@ -275,7 +275,7 @@ Config::detectCurrentKeyboardLayout()
{ {
return; return;
} }
cPointerSetter returnToIntial( &m_state, State::Initial ); cScopedAssignment returnToIntial( &m_state, State::Initial );
m_state = State::Guessing; m_state = State::Guessing;
//### Detect current keyboard layout and variant //### Detect current keyboard layout and variant
@ -427,7 +427,7 @@ Config::guessLocaleKeyboardLayout()
{ {
return; return;
} }
cPointerSetter returnToIntial( &m_state, State::Initial ); cScopedAssignment returnToIntial( &m_state, State::Initial );
m_state = State::Guessing; m_state = State::Guessing;
/* Guessing a keyboard layout based on the locale means /* Guessing a keyboard layout based on the locale means

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://calamares.io> ===
* *
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. * Calamares is Free Software: see the License-Identifier above.
* *

View File

@ -1,6 +1,7 @@
/* === This file is part of Calamares - <https://github.com/calamares> === /* === This file is part of Calamares - <https://calamares.io> ===
* *
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. * Calamares is Free Software: see the License-Identifier above.
* *

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".6"/> <Key labels = " |" ratio = ".6"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".6"/> <Key labels = " |" ratio = ".6"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".6"/> <Key labels = " |" ratio = ".6"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".8"/> <Key labels = " |" ratio = ".8"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".8"/> <Key labels = " |" ratio = ".8"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".8"/> <Key labels = " |" ratio = ".8"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".8"/> <Key labels = " |" ratio = ".8"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".8"/> <Key labels = " |" ratio = ".8"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".6"/> <Key labels = " |" ratio = ".6"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".8"/> <Key labels = " |" ratio = ".8"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".8"/> <Key labels = " |" ratio = ".8"/>

View File

@ -1,10 +1,10 @@
<!-- === This file is part of Calamares - <https://github.com/calamares> === <?xml version="1.0" encoding="UTF-8"?>
<!-- === This file is part of Calamares - <https://calamares.io> ===
* Copyright 2021, Anke Boersma <demm@kaosx.us> * SPDX-FileCopyrightText: 2021 Anke Boersma <demm@kaosx.us>
* SPDX-License-Identifier: GPL-3.0-or-later
* *
* Calamares is Free Software: see the License-Identifier above. --> * Calamares is Free Software: see the License-Identifier above. -->
<?xml version="1.0" encoding="UTF-8"?>
<Keyboard> <Keyboard>
<Row> <Row>
<Key labels = " |" ratio = ".8"/> <Key labels = " |" ratio = ".8"/>

View File

@ -174,7 +174,7 @@ LocalePage::locationChanged( const CalamaresUtils::Locale::TimeZoneData* locatio
{ {
return; return;
} }
cBoolSetter< true > b( m_blockTzWidgetSet ); cScopedAssignment b( &m_blockTzWidgetSet, true, false );
// Set region index // Set region index
int index = m_regionCombo->findData( location->region() ); int index = m_regionCombo->findData( location->region() );

View File

@ -8,7 +8,9 @@
#include "LuksBootKeyFileJob.h" #include "LuksBootKeyFileJob.h"
#include "utils/CalamaresUtilsSystem.h" #include "utils/CalamaresUtilsSystem.h"
#include "utils/Entropy.h"
#include "utils/Logger.h" #include "utils/Logger.h"
#include "utils/NamedEnum.h"
#include "utils/UMask.h" #include "utils/UMask.h"
#include "utils/Variant.h" #include "utils/Variant.h"
@ -102,15 +104,29 @@ static bool
generateTargetKeyfile() generateTargetKeyfile()
{ {
CalamaresUtils::UMask m( CalamaresUtils::UMask::Safe ); CalamaresUtils::UMask m( CalamaresUtils::UMask::Safe );
auto r = CalamaresUtils::System::instance()->targetEnvCommand(
{ "dd", "bs=512", "count=4", "if=/dev/urandom", QString( "of=%1" ).arg( keyfile ) } ); // Get the data
if ( r.getExitCode() != 0 ) QByteArray entropy;
auto entropySource = CalamaresUtils::getEntropy( 2048, entropy );
if ( entropySource != CalamaresUtils::EntropySource::URandom )
{ {
cWarning() << "Could not create LUKS keyfile:" << r.getOutput() << "(exit code" << r.getExitCode() << ')'; cWarning() << "Could not get entropy from /dev/urandom for LUKS.";
return false; return false;
} }
// Give ample time to check that the file was created correctly
r = CalamaresUtils::System::instance()->targetEnvCommand( { "ls", "-la", "/" } ); auto fileResult = CalamaresUtils::System::instance()->createTargetFile(
keyfile, entropy, CalamaresUtils::System::WriteMode::Overwrite );
entropy.fill( 'A' );
if ( !fileResult )
{
cWarning() << "Could not create LUKS keyfile:" << smash( fileResult.code() );
return false;
}
// Give ample time to check that the file was created correctly;
// we actually expect ls to return pretty-much-instantly.
auto r = CalamaresUtils::System::instance()->targetEnvCommand(
{ "ls", "-la", "/" }, QString(), QString(), std::chrono::seconds( 5 ) );
cDebug() << "In target system after creating LUKS file" << r.getOutput(); cDebug() << "In target system after creating LUKS file" << r.getOutput();
return true; return true;
} }
@ -118,8 +134,10 @@ generateTargetKeyfile()
static bool static bool
setupLuks( const LuksDevice& d ) setupLuks( const LuksDevice& d )
{ {
// Adding the key can take some times, measured around 15 seconds with
// a HDD (spinning rust) and a slow-ish computer. Give it a minute.
auto r = CalamaresUtils::System::instance()->targetEnvCommand( auto r = CalamaresUtils::System::instance()->targetEnvCommand(
{ "cryptsetup", "luksAddKey", d.device, keyfile }, QString(), d.passphrase, std::chrono::seconds( 15 ) ); { "cryptsetup", "luksAddKey", d.device, keyfile }, QString(), d.passphrase, std::chrono::seconds( 60 ) );
if ( r.getExitCode() != 0 ) if ( r.getExitCode() != 0 )
{ {
cWarning() << "Could not configure LUKS keyfile on" << d.device << ':' << r.getOutput() << "(exit code" cWarning() << "Could not configure LUKS keyfile on" << d.device << ':' << r.getOutput() << "(exit code"

View File

@ -126,23 +126,22 @@ canBeResized( Partition* candidate, const Logger::Once& o )
return false; return false;
} }
cDebug() << o << "Checking if" << convenienceName( candidate ) << "can be resized.";
if ( !candidate->fileSystem().supportGrow() || !candidate->fileSystem().supportShrink() ) if ( !candidate->fileSystem().supportGrow() || !candidate->fileSystem().supportShrink() )
{ {
cDebug() << Logger::SubEntry << "NO, filesystem" << candidate->fileSystem().name() cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", filesystem"
<< "does not support resize."; << candidate->fileSystem().name() << "does not support resize.";
return false; return false;
} }
if ( isPartitionFreeSpace( candidate ) ) if ( isPartitionFreeSpace( candidate ) )
{ {
cDebug() << Logger::SubEntry << "NO, partition is free space"; cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", partition is free space";
return false; return false;
} }
if ( candidate->isMounted() ) if ( candidate->isMounted() )
{ {
cDebug() << Logger::SubEntry << "NO, partition is mounted"; cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", partition is mounted";
return false; return false;
} }
@ -151,14 +150,14 @@ canBeResized( Partition* candidate, const Logger::Once& o )
PartitionTable* table = dynamic_cast< PartitionTable* >( candidate->parent() ); PartitionTable* table = dynamic_cast< PartitionTable* >( candidate->parent() );
if ( !table ) if ( !table )
{ {
cDebug() << Logger::SubEntry << "NO, no partition table found"; cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", no partition table found";
return false; return false;
} }
if ( table->numPrimaries() >= table->maxPrimaries() ) if ( table->numPrimaries() >= table->maxPrimaries() )
{ {
cDebug() << Logger::SubEntry << "NO, partition table already has" << table->maxPrimaries() cDebug() << o << "Can not resize" << convenienceName( candidate ) << ", partition table already has"
<< "primary partitions."; << table->maxPrimaries() << "primary partitions.";
return false; return false;
} }
} }
@ -167,7 +166,8 @@ canBeResized( Partition* candidate, const Logger::Once& o )
double requiredStorageGiB = getRequiredStorageGiB( ok ); double requiredStorageGiB = getRequiredStorageGiB( ok );
if ( !ok ) if ( !ok )
{ {
cDebug() << Logger::SubEntry << "NO, requiredStorageGiB is not set correctly."; cDebug() << o << "Can not resize" << convenienceName( candidate )
<< ", requiredStorageGiB is not set correctly.";
return false; return false;
} }
@ -200,24 +200,25 @@ canBeResized( Partition* candidate, const Logger::Once& o )
bool bool
canBeResized( DeviceModel* dm, const QString& partitionPath, const Logger::Once& o ) canBeResized( DeviceModel* dm, const QString& partitionPath, const Logger::Once& o )
{ {
cDebug() << o << "Checking if" << partitionPath << "can be resized."; if ( partitionPath.startsWith( "/dev/" ) )
QString partitionWithOs = partitionPath;
if ( partitionWithOs.startsWith( "/dev/" ) )
{ {
for ( int i = 0; i < dm->rowCount(); ++i ) for ( int i = 0; i < dm->rowCount(); ++i )
{ {
Device* dev = dm->deviceForIndex( dm->index( i ) ); Device* dev = dm->deviceForIndex( dm->index( i ) );
Partition* candidate = CalamaresUtils::Partition::findPartitionByPath( { dev }, partitionWithOs ); Partition* candidate = CalamaresUtils::Partition::findPartitionByPath( { dev }, partitionPath );
if ( candidate ) if ( candidate )
{ {
return canBeResized( candidate, o ); return canBeResized( candidate, o );
} }
} }
cDebug() << Logger::SubEntry << "no Partition* found for" << partitionWithOs; cWarning() << "Can not resize" << partitionPath << ", no Partition* found.";
return false;
}
else
{
cWarning() << "Can not resize" << partitionPath << ", does not start with /dev";
return false;
} }
cDebug() << Logger::SubEntry << "Partition" << partitionWithOs << "CANNOT BE RESIZED FOR AUTOINSTALL.";
return false;
} }
@ -250,8 +251,6 @@ lookForFstabEntries( const QString& partitionPath )
{ {
QFile fstabFile( mount.path() + "/etc/fstab" ); QFile fstabFile( mount.path() + "/etc/fstab" );
cDebug() << Logger::SubEntry << "reading" << fstabFile.fileName();
if ( fstabFile.open( QIODevice::ReadOnly | QIODevice::Text ) ) if ( fstabFile.open( QIODevice::ReadOnly | QIODevice::Text ) )
{ {
const QStringList fstabLines = QString::fromLocal8Bit( fstabFile.readAll() ).split( '\n' ); const QStringList fstabLines = QString::fromLocal8Bit( fstabFile.readAll() ).split( '\n' );
@ -261,10 +260,11 @@ lookForFstabEntries( const QString& partitionPath )
fstabEntries.append( FstabEntry::fromEtcFstab( rawLine ) ); fstabEntries.append( FstabEntry::fromEtcFstab( rawLine ) );
} }
fstabFile.close(); fstabFile.close();
cDebug() << Logger::SubEntry << "got" << fstabEntries.count() << "lines."; const int lineCount = fstabEntries.count();
std::remove_if( std::remove_if(
fstabEntries.begin(), fstabEntries.end(), []( const FstabEntry& x ) { return !x.isValid(); } ); fstabEntries.begin(), fstabEntries.end(), []( const FstabEntry& x ) { return !x.isValid(); } );
cDebug() << Logger::SubEntry << "got" << fstabEntries.count() << "fstab entries."; cDebug() << Logger::SubEntry << "got" << fstabEntries.count() << "fstab entries from" << lineCount
<< "lines in" << fstabFile.fileName();
} }
else else
{ {
@ -529,7 +529,7 @@ efiFilesystemMinimumSize()
QString QString
canonicalFilesystemName( const QString& fsName, FileSystem::Type* fsType ) canonicalFilesystemName( const QString& fsName, FileSystem::Type* fsType )
{ {
cPointerSetter type( fsType ); cScopedAssignment type( fsType );
if ( fsName.isEmpty() ) if ( fsName.isEmpty() )
{ {
type = FileSystem::Ext4; type = FileSystem::Ext4;