Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/user_interaction.py
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 /archinstall/lib/user_interaction.py
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 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index ab95909f..91720065 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -150,6 +150,20 @@ def generic_multi_select(options, text="Select one or more of the options above
sys.stdout.flush()
return selected_options
+def select_encrypted_partitions(blockdevices :dict) -> dict:
+ print(blockdevices[0])
+
+ if len(blockdevices) == 1:
+ if len(blockdevices[0]['partitions']) == 2:
+ root = find_partition_by_mountpoint(blockdevices[0]['partitions'], '/')
+ blockdevices[0]['partitions'][root]['encrypted'] = True
+ return True
+
+ options = []
+ for partition in blockdevices.values():
+ options.append({key: val for key, val in partition.items() if val})
+
+ print(generic_multi_select(options, f"Choose which partitions to encrypt (leave blank when done): "))
class MiniCurses():
def __init__(self, width, height):
@@ -594,7 +608,7 @@ def wipe_and_create_partitions(block_device):
else:
partition_type = 'msdos'
- partitions_result = [part.__dump__() for part in block_device.partitions.values()]
+ partitions_result = [] # Test code: [part.__dump__() for part in block_device.partitions.values()]
suggested_layout = [
{ # Boot
"type" : "primary",