Modifying init to create /dev/console ?

Terry Barnaby terry1 at beam.ltd.uk
Thu Mar 1 06:49:18 UTC 2007


Denis Vlasenko wrote:
> On Wednesday 28 February 2007 11:37, Terry Barnaby wrote:
>> Luciano Miguel Ferreira Rocha wrote:
>> I have had a quick look at the busybox init, and it appears that if 
>> there is not a /dev/console or /dev/null then it will not run any of the 
>> scripts .... So /dev/console or /dev/null is required for init to run.
>>
>> I am still thinking it would be best to add the ability for init to 
>> create a basic /dev with /dev/console etc if these do not exist. This
>> still appears a cleaner way of doing things to me at the moment ...
>> This could be done internally or by calling an external script from
>> init although it would be nice if /dev/console existed as early on as 
>> possible to at-least get debug info from programs running.
> 
> kernel boored with: init=/somewhere/fix_dev.sh
> 
> fix_dev.sh:
> 
> #!/bin/sh
> mknod ... /dev/....
> exec /sbin/init "$@"
> 
> No hacking in init! :)
> 
> Do you see any problems with this approach?
> --
> vda
Hi,

No problems I can see with this approach apart from the kernel boot line 
needing changing in all places and I'm not sure if it will work across a 
switch_root. But, I do prefer getting init to do the work. Using init, I 
believe, is cleaner, simpler and more in keeping with what init is 
supposed to do, assuming you want to use the init boot approach of 
course (and no hacking in sh! :) )

Cheers


Terry



More information about the busybox mailing list