devfs rules

David Collins davidcollins001 at gmail.com
Wed Jan 27 01:58:19 UTC 2010


Hi,

I am trying to get devfs to only show me a few devices but I can't
seem to get devfs to recognise the new rules that I create.

devfs recognises some of the rules but not all of them:
# devfs -m /path/to/jail rule showsets
1
2
3
4
8
9
10
11

Rules 12 and 13 are not recognised. If I try to set the devfs ruleset
to 4 (for jail in /etc/defaults/devfs.rules) for the /dev mounted in
the jail then add the rules and applyset everything works fine.

When i try to start the jail I get the following:

viper:/usr/jails# /etc/rc.d/jail restart myjail
Configuring jails:.
Starting jails:devfs rule: expecting argument for include
devfs rule: expecting argument for include
/etc/rc.d/jail: WARNING: devfs_set_ruleset: you must specify a ruleset
number
devfs rule: ioctl DEVFSIO_SAPPLY: No such process

I'm not sure why I get the first warning, it doesn't seem to prevent
anything from working in my other jails. The second warning is because
devfs can't find the rule set (defined as
jail_avr_devfs_ruleset="devfsrules_jail_avr" in rc.conf)

Can anyone shed any light on this for me I can't seem to figure it
out. Googling doesn't seem to help me either

viper:~$ uname -a
FreeBSD viper 7.0-RELEASE-p12 FreeBSD 7.0-RELEASE-p12 #0: Wed Oct  7 13:39:21 BST 2009 VIPER  i386




The contents of my devfs.rules is below

# cat /etc/devfs.rules
#
# Devices for xserver in jail
#
[devfsrules_unhide_xorg=8]
add path agpgart unhide
#add path console unhide
add path dri unhide
add path 'dri*' unhide
add path io unhide
add path mem unhide
#add path pci unhide
add path tty unhide
add path ttyv0 unhide
add path ttyv1 unhide
add path ttyv8 unhide

[devfsrules_unhide_cam=9]
add path 'da*' unhide
add path 'cd*' unhide

[devfsrules_unhide_kmem=10]
add path kmem unhide

#
# This allows to run a desktop system in a jail.  Think about what you want to
# achieve before you use this, it opens up the entire machine to access from
# this jail to any sophisticated program.
#
[devfsrules_jail_desktop=11]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add include $devfsrules_unhide_audio
add include $devfsrules_unhide_input
add include $devfsrules_unhide_xorg
add include $devfsrules_unhide_cam
add include $devfsrules_unhide_kmem


#
# add include $devfsrules_jail
#
[devfsrules_jail_dhcp=12]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add path 'bpf*' unhide
add path net unhide
add path 'net/*' unhide

#
# dev rules for serial avr device jail
#
[devfsrules_jail_avr=13]
add include $devfsrules_jail
add path 'cuaU*' unhide



David Collins


More information about the freebsd-questions mailing list