index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Dylan Taylor <dylan@dylanmtaylor.com> | 2021-06-02 21:10:41 -0400 |
---|---|---|
committer | Dylan Taylor <dylan@dylanmtaylor.com> | 2021-06-02 21:17:54 -0400 |
commit | e90b17ca1cab9287529eac7576c4e031d18a1f04 (patch) | |
tree | b728882fa159d1a3a6bca75a16bcd6eb6706848c /archinstall/lib/hardware.py | |
parent | c851a38a9e3e14e8cc9dee63d6531ba33b6bb262 (diff) |
-rw-r--r-- | archinstall/lib/hardware.py | 8 |
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 |