Modifying init to create /dev/console ?

Terry Barnaby terry1 at beam.ltd.uk
Tue Feb 27 13:45:49 PST 2007


Mike Frysinger wrote:
> On Tuesday 27 February 2007, Terry Barnaby wrote:
>> However, init and other programs obviously require /dev/console (and
>> other /dev entries).
> 
> they dont require /dev/console
> 
>> I was wondering about adding an option to init where it would create a
>> tmpfs file system, mount it on /dev and create a /dev/console node if no
>> /dev/console was found. I guess it could do a bit more and function as
>> udev as well.
> 
> it wouldnt work ... the kernel opens up /dev/console before executing init, so 
> even if /sbin/init created the device node, it wouldnt matter
> 
> also, this is what init scripts are for ... such / policy handling does not 
> belong hardcoded in the C code
> -mike

No, they don't require /dev/console just to operate, but if you want 
debug printout they do :)

Init could easily reopen its controlling terminal to the created 
/dev/console and continue ...

The reason I was looking at getting init to create /dev/console was so 
that I could debug my init scripts that are not working when 
/dev/console does not exist ...

Terry


More information about the busybox mailing list