Subject: Re: kern/7170
To: Todd Vierling <>
From: David Laight <>
List: netbsd-bugs
Date: 12/01/2003 22:36:37
On Mon, Dec 01, 2003 at 05:15:34PM -0500, Todd Vierling wrote:
> On Mon, 1 Dec 2003 wrote:
> : State-Changed-From-To: open->closed
> : State-Changed-By: dsl
> : State-Changed-When: Mon Dec 1 21:32:51 UTC 2003
> : State-Changed-Why:
> : init.main will create an MFS /dev if /dev/console is absent.
> While this does implement *one* of the cases mentioned in 7170, I wouldn't
> say that this completely fixes the bug in question, as a MFS /dev requires a
> valid /dev/MAKEDEV containing information about /dev/console.  It also
> requires that the running kernel have MFS compiled in, which may not be the
> case in a low memory flash disk based embedded system.
> It certainly doesn't help if someone hosed *all* of /dev, which is part of
> the point of kern/7170:  to add some way that you can get to /bin/sh even if
> /dev is hosed altogether.  Since the kernel does in fact "know" what the
> console major/minor is, it shouldn't be a problem to have it roll a file
> descriptor onto 0/1/2 before running init.

init contains:

	if (mknod(_PATH_CONSOLE, 0666 | S_IFCHR, dev) == -1)

So it doesn't rely on MAKEDEV to create /dev/console.


David Laight: