encrypted devices won't always report as a child to a device, can't reliably look for a 'parent' of a encrypted drive when it doesn't show up. Hence, the DiskError() can't be raised just because we can't find a parent. The parent should be the current path if no other option was found.

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

View File

@ -187,7 +187,8 @@ class Partition():
for blockdevice in json.loads(b''.join(sys_command('lsblk -J')).decode('UTF-8'))['blockdevices']:
if (parent := self.find_parent_of(blockdevice, os.path.basename(self.path))):
return f"/dev/{parent}"
raise DiskError(f'Could not find appropriate parent for encrypted partition {self}')
# raise DiskError(f'Could not find appropriate parent for encrypted partition {self}')
return self.path
def detect_inner_filesystem(self, password):
log(f'Trying to detect inner filesystem format on {self} (This might take a while)', level=LOG_LEVELS.Info)