grub-install failure does not fail package upgrade (and does not roll back to matching modules)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Groovy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[SRU Justification]
SRU regression triggered by latent misconfiguration of grub on the host system, leading to a failure to boot due to ABI mismatch between /boot/grub/i386-pc which is updated, and the grub image in the MBR which is not
[Test case]
1. Boot a system in BIOS mode.
2. Run sudo sed -i -e'/Name: grub-pc\
3. Enable -proposed in apt sources.list.
4. Run sudo env DEBIAN_
5. Reboot
6. Confirm that the system boots successfully
7. Boot a system in UEFI mode.
8. Enable -proposed in apt sources.list.
9. Run sudo env DEBIAN_
10. Confirm that the contents of /boot/efi/
[Original description]
Failure to install new grub core to the specified device does not correctly prevent upgrade to incompatible modules (LP: #1889509)
$ sudo debconf-
grub-pc grub-pc/
grub-pc grub-pc/
$ mount|grep nvme
/dev/nvme0n1p1 on / type ext4 (rw,relatime,
$ ls /dev/sda
ls: cannot access '/dev/sda': No such file or directory
$ sudo env DEBIAN_
...
Get:10 http://
...
Installing for i386-pc platform.
grub-install: error: cannot find a GRUB drive for /dev/sda. Check your device.map.
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-
Found linux image: /boot/vmlinuz-
Found initrd image: /boot/initrd.
done
...
# update-grub failed during the install but the return code is 0
$ echo $?
0
# The package is installed without apparent error, but the instance will fail to reboot (LP: #1889509)
$ dpkg -l|grep grub-pc
ii grub-pc 2.02~beta2-
ii grub-pc-bin 2.02~beta2-
# If I reboot it will fail to boot:
Booting from Hard Disk 0...
error: symbol `grub_calloc' not found.
Entering rescue mode...
grub rescue> _
---
Xenial in AWS (us-west-2 ami-060d1be0dd4
The debconf for grub was not set to the correct device when cloud-init first ran (LP: #1877491) or when the fix for that was applied (LP: #1889555)
The fact that grub-install fails during the upgrade but does not fail the package install (and cause a rollback) means that how we have a mismatch between grub core and modules which breaks boot (LP: #1889509).
Related branches
- Dimitri John Ledkov: Approve
- Michael Hudson-Doyle: Approve
-
Diff: 32 lines (+13/-0)2 files modifieddebian/changelog (+9/-0)
debian/postinst.in (+4/-0)
- Ubuntu Core Development Team: Pending requested
-
Diff: 13 lines (+1/-1)1 file modifieddebian/postinst.in (+1/-1)
- Steve Langasek: Needs Fixing
- Michael Hudson-Doyle: Pending requested
-
Diff: 339 lines (+321/-1)2 files modifieddebian/control (+1/-1)
debian/grub-pc.preinst.in (+320/-0)
- Robert C Jennings (community): Approve
- Pat Viafore (community): Approve
- Julian Andres Klode: Pending requested
- Ubuntu Core Development Team: Pending requested
-
Diff: 31 lines (+11/-1)2 files modifieddebian/changelog (+10/-0)
debian/postinst.in (+1/-1)
tags: | added: regression-release |
tags: | added: regression-update |
information type: | Public → Public Security |
tags: | added: regression-security |
tags: | removed: regression-release |
description: | updated |
description: | updated |
description: | updated |
tags: | added: sts |
Changed in grub2 (Ubuntu Groovy): | |
status: | Confirmed → Fix Committed |
I'm attaching a full log from the recreate that shows additional details