Second thoughts on MAKEDEV

看板DFBSD_submit作者時間21年前 (2005/03/17 08:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/4 (看更多)
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
文章代碼(AID): #12ED0800 (DFBSD_submit)
文章代碼(AID): #12ED0800 (DFBSD_submit)