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@hvornum.se>2021-06-13 14:25:07 +0200
committerAnton Hvornum <anton@hvornum.se>2021-06-13 14:25:07 +0200
commitd76760b45fcc085f1d878465e5293de2740a70b4 (patch)
tree85660842f569683c3159fbfcfd19687633d8c6c8 /archinstall/lib/user_interaction.py
parentaf790faf7af3412f13bb77b7c5ea2c85f72a1a47 (diff)
Removed old safety logics for partitions. Partitions will now always be formatted when .format() is called on them. The safety now lay in the code parsing the declerative partition layouts. Also added the encrypt/mount logic for encrypted partitions, which by default will be unencrypted unless a password is specified.
Diffstat (limited to 'archinstall/lib/user_interaction.py')
-rw-r--r--archinstall/lib/user_interaction.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index 07f98328..da9f9809 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -9,7 +9,7 @@ import signal
import sys
import time
-from .disk import BlockDevice, valid_fs_type, suggest_single_disk_layout, suggest_multi_disk_layout
+from .disk import BlockDevice, valid_fs_type, find_partition_by_mountpoint, suggest_single_disk_layout, suggest_multi_disk_layout
from .exceptions import *
from .general import SysCommand
from .hardware import AVAILABLE_GFX_DRIVERS, has_uefi
@@ -190,18 +190,19 @@ 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:
- 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
+def select_encrypted_partitions(block_devices :dict, password :str) -> dict:
+ root = find_partition_by_mountpoint(block_devices, '/')
+ root['encrypted'] = True
+ root['password'] = password
+
+ return block_devices
- options = []
- for partition in blockdevices.values():
- options.append({key: val for key, val in partition.items() if val})
+ # TODO: Next version perhaps we can support multiple encrypted partitions
+ #options = []
+ #for partition in block_devices.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): "))
+ #print(generic_multi_select(options, f"Choose which partitions to encrypt (leave blank when done): "))
class MiniCurses:
def __init__(self, width, height):