[klibc] initramfs howto

Russell King rmk+klibc at arm.linux.org.uk
Wed Aug 10 02:20:53 PDT 2005


On Wed, Aug 10, 2005 at 11:11:26AM +0200, Andreas Jellinghaus wrote:
> I believe that is wrong: the kernel will try to open /dev/console first
> and not even run init, if that fails. so two files are needed:
> /dev/console and /init.

No.  If /dev/console doesn't exist, /init doesn't get fd0,1,2
automatically opened for it, but /init is still run by the kernel.

What this means is that /init needs to be extra careful about its
startup, and do something with fd0,1,2 if it wishes to ensure that
it doesn't unintentionally read or write files that it's opened via
stdin/stdout/stderr.

That could mean that /init creates /dev/console itself, and then
tries to open it.  Or it could mean that /init creates /dev/null
and uses that instead.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core



More information about the klibc mailing list