Date: Wed, 7 Dec 2011 09:02:20 -0600 From: "Zane C. B-H." <v.velox@vvelox.net> To: freebsd-questions@freebsd.org, Mike Clarke <jmc-freebsd2@milibyte.co.uk> Subject: Re: umass to /dev/da* mapping Message-ID: <20111207090220.2f970f1d@vixen42.vulpes.vvelox.net> In-Reply-To: <201112071251.47968.jmc-freebsd2@milibyte.co.uk> References: <201112051708.16072.jmc-freebsd2@milibyte.co.uk> <20111207044901.72ace69f@vixen42.vulpes.vvelox.net> <201112071251.47968.jmc-freebsd2@milibyte.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 7 Dec 2011 12:51:47 +0000 Mike Clarke <jmc-freebsd2@milibyte.co.uk> wrote: > On Wednesday 07 December 2011, Zane C. B-H. wrote: > > > Why are you using a custom Perl script for this instead of the > > built in tools for this? > > > > Below is how I have it setup on my system... > > > > In /etc/devfs.rules... > > > > [localrules=10] > > add path 'da*s*' mode 0660 group 5001 > > Because devfs only relates to boot time and I want to deal with usb > sticks inserted while the system is running. The allocation of > device numbers is dynamic and depends on what other umass devices > are already connected. Normally my internal memory card reader is > allocated da[0-3] at boot time and the memory stick will appear as > da4 when subsequently inserted but if it's already plugged in when > the system boots then it appears as da0 and the card reader is > da[1-4]. If I insert an extra memory stick it will be allocated the > next available device number. I don't want the user to have to hunt > around to determine which device to mount so my script takes the > umass device number supplied by devd and determines the relevant > da* device then it sets the permission to 660 for that device and > creates a link, /dev/usbstick, pointing to it. All the user then > has to do is mount /dev/usbstick on his mount point. > > Following the earlier tip from Polytropon I now have a working > script which does exactly what I need. Still you will want to investigate what I've mentioned. It will drastically simplify permission stuff as well as make automatic. The devfs stuff is just not boottime only, but will be applied to any new device added etc post boot.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111207090220.2f970f1d>