special console handling

Andy Whitcroft apw at canonical.com
Wed Jan 26 13:30:48 UTC 2011


On Wed, Jan 26, 2011 at 11:57:57AM +0000, James Hunt wrote:

> > I don't know when this was added, but in 2.6.35 at least, if
> > CONFIG_INIT_PASS_ALL_PARAMS is set, then everything is passed to init.
> Not everything seemingly: testing on natty (2.6.37-12) and passing the
> following params on the kernel command-line:
> 
>     console=ttyS0 console=tty console=ttyUSB0,115200n8r
> 
> # tr '\0' '\n' < /proc/1/environ|grep -i console
> console=ttyUSB0
> #

Indeed as we 'setenv' each parameter into the environment of init I
would expect only the last one to be there from the current
implementation.

> So, obviously the kernel couldn't pass 3 values with the same name into
> inits environment, but it has only passed *part* of the last of the two
> of the valid "console=" params I specified. Checked that initramfs gets
> the same result. Doing a bit of poking around, it looks like the serial
> driver may be modifying the special "console=" param before it is set in
> inits environment.

That sounds plausable and rather unfortuanate of the serial driver.  If
its actually damaged the parameter during the processing we would get
whatever is left afterwards.

If we assume that the serial issue is simply a 'bug' we can likely fix
that pretty easy.  How to represent more than one option on the kernel
command line in the environment is more of a challenge.  I guess we
could simply append the ' <value>' to the variable if it already exists
(based on the assumtion that its not possible to write 'foo=this that'
on the command line).  Any other bright ideas?

-apw



More information about the upstart-devel mailing list