init requires /dev/vc devices

Rob Landley rob at landley.net
Wed Feb 15 17:12:08 UTC 2006


On Wednesday 15 February 2006 10:52 am, Martin Michlmayr wrote:
> * Colin Watson <cjwatson at debian.org> [2006-02-15 15:38]:
> > I hope Martin can point you to what he's using; any of the builds on
> > http://www.debian.org/devel/debian-installer/ should do if booted from a
> > serial console, but Martin's on MIPS hardware and I don't know if this
> > reproduces on i386.
>
> You can only reproduce it on machines which don't have any virtual
> consoles; or I suppose possibly by disabling virtual console support
> in the kernel and only enabling serial console.
>
> > Our problem is that if we don't create the devices, init fails to
> > spawn programs when run on hardware with virtual consoles; but if we
> > do create the devices then apparently it breaks on hardware without
> > virtual consoles.
>
> That's exactly the problem.

Lemme see if I understand this:

You have an inittab telling busybox init to spawn things on three consoles 
that either don't exist when you run init, or are invalid device nodes.  The 
current busybox init is not failing gracefully when you do this.

Let's see...  Pull up the current source code...

The first problem seems to be that new_init_action() in busybox/init/init.c 
calls access() on cons, and returns if that fails.  I.E. it doesn't add the 
inittab line to the linked list if the console you said to run it on doesn't 
exist at the time it reads the inittab.

That's a sequencing issue.  Whoever wrote this didn't expect the sysinit 
script to completely redo the contents of /dev.  If I can get it clear in my 
head exactly what you want to do, I can take a whack at fixing it.  But right 
now I'm trying to put together the 1.1.1 release, and that comes first.

In the long term, this should be fixed (although we're unlikely to backport 
the fix to 1.0.1 now that 1.1.0 is out).  In the short term, there are a few 
possible workarounds.  You could have your wrapper figure out whether or not 
it needs to create the device nodes before calling /init.  Or you could run 
sed against inittab.

Our init is dumb enough to believe what inittab tells it.

Rob
-- 
Never bet against the cheap plastic solution.



More information about the busybox mailing list