Converted from subprocess.check_output() to SysCommand() to hide cpu_vendor() output.

This commit is contained in:
Anton Hvornum 2021-05-18 00:21:48 +02:00
parent e23fffe288
commit e0561641f6
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
2 changed files with 6 additions and 5 deletions

View File

@ -98,11 +98,12 @@ def has_intel_graphics() -> bool:
def cpu_vendor() -> Optional[str]:
cpu_info = json.loads(subprocess.check_output("lscpu -J", shell=True).decode('utf-8'))['lscpu']
cpu_info_raw = SysCommand("lscpu -J")
cpu_info = json.loads(b"".join(cpu_info_raw).decode('UTF-8'))['lscpu']
for info in cpu_info:
if info.get('field', None):
if info.get('field', None) == "Vendor ID:":
return info.get('data', None)
if info.get('field', None) == "Vendor ID:":
return info.get('data', None)
return None

View File

@ -339,7 +339,7 @@ class Installer:
if (ucode := pathlib.Path(f"{self.target}/boot/intel-ucode.img")).exists():
ucode.unlink()
else:
self.log("Unknown cpu vendor not installing ucode", level=logging.INFO)
self.log(f"Unknown CPU vendor '{vendor}' detected. Archinstall won't install any ucode.", level=logging.DEBUG)
self.pacstrap(self.base_packages)
self.helper_flags['base-strapped'] = True