[Fwd: Re: [klibc] kinit]

Daniel Thaler daniel at dthaler.de
Wed Oct 27 04:19:43 PDT 2004


H. Peter Anvin wrote:
> Daniel Thaler wrote:
> 
>>
>> There is also no good way of finding out what was passed as root= on the
>> kernel command line. All other values are available to init as
>> environment variables, but root=bla is not.
>> Surely that is not intentional?
>>
> 
> That's incorrect, as far as I know; only parameters not understood by 
> the kernel are exported into the environment.  Blah.
> 
>> Currently I'm mounting proc, reading cmdline and unmounting it again.
>> That seems kind of ... inelegant.
> 
> 
> It works, though, and has worked consistently for the last 9 years.
> 

I think it would make sense to export the root= parameter to userspace. 
The reason for not exporting parameters that are understood by the 
kernel is probably that the kernel uses those parameters and userspace 
does not need them. However in the case of initramfs the kernel does 
_not_ use the root parameter, so init should get it because init _can_ 
use it.

Maybe the entire commandline could even be exported? Init could then 
pass that string to the modules it loads, allowing people to pass module 
parameters that way. I imagine that might be useful for installers and such.

Daniel Thaler



More information about the klibc mailing list