Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-05-17 22:22:14 +0000
committerGitHub <noreply@github.com>2021-05-17 22:22:14 +0000
commitba939188cf6ee349048935549bbb054348caf058 (patch)
treeb930115f73e5cf1452fe62efd4f38498da126765
parent4755de73197a96139e15f9b0d0673c348912dddc (diff)
parente0561641f6d801d4f37d28bc578e0cec6681f4fc (diff)
Merge pull request #461 from archlinux/torxed-fix-459
Unlink existing ucodes when strapping them in.
-rw-r--r--archinstall/lib/hardware.py9
-rw-r--r--archinstall/lib/installer.py6
2 files changed, 10 insertions, 5 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index f527b5da..8009e708 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -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
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index aa2ea920..103569fb 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -332,10 +332,14 @@ class Installer:
vendor = cpu_vendor()
if vendor == "AuthenticAMD":
self.base_packages.append("amd-ucode")
+ if (ucode := pathlib.Path(f"{self.target}/boot/amd-ucode.img")).exists():
+ ucode.unlink()
elif vendor == "GenuineIntel":
self.base_packages.append("intel-ucode")
+ if (ucode := pathlib.Path(f"{self.target}/boot/intel-ucode.img")).exists():
+ ucode.unlink()
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.helper_flags['base-strapped'] = True