Comment 9 for bug 2060695

Revision history for this message
Chris Siebenmann (cks) wrote :

I think I know what is happening here. In Ubuntu 20.04 and 22.04, the grub-pc.postinst has a chunk of code that was designed to deal with bug #1889556 by skipping running grub-install on package updates. The initial commit comment by Steve Langasek says:

debian/postinst.in: Avoid calling grub-install on upgrade of the grub-pc package, since we cannot be certain that it will install to the correct disk and a grub-install failure
will render the system unbootable. LP: #1889556
(commit 3aabdc6fe0ab3b6e129fc5b64238c45cbfd0de47 I believe)

This code is, in its final form in 22.04:
        elif dpkg --compare-versions "$2" ge 2.04-1ubuntu26 && [ -z "$DEBCONF_RECONFIGURE" ]; then
          # Avoid the possibility of breaking grub on SRU update
          # due to ABI change
          :

2.04-1ubuntu26 was the initial grub2 version in 20.04. This version was not updated for 22.04 to the 22.04 base version, but the effect was the same (since they were all more recent than the 20.04 base version). If you force a 22.04 machine to explicitly reconfigure grub-pc with 'dpkg-reconfigure grub-pc', it will fail with the same error message as in 24.04 (until you select the real devices).

The reason 24.04 fails here is that the 20.04/22.04 change to grub-pc.postinst wasn't carried forward to 24.04, the way it was for 22.04 (in commit 00e473f4e2b2e7e607b3aad58cb0c085b1f0561a I believe), so grub-pc always tries to run grub-install on package updates and fails here. I don't know if this is a grub-pc 24.04 problem by itself.