Added error handling for unlocking an old partition (autodetect feature).

This commit is contained in:
Anton Hvornum 2021-03-14 15:22:25 +01:00
parent dabaebe221
commit b495b3328e
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 5 additions and 1 deletions

View File

@ -91,7 +91,11 @@ def ask_user_questions():
new_filesystem = input(f"Enter a valid filesystem for {partition} (leave blank for {partition.filesystem}): ").strip(' ')
if len(new_filesystem) <= 0:
if partition.encrypted and partition.filesystem == 'crypto_LUKS':
if (autodetected_filesystem := partition.detect_inner_filesystem(archinstall.arguments.get('!encryption-password', None))):
old_password = archinstall.arguments.get('!encryption-password', None)
if not old_password:
old_password = input(f'Enter the old encryption password for {partition}: ')
if (autodetected_filesystem := partition.detect_inner_filesystem(old_password)):
new_filesystem = autodetected_filesystem
else:
archinstall.log(f"Could not auto-detect the filesystem inside the encrypted volume.", fg='red')