I have a number of systems on which I need to modify the kernel cmdline, adding a few options.
At the moment I do it using the following procedure:
- Open /etc/default/grub
- Modify GRUB_CMDLINE_LINUX_DEFAULT, adding the options
- Run update-grub
However, I would prefer to automate this process as a part of a packet installation, and avoid modifying the default file (as this is generally brittle).
What I would want to do is something like:
- Drop a file (in /etc/grub.d/?), overriding GRUB_CMDLINE_LINUX_DEFAULT or similar
- Run update-grub and reboot
There are a pile of scripts in /etc/grub.d/* which are used to build the actual menu config, however, there is no obvious way to interact with them. The script which generates the config only seems to read /etc/default/grub :(
Can somebody enlighten me if there is a way to drop a file to modify the default kernel commandline?