Bug 1600414 - GRUB_EARLY_INITRD_LINUX_CUSTOM in /etc/default/grub ignored by grub2-mkconfig
Summary: GRUB_EARLY_INITRD_LINUX_CUSTOM in /etc/default/grub ignored by grub2-mkconfig
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2   
(Show other bugs)
Version: 28
Hardware: x86_64 Linux
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2018-07-12 08:09 UTC by Rob Hicks
Modified: 2019-02-11 12:21 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Rob Hicks 2018-07-12 08:09:08 UTC
Description of problem:

Specifying GRUB_EARLY_INITRD_LINUX_CUSTOM entry in /etc/default/grub is ignored
by grub2-mkconfig.  I have read that with grub 2.02 and later this can be specified for a clean way to load microcode without hand editing /boot/efi/EFI/fedora/grub.cfg

Version-Release number of selected component (if applicable):

How reproducible:
Never works

Steps to Reproduce:
1. Put acpi-override.img in /boot/ [this is a valid microcode file that will load properly by hand-editing grub.cfg as described above]
2. Add GRUB_EARLY_INITRD_LINUX_CUSTOM entry in /etc/default/grub as follows:
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb q
uiet resume=/dev/mapper/fedora-swap mem_sleep_default=deep"
3. Run grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
4. Examine entries in /boot/efi/EFI/fedora/grub.cfg and see that acpi_override.img isn't preloaded in lines like this
initrdefi /initramfs-4.17.3-200.fc28.x86_64.img

Actual results:
microcode is ignored and grub.cfg has to be hand edited which doesn't survive kernel upgrades

Expected results:
Maintenance free way of preloading microcode that will survive kernel upgrades

Additional info:

Comment 1 Luca Cavanna 2018-07-15 18:47:16 UTC
I can confirm this, running `4.17.4-200.fc28.x86_64` .

Comment 2 J. Alexander Jacocks 2018-08-01 20:05:36 UTC
I can also confirm this...this prevents applying a DSDT fix on the Lenovo ThinkPad X1 Carbon 6th generation.

Comment 3 Pawel Krupa 2018-08-11 21:21:03 UTC
I can confirm this. Script responsible for generating linux section in grub (10_linux) is lacking references to GRUB_EARLY_INITRD_LINUX_CUSTOM variable.


$ grub2-mkconfig --version
grub2-mkconfig (GRUB) 2.03

dnf reports grub in version 2.02-38.fc28

Comment 4 Jim Perrin 2018-08-23 22:22:40 UTC
Confirmed here as well, for the same DSDT fix on the gen6 carbon.

Comment 5 Michal Rdest 2018-08-24 06:25:14 UTC
I'm also hitting this on 6th gen Carbon.
Kernel 4.17.14-202.fc28.x86_64

Comment 6 sdunne 2018-08-31 18:58:04 UTC
Confirmed on my Lenovo ThinkPad X1 Carbon g6.

Comment 7 Bernie Innocenti 2019-02-10 18:14:08 UTC
Still present on rawhide (but not bumping the bug version, not sure whether it should be set to the oldest or the latest affected release).

Comment 8 Javier Martinez Canillas 2019-02-11 11:37:48 UTC
I've tried the following on the latest Fedora Rawhide with grub2-tools-2.02-68.fc30.x86_64:

$ touch /boot/acpi-override.img

$ echo GRUB_EARLY_INITRD_LINUX_CUSTOM="acpi-override.img" >> /etc/default/grub

$ grub2-mkconfig 2>/dev/null | grep acpi-override.img
        initrd  /acpi-override.img /initramfs-5.0.0-0.rc4.git3.1.fc30.x86_64.img
        initrd  /acpi-override.img /initramfs-5.0.0-0.rc2.git1.1.fc30.x86_64.img
        initrd  /acpi-override.img /initramfs-4.20.0-0.rc5.git3.1.fc30.x86_64.img
        initrd  /acpi-override.img /initramfs-0-rescue-036f3661be4047b6b678d491f76df6f4.img

So $SUBJECT is misleading in the sense that grub2-mkconfig doesn't ignore GRUB_EARLY_INITRD_LINUX_CUSTOM.

The issue though is that grubby doesn't support this, so new menu entries added by installing kernels won't have the initrds defined in GRUB_EARLY_INITRD_LINUX_CUSTOM. That means that grub2.cfg will have to be re-generated using grub2-mkconfig after each kernel install.

On Rawhide though the default is to use a BLS configuration now (GRUB_ENABLE_BLSCFG=true in /etc/default/grub) and the BLS support honours GRUB_EARLY_INITRD_LINUX_CUSTOM. The grub2-mkconfig sets the early_initrd variable in grubenv with the value set in GRUB_EARLY_INITRD_LINUX_CUSTOM, and the blscfg module pre-pends early_initrd to the initrd field in the BLS snippet. So there's no need to take any action after a kernel install on a BLS configuration to have all the kernel entries to pre-pend the early initrds.

Note You need to log in before you can comment on or make changes to this bug.