Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-06-13 10:34:12 +0200
committerAnton Hvornum <anton@hvornum.se>2021-06-13 10:34:12 +0200
commit8cc51cbcdc95de86385c570cf75b4ffaa746b4f1 (patch)
treec74ab03f87ed4fa50635dd194da02e566679b582
parent858171986c2b1111c52df4b7398c366dd15921f0 (diff)
parentba60d82bb91fcbcb1ae168709812bf0b71c35523 (diff)
Merge branch 'torxed-rework-partitioning' of github.com:archlinux/archinstall into torxed-rework-partitioning
-rw-r--r--archinstall/lib/disk.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index abe34af1..1a592690 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -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)