grub-efi-amd64 postinst fails to install GRUB if /boot/efi/EFI/ubuntu/ is not present
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
This concerns grub-efi-amd64 2.02-2ubuntu8.1 in Ubuntu 18.04/bionic.
When the grub-efi-amd64 package is initially installed on a system that has not previously booted via the Ubuntu EFI bootloader (so /boot/efi/ is either empty, or at least does not have a /boot/efi/
The postinst script, in fact, contains this conditional around the grub-install invocation:
if [ "$bootloader_id" ] && [ -d "/boot/
It's not clear why this is here. There might be a reason why you would not want to install/update the bootloader if the directory for it isn't already there. In my case, however, I am running the postinst script (via dpkg-reconfigure) precisely to populate an EFI partition from scratch.
I can work around this issue with a simple
# mkdir -p /boot/efi/
before running dpkg-reconfigure, but this is far from obvious.
An additional problem with the conditional is that if it fails, no message is given to the user that the postinst is omitting the GRUB install, let alone the reason why. If the user misses the absence of the grub-install message, they'll only find out something went wrong when they attempt to boot using the newly-installed bootloader and it doesn't work.
Changed in grub2 (Ubuntu): | |
assignee: | Simon Quigley (tsimonq2) → nobody |
Changed in grub2 (Ubuntu): | |
status: | Confirmed → Triaged |
I should point out that on the Debian side, the same conditional exists in the postinst script, so this same issue occurs there as well. (Only with the /boot/efi/ EFI/debian/ directory, of course.)