Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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? –  Miro 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? –  Miro 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. –  Miro Feb 3 '12 at 21:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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