Subject: Re: devices in /dev
To: Roberto <roberto.trovo@redix.it>
From: Sean Davis <dive@endersgame.net>
List: current-users
Date: 03/30/2005 08:04:24
On Wed, Mar 30, 2005 at 10:08:52AM +0200, Roberto wrote:
> 
> > On Wed, Mar 30, 2005 at 10:45:51AM +0700, Ian Zagorskih wrote:
> >> Of course you need to create [/dev special files] manually :)
> >> /sbin/init does not create any devices.
> >
> > From NetBSD-2.0 src/sbin/init.c
> >
> >         /* Run the makedev script to create devices */
> >         switch ((pid = fork())) {
> >         case 0:
> >                 dup2(2, 1);     /* Give the script stdout */
> >                 if (chdir("/dev") == 0)
> >                         (void)execl(INIT_BSHELL, "sh",
> >                             mfile[0].len ? "./MAKEDEV" : "/etc/MAKEDEV",
> >                             "init", NULL);
> >
> > What is going on here?
> >
> > Ben
> >
> 
> On NetBSD 1.6.x, if init will not find /dev/console it will create a
> memory fs and populate it with device file (using MAKEDEV).
> On 2.0 and Current I've not tried yet.

It creates them on 2.0 and -current as well, in an MFS. Of course, if your
kernel lacks MFS, you lose on that one. I prefer creating them by hand
anyway (or letting the installer create them, but if you're making something
custom you're probably not using sysinst)

- Sean

--
 _
( ) ASCII Ribbon Campaign
 X
/ \ For Plain Text Email