Bug 1925776 - GRUB_CMDLINE_LINUX is ignored when installing a new kernel
Summary: GRUB_CMDLINE_LINUX is ignored when installing a new kernel
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 33
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Javier Martinez Canillas
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-06 13:25 UTC by Vladislav Grigoryev
Modified: 2023-07-10 07:13 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-29 20:50:33 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Vladislav Grigoryev 2021-02-06 13:25:41 UTC
Description of problem:
GRUB_CMDLINE_LINUX configured with /etc/default/grub is ignored when installing a new kernel e.g. with DNF upgrade, and /proc/cmdline appears to be used instead.

Version-Release number of selected component (if applicable):
grub2-tools-2.04-31.fc33.x86_64

How reproducible:
Always.

Steps to Reproduce:
1. Customize GRUB_CMDLINE_LINUX in /etc/default/grub.
2. Upgrade or reinstall the kernel-core package.
3. Check boot options in /boot/loader/entries/*.

Actual results:
Boot options use /proc/cmdline instead of /etc/default/grub.

Expected results:
Boot options should use /etc/default/grub instead of /proc/cmdline.

Additional info:
Use grub2-mkconfig to generate the proper boot entries as a workaround.

Comment 1 Sampson Fung 2021-02-06 13:56:27 UTC
I got this problem also.

From both Fedora Workstation 33 and Silverblue 33.

Comment 2 Vladislav Grigoryev 2021-02-06 14:18:24 UTC
It's important to note that /proc/cmdline can miss the options desired by default and configured in /etc/default/grub.
At the same time, /proc/cmdline can contain unwanted options such as fsck.mode=force.
That's why we should use only /etc/default/grub to specify the boot options when adding a new kernel.

Comment 3 Ronald L Humble 2021-02-06 16:29:50 UTC
I would like to add my steps to reproduce. /etc/default/grub is not touched during this process, nor is grub2-mkconfig executed.

Steps to reproduce:
1 - From grub boot menu, use 'e' to edit the entry. In my case, I added ‘3’ for text mode; removed
‘plymouth.enable=0 quiet’. [F10] to boot to graphical mode.
2- systemctl get-default
graphical.target
Note: found “3” on the kernel commandline, which overrides the default unit.
3 - Upgrade kernel. Examine the newly created entry in /boot/loader/entries
In the above case, ‘3’ is present; ‘plymouth.enable=0 quiet’ is absent from the newly created entry.

Expected result is GRUB_CMDLINE_LINUX in /etc/default/grub should be sourced to create entries in /boot/loader/entries/ instead of the kernel command line.

Comment 4 Fedora Admin user for bugzilla script actions 2021-05-07 00:35:54 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 5 Javier Martinez Canillas 2021-06-29 20:50:33 UTC
That's expected, grub2-mkconfig is not executed when a new kernel is installed nor the GRUB config file re-generated.

Comment 6 Netbulae 2021-09-07 07:28:37 UTC
(In reply to Javier Martinez Canillas from comment #5)
> That's expected, grub2-mkconfig is not executed when a new kernel is
> installed nor the GRUB config file re-generated.

Can you tell us how we can apply a kernel parameter permanently. I have added a critical parameter and every kernel update, I have to reapply grub2-mkconfig.

It started happening for me in Fedora 34 and there should be a proper way to make the grub config stick IMHO.

Comment 7 Netbulae 2021-10-06 06:35:23 UTC
(In reply to Javier Martinez Canillas from comment #5)
> That's expected, grub2-mkconfig is not executed when a new kernel is
> installed nor the GRUB config file re-generated.
(In reply to Vladislav Grigoryev from comment #0)
> Description of problem:
> GRUB_CMDLINE_LINUX configured with /etc/default/grub is ignored when
> installing a new kernel e.g. with DNF upgrade, and /proc/cmdline appears to
> be used instead.
> 
> Version-Release number of selected component (if applicable):
> grub2-tools-2.04-31.fc33.x86_64
> 
> How reproducible:
> Always.
> 
> Steps to Reproduce:
> 1. Customize GRUB_CMDLINE_LINUX in /etc/default/grub.
> 2. Upgrade or reinstall the kernel-core package.
> 3. Check boot options in /boot/loader/entries/*.
> 
> Actual results:
> Boot options use /proc/cmdline instead of /etc/default/grub.
> 
> Expected results:
> Boot options should use /etc/default/grub instead of /proc/cmdline.
> 
> Additional info:
> Use grub2-mkconfig to generate the proper boot entries as a workaround.


https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/

"The GRUB 2 configuration file, grub.cfg, is generated during installation, or by invoking the /usr/sbin/grub2-mkconfig utility, and is automatically updated by grubby each time a new kernel is installed."

I think we will need to use grubby to add the arguments

https://docs.fedoraproject.org/en-US/Fedora/23/html/System_Administrators_Guide/sec-Configuring_GRUB_2_Using_the_grubby_Tool.html

Comment 8 Thomas 2023-07-10 07:13:08 UTC
I have had the same issue and it's linked to https://bugzilla.redhat.com/show_bug.cgi?id=1931912#c6 which has been closed as won't fix...

New kernel install look at /etc/kernel/cmdline then /proc/cmdline if the first one is not existent. So changing only GRUB_CMDLINE_DEFAULT would not update /etc/kernel/cmdline and options would fall back to default at a new install. Took me a while to understand why plymouth came back after a kernel update.

Solutions I found are either to use grub2-mkconfig and then manually edit /etc/kernel/cmdline accordingly, use grubby, or add a hook to grub2-mkconfig in /etc/kernel/install.d

Not a bug, though I think it should be documented somewhere (grub2-mkconfig manpage that it won't update /etc/kernel/cmdline?)

Thanks


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