Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-09-06 15:42:15 +0200
committerGitHub <noreply@github.com>2021-09-06 15:42:15 +0200
commitbf18260510747da74e405bf3197426f555a9619b (patch)
treea7db8c6ad23d8f553bda35056b9e07319cbba379 /archinstall
parent0f5e0c0d3f34fd5e8802999e7c73efaa3ebb8895 (diff)
parent8d7ccde1626afbf358e38caa2733aff554b51ea9 (diff)
Merge pull request #605 from CYPT71/patch-1
Update hardware.py
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/hardware.py26
1 files changed, 11 insertions, 15 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index b1ac516d..03335e45 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -63,17 +63,20 @@ def has_wifi() -> bool:
def has_amd_cpu() -> bool:
- if subprocess.check_output("lscpu | grep AMD", shell=True).strip().decode():
- return True
+ try:
+ return subprocess.check_output("lscpu | grep AMD", shell=True).strip().decode()
+ except:
+ pass
return False
def has_intel_cpu() -> bool:
- if subprocess.check_output("lscpu | grep Intel", shell=True).strip().decode():
- return True
+ try:
+ return subprocess.check_output("lscpu | grep Intel", shell=True).strip().decode()
+ except:
+ pass
return False
-
def has_uefi() -> bool:
return os.path.isdir('/sys/firmware/efi')
@@ -106,7 +109,7 @@ def cpu_vendor() -> Optional[str]:
for info in cpu_info:
if info.get('field', None) == "Vendor ID:":
return info.get('data', None)
- return None
+ return
def cpu_model() -> Optional[str]:
@@ -116,7 +119,7 @@ def cpu_model() -> Optional[str]:
for info in cpu_info:
if info.get('field', None) == "Model name:":
return info.get('data', None)
- return None
+ return
def sys_vendor() -> Optional[str]:
@@ -154,13 +157,6 @@ def virtualization() -> Optional[str]:
def is_vm() -> bool:
- try:
- # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
- if b"none" not in b"".join(SysCommand("systemd-detect-virt")).lower():
- return True
- except:
- pass
-
- return False
+ return b"none" not in b"".join(SysCommand("systemd-detect-virt")).lower()
# TODO: Add more identifiers