Adding kernel commandline options?

I’m trying to get the refresh 120hz on KDE Wayland, it works in X11. I asked elsewhere for support and someone suggested adding video=DP-1:4112x2572@120 as a kernel commandline option.

I figured out how to write the video option, but don’t know where to put it. I looked up what to do but there aren’t clear instructions and how to know if the command is actually taken.

As a simple test you can press ‘e’ when the grub menu appears on boot, then go to the line that mentions rhgb quiet and add the video=[...] text after that. Then you can press F10 to continue booting.

If it works and you want to make it permanent, then you can place it in the file /etc/default/grub on the line that says GRUB_CMDLINE_LINUX. E.g.:

GRUB_CMDLINE_LINUX="rhgb quiet video=DP-1:4112x2572@120"

Regenerate the grub config:

$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg

and reboot.

If you want you can also add fallback resolutions to the parameter, e.g.:

video=DP-1:4112x2572@120,1024x768

or 

video=DP-1:4112x2572@120,auto
1 Like

To add or remove a kernel command line arg use grubby.

sudo grubby --update-kernel=ALL --args=video=DP-1:4112x2572@120

It’s easier then the steps @litemotiv outlined.

4 Likes

I don’t think it’s easier really, using a default config file is imo the simplest approach. Grubby is an extra abstraction layer with it’s own command parameters that doesn’t really make it more straightforward.

Idk which boot I’m using. Would these work if I installed the Fedroa KDE Spin ARM in Parallels?

I can’t tell you how this would affect a virtualized Fedora installation on a Mac, i have no experience with that myself.

Yes. It will work. I run kde in parallels and have tested kernel command line change in that environment in the past.

Edit: fix typos

Actually it is much simpler.
It modifies /etc/kernel/cmdline, /etc/default/grub, the files under /boot/loader/entries, and also updates /boot/grub2/grub/cfg.
Then the next boot those new kernel options are effective.

If the user tries to do so manually it takes at least 2 edits (/etc/kernel/cmdline & /etc/default/grub) as well as running grub2-mkconfig while grubby does it all in one command.

1 Like

Last time I looked, running grub2-mkconfig will update /etc/kernel/cmdline and all the entries in /boot/loader/entries.

Thank you! I tested and noticed the results on UFO Test: Multiple Framerates

I meant simple in the linux/unix way, not simple in the way that one abstracting tool performs a number of functions in different places. Since the functions it abstracts are already very straightforward and simple, it only adds unnecessary complexity. It doesn’t really solve anything new, and it doesn’t teach the user about the way their system is set up beneath the abstraction. I just don’t really like it.

2 Likes

The last time I checked grub2-mkconfig did not update /etc/kernel/cmdline. I just tested it again and it now does so.

Thanks for that information.