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

From: Jörn Engel
Date: Wed Oct 06 2004 - 07:17:17 EST


On Wed, 6 October 2004 10:43:52 +0200, Geert Uytterhoeven wrote:
> On Wed, 6 Oct 2004, Willy Tarreau wrote:
> > 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 have no idea about the probability, but in the one case I worry
about, a console is explicitly disabled because it is not wanted.
/dev does exist and is populated.

> Some debug methods use register_console() to get their print routines
> registered. If people forget to say e.g. `console=tty0' afterwards, the debug
> console without the real device cannot be opened through /dev/console, and they
> get a mysterious error. Usually /dev/console _is_ present in the root fs.

Yes, I thought about doing things at a different level as well. If
there really is no console, shouldn't /dev/console have the same
behavious as /dev/null?

Point is that above patch is simpler and empiria didn't give me a
reason to worry about anything else.

Jörn

--
Time? What's that? Time is only worth what you do with it.
-- Theo de Raadt
-
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/