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 16:29:14 +0200
committerGitHub <noreply@github.com>2021-09-06 16:29:14 +0200
commit4505c3a11ff8a6bda21fc0d86a621b0cb86ee498 (patch)
tree78798ec0a6832b369fcb2181c1ad6d39512a16dc /archinstall
parent81f3ccad40594fa9e8b4b71d4fae48fe459b6e59 (diff)
parent8841e209ee7d0cadb7b7c68e5001b4c006d3714b (diff)
Merge pull request #622 from conqp/refactor_cpu_data_detection
Refactor cpu data detection
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/hardware.py18
1 files changed, 6 insertions, 12 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index 56444eeb..416045c4 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -111,23 +111,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]: