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-03-14 15:32:22 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-14 15:32:22 +0100
commit32ab44e6dab9c2374fa65a1d76af5ab0fa746ce6 (patch)
tree7a0728da090c66dcaf85cead871c719dfa03db44 /examples
parent502968b579160b4df9f5cbd66c8f6e96c2f8d2b4 (diff)
More error handling to encrypted vs not encrypted partitions.
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 96243a1b..cf3610a1 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -248,8 +248,11 @@ def perform_installation_steps():
# which ones are safe to format, and format those.
for partition in archinstall.arguments['harddrive']:
if partition.safe_to_format():
- if partition.encrypted:
- partition.encrypt(password=archinstall.arguments.get('!encryption-password', None))
+ # Partition might be marked as encrypted due to the filesystem type crypt_LUKS
+ # But we might have omitted the encryption password question to skip encryption.
+ # In which case partition.encrypted will be true, but passwd will be false.
+ if partition.encrypted and passwd := archinstall.arguments.get('!encryption-password', None):
+ partition.encrypt(password=passwd)
else:
partition.format()
else: