index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | advaithm <advaith.madhukar@gmail.com> | 2021-04-07 17:00:55 +0530 |
---|---|---|
committer | advaithm <advaith.madhukar@gmail.com> | 2021-04-07 17:00:55 +0530 |
commit | d9480ee8a085409145de0d0fa4457ee2e144c444 (patch) | |
tree | 56f8eecd2aac3a791644799db03b146931666186 /archinstall/lib | |
parent | 86b4a5dc12908b27896e385bb0a51a69551e9482 (diff) |
-rw-r--r-- | archinstall/lib/hardware.py | 8 |
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index 687b4a74..3da333de 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -41,4 +41,12 @@ def cpuVendor()-> Optional[str]: if info.get('field',None): if info.get('field',None) == "Vendor ID:": return info.get('data',None) + +def isVM() -> bool: + try: + subprocess.check_call(["systemd-detect-virt"]) # systemd-detect-virt issues a none 0 exit code if it is not on a virtual machine + return True + except: + return False + # TODO: Add more identifiers |