Merge pull request #461 from archlinux/torxed-fix-459
Unlink existing ucodes when strapping them in.
This commit is contained in:
commit
ba939188cf
|
|
@ -98,11 +98,12 @@ def has_intel_graphics() -> bool:
|
||||||
|
|
||||||
|
|
||||||
def cpu_vendor() -> Optional[str]:
|
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:
|
for info in cpu_info:
|
||||||
if info.get('field', None):
|
if info.get('field', None) == "Vendor ID:":
|
||||||
if info.get('field', None) == "Vendor ID:":
|
return info.get('data', None)
|
||||||
return info.get('data', None)
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -332,10 +332,14 @@ class Installer:
|
||||||
vendor = cpu_vendor()
|
vendor = cpu_vendor()
|
||||||
if vendor == "AuthenticAMD":
|
if vendor == "AuthenticAMD":
|
||||||
self.base_packages.append("amd-ucode")
|
self.base_packages.append("amd-ucode")
|
||||||
|
if (ucode := pathlib.Path(f"{self.target}/boot/amd-ucode.img")).exists():
|
||||||
|
ucode.unlink()
|
||||||
elif vendor == "GenuineIntel":
|
elif vendor == "GenuineIntel":
|
||||||
self.base_packages.append("intel-ucode")
|
self.base_packages.append("intel-ucode")
|
||||||
|
if (ucode := pathlib.Path(f"{self.target}/boot/intel-ucode.img")).exists():
|
||||||
|
ucode.unlink()
|
||||||
else:
|
else:
|
||||||
self.log("Unknown cpu vendor not installing ucode")
|
self.log(f"Unknown CPU vendor '{vendor}' detected. Archinstall won't install any ucode.", level=logging.DEBUG)
|
||||||
|
|
||||||
self.pacstrap(self.base_packages)
|
self.pacstrap(self.base_packages)
|
||||||
self.helper_flags['base-strapped'] = True
|
self.helper_flags['base-strapped'] = True
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue