Re: Devices...

Jesse Pollard (pollard@tomcat.admin.navo.hpc.mil)
Wed, 6 Oct 1999 09:43:44 -0500 (CDT)


--------- Received message begins Here ---------
> From: Robert Dinse <nanook@eskimo.com>
> While the debate on whether or not to create a devfs ensues, I thought I'd
> thrown in my own two cents.
>
> Something I positively hate about Linux now is the way it dynamically
> assigns drives to device names when you boot. So I have for example,
> controller 0 with drives on ID 1, 3, and 5, and it maps them to /dev/sda,
> /dev/sdb, and /dev/sdc, then I add a device on ID 2, and it changes the mapping
> for the last two drives, or remove a device, etc. This is really a PITA.

I would like to see something along the lines of a hardware configuration map:
/hw
pci0
slot0
ctlspec (assume SCSI or USB ... this is text)
target0 (the first real device)
lun0 (assuming multiple luns/device)
s0 (if disk device this would be partition)
s1
...
lun1
...
lunn
target1
...
targetn
slot1
...
slotn
pci1
...

This would allow for missing entries (slot not used, target not used, luns not
used, partition not used...) An empty slot would just not show up. If there
were only one PCI then only one would show. IF two PCI existed, and the first
is dead/disabled, then the first one would not show up.

Variations that are equivalent is naming the slot from the board spec instead
of using the generic "slot<n>" nomenclature. I like generic simply because
if I change SCSI controllers in the slot, but hook the same disks up then
I would not have to change anything to get the previous access paths:

/h2/pci0/slot0/target0/lun0/s0 => would still be my boot partition.

The /dev directory count be setup by just copying the inode information from
the /hw directory (major/minor number, in whatever format they end up in)
or just use a symbolic link.

If the device is a tape drive that uses the minor number (or part) to specify
the functions (usually rewind, norewind, ...) then the slice identifier shown
would become the function identifier.

> Another concern I would have with devfs is the ability for permissions on
> a device to persist across boots. Chances are good that I don't want the
> permissions on a device to be the defaults. So then I have to add yet another
> script to run at boot time to change all of the device permissions which slows
> the boot process.

This should be a security concern - I would prefer the ownership and mode
of the devices to switch back to root. If I want to make the CD world readable
(or floppy read/write) then I should make this change each time I boot
the system.

I would like to be able to assign owners to devices (allocation of a device
for exclusive use by the specified user). This could be achieved by
a control entry for the controller/target/lun/slice as supported by the
driver. Tape drives I would like to assign ownership to all device access
name at once (ie the controller level, target level, ...). This could be
done via an IOCTL that only root could use, but the /hw interface looks
more flexable (especially if the /hw can support ACLs and MAC).
-------------------------------------------------------------------------
Jesse I Pollard, II
Email: pollard@navo.hpc.mil

Any opinions expressed are solely my own.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/