archinstall icon indicating copy to clipboard operation
archinstall copied to clipboard

Improve EFI bootloader installation

Open htv04 opened this issue 2 years ago • 7 comments

PR Description:

Some improvements to the installation of bootloaders on devices with UEFI:

  • GRUB:
    • Adjusted the grub-install parameters
      • Disabled the --bootloader-id option, using the default grub instead
      • Disabled the --debug option, which prints a lot of unnecessary info and may enable a debug flag
      • Disabled the --removable option, which prevents an EFI entry from being created
        • The other functionality of this option, setting the destination EFI file to the standard /EFI/BOOT/BOOTxxx.EFI/, has been implemented manually
  • Limine:
    • An EFI entry is now added via efibootmgr
  • EFISTUB
    • Code clarity tweaks
  • All bootloaders:
    • Like GRUB, all bootloaders will now attempt to install again upon failure to assist with buggy EFIs
      • After two failed attempts, the installer will attempt to use a fallback without EFI variables; if this fails, the installer will error out
    • Added a few debug messages for silent errors

Tests and Checks

  • [x] I have tested the code!

htv04 avatar Dec 24 '23 19:12 htv04

would it be possible to give the user a prompt, upon ultimate failure, to abort advancing on the entirety of the archinstall scripts, or to continue with a potentially failed grub-install? (or check for an archinstall flag to allow prompt/silent mode or something) - suggested grub-install errors as a my example in https://github.com/archlinux/archinstall/issues/2378

edit; i tested this on an ipxe'd bios-install and it has still failed (dropped it on top of the current installer.py, did not check for rebase'ing ect) ( it = https://github.com/archlinux/archinstall/blob/5b9574d3acbe5a106543e16d5cc02e1ed860d7b1/archinstall/lib/installer.py )

vanillaSprinkles avatar Mar 05 '24 10:03 vanillaSprinkles

Awesome work, I'd like to marge this. I'm wondering if we'll bring back this tho: https://github.com/archlinux/archinstall/pull/793

Torxed avatar Mar 07 '24 13:03 Torxed

Awesome work, I'd like to marge this. I'm wondering if we'll bring back this tho: #793

I believe that "fixed" the issue because it prevented grub-install from adding the EFI entry in the first place. The removable flag treats the destination as a removable drive, only adding a standard BOOTX64.EFI file.

Also, this PR might actually fix that issue due to automatically retrying the installation upon such an error.

htv04 avatar Mar 10 '24 05:03 htv04

would it be possible to give the user a prompt, upon ultimate failure, to abort advancing on the entirety of the archinstall scripts, or to continue with a potentially failed grub-install? (or check for an archinstall flag to allow prompt/silent mode or something) - suggested grub-install errors as a my example in #2378

edit; i tested this on an ipxe'd bios-install and it has still failed (dropped it on top of the current installer.py, did not check for rebase'ing ect) ( it = https://github.com/archlinux/archinstall/blob/5b9574d3acbe5a106543e16d5cc02e1ed860d7b1/archinstall/lib/installer.py )

I could try, but it would make the installation process less "automatic." This might be in the scope of a future PR to handle common errors during installation.

htv04 avatar Mar 10 '24 05:03 htv04

I could never get a hold of hardware that could trigger the error. I'm totally fine adding in this PR considering the try/except which should fallback to trying.

And now that we know about the issue, if it comes back we could add back this flag.

Torxed avatar Mar 10 '24 08:03 Torxed

im wondering now if adding different behaviors for each type of error would be useful? for example for my "fun" hardware the efibootmgr can fail but is not an issue due to having to teak the bios manually anyways; and skipping it by adding --no-nvram to grub-install might be useful (something like that is where a user-prompt maybe okay vs auto-skip (or the never ending add-more-flags/inputs))

vanillaSprinkles avatar Mar 11 '24 21:03 vanillaSprinkles

Those checks and tweaks would improve reliability if nothing else, and it's a godsend if we could get there. Because this and disk operations have always been a painpoint.

Torxed avatar Mar 12 '24 09:03 Torxed