Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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.

share|improve this answer
That's good, but how can i add any items into kernel command-line without affecting of anything else? – kravemir Feb 3 '12 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 '12 at 21:15
OK. But my question is how to pass any variable. So how can i pass variable without affecting anything else? – kravemir Feb 3 '12 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 '12 at 21:21
I hadn't knew this. Thanks. – kravemir Feb 3 '12 at 21:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .