From dd6bba093e5163f05fcfb84865b091c7f63dae7e Mon Sep 17 00:00:00 2001 From: dougb Date: Wed, 8 Feb 2012 08:52:40 +0000 Subject: As it stands right now, the default devfs rulesets are only loaded as a side effect of something else using them. If they haven't been loaded already but you want to use them, say for configuring a jail, you're out of luck. So add a knob to always load the default rulesets. While I'm here document the other devfs_ knobs in rc.conf.5. --- etc/defaults/rc.conf | 1 + etc/rc.d/devfs | 3 ++- share/man/man5/rc.conf.5 | 22 +++++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index b9e78ce..e8273d4 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -648,6 +648,7 @@ devfs_rulesets="/etc/defaults/devfs.rules /etc/devfs.rules" # Files containing devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to # apply (must be mounted already, i.e. fstab(5)) +devfs_load_rulesets="NO" # Enable to always load the default rulesets performance_cx_lowest="HIGH" # Online CPU idle state performance_cpu_freq="NONE" # Online CPU frequency economy_cx_lowest="HIGH" # Offline CPU idle state diff --git a/etc/rc.d/devfs b/etc/rc.d/devfs index 82278af..206a3ed 100755 --- a/etc/rc.d/devfs +++ b/etc/rc.d/devfs @@ -16,7 +16,8 @@ stop_cmd=':' devfs_start() { - if [ -n "$devfs_system_ruleset" -o -n "$devfs_set_rulesets" ]; then + if [ -n "$devfs_system_ruleset" -o -n "$devfs_set_rulesets" ] || + checkyesno devfs_load_rulesets; then devfs_init_rulesets if [ -n "$devfs_system_ruleset" ]; then devfs_set_ruleset $devfs_system_ruleset /dev diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 47a325b..5a5cf9d 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2011 +.Dd February 8, 2012 .Dt RC.CONF 5 .Os .Sh NAME @@ -3673,6 +3673,25 @@ is set to these are the flags passed to the .Xr watchdogd 8 daemon. +.It Va devfs_rulesets +.Pq Vt str +List of files containing sets of rules for +.Xr devfs 8 . +.It Va devfs_system_ruleset +.Pq Vt str +Rule name(s) to apply to the system +.Pa /dev +itself. +.It Va devfs_set_rulesets +.Pq Vt str +Pairs of already-mounted +.Pa dev +directories and rulesets that should be applied to them. +For example: /mount/dev=ruleset_name +.It Va devfs_load_rulesets +.Pq Vt bool +If set, always load the default rulesets listed in +.Va devfs_rulesets . .It Va performance_cx_lowest .Pq Vt str CPU idle state to use while on AC power. @@ -4532,6 +4551,7 @@ The default is 30. .Xr chkprintcap 8 , .Xr chown 8 , .Xr cron 8 , +.Xr devfs 8 , .Xr dhclient 8 , .Xr ftpd 8 , .Xr geli 8 , -- cgit v1.1