Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-11-11 09:39:56 +0000
committerAnton Hvornum <anton.feeds@gmail.com>2021-11-11 09:39:56 +0000
commit9fe4dbc50e3a85e16af655b3f6071e35db837ae4 (patch)
tree125d90a5b4b92fe8e51c57177c364095e6cfb1eb /archinstall/lib
parentdf59809206e74b7236cce805437a02688711b121 (diff)
Modified last few places where password gets set.
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/installer.py4
-rw-r--r--archinstall/lib/user_interaction.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 1318cb16..3b8f9612 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -176,7 +176,9 @@ class Installer:
for mountpoint in sorted(mountpoints.keys()):
if mountpoints[mountpoint]['encrypted']:
loopdev = storage.get('ENC_IDENTIFIER', 'ai') + 'loop'
- password = mountpoints[mountpoint]['password']
+ if not (password := mountpoints[mountpoint].get('!password', None)):
+ raise RequirementError(f"Missing mountpoint {mountpoint} encryption password in layout: {mountpoints[mountpoint]}")
+
with luks2(mountpoints[mountpoint]['device_instance'], loopdev, password, auto_unmount=False) as unlocked_device:
unlocked_device.mount(f"{self.target}{mountpoint}")
diff --git a/archinstall/lib/user_interaction.py b/archinstall/lib/user_interaction.py
index e62d8c6c..c8b3fd91 100644
--- a/archinstall/lib/user_interaction.py
+++ b/archinstall/lib/user_interaction.py
@@ -195,7 +195,7 @@ def generic_multi_select(options, text="Select one or more of the options above
def select_encrypted_partitions(block_devices :dict, password :str) -> dict:
root = find_partition_by_mountpoint(block_devices, '/')
root['encrypted'] = True
- root['password'] = password
+ root['!password'] = password
return block_devices