Partition.boot works now for GPT and MBR disks (issue #1061) (#1063)

This commit is contained in:
Werner Llácer 2022-04-03 23:17:25 +02:00 committed by GitHub
parent 656047163a
commit 57b16d5468
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -172,7 +172,8 @@ class Partition:
for partition in output.get('partitiontable', {}).get('partitions', []):
if partition['node'] == self.path:
return partition.get('bootable', False)
# first condition is for MBR disks, second for GPT disks
return partition.get('bootable', False) or partition.get('type','') == 'C12A7328-F81F-11D2-BA4B-00A0C93EC93B'
return False
@ -440,7 +441,7 @@ class Partition:
def unmount(self) -> bool:
worker = SysCommand(f"/usr/bin/umount {self.path}")
# Without to much research, it seams that low error codes are errors.
# And above 8k is indicators such as "/dev/x not mounted.".
# So anything in between 0 and 8k are errors (?).