How to modify kernel command line on atomic variants?

Hi together,

I have identified a kernel command line that I want to change on my Fedora atomic (Silverblue) installation.

What works:

  1. While booting, in grub2, press `e` key
  2. When the cmdline editor shows up, append command line parameter `intel_iommu=on` to the line containing `rhgb quiet`
  3. Continue booting with `Ctrl+X`
  4. When booted, the expected kernel change is applied and visible in `less /proc/cmdline`

Now I want to make this change permanent. On a non-atomic Fedora installation, I would have edited `GRUB_CMDLINE_LINUX=` in `/etc/default/grub`, then regenerated the grub config manually with `grub-mkconfig` or with a kernel update.

How do I do this on Silverblue? I found that I should probably create the file `/etc/kernel/cmdline`, as mentioned by systemd’s `man kernel-install`. Does this apply to atomic installations too? And if yes, how do I do that, other than waiting for the next update?

On Silverblue, it seems you don’t edit /etc/default/grub like on traditional Fedora. From what I understand and the docs I’ve read, the solution is to use rpm-ostree kargs to permanently add kernel arguments.

For your case, it appears you could run

sudo rpm-ostree kargs --append='intel_iommu=on'

This should create a new deployment with the kernel argument added. The change should be permanent and persist across updates and reboots.

It seems you can verify with rpm-ostree kargs (no options) to get all current kernel arguments.

For more details: https://docs.fedoraproject.org/en-US/fedora-coreos/kernel-args/#_modifying_kernel_arguments_on_existing_systems

2 Likes

Thanks a lot, that is exactly what I was searching for. And it also regenerates the configuration as expected, so no need to do something like `grub-mkconfig` manually.