Bug#820838: os-prober: 40grub2 does not handle multiple initrd paths

Simon McVittie smcv at collabora.com
Wed Jun 9 13:33:50 BST 2021


Control: unmerge 820838 838177
Control: forwarded 820838 https://salsa.debian.org/installer-team/os-prober/-/merge_requests/8
Control: retitle 838177 grub-common: grub.d/30_os-prober does not handle multiple initrd paths
Control: reassign 838177 grub-common 2.02+dfsg1-20
Control: forwarded 838177 https://savannah.gnu.org/bugs/index.php?47681

A recap of this bug for maintainers, since it has been a while:

In Arch Linux and its derivatives like Manjaro, instead of concatenating
CPU microcode and early user-space into a single initrd blob like we
do in Debian, the CPU microcode and the rest of early user-space are
supplied as two separate initrd archives. When Debian's grub integration
scripts detect other operating systems, they successfully identify Arch
Linux and add it to Debian's grub menu, but only the first initrd gets
added to grub.cfg, resulting in boot failure for the Arch menu entry
(because the first initrd happens to be the CPU microcode, so early
user-space is missing).

I can reproduce this on a Debian 11 test system that dual-boots into Arch,
by running update-grub and grub-install while booted into Debian 11.

Solving this requires changes in two packages: os-prober and grub-common.
I have verified that with the patches attached here, Debian's grub menu
boots Arch successfully. Unfortunately, I think we might be in a situation
where grub is waiting for os-prober and os-prober is waiting for grub.

For os-prober, the patch supplied by "General Chaos" in 2016 seems good.
I attach a clean version without the change to the Maintainer field, and
a follow-up patch that just reindents it to match the prevailing style.
Please see attached os-prober-*.patch or the merge request
<https://salsa.debian.org/installer-team/os-prober/-/merge_requests/8>.

On Thu, 23 Feb 2017 at 10:56:22 +0100, Johannes Rohr wrote:
> I've tested the patch. The initrd stanza generated is not totally correct:
> 
> іnitrd /boot/intel-ucode.img^/boot/initramfs-linux-pf.img
> 
> (note the ^ where there should be a blank)

This is a bug in integration scripts supplied by grub2: after
modifying os-prober to be able to emit more than one initrd, it
is also necessary to modify the corresponding script in grub2 to
be able to consume more than one initrd. "General Chaos" proposed
a patch upstream in 2016, which upstream said would be OK to apply
after os-prober was fixed, but there was never a Debian bug report
specifically for this. I'm repurposing 838177 to be that Debian
bug report. Please see attached grub2-*.patch or the merge request
<https://salsa.debian.org/grub-team/grub/-/merge_requests/26>.

At this stage in the freeze these changes seem unlikely to make it into
Debian 11, but it would be great if they can be landed at the beginning
of the Debian 12 cycle, or perhaps even incorporated into a Debian 11
point release.

Thanks,
    smcv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grub2-0001-os-prober-Allow-initrd-to-contain-spaces.patch
Type: text/x-diff
Size: 2122 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grub-devel/attachments/20210609/1887c3e4/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: os-prober-0001-Handle-multiple-initrd-paths-as-used-in-some-distros.patch
Type: text/x-diff
Size: 1544 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grub-devel/attachments/20210609/1887c3e4/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: os-prober-0002-Re-indent-previous-commit.patch
Type: text/x-diff
Size: 1389 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grub-devel/attachments/20210609/1887c3e4/attachment-0002.patch>


More information about the Pkg-grub-devel mailing list