Re: [PATCH] Console: fall back to /dev/null when no console is availlable

From: Willy Tarreau
Date: Tue Oct 05 2004 - 23:36:44 EST


On Wed, Oct 06, 2004 at 12:58:57AM +0300, Denis Vlasenko wrote:
> > + if (open("/dev/null", O_RDWR, 0) == 0)
> > + printk(" Falling back to /dev/null.\n");
> > + }
>
> What will happen if /dev is totally empty?

... Which is the most probable reason causing this trouble.
I've long wondered why the kernel could not open the /dev/console fds itself
since they are character devices, so handled by the kernel internally. It
should be possible to bypass the file-system access and get the fds anyway.
Or we might need some tricks such as populate rootfs with 'console' before
mounting root, open it, remove the entry while keeping the fd for use after
the real root is mounted. This way, it would not be the real /dev/console
which would be passed to init, so it would never even have to exist.

Comments ?

Willy

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/