Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-05-18 00:28:59 +0200
committerAnton Hvornum <anton@hvornum.se>2021-05-18 00:28:59 +0200
commitd0bc166e7e9f381be15791ebd1d0150ba17a66c0 (patch)
tree9361eb6592797c88a42b324fdb476dc4cb453362 /archinstall/lib
parentba939188cf6ee349048935549bbb054348caf058 (diff)
Compliment to #461 and #459: is_vm() also outputted 'kvm'. This should fix that.
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/hardware.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index 8009e708..7c164096 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -109,9 +109,12 @@ def cpu_vendor() -> Optional[str]:
def is_vm() -> bool:
try:
- subprocess.check_call(["systemd-detect-virt"]) # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
- return True
+ # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
+ if b"".join(SysCommand("systemd-detect-virt")).lower() != b"none":
+ return True
except:
- return False
+ pass
+
+ return False
# TODO: Add more identifiers