Merge branch 'torxed-rework-partitioning' of github.com:archlinux/archinstall into torxed-rework-partitioning

This commit is contained in:
Anton Hvornum 2021-06-13 10:34:12 +02:00
commit 8cc51cbcdc
1 changed files with 14 additions and 0 deletions

View File

@ -228,6 +228,20 @@ class BlockDevice:
return float(device['size'][:-1])
@property
def bus_type(self):
output = json.loads(SysCommand(f"lsblk --json -o+ROTA,TRAN {self.path}").decode('UTF-8'))
for device in output['blockdevices']:
return device['tran']
@property
def spinning(self):
output = json.loads(SysCommand(f"lsblk --json -o+ROTA,TRAN {self.path}").decode('UTF-8'))
for device in output['blockdevices']:
return device['rota'] is True
def has_partitions(self):
return len(self.partitions)