Added a try-rerun-except block to grub-install (#1085)
* Added a try-rerun-except block to grub-install first with --removable and then without if it fails. I have a sneaky suspicion that it's due to USB drives being the destination medium, but I cannot confirm yet. I've also added peak_output=True and --debug to GRUB so we can catch the issues in the future. * Fixed flake8 complaint
This commit is contained in:
parent
12b5e2e4e9
commit
c095eb56d8
|
|
@ -832,12 +832,15 @@ class Installer:
|
||||||
if has_uefi():
|
if has_uefi():
|
||||||
self.pacstrap('efibootmgr') # TODO: Do we need? Yes, but remove from minimal_installation() instead?
|
self.pacstrap('efibootmgr') # TODO: Do we need? Yes, but remove from minimal_installation() instead?
|
||||||
try:
|
try:
|
||||||
SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --removable')
|
SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --debug --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --removable', peak_output=True)
|
||||||
except SysCallError as error:
|
except SysCallError:
|
||||||
raise DiskError(f"Could not install GRUB to {self.target}/boot: {error}")
|
try:
|
||||||
|
SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --debug --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB --removable', peak_output=True)
|
||||||
|
except SysCallError as error:
|
||||||
|
raise DiskError(f"Could not install GRUB to {self.target}/boot: {error}")
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --target=i386-pc --recheck {boot_partition.parent}')
|
SysCommand(f'/usr/bin/arch-chroot {self.target} grub-install --debug --target=i386-pc --recheck {boot_partition.parent}', peak_output=True)
|
||||||
except SysCallError as error:
|
except SysCallError as error:
|
||||||
raise DiskError(f"Could not install GRUB to {boot_partition.path}: {error}")
|
raise DiskError(f"Could not install GRUB to {boot_partition.path}: {error}")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue