initrdfail can result in resuming with different initrd images and hanging resume
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
Fix Released
|
Critical
|
Unassigned | ||
Bionic |
In Progress
|
Undecided
|
Julian Andres Klode | ||
Focal |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
Ubuntu Focal (and new releases) on AWS will normally boot without an initrd image (just the microcode.cpio). There is a fallback mechanism to reboot with the full initrd image when the boot fails to complete. The grub environment variable "initrdfail" is used to track when a boot failed and switch between the optimized initrd-less boot path and the full initrd path.
On a normal successful boot, the "initrdfail" variable is cleared by grub-initrd-
We've been able to successfully avoid this issue by adding the following to the ec2-hibinit-agent resume handler:
/usr/bin/
/usr/bin/
(Note: clearing recordfail may not be necessary, will need to try again without it.)
This bug was filed against grub2 as it appears to own initrdfail.
[Test plan]
TBD w/ CPC
[Regression potential]
Services get changed to oneshot, and wantedby=multi-user sleep; maybe we miss other places it should run, or record the wrong thing on resume?
Related branches
- Ubuntu Core Development Team: Pending requested
-
Diff: 368 lines (+323/-1)6 files modifieddebian/changelog (+30/-0)
debian/grub-common.service (+15/-0)
debian/patches/series (+2/-0)
debian/patches/ubuntu-add-initrd-less-boot-fallback.patch (+209/-0)
debian/patches/ubuntu-add-initrd-less-boot-messages.patch (+66/-0)
debian/rules (+1/-1)
- Dimitri John Ledkov: Pending requested
-
Diff: 176 lines (+110/-5)5 files modifieddebian/changelog (+22/-0)
debian/grub-common.service (+15/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu-add-initrd-less-boot-fallback.patch (+6/-5)
debian/patches/ubuntu-add-initrd-less-boot-messages.patch (+66/-0)
- Julian Andres Klode: Pending requested
- Ubuntu Core Development Team: Pending requested
-
Diff: 177 lines (+73/-10)7 files modifieddebian/changelog (+16/-0)
debian/grub-common.service (+4/-3)
debian/patches/0239-arm-linux-Fix-ARM-Linux-header-layout.patch (+29/-0)
debian/patches/series (+1/-0)
debian/patches/ubuntu-add-initrd-less-boot-fallback.patch (+6/-5)
debian/patches/ubuntu-add-initrd-less-boot-messages.patch (+15/-2)
debian/rules (+2/-0)
affects: | ec2-hibinit-agent (Ubuntu) → grub2 (Ubuntu) |
tags: | added: rls-ii-incomings |
tags: | added: fr-1421 |
Changed in grub2 (Ubuntu): | |
status: | New → In Progress |
importance: | Undecided → Critical |
Changed in grub2 (Ubuntu Focal): | |
status: | New → Triaged |
Changed in grub2 (Ubuntu Focal): | |
milestone: | none → ubuntu-20.04.3 |
description: | updated |
Changed in grub2 (Ubuntu Bionic): | |
status: | New → In Progress |
tags: | added: foundations-todo |
tags: | removed: fr-1421 |
Changed in grub2 (Ubuntu Bionic): | |
assignee: | nobody → Julian Andres Klode (juliank) |
tags: | removed: foundations-todo |
This bug was fixed in the package grub2 - 2.04-1ubuntu46
---------------
grub2 (2.04-1ubuntu46) impish; urgency=medium
* debian/ grub-common. service: change type to oneshot, add wantedby fallback. service: add wantedby sleep.target, after fallback. service, debian/ grub-common. service: only start
sleep.target, after sleep.target. The service will now start after
resume from hybernation. LP: #1929860
* grub-initrd-
sleep.target. The service will now start after resume from
hybernation. LP: #1929860
* cherrypick upstream fix to make armhf efi boot work. LP: #1788940
* debian/rules: disable LTO. LP: #1922005
* grub-initrd-
units when booted with grub. Use presence of /boot/grub/grub.cfg as
proxy. LP: #1925507
* tests: patch qemu command to use ide-hd instead of the removed
ide-drive.
-- Dimitri John Ledkov <email address hidden> Fri, 16 Jul 2021 14:01:31 +0100