Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
.`grubby` now passes arguments to a new kernel correctly
When you add a new kernel using the `grubby` tool and do not specify any arguments, or leave the arguments blank, `grubby` will not pass any arguments to the new kernel and `root` will not be set. Using the `--args` and `--copy-default` options ensures new arguments are appended to the default arguments.
grubby-8.40-62.el9 adds an unexpected root=... boot argument when the user specifies --args=... See:
[root@localhost boot]# grubby --add-kernel=/boot/vmlinuz --initrd=/boot/initrd.img --args="my_arg" --title="Test"
[root@localhost boot]# cat /boot/loader/entries/dc227bca83644c7aad89fa7e31bb3e4e-vmlinuz.conf
title Test
version vmlinuz
linux /vmlinuz
initrd /initrd.img
options root=/dev/mapper/rhel-root my_arg
id rhel-0-vmlinuz
grub_users $grub_users
grub_arg --unrestricted
grub_class kernel
[root@localhost boot]#
The expected behavior is that only "my_arg" would be present on the kernel command line, root=/dev/mapper/rhel-root should not be there.
I'm moving this bug back to ASSIGNED. This is a change of behavior and has an impact on our automated testing.
Comment 17Marta Lewandowska
2023-02-22 09:19:59 UTC
I thought the root= was desired! But since it is not, here it is again with grubby-8.40-63.el9:
[root@ibm-p9z-23-lp3 boot]# grubby --add-kernel my_kernel --initrd my_initrd --title no_args
[root@ibm-p9z-23-lp3 boot]# grubby --add-kernel my_kernel --initrd my_initrd --args args --title some_args
args
An entry for kernel my_kernel already exists, adding /boot/loader/entries/a7c94d39d09c4db1a076bdfc5ca994e7-my_kernel.0~custom.conf
[root@ibm-p9z-23-lp3 boot]# grubby --info my_kernel
index=2
kernel="/boot/my_kernel"
args="args"
initrd="/boot/my_initrd"
title="some_args"
id="a7c94d39d09c4db1a076bdfc5ca994e7-my_kernel.0~custom"
index=3
kernel="/boot/my_kernel"
args=""
initrd="/boot/my_initrd"
title="no_args"
id="a7c94d39d09c4db1a076bdfc5ca994e7-my_kernel"
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (grubby bug fix and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2023:2584
diff --git a/grubby-bls b/grubby-bls index fd76f63..f09156b 100755 --- a/grubby-bls +++ b/grubby-bls @@ -827,13 +827,14 @@ fi remove_var_prefix "$(get_prefix)" if [[ -n $kernel ]]; then - opts="${bls_options[$default_index]}" - if [[ $copy_default != "true" ]]; then - opts=$(echo $opts | sed -e 's/ .*//') + if [[ $copy_default = "true" ]]; then + opts="${bls_options[$default_index]}" + if [[ -n $args ]]; then + opts="${opts} ${args}" + fi + else + opts="${args}" fi - if [[ -n $args ]]; then - opts="${opts} ${args}" - fi add_bls_fragment "${kernel}" "${title}" "${opts}" "${initrd}" \ "${extra_initrd}"