1

I learned that if the kernel does not understand a parameter, it saves it and passes it to init when performing the user space start.

While e.g. in show parameters of running kernel or How to display kernel command line parameters? you learn that

cat /proc/cmdline shows

Arguments passed to the Linux kernel at boot time

and sysctl --all

shows up all possible kernel parameters

... they do not tell me which of the parameters are actually not processed by the kernel but passed along to init.

How can I check which parameters the kernel actually accepted and which are passed on? How can I display the parameters that were provided to init?

I guess it depends on the actual implementation of init (systemd, upstart, systemvinit)...

5
  • 1
    My question is different: The referenced question(s) do not tell me which of the boot parameters are actually passed along to init. Commented May 10, 2015 at 17:23
  • 1
    For having built initial ramdisks quite a lot of times, I don't think there is such thing as the kernel "passing parameters to init" as it is not necessary. In fact boot parameters are accessible throughout the running time of your system — via /proc/cmdline — and any application, init included, can grab and interpret any parameter it likes. See argument nox on certain distributions for example. The latter prevents X from starting automatically and is interpreted by a script in /etc/init.d not init itself.
    – user86969
    Commented May 10, 2015 at 18:14
  • I took the info from the book "How Linux Works 2n ed." by Brain Ward. He writes on page 96: "Upon encountering a parameter that it does not understand, the Linux kernel saves the parameter. The kernel later passes the parameter to init when performing the user space start. For example, if you add -s to the kernel parameters, the kernel passes the -s to the init program to indicate ..." Commented May 10, 2015 at 18:18
  • Then, intuitively, I'd expect cat /proc/1/cmdline to give me the answer you're looking for.
    – user86969
    Commented May 10, 2015 at 18:23
  • Brian Ward probably talks about boot flags as -s indeed is one of these and it means "boot in single user mode". Refer to man init for details. I learnt something new today :D .
    – user86969
    Commented May 10, 2015 at 18:34

0

Browse other questions tagged .