Fix multiple initrds support in grub.conf

Bug #1878705 reported by Dimitri John Ledkov
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Fix Released
Undecided
Unassigned
Groovy
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

 * When attempting to use multiple initrd, update-grub generates invalid grub.cfg configuration.

[Test Case]

 * sudo touch /boot/microcode.cpio
 * sudo update-grub
 * grep microcode.cpio /boot/grub/grub.cfg
initrd / microcode.cpio initrd.img-5.4.0-37-generic

Observe that the initrd stanzas are incorrect. Instead they should be _both_ absolute valid filepaths from grub prefix location, i.e.

initrd /microcode.cpio /initrd.img-5.4.0-37-generic

 # ensure one cleans up the system after testing
 * sudo rm /boot/microcode.cpio
 * sudo update-grub

[Regression Potential]

 * 2.04 upstream release supports multiple initrds correctly, but the ubuntu-only patches incorrectly changed the behaviour of grub-mkconfig breaking this support. This SRU fixes this. Since currently multiple initrd support is broken, nobody is using it. But hopefully it will become usable after this SRU and will be used by default in certain configurations.

Related branches

Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Revision history for this message
Dimitri John Ledkov (xnox) wrote :
Changed in grub2 (Ubuntu):
status: New → In Progress
information type: Private → Public
Revision history for this message
Julian Andres Klode (juliank) wrote :
Changed in grub2 (Ubuntu):
status: In Progress → Fix Committed
tags: added: patch
description: updated
Revision history for this message
Julian Andres Klode (juliank) wrote :
Changed in grub2 (Ubuntu Focal):
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

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

  * Ensure that grub-multi-install can always find templates (LP: #1879948)
  * Fix changelog entries for security update

 -- Julian Andres Klode <email address hidden> Mon, 10 Aug 2020 15:07:29 +0200

Changed in grub2 (Ubuntu Groovy):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Dimitri, 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.3 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.3)

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

ubuntu-image/1.9+20.04ubuntu1 (arm64)
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
Jrandiny (jrandiny) wrote :

Hi, I have tested the updated grub-common from focal-proposed (version 2.04-1ubuntu26.3) and it fixed the problem for me. I tested with the following step:
- create /boot/acpi_override
- Add GRUB_EARLY_INITRD_LINUX_CUSTOM="acpi_override" flag to /etc/default/grub
- Run update-grub
- Check grub.cfg

initrd /boot/acpi_override /boot/initrd.img-5.8.2-050802-generic

Revision history for this message
Dimitri John Ledkov (xnox) wrote :

@jrandiny this is an interesting usecase. I was hoping to use this for early initrd. Do you think acpi_override name should be standertized and submitted to upstream grub too?

tags: added: verification-done-focal
removed: verification-needed-focal
Revision history for this message
Jrandiny (jrandiny) wrote :

@xnox I don't think it will benefit a lot of people if standardized, it's not a very common usecase (https://www.kernel.org/doc/html/latest/admin-guide/acpi/initrd_table_override.html). Most people that are going to use this are probably familiar enough with grub.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Łukasz Zemczak (sil2100) 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
Launchpad Janitor (janitor) wrote :

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

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

  * 2.04-1ubuntu27 and 2.04-1ubuntu28 folded together for focal
  * debian/patches/ubuntu-flavour-order.patch:
    - Add a (hidden) GRUB_FLAVOUR_ORDER setting that can mark certain kernel
      flavours as preferred, and specify an order between those preferred
      flavours (LP: #1882663)
  * debian/patches/ubuntu-zfs-enhance-support.patch:
    - Use version_find_latest for ordering kernels, so it also supports
      the GRUB_FLAVOUR_ORDER setting.
  * debian/patches/ubuntu-dont-verify-loopback-images.patch:
    - disk/loopback: Don't verify loopback images (LP: #1878541),
      Thanks to Chris Coulson for the patch
  * debian/patches/ubuntu-recovery-dis_ucode_ldr.patch
    - Pass dis_ucode_ldr to kernel for recovery mode (LP: #1831789)
  * debian/patches/ubuntu-add-initrd-less-boot-fallback.patch:
    - Merge changes from xnox to fix multiple initrds support (LP: #1878705)
  * debian/patches/ubuntu-clear-invalid-initrd-spacing.patch:
    - Remove, no longer needed thanks to xnox's patch
  * Ensure that grub-multi-install can always find templates (LP: #1879948)

 -- Julian Andres Klode <email address hidden> Mon, 17 Aug 2020 16:04:31 +0200

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.