RE: grubby since Fedora 30 is not the real grubby, which is now the grubby-deprecated package. The new grubby is a somewhat limited script intended to provide a familiar grubby interface for people who know grubby, but with all the new BLS support. Since I only very rarely used grubby(-deprecated) or the new grubby, I can’t really speak to whether it’s useful for this use case.
What i can tell you use the relationship between some of the parts.
grub2-mkconfig reads /etc/default/grub for some variables to use when creating, grub.cfg. It will also reset the $kernelopts variable. That variable is used by each drop in snippet found in /boot/loader/entries, rather than each entry containing those options - this is a Fedora specific behavior, it’s not found in either upstream GRUB (which still doesn’t use BLS), nor in the upstream boot loader spec.
So yeah, it’s more than a bit confusing. Do you want to do things the GRUB upstream way, or the BLS upstream way, or the Fedora way, and now you have to become reasonably familiar with all of them in order to answer that simple question, making it not that simple.
One possible idea:
- Edit /etc/default/grub GRUB_CMDLINE_LINUX= to contain your “primary” boot parameters.
- Run
grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
(I’m assuming UEFI)
-
grub2-editenv list
should show the kernelopts= variable, pretty much matching what you have in /etc/default/grub.
- Copy that kernelopts variable, modified with your “secondary” boot parameters
- Paste it into this command
`grub2-editenv - set kernelopts2=“pasted parameters in quotes”
Yes that is a minus symbol, it’s a reference to the default grubenv path.
- Duplicate each of your /boot/loader/entries drop in scripts, and in the duplicate for each one, modify the line such that:
s/options $kernelopts/options $kernelopts2
So now you have two bls drop in scripts per kernel. One references $kernelopts, the other references $kernelopts2.
A variation on that idea:
If the two sets of boot parameters have a lot in common, you can make the “primary” boot parameters in /etc/default/grub contain what’s in common; thus grubenv $kernelopts contains what’s in common. And now you can add extra values to the drop in bls snippets, e.g.
`options $kernelopts systemd.loglevel_debug
NOTE: Since grub2-mkconfig will step on grubenv, your kernelopts2= variable might also get stepped on, I’m not sure because I haven’t tested whether the entire grubenv is replaced, or if just the kernelopts= line is modified.
NOTE2: These days I pretty much don’t modify /etc/default/grub and don’t run grub2-mkconfig anymore. I just directly modify the /boot/loader/entries if necessary; or change the defaults (the variables) in grubenv by using grub2-editenv - set variable="blahblah"
And that also includes changing the default kernel if I need to do that for some reason.