Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/installer.py
diff options
context:
space:
mode:
authorHugo Ankarloo <hugo@ilait.se>2021-09-20 21:52:14 +0200
committerHugo Ankarloo <hugo@ilait.se>2021-09-20 21:52:14 +0200
commite71a41377d2d97fce98afc4f64ed5f1caa830ec9 (patch)
tree162af14879b6fcb478359af5fdac05a100122744 /archinstall/lib/installer.py
parent26244212cfe2d2ecbf7c791c811deb499e7a3bcf (diff)
parentc33ab997c9ceff39924ce80018b620ba6b391f6a (diff)
Merge branch 'master' into svintooo-fix
Sync branch svintooo-fix with latest code changes on master.
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 3efb0499..2aac8510 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 {self.target} {" ".join(packages)} --noconfirm', 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)
@@ -401,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')
@@ -429,7 +428,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 +534,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}")