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

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
MattG
Posts: 11
Joined: Sat Dec 08, 2018 5:00 pm

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

Post by MattG »

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:

Code: Select all

#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.

Thanks!

Edit: I'm on Raspberry Pi FWIW.
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

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

Post by MichaIng »

/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.
MattG
Posts: 11
Joined: Sat Dec 08, 2018 5:00 pm

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

Post by MattG »

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

Though the note in /boot/config.txt does say "/boot/*" files are over-written, which implies /boot/cmdline.txt. So it is somewhat misleading.
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

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

Post by MichaIng »

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.
Post Reply