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:
authorRichard Neumann <mail@richard-neumann.de>2021-08-20 18:16:00 +0200
committerRichard Neumann <mail@richard-neumann.de>2021-08-20 18:16:00 +0200
commit61947ab944aec76d60ee921ff3c451b7d02a5df2 (patch)
tree0c28a17dde9a7f81c6befaf5413076e4d2bfd92a /archinstall/lib/hardware.py
parentb8ede1b333e3dd4d2a6c3553685e5026dfd2c346 (diff)
Rewrite CPU vendor detection functions
Use cpuinfo() function rather than a subprocess.
Diffstat (limited to 'archinstall/lib/hardware.py')
-rw-r--r--archinstall/lib/hardware.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index 56a9fa11..eaf01f40 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -1,6 +1,5 @@
import json
import os
-import subprocess
from pathlib import Path
from typing import Iterator, Optional
@@ -82,15 +81,11 @@ def has_wifi() -> bool:
def has_amd_cpu() -> bool:
- if subprocess.check_output("lscpu | grep AMD", shell=True).strip().decode():
- return True
- return False
+ return any(cpu.get("vendor_id") == "AuthenticAMD" for cpu in cpuinfo())
def has_intel_cpu() -> bool:
- if subprocess.check_output("lscpu | grep Intel", shell=True).strip().decode():
- return True
- return False
+ return any(cpu.get("vendor_id") == "GenuineIntel" for cpu in cpuinfo())
def has_uefi() -> bool: