Subject: Re: improvements to mknod(8)
To: <>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 02/07/2003 17:49:09
> While I think you're right that MAKEDEV could use some work, I'm not sure
> that extending mknod is the way to go.  In particular, remember that in a
> diskless environment, MAKEDEV usually gets run on the NFS server, which may
> well not be running NetBSD, and even if it is running NetBSD is likely to be
> a different architecture and version from the system whose /dev is being
> populated.  MAKEDEV isn't as portable as it could be, but making it even
> less portable would be a bad idea IMO.

With the current system, init will run MAKEDEV in an mfs filesystem
when bringing up the system.

This means you don't need to have run it when setting up the
diskless root fs.  It might even make sense for an rc script to
detect the mfs /dev and create the disk version (this can't
be done until after / is remounted rw, and requires a 'umount -f /dev')

That way /dev would be populated by items that are definitely correct
for the current kernel.

With the ability to get the name <=> major mapping out of the kernel
you can even check that /dev is correct while booting.

Having a /dev for the wrong architecture is all too easy to do.
(postinstall will prompt you to execute a command that will install
the wrong MAKEDEV script.)

	David

-- 
David Laight: david@l8s.co.uk