Changing kernel commandline options (persistent /boot/cmdline.txt)?

What is the right way to modify kernel commandline arguments? Typically this is one via /boot/cmdline.txt, but as per the warning at the top of /Dietpi/config.txt:

#Modifcations to /boot/* files, will not be saved when powered on.
#Please ensure you edit from the DietPi-RamDisk location /DietPi/*

But I don’t see anything for explicitly setting kernel commandline params. I see a number of scripts in /DietPi modify the /boot/cmdline.txt on-the-fly via sed. But I’d rather not go hacking in those files.

In particular, what I want to do is set the isolcpus parameter.


Edit: I’m on Raspberry Pi FWIW.

/boot/cmdline.txt is only available on RPi, where it is the right way to add boot cmdline options on RPi.
The arguments/options themselves are right for all Linux systems (at least if kernel version is not too far away).

/boot/config.txt is for other RPi specific kernel/boot options, modules and overlays.
Since DietPi reads/writes quite much to config.txt, it is as well copied to RAMdisk: /DietPi/config.txt
On running system, DietPi reads/writes only from/to that location and on shutdown it will be copied to /boot/config.txt, overwriting what is there. This is the reason for the info comment on top of the file.

/boot/cmdline.txt is not copied to RAMdisk, since it is used very rarely. So there you don’t find the comment and you can/need to directly edit it there.

Ahh, thank you, I suppose I could have just tried it, and found it’s automatically persistent. :slight_smile:

Though the note in /boot/config.txt does say “/boot/*” files are over-written, which implies /boot/cmdline.txt. So it is somewhat misleading.

Ah jep good hint, we will do some rewording. It’s only /boot/dietpi|dietpi.txt|config.txt(RPi)|boot.ini(Odroid)|uEnv.txt(Pine) that are copied from and to RAMdisk.