Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-05-11 13:37:08 +0200
committerAnton Hvornum <anton.feeds@gmail.com>2021-05-11 13:37:08 +0200
commit129ceaea8be14362e2b22cbbf8b83ae0e392d1e8 (patch)
tree8b2f2249e77a38bb58aa9e602e717f54d998f495 /examples
parente6c28a94ee42dad37cc69f8ebd3e6edebc33b938 (diff)
Renamed keyboard-language to keyboard-layout to avoid confusion. Added encryption checks for disk layout selection, if disk encryption password is given - but no partitions were found using encryption, the user will be asked which partitions to encrypt - unless there's only /boot and /<root> then we'll automatically select /<root> because that's what we support for now.
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 9e56aa44..3f854f4c 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -16,10 +16,10 @@ def ask_user_questions():
Not until we're satisfied with what we want to install
will we continue with the actual installation steps.
"""
- if not archinstall.arguments.get('keyboard-language', None):
+ if not archinstall.arguments.get('keyboard-layout', None):
while True:
try:
- archinstall.arguments['keyboard-language'] = archinstall.select_language(archinstall.list_keyboard_languages()).strip()
+ archinstall.arguments['keyboard-layout'] = archinstall.select_language(archinstall.list_keyboard_languages()).strip()
break
except archinstall.RequirementError as err:
archinstall.log(err, fg="red")
@@ -27,8 +27,8 @@ def ask_user_questions():
# Before continuing, set the preferred keyboard layout/language in the current terminal.
# This will just help the user with the next following questions.
- if len(archinstall.arguments['keyboard-language']):
- archinstall.set_keyboard_language(archinstall.arguments['keyboard-language'])
+ if len(archinstall.arguments['keyboard-layout']):
+ archinstall.set_keyboard_language(archinstall.arguments['keyboard-layout'])
# Set which region to download packages from during the installation
@@ -64,6 +64,11 @@ def ask_user_questions():
if (passwd := archinstall.get_password(prompt='Enter disk encryption password (leave blank for no encryption): ')):
archinstall.arguments['!encryption-password'] = passwd
+ # If no partitions was marked as encrypted (rare), but a password was supplied -
+ # then we need to identify which partitions to encrypt. This will default to / (root) if only
+ # root and boot are detected.
+ if len(list(archinstall.encrypted_partitions(archinstall.storage['disk_layouts']))) == 0:
+ archinstall.storage['disk_layouts'] = archinstall.select_encrypted_partitions(archinstall.storage['disk_layouts'])
# Ask which boot-loader to use (will only ask if we're in BIOS (non-efi) mode)
archinstall.arguments["bootloader"] = archinstall.ask_for_bootloader()