You are not logged in.

#1 2010-10-07 06:03:48

silvik
Member
From: Bucharest/Romania
Registered: 2006-11-08
Posts: 110

[SOLVED] get kernel command line parameters in bash

Let's say that when booting I edit the kernel line in grub boot screen and pass my_special_parameter at the end like:
kernel /vmlinuz26 root=/dev/md0 ro vga=773 my_special_parameter

I'll edit /etc/rc.sysinit and do some mounting IF my_special_parameter is present in kernel's boot line. So I'll have an:
if [[ my_special_parameter is there ]]; then ... fi
or something like that.

So how can i write that condition? is kernel's boot line stored somewhere, in a variable, file, /proc value? It has to be somewhere...
Thanks!

P.S. I'm not sure if I this is the right place for this subject. If not, please move it where it belongs.

Last edited by silvik (2010-10-07 06:29:15)

Offline

#2 2010-10-07 06:25:10

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] get kernel command line parameters in bash

/proc/cmdline

Offline

#3 2010-10-07 06:29:00

silvik
Member
From: Bucharest/Romania
Registered: 2006-11-08
Posts: 110

Re: [SOLVED] get kernel command line parameters in bash

wow, great! exactly what I needed!
thanks

Offline

Board footer

Powered by FluxBB