I want to identify which menu entry has been lauched in rc scripts.

So is it possible to pass any variable into my system via kernel argument?

link|improve this question

feedback

1 Answer

up vote 3 down vote accepted

You can read the kernel command-line out of /proc/cmdline, which is set by grub. That is the most direct way to access that data. It may even include the details you want already.

link|improve this answer
That's good, but how can i add any items into kernel command-line without affecting of anything else? – Miro Feb 3 at 21:13
I don't follow your question. Grub sets the kernel command line, which appears to be what you are asking about. How you configure grub is between you and your distribution. – Daniel Pittman Feb 3 at 21:15
OK. But my question is how to pass any variable. So how can i pass variable without affecting anything else? – Miro Feb 3 at 21:17
Oh. As long as whatever you add isn't a command line option that Linux recognises, it will be ignored. – Daniel Pittman Feb 3 at 21:21
I hadn't knew this. Thanks. – Miro Feb 3 at 21:22
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.