summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/defaults/rc.conf2
-rw-r--r--etc/rc.d/moused43
-rw-r--r--etc/usbd.conf2
3 files changed, 42 insertions, 5 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 0916c34..417b665 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -362,6 +362,8 @@ font8x14="NO" # font 8x14 from /usr/share/syscons/fonts/* (or NO).
font8x8="NO" # font 8x8 from /usr/share/syscons/fonts/* (or NO).
blanktime="300" # blank time (in seconds) or "NO" to turn it off.
saver="NO" # screen saver: Uses /boot/kernel/${saver}_saver.ko
+moused_nondefault_enable="YES" # Treat non-default mice as enabled unless
+ # specifically overriden in rc.conf(5).
moused_enable="NO" # Run the mouse daemon.
moused_type="auto" # See man page for rc.conf(5) for available settings.
moused_port="/dev/psm0" # Set to your mouse port.
diff --git a/etc/rc.d/moused b/etc/rc.d/moused
index 9ef5ee5..9d35a05 100644
--- a/etc/rc.d/moused
+++ b/etc/rc.d/moused
@@ -14,11 +14,47 @@ name=moused
rcvar=`set_rcvar`
command="/usr/sbin/${name}"
start_cmd="moused_start"
+_pidprefix="/var/run/moused"
+pidfile="${_pidprefix}.pid"
+_pidarg=
+load_rc_config $name
+
+# Set the pid file and variable name. The second argument, if it exists, is
+# expected to be the mouse device.
+#
+if [ -n "$2" ]; then
+ checkyesno moused_nondefault_enable &&
+ eval moused_$2_enable=\${moused_$2_enable-YES}
+ rcvar=`set_rcvar moused_$2`
+ pidfile="${_pidprefix}.$2.pid"
+ _pidarg="-I $pidfile"
+fi
moused_start()
{
- echo -n 'Starting moused:'
- /usr/sbin/moused ${moused_flags} -p ${moused_port} -t ${moused_type}
+ local ms myflags myport mytype
+
+ # Set the mouse device and get any related variables. If
+ # a moused device has been specified on the commandline, then
+ # rc.conf(5) variables defined for that device take precedence
+ # over the generic moused_* variables. The only exception is
+ # the moused_port variable, which if not defined sets it to the
+ # passed in device name.
+ #
+ ms=$1
+ if [ -n "$ms" ]; then
+ eval myflags=\${moused_${ms}_flags-$moused_flags}
+ eval myport=\${moused_${ms}_port-/dev/$ms}
+ eval mytype=\${moused_${ms}_type-$moused_type}
+ else
+ ms="default"
+ myflags="$moused_flags"
+ myport="$moused_port"
+ mytype="$moused_type"
+ fi
+
+ echo -n "Starting ${ms} moused:"
+ /usr/sbin/moused ${myflags} -p ${myport} -t ${mytype} ${_pidarg}
_mousechar_arg=
case ${mousechar_start} in
@@ -36,5 +72,4 @@ moused_start()
echo '.'
}
-load_rc_config $name
-run_rc_command "$1"
+run_rc_command $*
diff --git a/etc/usbd.conf b/etc/usbd.conf
index 03c3f4f..6c79348 100644
--- a/etc/usbd.conf
+++ b/etc/usbd.conf
@@ -46,7 +46,7 @@ device "Handspring Visor"
#
device "Mouse"
devname "ums[0-9]+"
- attach "/usr/sbin/moused -p /dev/${DEVNAME} -I /var/run/moused.${DEVNAME}.pid ; /usr/sbin/vidcontrol -m on"
+ attach "/etc/rc.d/moused start ${DEVNAME}"
# The fallthrough entry: Nothing is specified, nothing is done. And it isn't
# necessary at all :-). Just for pretty printing in debugging mode.
OpenPOWER on IntegriCloud