[Bug 1783044] Re: grub-efi-amd64 postinst fails to install GRUB if /boot/efi/EFI/ubuntu/ is not present
Phillip Susi
psusi at ubuntu.com
Fri Aug 3 18:37:30 UTC 2018
I would think that the postinst script should use a low priority debconf
question to ask if you want to create the directory and install or not,
and default to not if you aren't showing low priority questions.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/1783044
Title:
grub-efi-amd64 postinst fails to install GRUB if /boot/efi/EFI/ubuntu/
is not present
Status in grub2 package in Ubuntu:
Confirmed
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/EFI/ubuntu/ directory), the package postinst script fails to
install anything into /boot/efi/.
The postinst script, in fact, contains this conditional around the
grub-install invocation:
if [ "$bootloader_id" ] && [ -d "/boot/efi/EFI/$bootloader_id" ];
then
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/EFI/ubuntu
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1783044/+subscriptions
More information about the foundations-bugs
mailing list