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:
Diffstat (limited to 'archinstall/lib/hardware.py')
-rw-r--r--archinstall/lib/hardware.py22
1 files changed, 8 insertions, 14 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index 5c669a1e..b58e45af 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -99,10 +99,10 @@ def has_wifi() -> bool:
def has_amd_cpu() -> bool:
- return any(cpu.get("vendor_id") == "AuthenticAMD" for cpu in cpuinfo())
+ return any(cpu.get("vendor_id") == "AuthenticAMD" for cpu in cpuinfo())
def has_intel_cpu() -> bool:
- return any(cpu.get("vendor_id") == "GenuineIntel" for cpu in cpuinfo())
+ return any(cpu.get("vendor_id") == "GenuineIntel" for cpu in cpuinfo())
def has_uefi() -> bool:
return os.path.isdir('/sys/firmware/efi')
@@ -130,23 +130,17 @@ def has_intel_graphics() -> bool:
def cpu_vendor() -> Optional[str]:
- cpu_info_raw = SysCommand("lscpu -J")
- cpu_info = json.loads(b"".join(cpu_info_raw).decode('UTF-8'))['lscpu']
+ for cpu in cpuinfo():
+ return cpu.get("vendor_id")
- for info in cpu_info:
- if info.get('field', None) == "Vendor ID:":
- return info.get('data', None)
- return
+ return None
def cpu_model() -> Optional[str]:
- cpu_info_raw = SysCommand("lscpu -J")
- cpu_info = json.loads(b"".join(cpu_info_raw).decode('UTF-8'))['lscpu']
+ for cpu in cpuinfo():
+ return cpu.get("model name")
- for info in cpu_info:
- if info.get('field', None) == "Model name:":
- return info.get('data', None)
- return
+ return None
def sys_vendor() -> Optional[str]: