5

In GRUB, when loading a kernel, you can pass various parameters to linux/vmlinuz, for example:

menuentry 'GNU/Linux' {
    ...
    linux   /live/vmlinuz boot=live config live-media=removable nopersistence splash
    ...
}

Is it possible for GRUB to automatically read these parameters beforehand and show me which kernel parameters a specific kernel supports?

2 Answers 2

7

No, that's not possible. Even for arguments that are read by the kernel, there's no list compiled into it - the documentation is the only list I'm aware of.

And for arguments that are read by user-space, the possibilities are unlimited.

7

Kernel command line parameters are used by multiple parts of the system:

  • The kernel itself reads these, documented at https://www.kernel.org/doc/html/v4.14/admin-guide/kernel-parameters.html (Note: version specific, this is a random version)
  • Device drivers may have their own parameters. If the driver is a module, you can get a list of them with the modinfo command, listed as param:; these can be set from the kernel command line, module config files in /etc/modprobe.d or on the modprobe command line. (But if the driver is compiled into the kernel or loaded from initrd, it likely has to be on the kernel command line). The driver may also separately document these, or you may need to look at the driver source code to figure them out.
  • systemd uses kernel command line parameters, some of which are documented in the systemd man page under the heading KERNEL COMMAND LINE
  • Any user program can read /proc/cmdline and parse it and use what it finds however it wants.

Note that these uses are not exclusive, and the same parameter can be used by multiple parts of the system, and not always intentionally. (This has been the source of some bugs.)

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.