Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/installer.py52
1 files changed, 25 insertions, 27 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index d010e8a1..c32069c3 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -876,45 +876,43 @@ class Installer:
info(f"GRUB boot partition: {boot_partition.dev_path}")
+ command = [
+ '/usr/bin/arch-chroot',
+ str(self.target),
+ 'grub-install',
+ '--debug'
+ ]
+
if SysInfo.has_uefi():
self.pacman.strap('efibootmgr') # TODO: Do we need? Yes, but remove from minimal_installation() instead?
+ add_options = [
+ '--target=x86_64-efi',
+ f'--efi-directory={boot_partition.mountpoint}',
+ '--bootloader-id=GRUB',
+ '--removable'
+ ]
+
+ command.extend(add_options)
+
try:
- SysCommand(
- f'/usr/bin/arch-chroot {self.target} grub-install '
- f'--debug '
- f'--target=x86_64-efi '
- f'--efi-directory={boot_partition.mountpoint} '
- f'--bootloader-id=GRUB '
- f'--removable',
- peek_output=True
- )
+ SysCommand(command, peek_output=True)
except SysCallError:
try:
- SysCommand(
- f'/usr/bin/arch-chroot {self.target} '
- f'grub-install '
- f'--debug '
- f'--target=x86_64-efi '
- f'--efi-directory={boot_partition.mountpoint} '
- f'--bootloader-id=GRUB '
- f'--removable',
- peek_output=True
- )
+ SysCommand(command, peek_output=True)
except SysCallError as err:
raise DiskError(f"Could not install GRUB to {self.target}{boot_partition.mountpoint}: {err}")
else:
parent_dev_path = disk.device_handler.get_parent_device_path(boot_partition.safe_dev_path)
- try:
- cmd = f'/usr/bin/arch-chroot' \
- f' {self.target}' \
- f' grub-install' \
- f' --debug' \
- f' --target=i386-pc' \
- f' --recheck {parent_dev_path}'
+ add_options = [
+ '--target=i386-pc',
+ '--recheck',
+ str(parent_dev_path)
+ ]
- SysCommand(cmd, peek_output=True)
+ try:
+ SysCommand(command + add_options, peek_output=True)
except SysCallError as err:
raise DiskError(f"Failed to install GRUB boot on {boot_partition.dev_path}: {err}")