[klibc] kinit cmdline handling change

Aaron Griffin aaronmgriffin at gmail.com
Sun May 7 14:41:57 PDT 2006


On 5/5/06, H. Peter Anvin <hpa at zytor.com> wrote:
> Aaron Griffin wrote:
> > The following patch swaps the command line handling of kinit.  It
> > seems apparent that, if one were to call kinit like so:
> >   kinit root=/foo/bar
> > They would be attempting to override the /proc/cmdline.  As it stands,
> > kinit parses the /proc/cmdline *first*, meaning the above does not
> > work.
> >
> > Just for a simple use case:
> > User A has an encrypted root device, root=/dev/hda3
> > Some init scripts detect this, and set up the dev-mapper mapping, as
> > /dev/mapper/cryptoroot.
> >
> > The scripts then need a way to replace the root parameter, so that
> > kinit will load off the cryptoroot device, instead of the encrypted
> > volume.  As it stands there is no way to do this (/proc/cmdline is
> > readonly).
>
> That makes sense.

Hmmm, also, I would assume the init_argc and init_argv should use
these cumulative params, instead of only the params passed to kinit. 
It would simply clean up kinit usage.  Currently, it requires:
kinit myparam=1 another=2 $(cat /proc/cmdline)
in order to set the proper runlevel and things of that nature, yes
/proc/cmdline is already read/parsed from within kinit anyway.

I can send a patch, but it's fairly trivial.



More information about the klibc mailing list