Passing arguments to initrd's 'init' script.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux