Passing arguments to initrd's 'init' script.
Ryan Lynch
ryan.b.lynch at gmail.com
Mon May 11 14:50:25 UTC 2009
Is it possible to pass arguments from the kernel (boot) command line to the
'init' script located in my initrd? If so, is there a best-practice method
for doing this?
Looking at the non-initrd system init script '/etc/event.d/rcS', I see that
it just reads '/proc/cmdline' and looks for relevent tokens:
{{{
for t in $(cat /proc/cmdline); do
case $t in
-s|single|S|s) runlevel="S" ;;
[1-9]) runlevel="$t" ;;
esac
done
}}}
I assume that the initrd's 'init' script has access to this same
information, at least after it mounts '/proc'. Is there some reason not to
use this from the initrd, or is it acceptable?
This is related to a larger question I have about 'mkinitrd' and the 'init'
script: Why does 'mkinitrd' hard-code the name of the LVM root device,
among other things, instead of reading it from the 'root=' parameter on the
boot command line? Wouldn't it make more sense to dynamically pick up the
root device on each boot, using a method similar to the 'rcS' script, above?
-Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090511/17fc6741/attachment-0001.htm>
More information about the fedora-list
mailing list