This partially addresses #151. Which might require more than just the path being returned. As the blkid might not be correctly identifying it in the bootloader step. But we'll have to test and see.

This commit is contained in:
Anton Hvornum 2021-04-03 14:59:40 +02:00
parent 7ae9696f13
commit 67bb00c655
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 5 additions and 0 deletions

View File

@ -78,10 +78,15 @@ class BlockDevice():
return drive['back-file']
elif self.info['type'] == 'disk':
return self.path
elif self.info['type'][:4] == 'raid':
# This should catch /dev/md## raid devices
return self.path
elif self.info['type'] == 'crypt':
if 'pkname' not in self.info:
raise DiskError(f'A crypt device ({self.path}) without a parent kernel device name.')
return f"/dev/{self.info['pkname']}"
else:
raise DiskError(f"Could not locate actual block device path for {self.path}")
# if not stat.S_ISBLK(os.stat(full_path).st_mode):
# raise DiskError(f'Selected disk "{full_path}" is not a block device.')