Bug 1806022

Summary: initrd entry is generated for grub2 BLSCFG config in spite of no option specified in /boot/loader/entries/kernel.conf
Product: [Fedora] Fedora Reporter: Artem S. Tashkinov <aros>
Component: grub2Assignee: Javier Martinez Canillas <fmartine>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: fmartine, lkundrak, pjones, y9t7sypezp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: grub2-2.02-106.fc31 grub2-2.04-10.fc32 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-20 01:49:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Artem S. Tashkinov 2020-02-21 20:17:00 UTC
My /boot/loader/entries/5.5.5.conf does NOT contain initrd entry and according to https://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ 

> initrd refers to the initrd to use when executing the kernel. This also shall be a path relative to the $BOOT directory. This key is ***optional***.

Still on boot Grub2 generates a config entry with an empty initrd argument, i.e.

linux /boot/bzImage-5.5.5 root=/dev/sda2
initrd

This is an error. When initrd is *not* specified in /boot/loader/entries/kernel.conf, grub2 BLSCFG must *not* generate it.

rpm -qa | grep grub2
grub2-tools-2.02-105.fc31.x86_64
grub2-pc-2.02-105.fc31.x86_64
grub2-pc-modules-2.02-105.fc31.noarch
grub2-efi-x64-2.02-105.fc31.x86_64
grub2-tools-efi-2.02-105.fc31.x86_64
grub2-common-2.02-105.fc31.noarch
grub2-tools-extra-2.02-105.fc31.x86_64
grub2-tools-minimal-2.02-105.fc31.x86_64

Comment 1 Steve 2020-03-01 01:25:26 UTC
(In reply to Artem S. Tashkinov from comment #0)
...
> /boot/loader/entries/kernel.conf, grub2 BLSCFG must *not* generate it.
...

Could you post or attach:

1. /boot/loader/entries/kernel.conf (or 5.5.5.conf, if that is what you are using)
2. /etc/default/grub

And how are you building grub.cfg? With grub2-mkconfig?

Comment 2 Steve 2020-03-01 01:42:07 UTC
(In reply to Steve from comment #1)
...
> Could you post or attach:
...

No need. I reproduced it without any trouble by modifying a copy of the ".conf" file for "Fedora (5.5.7-100.fc30.x86_64) 30 (Thirty)".

# cat /boot/loader/entries/foo.conf 
title Foo Fedora (5.5.7-100.fc30.x86_64) 30 (Thirty)
version 5.5.7-100.fc30.x86_64
linux /vmlinuz-5.5.7-100.fc30.x86_64
#initrd /initramfs-5.5.7-100.fc30.x86_64.img
options $kernelopts
grub_users $grub_users
grub_arg --unrestricted
grub_class kernel

# grep BLSCFG /etc/default/grub
GRUB_ENABLE_BLSCFG="true"

Running grub2-mkconfig isn't needed when BLSCFG is enabled.

Test procedure:

Reboot, select "Foo Fedora ...", press "e", and note that the "initrd" line has no arguments.

Comment 3 Fedora Update System 2020-03-17 13:33:24 UTC
FEDORA-2020-c00ce6527f has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-c00ce6527f

Comment 4 Fedora Update System 2020-03-18 02:38:53 UTC
grub2-2.04-10.fc32 has been pushed to the Fedora 32 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-17e46a4bd6

Comment 5 Fedora Update System 2020-03-18 02:49:18 UTC
grub2-2.02-106.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-c00ce6527f

Comment 6 Fedora Update System 2020-03-20 01:49:56 UTC
grub2-2.02-106.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2020-03-21 02:14:12 UTC
grub2-2.04-10.fc32 has been pushed to the Fedora 32 stable repository. If problems still persist, please make note of it in this bug report.