Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-09-12 15:42:13 +0200
committerAnton Hvornum <anton@hvornum.se>2021-09-12 15:42:13 +0200
commit995edaf316ab42cec5adbc50b32c133ae2ec77b6 (patch)
treeea7f6685ae9b73352a04bd3ca0e7ba21cacf8d5f /archinstall
parentea41a6c2685a1f1d47df708862e27b5b5768c41d (diff)
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.
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/installer.py13
1 files changed, 7 insertions, 6 deletions
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}")