index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Victor Gavro <vgavro@gmail.com> | 2022-02-05 00:58:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 23:58:44 +0100 |
commit | 68c2988358426e8d0074479cef539ddadc2a31e6 (patch) | |
tree | 17ee0aa35065767a97c0b7686ff07378e722fce8 /archinstall/lib/disk/partition.py | |
parent | 85f2938df9e7e34a08fd1b1acc7c8b41d14ccb54 (diff) |
-rw-r--r-- | archinstall/lib/disk/partition.py | 9 |
diff --git a/archinstall/lib/disk/partition.py b/archinstall/lib/disk/partition.py index afd34f20..7bfde64c 100644 --- a/archinstall/lib/disk/partition.py +++ b/archinstall/lib/disk/partition.py @@ -114,6 +114,7 @@ class Partition: @property def end(self) -> Optional[str]: + # TODO: actually this is size in sectors unit # TODO: Verify that the logic holds up, that 'size' is the size without 'start' added to it. output = json.loads(SysCommand(f"sfdisk --json {self.block_device.path}").decode('UTF-8')) @@ -122,6 +123,14 @@ class Partition: return partition['size'] # * self.sector_size @property + def end_sectors(self) -> Optional[str]: + output = json.loads(SysCommand(f"sfdisk --json {self.block_device.path}").decode('UTF-8')) + + for partition in output.get('partitiontable', {}).get('partitions', []): + if partition['node'] == self.path: + return partition['start'] + partition['size'] + + @property def size(self) -> Optional[float]: for i in range(storage['DISK_RETRY_ATTEMPTS']): self.partprobe() |