Invalid config generated when using GRUB_EARLY_INITRD_LINUX_CUSTOM

Bug #1891131 reported by Jrandiny
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

When trying to add GRUB_EARLY_INITRD_LINUX_CUSTOM options in /etc/default/grub the resulting grub.cfg become invalid

For example by adding

GRUB_EARLY_INITRD_LINUX_CUSTOM="acpi_override"

Result:
```
 initrd /boot/ acpi_override initrd.img-5.8.0-050800-generic
```

Expected:
```
 initrd /boot/acpi_override /boot/initrd.img-5.8.0-050800-generic

```

When comparing 10_linux script with other distro (Manjaro) it seems that the Ubuntu version doesn't account for multiple initrd

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: grub-common 2.04-1ubuntu26.2
Uname: Linux 5.8.0-050800-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.6
Architecture: amd64
CasperMD5CheckResult: skip
Date: Tue Aug 11 13:18:18 2020
InstallationDate: Installed on 2020-08-09 (1 days ago)
InstallationMedia: Ubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
SourcePackage: grub2
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Jrandiny (jrandiny) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Possible fix" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in grub2 (Ubuntu):
status: New → Fix Released
Revision history for this message
Patric (pakar) wrote :

Patch does not work as expected.

Before the loop
            initrd_path="" <-- Needs to be cleared before the loop.
            for i in ${initrd}; do
              initrd_path="${initrd_path} ${rel_dirname}/${i}"
            done

If this is not done it will append the same data over and over to this variable creating duplicates for subsequent boot-entries..

Ie
  initrd /acpi_override /initrd.img-5.8.0 /acpi_override /initrd.img-5.8.0 /acpi_override /initrd.img-5.8.0 /acpi_override /initrd.img-5.8.0-rc7 /acpi_override /initrd.img-5.8.0-rc7 /acpi_override /initrd.img-5.4.0-42-generic /acpi_override /initrd.img-5.4.0-42-generic

Revision history for this message
Julian Andres Klode (juliank) wrote :

Hello Patric, I'm not sure what you're commenting on. Please recall that this is a duplicate and the patch here is not being used. If you think you found a bug in the current grub in groovy and focal-proposed, please open a new bug. Thank you!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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