aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Margiolis <christos@FreeBSD.org>2026-05-21 11:38:22 +0000
committerChristos Margiolis <christos@FreeBSD.org>2026-05-28 14:06:06 +0000
commita576e5140ef352af6cf227528d1bfc6b964516c8 (patch)
tree52901c3ec9ff6fb2e65cb68c3dea03e147a05629
parentf9f46294d6af2a937afa74938bd4bb6826cbb921 (diff)
rc: virtual_oss: Define some variables in rc.conf
They will now be part of /etc/defaults/rc.conf and be accessible by sysrc(8). Fixes: 70e27ecba518 ("virtual_oss: Introduce virtual_oss_default_control_device rc variable") PR: 295560 Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: 0mp, jrm Pull-Reqeust: https://ron-dev.freebsd.org/FreeBSD/src/pulls/33
-rw-r--r--libexec/rc/rc.conf6
-rw-r--r--libexec/rc/rc.d/virtual_oss12
2 files changed, 6 insertions, 12 deletions
diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf
index 75420e42cdeb..27e8c8456b6f 100644
--- a/libexec/rc/rc.conf
+++ b/libexec/rc/rc.conf
@@ -736,7 +736,11 @@ newsyslog_flags="-CN" # Newsyslog flags to create marked files
mixer_enable="YES" # Run the sound mixer.
opensm_enable="NO" # Opensm(8) for infiniband devices defaults to off
nuageinit_enable="NO" # Run nuageinit at startup
-virtual_oss_enable="NO" # Run virtual_oss at startup
+
+virtual_oss_enable="NO" # Run virtual_oss at startup.
+virtual_oss_configs="dsp" # List of configurations.
+virtual_oss_default_control_device="vdsp.ctl" # Default configuration's
+ # control device.
# rctl(8) requires kernel options RACCT and RCTL
rctl_enable="YES" # Load rctl(8) rules on boot
diff --git a/libexec/rc/rc.d/virtual_oss b/libexec/rc/rc.d/virtual_oss
index 73a486f547a5..07f81aeed4bc 100644
--- a/libexec/rc/rc.d/virtual_oss
+++ b/libexec/rc/rc.d/virtual_oss
@@ -22,13 +22,9 @@ status_cmd="${name}_status"
required_modules="cuse"
-configs=
pidpath="/var/run/${name}"
-default_unit=$(sysctl -n hw.snd.default_unit 2> /dev/null)
-
-# Default configuration's control device.
-: "${virtual_oss_default_control_device:="vdsp.ctl"}"
+default_unit=$(sysctl -n hw.snd.default_unit 2> /dev/null)
virtual_oss_default_args="\
-S \
-C 2 \
@@ -42,12 +38,6 @@ virtual_oss_default_args="\
-l dsp.loop \
-t ${virtual_oss_default_control_device}"
-# Set to NO by default. Set it to "YES" to enable virtual_oss.
-: "${virtual_oss_enable:="NO"}"
-
-# List of configurations to use. Default is "dsp".
-: "${virtual_oss_configs:="dsp"}"
-
# Default (dsp) virtual_oss config.
: "${virtual_oss_dsp:="${virtual_oss_default_args}"}"