Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/luks.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-14 13:54:01 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-14 13:54:01 +0100
commit7ac68b2436b3a542d8004b26defb89ebb2905fa9 (patch)
tree63ae45379c2608eb5100551f9570fadb468b7568 /archinstall/lib/luks.py
parent1c6d70571481e30651f62f216fcc9653e03c9c62 (diff)
Removed redundant error handling as well as added some more debug logs.
Diffstat (limited to 'archinstall/lib/luks.py')
-rw-r--r--archinstall/lib/luks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/archinstall/lib/luks.py b/archinstall/lib/luks.py
index f4c787ab..ff5e2057 100644
--- a/archinstall/lib/luks.py
+++ b/archinstall/lib/luks.py
@@ -69,6 +69,7 @@ class luks2():
cmd_handle = sys_command(f'/usr/bin/cryptsetup -q -v --type luks2 --pbkdf argon2i --hash {hash_type} --key-size {key_size} --iter-time {iter_time} --key-file {os.path.abspath(key_file)} --use-urandom luksFormat {partition.path}')
except SysCallError as err:
if err.exit_code == 256:
+ log(f'{partition} is being used, trying to unmount and crypt-close the device and running one more attempt at encrypting the device.', level=LOG_LEVELS.Debug)
# Partition was in use, unmount it and try again
partition.unmount()
@@ -81,9 +82,11 @@ class luks2():
for child in children:
# Unmount the child location
if child_mountpoint := child.get('mountpoint', None):
+ log(f'Unmounting {child_mountpoint}', level=LOG_LEVELS.Debug)
sys_command(f"umount {child_mountpoint}")
# And close it if possible.
+ log(f"Closing crypt device {child['name']}", level=LOG_LEVELS.Debug)
sys_command(f"cryptsetup close {child['name']}")
# Then try again to set up the crypt-device