file mode on dynamicly created cua/tty devices

Randy Primeaux randyprimeaux at gmail.com
Sat Apr 2 16:24:17 PST 2005


Roland, thanks.  Kris, I'd read "man devfs", but couldn't wrap my head
around it in the time available.  The comments in this email are for
the benefit of future readers.

I solved my issue my implementing a ruleset as Roland had suggested in
his webpage, and applied the ruleset.  And yes, the man page helped me
through this process.

***** 
/etc/devfs.rules

[chuck_usb=10]
add path 'da*' mode 0660 group usb
add path 'cua*' mode 0666
*****
/etc/rc.conf

# Set the default devfs ruleset.
devfs_system_ruleset="chuck_usb"
*****
This is a sample of what I did at the commandline.

# /sbin/devfs rule -s 10 add path 'cua*' mode 0666
# /sbin/devfs ruleset 10 apply
# ls -laF /dev/cua*
crw-rw-rw-  1 root  wheel   12, 152 Apr  2 14:00 /dev/cuaU0
crw-rw-rw-  1 root  wheel   12, 155 Apr  1 00:38 /dev/cuaU0.init
crw-rw-rw-  1 root  wheel   12, 154 Apr  1 00:38 /dev/cuaU0.lock
crw-------  1 root  wheel   12,  70 Apr  1 00:38 /dev/cuad0
crw-------  1 root  wheel   12,  65 Apr  1 00:38 /dev/cuad0.init
crw-------  1 root  wheel   12,  64 Apr  1 00:38 /dev/cuad0.lock


I wasn't able to correctly "add path" directly.

#devfs add path 'cua*' mode 0666
devfs: unknown command: add

# devfs rule add path 'cua*' mode 0666
devfs rule: ioctl DEVFSIO_RADD: Input/output error


Now I can hotsync and backup my Palm with Kpilot.  Yay!


On Apr 2, 2005 1:10 AM, Roland Smith <rsmith at xs4all.nl> wrote:
> On Fri, Apr 01, 2005 at 08:12:05PM -0800, Randy Primeaux wrote:
> > How do I set file mode to 0666 on dynamicly created devices, such as
> > cua* and tty* ?
> 
> With devfs(8). To set the permissions from the command line, use
> 
> devfs add path 'cua*' mode 0666
> 
> This setting is lost at reboot, unless you put it in
> /etc/devfs.rules. See my freebsd page at
> http://www.xs4all.nl/~rsmith/freebsd/ for a more thorough explenation.
> 
> Roland
> --
> R.F. Smith                           /"\    ASCII Ribbon Campaign
> r s m i t h @ x s 4 a l l . n l      \ /    No HTML/RTF in e-mail
> http://www.xs4all.nl/~rsmith/         X     No Word docs in e-mail
> public key: http://www.keyserver.net / \    Respect for open standards


More information about the freebsd-questions mailing list