Hide Forgot
Description of problem: When adding a new kernel and the --args option is not specified, the kernel arguments from the running kernel are used (except of the root= argument): [root@localhost ~]# cd /boot/ [root@localhost boot]# touch my_kernel my_initrd [root@localhost boot]# grubby --add-kernel=/boot/my_kernel --initrd=/boot/my_initrd --title=no_args [root@localhost boot]# grubby --add-kernel=/boot/my_kernel --initrd=/boot/my_initrd --args=bla --title=some_args An entry for kernel my_kernel already exists, adding /boot/loader/entries/2d33c9bc03a345b4990f71804c74e899-my_kernel.0~custom.conf [root@localhost boot]# grubby --info=/boot/my_kernel index=2 kernel="/boot/my_kernel" args="bla" initrd="/boot/my_initrd" title="some_args" id="2d33c9bc03a345b4990f71804c74e899-my_kernel.0~custom" index=3 kernel="/boot/my_kernel" args="ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet" root="/dev/mapper/rhel-root" initrd="/boot/my_initrd" title="no_args" id="2d33c9bc03a345b4990f71804c74e899-my_kernel" [root@localhost boot]# cat /proc/cmdline BOOT_IMAGE=(hd0,msdos1)/vmlinuz-4.18.0-246.el8.dt4.x86_64 root=/dev/mapper/rhel-root ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet [root@localhost boot]# rpm -q grubby grubby-8.40-41.el8.x86_64 [root@localhost boot]# Compare with RHEL-7: [root@dhcp76 ~]# cd /boot/ [root@dhcp76 boot]# touch my_kernel my_initrd [root@dhcp76 boot]# grubby --add-kernel=/boot/my_kernel --initrd=/boot/my_initrd --title=no_args [root@dhcp76 boot]# grubby --add-kernel=/boot/my_kernel --initrd=/boot/my_initrd --args=bla --title=some_args [root@dhcp76 boot]# grubby --info=/boot/my_kernel index=0 kernel=/boot/my_kernel args="bla" initrd=/boot/my_initrd title=some_args index=1 kernel=/boot/my_kernel initrd=/boot/my_initrd title=no_args [root@dhcp76 boot]# rpm -q grubby grubby-8.28-26.el7.x86_64 [root@dhcp76 boot]# Version-Release number of selected component (if applicable): grubby-8.40-41.el8 How reproducible: always Steps to Reproduce: 1. see above Actual results: args="ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet" Expected results: empty/no args, like in the RHEL-7 case.
And it also doesn't help using an empty string for --args: [root@localhost boot]# grubby --add-kernel=/boot/my_kernel --initrd=/boot/my_initrd --args="" --title=empty_args An entry for kernel my_kernel already exists, adding /boot/loader/entries/2d33c9bc03a345b4990f71804c74e899-my_kernel.4~custom.conf [root@localhost boot]# grubby --info=/boot/my_kernel index=2 kernel="/boot/my_kernel" args="ro crashkernel=auto resume=/dev/mapper/rhel-swap rd.lvm.lv=rhel/root rd.lvm.lv=rhel/swap rhgb quiet" root="/dev/mapper/rhel-root" initrd="/boot/my_initrd" title="empty_args" id="2d33c9bc03a345b4990f71804c74e899-my_kernel.4~custom" ...
From man page of grubby-8.40-42.el8 --args=kernel-args When a new kernel is added, this specifies the command line arguments which should be passed to the kernel by default (note they are merged with the arguments of the default entry if --copy-default is used). When --update-kernel is used, this specifies new arguments to add to the argument list. Multiple, space separated arguments may be used. If an argument already exists the new value replaces the old values. The root= kernel argument gets special handling if the configuration file has special handling for specifying the root filesystem. which leads me in opinion that reporter is right and args shouldn't be copied by default (otherwise the option --copy-default doesn't make any sense) I would also note that when installing a new kernel (yum update| yum install some_new_kernel_package) users expects to have arguments copied to a new kernel.