Improve EFI bootloader installation
PR Description:
Some improvements to the installation of bootloaders on devices with UEFI:
- GRUB:
- Adjusted the grub-install parameters
- Disabled the
--bootloader-idoption, using the defaultgrubinstead - Disabled the
--debugoption, which prints a lot of unnecessary info and may enable a debug flag - Disabled the
--removableoption, 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
- The other functionality of this option, setting the destination EFI file to the standard
- Disabled the
- Adjusted the grub-install parameters
- Limine:
- An EFI entry is now added via
efibootmgr
- An EFI entry is now added via
- 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
- Like GRUB, all bootloaders will now attempt to install again upon failure to assist with buggy EFIs
Tests and Checks
- [x] I have tested the code!
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 )
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
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.
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.
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.
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))
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.