Subject: Re: devfs, was single user mode file comparisons
To: Charles Blundell <cb@kittenz.org>
From: Bill Studenmund <wrstuden@netbsd.org>
List: current-users
Date: 06/09/2003 13:17:05
On Mon, 9 Jun 2003, Charles Blundell wrote:

> on Mon, Jun 09, 2003 at 09:25:59AM -0700, Greywolf wrote:
> > What we'd need is some sort of configuration file that we could let the
> > devfs look at when starting up.  Someone might, for example, have per-
> > missions on disks just slightly different, or they might change them
> > after the system comes up.
>
> mtree?
>
> In rc devfs stop, save specification with mtree -C to some file.
> In rc devfs start, restore it with mtree -u from some file.
>
> So modify as usual with chmod/chown+friends, changes get
> saved automagically next reboot/cron-cycle.

I'd like something better. What we really need is for all our devices to
have locators. Then we tie the permissions (and names) to the locator.
That way if the device moves around, you still get the same names and
permissions. Then you'd pretty much get what we have now, which is a /dev
that you can rename & change permissions as you see fit.

With our current scheme, the kernel exports a constant mapping of device
numbers to devices, and our static /dev maps names with permisssions to
those device numbers. You are free to change the names of devices, since
all that really matters is the device number (major & minor) in the in-dev
inode.

All the devfs proposals I've heard of end up using static names for the
device nodes (/dev/sd1a, /dev/fd0d, etc.). While that gets away from
device numbers (and you don't have to run MAKEDEV to have new devices show
up), we lose the ability to rename things, and permissions (and
ownerships) become difficult.

While something like mtree would cover the ownership and permissions, it
won't handle renaming. The only way to do that is using locators. Once we
do that, we might as well do it for everything. :-) Also, using locators
would help with machines connected to SANs. For Fibre Channel, we can use
WWNs, and for iSCSI we can use target names.

Take care,

Bill