From 995edaf316ab42cec5adbc50b32c133ae2ec77b6 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Sun, 12 Sep 2021 15:42:13 +0200 Subject: Removed legacy need to add_bootloader `add_bootloader` no longer needs to have a harddrive given as a argument. It will (and should) auto-detect what's mounted in the `self.target` (aka mountpoint) of the installation. --- archinstall/lib/installer.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 3efb0499..f206946c 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -429,7 +429,7 @@ class Installer: return True - def add_bootloader(self, _device, bootloader='systemd-bootctl'): + def add_bootloader(self, bootloader='systemd-bootctl'): for plugin in plugins.values(): if hasattr(plugin, 'on_add_bootloader'): # Allow plugins to override the boot-loader handling. @@ -535,14 +535,15 @@ class Installer: SysCommand(f"/usr/bin/arch-chroot {self.target} {enable_CRYPTODISK} {_file}") if has_uefi(): - self.pacstrap('efibootmgr') - o = b''.join(SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB')) - SysCommand('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg') + self.pacstrap('efibootmgr') # TODO: Do we need? + SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB') + SysCommand(f'/usr/bin/arch-chroot {self.target} grub-mkconfig -o /boot/grub/grub.cfg') self.helper_flags['bootloader'] = True return True else: - o = b''.join(SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=i386-pc --recheck {_device.path}')) - SysCommand('/usr/bin/arch-chroot /mnt grub-mkconfig -o /boot/grub/grub.cfg') + boot_partition = filesystem.find_partition(mountpoint=f"{self.target}/boot") + SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=i386-pc --recheck {boot_partition.path}') + SysCommand(f'/usr/bin/arch-chroot {self.target} grub-mkconfig -o /boot/grub/grub.cfg') self.helper_flags['bootloader'] = True else: raise RequirementError(f"Unknown (or not yet implemented) bootloader requested: {bootloader}") -- cgit v1.2.3-70-g09d2 From 168379d43dce60e71e999722aa6a49fd5679891f Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Mon, 13 Sep 2021 14:55:09 +0000 Subject: Added --noconfirm to pacstrap and increased logging verbosity when packages fail, and adding a exception so that the installation doesn't continue silently. This causes too much confusion (even tho I liked the idea that people could recover the missing parts without having to re-run the installer for subsequent steps. --- archinstall/lib/installer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 3efb0499..cb5b24a0 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -163,10 +163,12 @@ class Installer: self.log(f'Installing packages: {packages}', level=logging.INFO) if (sync_mirrors := SysCommand('/usr/bin/pacman -Syy')).exit_code == 0: - if (pacstrap := SysCommand(f'/usr/bin/pacstrap {self.target} {" ".join(packages)}', peak_output=True)).exit_code == 0: + if (pacstrap := SysCommand(f'/usr/bin/pacstrap --noconfirm {self.target} {" ".join(packages)}', peak_output=True)).exit_code == 0: return True else: - self.log(f'Could not strap in packages: {pacstrap.exit_code}', level=logging.INFO) + self.log(f'Could not strap in packages: {pacstrap}', level=logging.ERROR, fg="red") + self.log(f'Could not strap in packages: {pacstrap.exit_code}', level=logging.ERROR, fg="red") + raise RequirementError("Pacstrap failed. See /var/log/archinstall/install.log or above message for error details.") else: self.log(f'Could not sync mirrors: {sync_mirrors.exit_code}', level=logging.INFO) -- cgit v1.2.3-70-g09d2 From 6d2a2f327c874f38233d6f52bc27d5678586567a Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 14 Sep 2021 11:47:16 +0000 Subject: Moved --noconfirm at the end of the pacstrap command to get piped properly to pacman inside pacstrap. --- archinstall/lib/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 1ade75b3..62dc933d 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -163,7 +163,7 @@ class Installer: self.log(f'Installing packages: {packages}', level=logging.INFO) if (sync_mirrors := SysCommand('/usr/bin/pacman -Syy')).exit_code == 0: - if (pacstrap := SysCommand(f'/usr/bin/pacstrap --noconfirm {self.target} {" ".join(packages)}', peak_output=True)).exit_code == 0: + if (pacstrap := SysCommand(f'/usr/bin/pacstrap {self.target} {" ".join(packages)} --noconfirm', peak_output=True)).exit_code == 0: return True else: self.log(f'Could not strap in packages: {pacstrap}', level=logging.ERROR, fg="red") -- cgit v1.2.3-70-g09d2 From e21cf77e77119cc894ab6893a96cfd361106fc15 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Fri, 17 Sep 2021 23:52:10 +0200 Subject: Removing /tmp from fstab Since systemd takes care of mounting /tmp as a tmpt, there's no point in having a manual entry in fstab. --- archinstall/lib/installer.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 62dc933d..2aac8510 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -403,9 +403,6 @@ class Installer: self.pacstrap(self.base_packages) self.helper_flags['base-strapped'] = True - with open(f"{self.target}/etc/fstab", "a") as fstab: - fstab.write("\ntmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0\n") # Redundant \n at the start? who knows? - # TODO: Support locale and timezone # os.remove(f'{self.target}/etc/localtime') # sys_command(f'/usr/bin/arch-chroot {self.target} ln -s /usr/share/zoneinfo/{localtime} /etc/localtime') -- cgit v1.2.3-70-g09d2