How to list GRUB2's “menuentries” in command-line under Centos-8? The used workable method "fgrep menuentry /etc/grub2.conf" failed.
Because at Centos-8/RHEL-8, they DO NOT store menuentry in /etc/grub2.conf. Instead, they search and build entries at booting runtime.
And how to add a custom cmdline parameter to special menuentry? There is no menuentry in /etc/grub2.conf, I can not edit any menuentry.
Grub menu entries in RHEL/CentOS 8 are assembled from various files and scripts so we won't see static entries as was the case for previous versions of the OSes. (You can see the un-expanded boot entry configuration files located in the /boot/loader/entries/ directory)
In order to view the default menu entry, you can use:
grubby --info DEFAULT
In order to view all the menu entries, you can use:
grubby --info ALL
The latter also gives us the corresponding index for each of the entries that can be useful. For instance, the following will list the meny entry details for the 3rd entry:
grubby --info 2
In order to customize a specific entry you can do so by either referencing the index:
grubby --args amd_iommu=on --update-kernel 2
Or by simply using the kernel version as the following for the current kernel:
grubby --args amd_iommu=on --update-kernel=/boot/vmlinuz-$(uname -r)
Once you do a modification to an entry, the options should be expanded and listed in the corresponding entry file in /boot/loader/entries/ (otherwise you will see variables).