From d76760b45fcc085f1d878465e5293de2740a70b4 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 13 Jun 2021 14:25:07 +0200 Subject: 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. --- examples/guided.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples') 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): -- cgit v1.2.3-54-g00ecf