dpkg-reconfigure grub-pc no longer prompts for grub-pc/install_devices

Bug #1892526 reported by Brian Turek
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
High
Unassigned
Trusty
Confirmed
High
Unassigned
Xenial
Confirmed
High
Unassigned
Bionic
Fix Released
High
Unassigned
Focal
Fix Released
High
Unassigned
Groovy
Fix Released
High
Unassigned

Bug Description

[Impact]

 * dpkg-reconfigure grub-pc no longer reinstalls grub, as it should.

[Test Case]

 * Set grub-pc/install_devices to some invalid device that does not exist (i.e. /dev/hda)

 * Execute $ sudo dpkg-reconfigure grub-pc

One should expect attempts to grub-instal onto /dev/hda, fail that, and see dialogues asking which devices to install grub-pc onto, and successfully install them.

[Regression Potential]

 * We are patching, the recently/newly added postinst condition to skip trying to install grub-install during typical/regular upgrades. Further tighten the conditions there, to still force install grub-install when executing grub-reconfigure to be inline with existing documentation that this is the command to use when one wishes to reinstall grub-pc interactively.

[Other Info]

 * Original bug report

I recently had a RAID-5 disk failure and was greeted by an inoperable grub due to not having installed grub on all the disks. I temporarily fixed this problem by manually running "grub-install" on the other disks in the array and got my system working.

Previously it was advised to run "dpkg-reconfigure grub-pc" and select the relevant disks to ensure that future grub updates installed on all the disks in the array. This command no longer prompts for the install disks due to the changed introduced by https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1889556. In /var/lib/dpkg/info/grub-pc.postinst, the following elif block immediately precedes the elif block that prompts for grub-pc/install_devices and short circuits on all recent grub versions:

  elif dpkg --compare-versions "$2" ge 2.04-1ubuntu26; then
    # Avoid the possibility of breaking grub on SRU update
    # due to ABI change
    :

I can confirm this issue is present on 20.04.1 and it appears to be present on 18.04.4 per https://askubuntu.com/questions/1212569/dpkg-reconfigure-grub-pc-no-option-to-select-boot-device

tags: added: regression-update
tags: added: rls-gg-incoming
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@vorlon we should ask all these questions if "$1" is "reconfigure", no?

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1892526] Re: dpkg-reconfigure grub-pc no longer prompts for grub-pc/install_devices

On Tue, Aug 25, 2020 at 06:25:13PM -0000, Dimitri John Ledkov wrote:
> @vorlon we should ask all these questions if "$1" is "reconfigure", no?

$1 never equals reconfigure. The check is for DEBCONF_RECONFIGURE in the
environment.

Steve Langasek (vorlon)
Changed in grub2 (Ubuntu Trusty):
importance: Undecided → High
Changed in grub2 (Ubuntu Xenial):
importance: Undecided → High
Changed in grub2 (Ubuntu Bionic):
importance: Undecided → High
Changed in grub2 (Ubuntu Focal):
importance: Undecided → High
Changed in grub2 (Ubuntu Groovy):
importance: Undecided → High
tags: removed: rls-gg-incoming
description: updated
tags: added: id-5f47d07571fd694b6b92cb34
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.04-1ubuntu29

---------------
grub2 (2.04-1ubuntu29) groovy; urgency=medium

  * grub-install: cherry-pick patch from grub-devel to make grub-install
    fault tolerant. Create backup of files in /boot/grub, and restore them
    on failure to complete grub-install. LP: #1891680
  * postinst.in: do not exit successfully when failing to show critical
    grub-pc/install_devices_failed and grub-pc/install_devices_empty
    prompts in non-interactive mode. This enables surfacing upgrade errors
    to the users and/or automation. LP: #1891680
  * postinst.in: Fixup postinst.in, to attempt grub-install upon explicit
    dpkg-reconfigure grub-pc. LP: #1892526

 -- Dimitri John Ledkov <email address hidden> Tue, 01 Sep 2020 20:04:44 +0100

Changed in grub2 (Ubuntu Groovy):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu Bionic):
status: New → Confirmed
Changed in grub2 (Ubuntu Focal):
status: New → Confirmed
Changed in grub2 (Ubuntu Trusty):
status: New → Confirmed
Changed in grub2 (Ubuntu Xenial):
status: New → Confirmed
Revision history for this message
Brian Turek (brian-turek) wrote :

Is this queued up for a SRU release for Focal? It looks like the right people are involved but I wasn't sure if there was something specific I need to do.

Revision history for this message
Brian Murray (brian-murray) wrote :

Yes, it is planned to SRU these changes.

Changed in grub2 (Ubuntu Focal):
status: Confirmed → In Progress
Revision history for this message
Steve Langasek (vorlon) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted grub2 into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2/2.04-1ubuntu26.4 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in grub2 (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (grub2/2.04-1ubuntu26.4)

All autopkgtests for the newly accepted grub2 (2.04-1ubuntu26.4) for focal have finished running.
The following regressions have been reported in tests triggered by the package:

grubzfs-testsuite/0.4.10 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/focal/update_excuses.html#grub2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Brian Turek (brian-turek) wrote :

I looked through the regression log and the "issue" is due to https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1831789 which added the dis_ucode_ldr flag to GRUB recovery options. This just triggered an obvious change from the expected lines which did not have that option.

I tested v2.04-1ubuntu26.4 of grub-common, grub-pc-bin, grub-pc, and grub2-common and can confirm that "dpkg-reconfigure grub-pc" now prompts for the destination hard drives. I also received the same number of "Installing for i386-pc platform" message as the number of hard drives I selected. I think it's fixed!

tags: added: verification-done-focal
removed: verification-needed-focal
tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.04-1ubuntu26.4

---------------
grub2 (2.04-1ubuntu26.4) focal; urgency=medium

  * grub-install: cherry-pick patch from grub-devel to make grub-install
    fault tolerant. Create backup of files in /boot/grub, and restore them
    on failure to complete grub-install. LP: #1891680
  * postinst.in: do not exit successfully when failing to show critical
    grub-pc/install_devices_failed and grub-pc/install_devices_empty
    prompts in non-interactive mode. This enables surfacing upgrade errors
    to the users and/or automation. LP: #1891680
  * postinst.in: do not attempt to call grub-install upon fresh install of
    grub-pc because it it a job of installers to do that after fresh
    install. Fixup for the issue unmasked by above. LP: #1891680
  * grub-multi-install: fix non-interactive failures for grub-efi like it
    was fixed in postinst for grub-pc. LP: #1891680
  * postinst.in: Fixup postinst.in, to attempt grub-install upon explicit
    dpkg-reconfigure grub-pc. LP: #1892526

 -- Dimitri John Ledkov <email address hidden> Tue, 08 Sep 2020 11:24:35 +0100

Changed in grub2 (Ubuntu Focal):
status: Fix Committed → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote : Update Released

The verification of the Stable Release Update for grub2 has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Jason Perrin (jvperrin) wrote :

Is this something that's going to be included in xenial-updates/bionic-updates? I'd definitely like to see it there if that's possible, as this has made remediation of https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1889556 and https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1889509 more difficult to perform on those releases.

Thanks for all your work in fixing this and on grub overall!

tags: added: fr-206
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Brian, or anyone else affected,

Accepted grub2 into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/grub2/2.02-2ubuntu8.19 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in grub2 (Ubuntu Bionic):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-bionic
removed: verification-done
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (grub2/2.02-2ubuntu8.19)

All autopkgtests for the newly accepted grub2 (2.02-2ubuntu8.19) for bionic have finished running.
The following regressions have been reported in tests triggered by the package:

ubuntu-image/1.10+18.04ubuntu1 (ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/bionic/update_excuses.html#grub2

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Kees Cook (kees) wrote :

I can confirm this fixes the issue on Bionic on amd64. Thanks for the SRU!

tags: added: verification-done-bionic
removed: verification-needed-bionic
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.02-2ubuntu8.19

---------------
grub2 (2.02-2ubuntu8.19) bionic; urgency=medium

  * grub-install: cherry-pick patch from grub-devel to make grub-install
    fault tolerant. Create backup of files in /boot/grub, and restore them
    on failure to complete grub-install. LP: #1891680
    Also cherry-pick patch to make atexit work correctly.
  * postinst.in: do not exit successfully when failing to show critical
    grub-pc/install_devices_failed and grub-pc/install_devices_empty
    prompts in non-interactive mode. This enables surfacing upgrade errors
    to the users and/or automation. LP: #1891680 LP: #1896608
  * postinst.in: do not attempt to call grub-install upon fresh install of
    grub-pc because it it a job of installers to do that after fresh
    install. Fixup for the issue unmasked by above. LP: #1891680
  * postinst.in: Fixup postinst.in, to attempt grub-install upon explicit
    dpkg-reconfigure grub-pc. LP: #1892526

 -- Dimitri John Ledkov <email address hidden> Thu, 22 Oct 2020 15:01:52 +0100

Changed in grub2 (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers