Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/hardware.py
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-06-02 21:10:41 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-06-02 21:17:54 -0400
commite90b17ca1cab9287529eac7576c4e031d18a1f04 (patch)
treeb728882fa159d1a3a6bca75a16bcd6eb6706848c /archinstall/lib/hardware.py
parentc851a38a9e3e14e8cc9dee63d6531ba33b6bb262 (diff)
Add hardware logging to beginning of installation
Diffstat (limited to 'archinstall/lib/hardware.py')
-rw-r--r--archinstall/lib/hardware.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index 6f05f620..180d0b75 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -119,12 +119,12 @@ def cpu_model() -> Optional[str]:
def sys_vendor() -> Optional[str]:
with open(f"/sys/devices/virtual/dmi/id/sys_vendor") as vendor:
- return vendor.read()
+ return vendor.read().strip()
def product_name() -> Optional[str]:
with open(f"/sys/devices/virtual/dmi/id/product_name") as product:
- return product.read()
+ return product.read().strip()
def mem_info():
@@ -144,6 +144,10 @@ def mem_total() -> Optional[str]:
return mem_info()['MemTotal']
+def virtualization() -> Optional[str]:
+ return str(SysCommand("systemd-detect-virt")).strip('\r\n')
+
+
def is_vm() -> bool:
try:
# systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine