Second thoughts on MAKEDEV

Joerg Anslik joerg at anslik.de
Wed Mar 16 16:04:38 PST 2005


Hi,

I spent some time playing around with MAKEDEV in order to get a way
for local device owenership/permissions overrides.

For those willing to give it a try, check this out:

http://bettlakenauszuzeln.magic-ceee.com/MAKEDEV.tar.gz

There are three files in this tarball:

MAKEDEV
etc.devices.conf --> Copy to /etc/devices.conf
etc.defaults.devices.conf --> Copy to /etc/defaults/devices.conf

For test purposes, you can install the new MAKEDEV to, let's say,
/tmp/devtest. You'll have to adjust the DEVDIR variable at the
beginning of the MAKEDEV script to "devtest" then. A test run will
create device nodes in the current working directory, not affecting
any "real" entries in /dev.

The /etc/defaults/devices.conf contains all devices MAKEDEV can
create, but due to the huge number, it contains entries with
wildcards. So, "ad0*" will apply to the whole ad0[....] stuff.

Default ownership and permissions were extracted from the original
MAKEDEV script.

To override default ownership and/or permissions, just place a
corresponding entry in your /etc/devices.conf file, like

ad0s1c	root:wheel	666
pass*	bacula:backup	660

And so on. Next time MAKEDEV creates the device nodes, it will use
your local overrides. MAKEDEV also handles the special case of "fd"
device nodes, which live in /dev/fd. To override, let's say, the
entire device family, just put a

fd/*	nobody:wheel	000

or whatever in /etc/devices.conf.

I'm aware there's still a flaw with "*.ctl" entries in the device
files, but before I spend more time beautifying and extending the
script, I'd like to know if you think this all makes sense. At least,
it does make sense for me. (And yes, it can be simplyfied, but this is
a first try. See above... :)

Enjoy the show

--j

-----------------------------------------------------
who | grep -i blonde | talk; cd ~; wine; talk; touch;
unzip; touch; strip; gasp; finger; gasp; mount;
fsck; more; yes; gasp; umount; make clean; sleep





More information about the Submit mailing list