From e23fffe288690cfd35774f1e8ddaf74b678855ac Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 17 May 2021 21:59:42 +0200 Subject: Reverted 2afc317. Using Path().unlink() instead on ucode if they exist. --- archinstall/lib/installer.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'archinstall/lib') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 4b1cda7b..6150ad00 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -130,23 +130,13 @@ class Installer: def post_install_check(self, *args, **kwargs): return [step for step, flag in self.helper_flags.items() if flag is False] - def pacstrap(self, *packages, options=[], **kwargs): + def pacstrap(self, *packages, **kwargs): if type(packages[0]) in (list, tuple): packages = packages[0] - if type(packages) != list: # Redundant? - packages = packages.split(' ') - self.log(f'Installing packages: {packages}', level=logging.INFO) - cmd_struct = [ - "/usr/bin/pacman", - *options, - self.target, - *packages - ] - if (sync_mirrors := SysCommand('/usr/bin/pacman -Syy')).exit_code == 0: - if (pacstrap := SysCommand(cmd_struct, **kwargs)).exit_code == 0: + if (pacstrap := SysCommand(f'/usr/bin/pacstrap {self.target} {" ".join(packages)}', **kwargs)).exit_code == 0: return True else: self.log(f'Could not strap in packages: {pacstrap.exit_code}', level=logging.INFO) @@ -342,12 +332,16 @@ 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("Unknown cpu vendor not installing ucode", level=logging.INFO) - self.pacstrap(self.base_packages, options=['--overwrite', "/boot/*-ucode.img"]) + self.pacstrap(self.base_packages) self.helper_flags['base-strapped'] = True with open(f"{self.target}/etc/fstab", "a") as fstab: -- cgit v1.2.3-70-g09d2