[Bug 1714090] Re: grub2 upgrade doesn't preserve current boot order.
Rod Smith
rod.smith at canonical.com
Thu Aug 31 19:30:33 UTC 2017
I'm copying my comment #49 from bug #1642298 here....
Blake, your proposal makes sense on the surface; however, there are
cases where it would cause problems. For instance, suppose that, outside
of a MAAS environment, somebody installs Ubuntu, then installs Windows
in a dual-boot configuration, then re-installs Ubuntu because Windows
grabbed the boot process and the user couldn't figure out how to boot
into Ubuntu. In this case, Ubuntu/GRUB would not then gain control of
the boot process, which is what the user was hoping would happen, and (I
THINK) what would happen today. Of course, re-installing Ubuntu was
overkill in this scenario, and a little knowledge would go a long way to
resolving the problem in an easier way; but I've seen posts on user
forums from new users who do things like this. This isn't to say that
your suggestion is a bad one; but implementing it would create some new
problems of its own. They might be smaller than the ones we've got now,
but they should be considered.
Three more points, should Blake's proposal be implemented:
First, and most importantly, the initial installation of GRUB in a MAAS
environment would get it wrong, since as outlined, the proposal would
give boot control to the local hard disk, which is exactly the problem
we want to avoid. In such an environment, you'd need to install GRUB and
ensure that it comes AFTER the PXE-boot option, otherwise the initial
problem (MAAS losing control of nodes' boot process) would exist. Thus,
either the GRUB package would need to take a cue from MAAS to leave the
current top boot option in control (that is, install GRUB as the second
or later boot option) or it would need enough smarts to figure this out
itself. Given the wide variation in the way PXE-boot options appear in
efibootmgr output, the former is likely to be more reliable than the
latter.
Second, there's a potential implementation pitfall: There might be
stale/invalid NVRAM entries that point to GRUB on non-existent devices.
This could happen when MAAS redeploys a node, since the partition table
will be wiped and new partitions created, but the NVRAM-based boot
entries will be untouched. (Analogous things can happen in local/manual
installations, too, of course.) The new EFI System Partition (ESP) will
have a new GUID, which won't match the old one for the original
installation. Thus, if the check for a reference to grubx64.efi doesn't
include the GUID value (at a minimum; there are other identifying
features, too), it might think the existing entry is valid, when in fact
it's not. (Note that some, but not all, EFIs wipe invalid boot entries,
so some computers might not exhibit this problem, but others will.)
Third, on systems that boot with Secure Boot active, the NVRAM entry
will normally point to shimx64.efi, not grubx64.efi. In fact, this is
usually the case even when Secure Boot is NOT active, or is unavailable;
but with Secure Boot out of the picture, either binary should work to
boot the computer.
--
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/1714090
Title:
grub2 upgrade doesn't preserve current boot order.
Status in grub2 package in Ubuntu:
New
Bug description:
This is a follow up discussion from #1642298 and filing this bug to
keep a record.
On a fresh Ubuntu install, grub2 overwrites the NVRAM and updates to
boot order to have Ubuntu as the first boot device. This affects
situations in which PXE had been set the first boot device in the boot
order as it would overwrite it.
However, every single time grub2 package upgrades, it will overwrite
the NVRAM and completely override the boot order again. For example,
consider that ubuntu is first in the boot order.
efibootmgr -v
BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000* ubuntu
Boot0001 PCI LAN
But the administrator changed Network to be the first in the boot
order.
efibootmgr -v
BootCurrent: 0001
Timeout: 2 seconds
BootOrder: 0001,0000
Boot0001* PCI LAN
Boot0000 ubuntu
After a package upgrade, grub will overwrite the NVRAM and change this
back to:
efibootmgr -v
BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000,0001
Boot0000* ubuntu
Boot0001 PCI LAN
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1714090/+subscriptions
More information about the foundations-bugs
mailing list