Modifying init to create /dev/console ?

Terry Barnaby terry1 at beam.ltd.uk
Wed Feb 28 10:37:48 UTC 2007


Luciano Miguel Ferreira Rocha wrote:
> On Wed, Feb 28, 2007 at 09:23:22AM +0000, Terry Barnaby wrote:
>> Yes, I am using initramfs and thanks for the info. I could use this for 
>> the boot initrd, but the system then mounts its real root fs using a 
>> read only NFS mount. I would prefer not to have a /dev/console in my NFS 
>> mounted file system either ...
> 
> Well, you'll still need some RW paths in your system. You can accomplish
> that for /dev and get a working one too by keeping the one in initramfs:
> 
> mount --bind /dev /nfsroot/dev
> ...
> switch_root
> 
I guess I could do that, but I would like the initial boot tmpfs to have 
gone once the system is booted so that the NFS mounted file system is 
the only one in operation. I have created tmpfs file systems for 
/dev,/tmp etc in my /etc/init.d/rcS script and this works fine if there 
is a /dev/console ...

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.


Terry



More information about the busybox mailing list