I am using some custom made/created image of Linux. I need to make changes in "/proc/cmdline" but that file cannot be changed directly - obviously. Normally I would change "/boot/cmdline.txt", but in this case it does not change anything. Probably kernel is "looking for" some other file than "/boot/cmdline.txt". Is there a way to check it? Thanks. Sorry if I misused some terminology.
1 Answer
It's not actually the kernel but the bootloader which reads the command line from disk (or somewhere) and provides it when starting the kernel. There is no direct link to any file, at least none that the kernel itself could tell you about.
So the only ways to find it are a) read the documentation that the image's authors provided, or b) guessing.
If your system uses GRUB2 as the bootloader, then the kernel command line is configured through /etc/default/grub, which then gets written into /boot/grub/grub.cfg when you run update-grub, and is later read by GRUB from that grub.cfg file.
If the system uses systemd-boot (assuming no fancy "signed kernel image" stuff is going on), then it'll read the parameters from /boot/loader/entries/*.conf – although those files may be auto-generated from some other source, so pay attention to any "# comments" that might be inside.
The system might also be using other bootloaders – look for /boot/syslinux/syslinux.cfg, /boot/grub/menu.lst, /boot/refind_linux.conf, and such. You could also try searching the entire /boot and /etc for the current cmdline contents using grep -r.