From 114e3626e2f3d5c89e21b4dbf94edd8ca5996fee Mon Sep 17 00:00:00 2001 From: bd-g <49082060+bd-g@users.noreply.github.com> Date: Fri, 10 Mar 2023 04:17:19 -0500 Subject: Sway profile - select seat (#1661) * sway profile choose seat --- archinstall/lib/user_interaction/general_conf.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'archinstall/lib/user_interaction') diff --git a/archinstall/lib/user_interaction/general_conf.py b/archinstall/lib/user_interaction/general_conf.py index 76631a98..fc7ded45 100644 --- a/archinstall/lib/user_interaction/general_conf.py +++ b/archinstall/lib/user_interaction/general_conf.py @@ -174,7 +174,10 @@ def select_profile(preset) -> Optional[Profile]: storage['profile_minimal'] = False storage['_selected_servers'] = [] storage['_desktop_profile'] = None + storage['sway_sys_priv_ctrl'] = None + storage['arguments']['sway_sys_priv_ctrl'] = None storage['arguments']['desktop-environment'] = None + storage['arguments']['gfx_driver'] = None storage['arguments']['gfx_driver_packages'] = None return None case MenuSelectionType.Skip: -- cgit v1.2.3-70-g09d2 From 6fdfd93e69aa27dd521449d363cdc66cf8429815 Mon Sep 17 00:00:00 2001 From: Murphy Date: Sun, 26 Mar 2023 21:42:24 +0200 Subject: Partition creation prompt text (#1683) * new prompt text * remove quotes --- archinstall/lib/user_interaction/partitioning_conf.py | 4 ++-- archinstall/locales/ar/LC_MESSAGES/base.po | 4 ++-- archinstall/locales/base.pot | 4 ++-- archinstall/locales/cs/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/de/LC_MESSAGES/base.po | 8 ++++---- archinstall/locales/el/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/en/LC_MESSAGES/base.po | 5 ++++- archinstall/locales/es/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/fr/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/id/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/it/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/ka/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/ko/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/nl/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/pl/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/pt/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/pt_BR/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/ru/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/sv/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/ta/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/tr/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/uk/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/ur/LC_MESSAGES/base.po | 6 ++++++ archinstall/locales/zh-CN/LC_MESSAGES/base.po | 6 ++++++ 24 files changed, 128 insertions(+), 11 deletions(-) (limited to 'archinstall/lib/user_interaction') diff --git a/archinstall/lib/user_interaction/partitioning_conf.py b/archinstall/lib/user_interaction/partitioning_conf.py index cff76dc2..0a5ede51 100644 --- a/archinstall/lib/user_interaction/partitioning_conf.py +++ b/archinstall/lib/user_interaction/partitioning_conf.py @@ -208,7 +208,7 @@ def manage_new_and_existing_partitions(block_device: 'BlockDevice') -> Dict[str, if fs_choice.type_ == MenuSelectionType.Skip: continue - prompt = str(_('Enter the start sector (percentage or block number, default: {}): ')).format( + prompt = str(_('Enter the start location (in parted units: s, GB, %, etc. ; default: {}): ')).format( block_device.first_free_sector ) start = input(prompt).strip() @@ -219,7 +219,7 @@ def manage_new_and_existing_partitions(block_device: 'BlockDevice') -> Dict[str, else: end_suggested = '100%' - prompt = str(_('Enter the end sector of the partition (percentage or block number, ex: {}): ')).format( + prompt = str(_('Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): ')).format( end_suggested ) end = input(prompt).strip() diff --git a/archinstall/locales/ar/LC_MESSAGES/base.po b/archinstall/locales/ar/LC_MESSAGES/base.po index 1a9fc1aa..1207e31d 100644 --- a/archinstall/locales/ar/LC_MESSAGES/base.po +++ b/archinstall/locales/ar/LC_MESSAGES/base.po @@ -97,10 +97,10 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "" -msgid "Enter the start sector (percentage or block number, default: {}): " +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " msgstr "" -msgid "Enter the end sector of the partition (percentage or block number, ex: {}): " +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " msgstr "" msgid "{} contains queued partitions, this will remove those, are you sure?" diff --git a/archinstall/locales/base.pot b/archinstall/locales/base.pot index 2becbbf3..dd4076d6 100644 --- a/archinstall/locales/base.pot +++ b/archinstall/locales/base.pot @@ -97,11 +97,11 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "" -msgid "Enter the start sector (percentage or block number, default: {}): " +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " msgstr "" msgid "" -"Enter the end sector of the partition (percentage or block number, ex: {}): " +"Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " msgstr "" msgid "{} contains queued partitions, this will remove those, are you sure?" diff --git a/archinstall/locales/cs/LC_MESSAGES/base.po b/archinstall/locales/cs/LC_MESSAGES/base.po index b3dea244..42bbb7d5 100644 --- a/archinstall/locales/cs/LC_MESSAGES/base.po +++ b/archinstall/locales/cs/LC_MESSAGES/base.po @@ -94,6 +94,12 @@ msgstr "Zvolte co dělat s {}" msgid "Enter a desired filesystem type for the partition" msgstr "Zadejte požadovaný souborový systém pro oddíl" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Zadejte počáteční sektor (procenta nebo číslo bloku, výchozí: {}): " diff --git a/archinstall/locales/de/LC_MESSAGES/base.po b/archinstall/locales/de/LC_MESSAGES/base.po index dee2b481..ab7e8ef8 100644 --- a/archinstall/locales/de/LC_MESSAGES/base.po +++ b/archinstall/locales/de/LC_MESSAGES/base.po @@ -96,11 +96,11 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Bitte wählen Sie einen Dateisystemtyp für die Partition aus" -msgid "Enter the start sector (percentage or block number, default: {}): " -msgstr "Bitte geben Sie den start Sektor ein (in Prozent oder Blocknummer, default: {}): " +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "Bitte geben Sie die Startposition ein (in parted Einheiten: s, GB, %, etc. ; default: {}): " -msgid "Enter the end sector of the partition (percentage or block number, ex: {}): " -msgstr "Bitte geben Sie den end Sektor ein (in Prozent oder Blocknummer, default: {}): " +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "Bitte geben Sie die Endposition ein (in parted Einheiten: s, GB, %, etc. ; default: {}): " msgid "{} contains queued partitions, this will remove those, are you sure?" msgstr "{} enthält Partitionen in der Warteschlange, dies werden damit entfernt, sind sie sicher?" diff --git a/archinstall/locales/el/LC_MESSAGES/base.po b/archinstall/locales/el/LC_MESSAGES/base.po index c41dbb7e..ddbfa437 100644 --- a/archinstall/locales/el/LC_MESSAGES/base.po +++ b/archinstall/locales/el/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Εισάγετε ένα επιθυμητό τύπο συστήματος αρχείων για τη διαμέριση" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Εισάγετε τον start sector (ποσοστό ή αριθμό block, προκαθορισμένο {}): " diff --git a/archinstall/locales/en/LC_MESSAGES/base.po b/archinstall/locales/en/LC_MESSAGES/base.po index 62543eaa..f458aa76 100644 --- a/archinstall/locales/en/LC_MESSAGES/base.po +++ b/archinstall/locales/en/LC_MESSAGES/base.po @@ -94,7 +94,10 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "" -msgid "Enter the start sector (percentage or block number, default: {}): " +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " msgstr "" msgid "Enter the end sector of the partition (percentage or block number, ex: {}): " diff --git a/archinstall/locales/es/LC_MESSAGES/base.po b/archinstall/locales/es/LC_MESSAGES/base.po index f744daae..377488f8 100644 --- a/archinstall/locales/es/LC_MESSAGES/base.po +++ b/archinstall/locales/es/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Ingrese un tipo de sistema de archivos deseado para la partición" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Introduzca el sector de inicio (porcentaje o número de bloque, predeterminado: {}): " diff --git a/archinstall/locales/fr/LC_MESSAGES/base.po b/archinstall/locales/fr/LC_MESSAGES/base.po index ada12b8e..3fa12a34 100644 --- a/archinstall/locales/fr/LC_MESSAGES/base.po +++ b/archinstall/locales/fr/LC_MESSAGES/base.po @@ -93,6 +93,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Entrer un type de système de fichiers souhaité pour la partition" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Entrer le secteur de début (pourcentage ou numéro de bloc, par défaut : {}) : " diff --git a/archinstall/locales/id/LC_MESSAGES/base.po b/archinstall/locales/id/LC_MESSAGES/base.po index 85479389..99788ed6 100644 --- a/archinstall/locales/id/LC_MESSAGES/base.po +++ b/archinstall/locales/id/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Masukkan jenis filesystem yang diinginkan untuk partisi" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Masukkan sektor awal (persentase atau nomor blok, default: {}): " diff --git a/archinstall/locales/it/LC_MESSAGES/base.po b/archinstall/locales/it/LC_MESSAGES/base.po index 176d3959..18015fc8 100644 --- a/archinstall/locales/it/LC_MESSAGES/base.po +++ b/archinstall/locales/it/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Immettere un tipo di filesystem desiderato per la partizione" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Inserisci il settore iniziale (percentuale o numero di blocco, predefinito: {}): " diff --git a/archinstall/locales/ka/LC_MESSAGES/base.po b/archinstall/locales/ka/LC_MESSAGES/base.po index 6357d1a7..46d198ec 100644 --- a/archinstall/locales/ka/LC_MESSAGES/base.po +++ b/archinstall/locales/ka/LC_MESSAGES/base.po @@ -97,6 +97,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "შეიყვანეთ დანაყოფის სასურველი ფაილური სისტემის ტიპი" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "შეიყვანეთ საწყისი სექტორი (პროცენტებში ან ბლოკის ნომერი. ნაგულისხმები: {}): " diff --git a/archinstall/locales/ko/LC_MESSAGES/base.po b/archinstall/locales/ko/LC_MESSAGES/base.po index b0a85c64..7b914a90 100644 --- a/archinstall/locales/ko/LC_MESSAGES/base.po +++ b/archinstall/locales/ko/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "파티션에 대해 원하는 파일 시스템 유형을 입력하세요" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "시작 섹터를 입력하세요 (백분율 또는 블록 번호, 기본값: {}): " diff --git a/archinstall/locales/nl/LC_MESSAGES/base.po b/archinstall/locales/nl/LC_MESSAGES/base.po index b7323059..2986779b 100644 --- a/archinstall/locales/nl/LC_MESSAGES/base.po +++ b/archinstall/locales/nl/LC_MESSAGES/base.po @@ -97,6 +97,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Kies het gewenste bestandssysteem voor de partitie" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Voer de beginsector in (percentage of bloknummer - standaard: {}): " diff --git a/archinstall/locales/pl/LC_MESSAGES/base.po b/archinstall/locales/pl/LC_MESSAGES/base.po index 6655bbbd..363c5d9f 100644 --- a/archinstall/locales/pl/LC_MESSAGES/base.po +++ b/archinstall/locales/pl/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Wprowadź typ systemu plików dla partycji" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Wprowadź sektor początkowy (procent lub numer bloku, domyślnie: {}): " diff --git a/archinstall/locales/pt/LC_MESSAGES/base.po b/archinstall/locales/pt/LC_MESSAGES/base.po index 683de0ad..6c7338d4 100644 --- a/archinstall/locales/pt/LC_MESSAGES/base.po +++ b/archinstall/locales/pt/LC_MESSAGES/base.po @@ -95,6 +95,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Escreve o tipo de sistema de ficheiros desejado para a partição" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Escreve o sector de início (percentagem ou número de bloco, padrão: {}): " diff --git a/archinstall/locales/pt_BR/LC_MESSAGES/base.po b/archinstall/locales/pt_BR/LC_MESSAGES/base.po index 938f5068..8d1db8ac 100644 --- a/archinstall/locales/pt_BR/LC_MESSAGES/base.po +++ b/archinstall/locales/pt_BR/LC_MESSAGES/base.po @@ -94,6 +94,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Digite o tipo de sistema de arquivos desejado para a partição" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Digite o setor de início (porcentagem ou número do bloco, padrão: {}): " diff --git a/archinstall/locales/ru/LC_MESSAGES/base.po b/archinstall/locales/ru/LC_MESSAGES/base.po index d8762ef6..bdb1c4b6 100644 --- a/archinstall/locales/ru/LC_MESSAGES/base.po +++ b/archinstall/locales/ru/LC_MESSAGES/base.po @@ -97,6 +97,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Введите желаемый тип файловой системы для раздела" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Введите начальный сектор (процент или номер блока, по умолчанию: {}): " diff --git a/archinstall/locales/sv/LC_MESSAGES/base.po b/archinstall/locales/sv/LC_MESSAGES/base.po index fc311551..8bc51650 100644 --- a/archinstall/locales/sv/LC_MESSAGES/base.po +++ b/archinstall/locales/sv/LC_MESSAGES/base.po @@ -97,6 +97,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Mata in önskad filsystemtyp för partition" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Mata in startsektor (procent eller block-nummer, standard: {}): " diff --git a/archinstall/locales/ta/LC_MESSAGES/base.po b/archinstall/locales/ta/LC_MESSAGES/base.po index 4375f477..763e9fc9 100644 --- a/archinstall/locales/ta/LC_MESSAGES/base.po +++ b/archinstall/locales/ta/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "பகிர்வுக்கு தேவையான கோப்பு முறைமை வகையை உள்ளிடவும்" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "தொடக்கப் பிரிவை உள்ளிடவும் (சதவீதம் அல்லது தொகுதி எண், இயல்புநிலை: {}): " diff --git a/archinstall/locales/tr/LC_MESSAGES/base.po b/archinstall/locales/tr/LC_MESSAGES/base.po index fd1e2393..d31db52d 100644 --- a/archinstall/locales/tr/LC_MESSAGES/base.po +++ b/archinstall/locales/tr/LC_MESSAGES/base.po @@ -97,6 +97,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Disk bölümü için arzu edilen bir dosya systemi tipi girin" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Başlangıç kesimini girin (yüzde ya da blok numarası, varsayılan: {}): " diff --git a/archinstall/locales/uk/LC_MESSAGES/base.po b/archinstall/locales/uk/LC_MESSAGES/base.po index 3589df98..8216c4a7 100644 --- a/archinstall/locales/uk/LC_MESSAGES/base.po +++ b/archinstall/locales/uk/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "Введіть бажаний тип файлової системи для розділу" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "Введіть початковий сектор (відсоток або номер блоку, за замовчуванням: {}): " diff --git a/archinstall/locales/ur/LC_MESSAGES/base.po b/archinstall/locales/ur/LC_MESSAGES/base.po index 0b024031..fc8174da 100644 --- a/archinstall/locales/ur/LC_MESSAGES/base.po +++ b/archinstall/locales/ur/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "اس پارٹیشن کے لیے مطلوبہ فائل سسٹم درج کریں" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "اسٹارٹ سیکٹر درج کریں (فیصد یا بلاک نمبر، ڈیفالٹ: {}):" diff --git a/archinstall/locales/zh-CN/LC_MESSAGES/base.po b/archinstall/locales/zh-CN/LC_MESSAGES/base.po index 60f88a01..78e86f8e 100644 --- a/archinstall/locales/zh-CN/LC_MESSAGES/base.po +++ b/archinstall/locales/zh-CN/LC_MESSAGES/base.po @@ -96,6 +96,12 @@ msgstr "" msgid "Enter a desired filesystem type for the partition" msgstr "为分区输入所需的文件系统类型" +msgid "Enter the start location (in parted units: s, GB, %, etc. ; default: {}): " +msgstr "" + +msgid "Enter the end location (in parted units: s, GB, %, etc. ; ex: {}): " +msgstr "" + msgid "Enter the start sector (percentage or block number, default: {}): " msgstr "输入起始扇区(百分比或块号,默认:{}): " -- cgit v1.2.3-70-g09d2 From 83f4b4178fae83f9fae3dd0a7ac333957acd0c3f Mon Sep 17 00:00:00 2001 From: Daniel Girtler Date: Wed, 29 Mar 2023 21:48:11 +1100 Subject: Save encryption configuration (#1672) * Save encryption configuration * Fix deserialization problem * Added .part_uuid to MapperDev --------- Co-authored-by: Daniel Girtler Co-authored-by: Anton Hvornum Co-authored-by: Anton Hvornum --- archinstall/__init__.py | 8 ++++ archinstall/lib/configuration.py | 5 ++- archinstall/lib/disk/encryption.py | 26 ++++++++--- archinstall/lib/disk/filesystem.py | 2 +- archinstall/lib/hsm/fido.py | 19 +++++++- archinstall/lib/installer.py | 6 +-- archinstall/lib/menu/global_menu.py | 4 +- archinstall/lib/models/disk_encryption.py | 59 ++++++++++++++++++++++--- archinstall/lib/user_interaction/system_conf.py | 1 - 9 files changed, 108 insertions(+), 22 deletions(-) (limited to 'archinstall/lib/user_interaction') diff --git a/archinstall/__init__.py b/archinstall/__init__.py index b22b4663..9664c507 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -240,6 +240,14 @@ def load_config(): superusers = arguments.get('!superusers', None) arguments['!users'] = User.parse_arguments(users, superusers) + if arguments.get('disk_encryption', None) is not None and arguments.get('disk_layouts', None) is not None: + password = arguments.get('encryption_password', '') + arguments['disk_encryption'] = DiskEncryption.parse_arg( + arguments['disk_layouts'], + arguments['disk_encryption'], + password + ) + def post_process_arguments(arguments): storage['arguments'] = arguments diff --git a/archinstall/lib/configuration.py b/archinstall/lib/configuration.py index ad537b21..e0b5a143 100644 --- a/archinstall/lib/configuration.py +++ b/archinstall/lib/configuration.py @@ -44,7 +44,7 @@ class ConfigurationOutput: self._disk_layout_file = "user_disk_layout.json" self._sensitive = ['!users'] - self._ignore = ['abort', 'install', 'config', 'creds', 'dry_run', 'disk_encryption'] + self._ignore = ['abort', 'install', 'config', 'creds', 'dry_run'] self._process_config() @@ -71,6 +71,9 @@ class ConfigurationOutput: else: self._user_config[key] = self._config[key] + if key == 'disk_encryption': # special handling for encryption password + self._user_credentials['encryption_password'] = self._config[key].encryption_password + def user_config_to_json(self) -> str: return json.dumps({ 'config_version': storage['__version__'], # Tells us what version was used to generate the config diff --git a/archinstall/lib/disk/encryption.py b/archinstall/lib/disk/encryption.py index 67f656c8..c7496bfa 100644 --- a/archinstall/lib/disk/encryption.py +++ b/archinstall/lib/disk/encryption.py @@ -46,7 +46,7 @@ class DiskEncryptionMenu(AbstractSubMenu): Selector( _('Partitions'), func=lambda preset: select_partitions_to_encrypt(self._disk_layouts, preset), - display_func=lambda x: f'{len(x)} {_("Partitions")}' if x else None, + display_func=lambda x: f'{sum([len(y) for y in x.values()])} {_("Partitions")}' if x else None, dependencies=['encryption_password'], default=self._preset.partitions, preview_func=self._prev_disk_layouts, @@ -86,9 +86,14 @@ class DiskEncryptionMenu(AbstractSubMenu): def _prev_disk_layouts(self) -> Optional[str]: selector = self._menu_options['partitions'] if selector.has_selection(): - partitions: List[Any] = selector.current_selection + partitions: Dict[str, Any] = selector.current_selection + + all_partitions = [] + for parts in partitions.values(): + all_partitions += parts + output = str(_('Partitions to be encrypted')) + '\n' - output += current_partition_layout(partitions, with_title=False) + output += current_partition_layout(all_partitions, with_title=False) return output.rstrip() return None @@ -132,7 +137,7 @@ def select_hsm(preset: Optional[Fido2Device] = None) -> Optional[Fido2Device]: return None -def select_partitions_to_encrypt(disk_layouts: Dict[str, Any], preset: List[Any]) -> List[Any]: +def select_partitions_to_encrypt(disk_layouts: Dict[str, Any], preset: Dict[str, Any]) -> Dict[str, Any]: # If no partitions was marked as encrypted, but a password was supplied and we have some disks to format.. # Then we need to identify which partitions to encrypt. This will default to / (root). all_partitions = [] @@ -153,10 +158,17 @@ def select_partitions_to_encrypt(disk_layouts: Dict[str, Any], preset: List[Any] match choice.type_: case MenuSelectionType.Reset: - return [] + return {} case MenuSelectionType.Skip: return preset case MenuSelectionType.Selection: - return choice.value # type: ignore + selections: List[Any] = choice.value # type: ignore + partitions = {} + + for path, device in disk_layouts.items(): + for part in selections: + if part in device.get('partitions', []): + partitions.setdefault(path, []).append(part) - return [] + return partitions + return {} diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py index 1e722ce5..1083df53 100644 --- a/archinstall/lib/disk/filesystem.py +++ b/archinstall/lib/disk/filesystem.py @@ -113,7 +113,7 @@ class Filesystem: format_options = partition.get('options',[]) + partition.get('filesystem',{}).get('format_options',[]) disk_encryption: DiskEncryption = storage['arguments'].get('disk_encryption') - if disk_encryption and partition in disk_encryption.partitions: + if disk_encryption and partition in disk_encryption.all_partitions: if not partition['device_instance']: raise DiskError(f"Internal error caused us to loose the partition. Please report this issue upstream!") diff --git a/archinstall/lib/hsm/fido.py b/archinstall/lib/hsm/fido.py index 758a2548..1c226322 100644 --- a/archinstall/lib/hsm/fido.py +++ b/archinstall/lib/hsm/fido.py @@ -1,9 +1,11 @@ +from __future__ import annotations + import getpass import logging from dataclasses import dataclass from pathlib import Path -from typing import List +from typing import List, Dict from ..general import SysCommand, SysCommandWorker, clear_vt100_escape_codes from ..disk.partition import Partition @@ -16,6 +18,21 @@ class Fido2Device: manufacturer: str product: str + def json(self) -> Dict[str, str]: + return { + 'path': str(self.path), + 'manufacturer': self.manufacturer, + 'product': self.product + } + + @classmethod + def parse_arg(cls, arg: Dict[str, str]) -> 'Fido2Device': + return Fido2Device( + Path(arg['path']), + arg['manufacturer'], + arg['product'] + ) + class Fido2: _loaded: bool = False diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 8c6a8367..0e9f0662 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -248,7 +248,7 @@ class Installer: # we manage the encrypted partititons if self._disk_encryption: - for partition in self._disk_encryption.partitions: + for partition in self._disk_encryption.all_partitions: # open the luks device and all associate stuff loopdev = f"{storage.get('ENC_IDENTIFIER', 'ai')}{pathlib.Path(partition['device_instance'].path).name}" @@ -324,7 +324,7 @@ class Installer: file = f"/{file}" if len(file.strip()) <= 0 or file == '/': raise ValueError(f"The filename for the swap file has to be a valid path, not: {self.target}{file}") - + SysCommand(f'dd if=/dev/zero of={self.target}{file} bs={size} count=1') SysCommand(f'chmod 0600 {self.target}{file}') SysCommand(f'mkswap {self.target}{file}') @@ -452,7 +452,7 @@ class Installer: if hasattr(plugin, 'on_genfstab'): if plugin.on_genfstab(self) is True: break - + with open(f"{self.target}/etc/fstab", 'a') as fstab_fh: for entry in self.FSTAB_ENTRIES: fstab_fh.write(f'{entry}\n') diff --git a/archinstall/lib/menu/global_menu.py b/archinstall/lib/menu/global_menu.py index f0062b4c..7c5b153e 100644 --- a/archinstall/lib/menu/global_menu.py +++ b/archinstall/lib/menu/global_menu.py @@ -279,8 +279,8 @@ class GlobalMenu(AbstractMenu): output = str(_('Encryption type')) + f': {enc_type}\n' output += str(_('Password')) + f': {secret(encryption.encryption_password)}\n' - if encryption.partitions: - output += 'Partitions: {} selected'.format(len(encryption.partitions)) + '\n' + if encryption.all_partitions: + output += 'Partitions: {} selected'.format(len(encryption.all_partitions)) + '\n' if encryption.hsm_device: output += f'HSM: {encryption.hsm_device.manufacturer}' diff --git a/archinstall/lib/models/disk_encryption.py b/archinstall/lib/models/disk_encryption.py index 3edab93e..a4a501d9 100644 --- a/archinstall/lib/models/disk_encryption.py +++ b/archinstall/lib/models/disk_encryption.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from dataclasses import dataclass, field -from enum import Enum, auto +from enum import Enum from typing import Optional, List, Dict, TYPE_CHECKING, Any from ..hsm.fido import Fido2Device @@ -9,8 +11,7 @@ if TYPE_CHECKING: class EncryptionType(Enum): - Partition = auto() - # FullDiskEncryption = auto() + Partition = 'partition' @classmethod def _encryption_type_mapper(cls) -> Dict[str, 'EncryptionType']: @@ -35,9 +36,55 @@ class EncryptionType(Enum): class DiskEncryption: encryption_type: EncryptionType = EncryptionType.Partition encryption_password: str = '' - partitions: List[str] = field(default_factory=list) + partitions: Dict[str, List[Dict[str, Any]]] = field(default_factory=dict) hsm_device: Optional[Fido2Device] = None + @property + def all_partitions(self) -> List[Dict[str, Any]]: + _all: List[Dict[str, Any]] = [] + for parts in self.partitions.values(): + _all += parts + return _all + def generate_encryption_file(self, partition) -> bool: - return partition in self.partitions and partition['mountpoint'] != '/' - + return partition in self.all_partitions and partition['mountpoint'] != '/' + + def json(self) -> Dict[str, Any]: + obj = { + 'encryption_type': self.encryption_type.value, + 'partitions': self.partitions + } + + if self.hsm_device: + obj['hsm_device'] = self.hsm_device.json() + + return obj + + @classmethod + def parse_arg( + cls, + disk_layout: Dict[str, Any], + arg: Dict[str, Any], + password: str = '' + ) -> 'DiskEncryption': + # we have to map the enc partition config to the disk layout objects + # they both need to point to the same object as it will get modified + # during the installation process + enc_partitions: Dict[str, List[Dict[str, Any]]] = {} + + for path, partitions in disk_layout.items(): + conf_partitions = arg['partitions'].get(path, []) + for part in partitions['partitions']: + if part in conf_partitions: + enc_partitions.setdefault(path, []).append(part) + + enc = DiskEncryption( + EncryptionType(arg['encryption_type']), + password, + enc_partitions + ) + + if hsm := arg.get('hsm_device', None): + enc.hsm_device = Fido2Device.parse_arg(hsm) + + return enc diff --git a/archinstall/lib/user_interaction/system_conf.py b/archinstall/lib/user_interaction/system_conf.py index 42a6cec7..e1581677 100644 --- a/archinstall/lib/user_interaction/system_conf.py +++ b/archinstall/lib/user_interaction/system_conf.py @@ -60,7 +60,6 @@ def select_harddrives(preset: List[str] = []) -> List[str]: selected_harddrive = Menu( title, list(options.keys()), - preset_values=preset, multi=True, allow_reset=True, allow_reset_warning_msg=warning -- cgit v1.2.3-70-g09d2 From 7ad00d96e1f1104e3c321d69e4f6cd8625ef4dac Mon Sep 17 00:00:00 2001 From: bd-g <49082060+bd-g@users.noreply.github.com> Date: Sat, 1 Apr 2023 04:13:18 -0400 Subject: Make it easier to save configuration files (#1659) * updated save menu for configuration files * add log message to TUI to let user know we may run for a second finding save directories * remove testing line * remove unnecessary non-relative import * fix bug when skipping save location * make save configuration translatable * fix linting errors * handle skip and reset options correctly * fix flake8 linting error --------- Co-authored-by: Anton Hvornum --- archinstall/lib/user_interaction/save_conf.py | 92 ++++++++++++++++++++++----- 1 file changed, 75 insertions(+), 17 deletions(-) (limited to 'archinstall/lib/user_interaction') diff --git a/archinstall/lib/user_interaction/save_conf.py b/archinstall/lib/user_interaction/save_conf.py index d60ef995..5b4ae2b3 100644 --- a/archinstall/lib/user_interaction/save_conf.py +++ b/archinstall/lib/user_interaction/save_conf.py @@ -1,9 +1,12 @@ from __future__ import annotations +import logging + from pathlib import Path from typing import Any, Dict, TYPE_CHECKING from ..configuration import ConfigurationOutput +from ..general import SysCommand from ..menu import Menu from ..menu.menu import MenuSelectionType from ..output import log @@ -58,20 +61,75 @@ def save_config(config: Dict): if choice.type_ == MenuSelectionType.Skip: return - while True: - path = input(_('Enter a directory for the configuration(s) to be saved: ')).strip(' ') - dest_path = Path(path) - if dest_path.exists() and dest_path.is_dir(): - break - log(_('Not a valid directory: {}').format(dest_path), fg='red') - - if options['user_config'] == choice.value: - config_output.save_user_config(dest_path) - elif options['user_creds'] == choice.value: - config_output.save_user_creds(dest_path) - elif options['disk_layout'] == choice.value: - config_output.save_disk_layout(dest_path) - elif options['all'] == choice.value: - config_output.save_user_config(dest_path) - config_output.save_user_creds(dest_path) - config_output.save_disk_layout(dest_path) + dirs_to_exclude = [ + '/bin', + '/dev', + '/lib', + '/lib64', + '/lost+found', + '/opt', + '/proc', + '/run', + '/sbin', + '/srv', + '/sys', + '/usr', + '/var', + ] + log( + _('When picking a directory to save configuration files to,' + ' by default we will ignore the following folders: ') + ','.join(dirs_to_exclude), + level=logging.DEBUG + ) + + log(_('Finding possible directories to save configuration files ...'), level=logging.INFO) + + find_exclude = '-path ' + ' -prune -o -path '.join(dirs_to_exclude) + ' -prune ' + file_picker_command = f'find / {find_exclude} -o -type d -print0' + possible_save_dirs = list( + filter(None, SysCommand(file_picker_command).decode().split('\x00')) + ) + + selection = Menu( + _('Select directory (or directories) for saving configuration files'), + possible_save_dirs, + multi=True, + skip=True, + allow_reset=False, + ).run() + + match selection.type_: + case MenuSelectionType.Skip: + return + case _: + save_dirs = selection.value + + prompt = _('Do you want to save {} configuration file(s) in the following locations?\n\n{}').format( + list(options.keys())[list(options.values()).index(choice.value)], + save_dirs + ) + save_confirmation = Menu(prompt, Menu.yes_no(), default_option=Menu.yes()).run() + if save_confirmation == Menu.no(): + return + + log( + _('Saving {} configuration files to {}').format( + list(options.keys())[list(options.values()).index(choice.value)], + save_dirs + ), + level=logging.DEBUG + ) + + if save_dirs is not None: + for save_dir_str in save_dirs: + save_dir = Path(save_dir_str) + if options['user_config'] == choice.value: + config_output.save_user_config(save_dir) + elif options['user_creds'] == choice.value: + config_output.save_user_creds(save_dir) + elif options['disk_layout'] == choice.value: + config_output.save_disk_layout(save_dir) + elif options['all'] == choice.value: + config_output.save_user_config(save_dir) + config_output.save_user_creds(save_dir) + config_output.save_disk_layout(save_dir) -- cgit v1.2.3-70-g09d2