[Bug 2043995] Re: fix grub-install to not write modules to /boot before we know we have a valid disk target

Julian Andres Klode 2043995 at bugs.launchpad.net
Mon Nov 20 14:29:26 UTC 2023


I think we need to have rollback either way, if we have a valid target
disk but then fail to write the sectors or we fail halfway building
core.mod or something we'd want to try to restore some backup of what we
had before.

-- 
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/2043995

Title:
  fix grub-install to not write modules to /boot before we know we have
  a valid disk target

Status in grub2 package in Ubuntu:
  New
Status in grub2 source package in Noble:
  New

Bug description:
  grub2 2.04-1ubuntu26.2 in 2020 introduced a workaround in focal for
  the fact that grub2 would write updated modules to /boot/grub, and
  only afterwards check that it had a valid disk target for installation
  of the first stage bootloader, with the result that if the debconf
  config for grub was outdated and points at a device that no longer
  exists, and there is ABI skew between the 1st/2nd stage bootloader and
  the grub modules from the new package, the system becomes unbootable
  because it is unable to load modules from the /boot filesystem, and
  rollback is not possible (LP: #1889556).

  This was supposed to be a workaround, but the work was never done to
  fix grub-install behavior to avoid this detectable and avoidable
  failure.

  We need grub-install to validate the target disk, and if it is
  unavailable, abort BEFORE updating /boot/grub with incompatible
  contents.

  Once this is done, the postinst hack that skips grub-install for grub-
  pc should be dropped.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/2043995/+subscriptions




More information about the foundations-bugs mailing list