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@hvornum.se>2021-06-13 14:25:07 +0200
committerAnton Hvornum <anton@hvornum.se>2021-06-13 14:25:07 +0200
commitd76760b45fcc085f1d878465e5293de2740a70b4 (patch)
tree85660842f569683c3159fbfcfd19687633d8c6c8 /examples
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 'examples')
-rw-r--r--examples/guided.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 14cbe0a1..4136ca6e 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -87,11 +87,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'])
+ if archinstall.arguments['harddrives'] and archinstall.arguments.get('!encryption-password', None):
+ # 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).
+ if len(list(archinstall.encrypted_partitions(archinstall.storage['disk_layouts']))) == 0:
+ archinstall.storage['disk_layouts'] = archinstall.select_encrypted_partitions(archinstall.storage['disk_layouts'], archinstall.arguments['!encryption-password'])
# Ask which boot-loader to use (will only ask if we're in BIOS (non-efi) mode)
if not archinstall.arguments.get("bootloader", None):