Bug 1931912

Summary: grub2-mkconfig should read /etc/kernel/cmdline
Product: Red Hat Enterprise Linux 8 Reporter: Christian Kellner <ckellner>
Component: grub2Assignee: Bootloader engineering team <bootloader-eng-team>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.4CC: bootloader-eng-team, fmartine, jpazdziora, lmiksik, pjanda, pstodulk, rharwood, rmetrich, vpolasek, yurysub
Target Milestone: rcKeywords: OtherQA, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-23 07:27:49 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:
Embargoed:

Description Christian Kellner 2021-02-23 15:08:16 UTC
osbuild when building images for S390x, such as the 8.4 guest images, follows the kernel-install(8) specification and sets the kernel command line via "/etc/kernel/cmdline". This is also already respected respected on platforms that use grub, via `20-grub.install`. But when using grub2-mkconfig, the file is not read, leading to a loss of kernel command line options.

If grub2-mkconfig was to first read, `/etc/kernel/cmdline`, before sourcing `/etc/default/grub`, the new way and the old way could be supported at the same time.

Comment 6 Javier Martinez Canillas 2022-01-10 13:43:02 UTC
and the grubby tool also needs to learn about /etc/kernel/cmdline

Comment 7 Renaud Métrich 2022-01-10 15:00:27 UTC
What about having grub2-mkconfig *also* write to /etc/kernel/cmdline when building the kernel opts?
I'd expect this to then be used by /usr/lib/kernel/install.d/20-grub.install instead of using /proc/cmdline which may contain non-persistent options.

Example with this scenario:

1. Boot with "rd.debug"

2. Update the kernel

  This will create a BLS entry containing "rd.debug" which is non-sense, due to not relying on content of /etc/kernel/cmdline but /proc/cmdline

Comment 8 Javier Martinez Canillas 2022-02-09 07:05:01 UTC
(In reply to Renaud Métrich from comment #7)
> What about having grub2-mkconfig *also* write to /etc/kernel/cmdline when
> building the kernel opts?

Yes, agreed. It should do both.

Same for grubby as mentioned in Comment 6.

Comment 11 RHEL Program Management 2022-08-23 07:27:49 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.