From b8ce6fd21e609d22c41fb688665094cd88996128 Mon Sep 17 00:00:00 2001 From: jlam Date: Wed, 2 Oct 2002 21:06:53 +0000 Subject: * Move sound{on,off,conf} to ${PREFIX}/sbin. * Make the oss rc.d script smarter: check that soundconf has been run before starting, and check that the OSS LKM is loaded before unloading it when stopping. * Ensure the OSS LKM is unloaded before deinstalling. --- audio/oss/DEINSTALL | 8 +++++++- audio/oss/Makefile | 8 ++++---- audio/oss/PLIST | 8 ++++---- audio/oss/files/oss.sh | 22 +++++++++++++++------- 4 files changed, 30 insertions(+), 16 deletions(-) (limited to 'audio') diff --git a/audio/oss/DEINSTALL b/audio/oss/DEINSTALL index 73166c46691..e24896203d9 100644 --- a/audio/oss/DEINSTALL +++ b/audio/oss/DEINSTALL @@ -1,10 +1,16 @@ -# $NetBSD: DEINSTALL,v 1.1.1.1 2002/10/02 20:33:31 jlam Exp $ +# $NetBSD: DEINSTALL,v 1.2 2002/10/02 21:06:53 jlam Exp $ OSSLIBDIR="@OSSLIBDIR@" SFILES="@SFILES@" case ${STAGE} in DEINSTALL) + # + # Ensure the OSS LKM is unloaded. + # + if [ -f @RCD_SCRIPTS@/oss ]; then + @RCD_SCRIPTS@/oss forcestop + fi # # Unconditionally remove the OSS files in /etc. # diff --git a/audio/oss/Makefile b/audio/oss/Makefile index 877b4879490..5798b263149 100644 --- a/audio/oss/Makefile +++ b/audio/oss/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1.1.1 2002/10/02 20:33:30 jlam Exp $ +# $NetBSD: Makefile,v 1.2 2002/10/02 21:06:53 jlam Exp $ DISTNAME= oss397d-netbsd-v1.6 PKGNAME= oss-3.97d @@ -64,9 +64,9 @@ do-install: chroot ${LN} -sf ../lib/oss/play ${PREFIX}/bin/ossplay ${LN} -sf ../lib/oss/record ${PREFIX}/bin/ossrecord ${LN} -sf ../lib/oss/savemixer ${PREFIX}/bin/osssavemixer - ${LN} -sf ../lib/oss/soundconf ${PREFIX}/bin/soundconf - ${LN} -sf ../lib/oss/soundoff ${PREFIX}/bin/soundoff - ${LN} -sf ../lib/oss/soundon ${PREFIX}/bin/soundon + ${LN} -sf ../lib/oss/soundconf ${PREFIX}/sbin/soundconf + ${LN} -sf ../lib/oss/soundoff ${PREFIX}/sbin/soundoff + ${LN} -sf ../lib/oss/soundon ${PREFIX}/sbin/soundon ${RM} -rf ${WRKSRC}/bin ${WRKSRC}/sbin ${WRKSRC}/usr ${RM} -f ${WRKSRC}/dev/mixer0 ${WRKSRC}/dev/null diff --git a/audio/oss/PLIST b/audio/oss/PLIST index dd87e3dc0f8..549019b45f2 100644 --- a/audio/oss/PLIST +++ b/audio/oss/PLIST @@ -1,13 +1,10 @@ -@comment $NetBSD: PLIST,v 1.1.1.1 2002/10/02 20:33:31 jlam Exp $ +@comment $NetBSD: PLIST,v 1.2 2002/10/02 21:06:54 jlam Exp $ bin/ossplay bin/ossmixer bin/ossmplay bin/ossrecord bin/osssavemixer bin/ossxmix -bin/soundconf -bin/soundoff -bin/soundon lib/oss/Cards.lis lib/oss/LICENSE lib/oss/MAKEDEV.oss @@ -95,6 +92,9 @@ lib/oss/ui_curses.so lib/oss/ultrasound.h lib/oss/uninstall.sh lib/oss/za2v2.dat +sbin/soundconf +sbin/soundoff +sbin/soundon @dirrm lib/oss/include/sys @dirrm lib/oss/include @dirrm lib/oss/docs diff --git a/audio/oss/files/oss.sh b/audio/oss/files/oss.sh index 31ae0be8218..f423dad3bcf 100644 --- a/audio/oss/files/oss.sh +++ b/audio/oss/files/oss.sh @@ -1,6 +1,6 @@ #!@RCD_SCRIPTS_SHELL@ # -# $NetBSD: oss.sh,v 1.2 2002/10/02 20:46:46 jlam Exp $ +# $NetBSD: oss.sh,v 1.3 2002/10/02 21:06:55 jlam Exp $ # # PROVIDE: oss # REQUIRE: aftermountlkm @@ -12,23 +12,31 @@ fi name="oss" rcvar=$name -required_files="/etc/oss.conf" +required_files="/etc/oss.conf @OSSLIBDIR@/devices.cfg" start_cmd="oss_start" stop_cmd="oss_stop" oss_start() { - if [ -x @PREFIX@/bin/soundon ]; then + missing_files= + for file in ${required_files}; do + if [ ! -f "${file}" ]; then + missing_files="${missing_files} ${file}" + fi + done + if [ -z "${missing_files}" -a -x @PREFIX@/sbin/soundon ]; then @ECHO@ "Starting ${name}." - @PREFIX@/bin/soundon + @PREFIX@/sbin/soundon fi } oss_stop() { - if [ -x @PREFIX@/bin/soundoff ]; then - @ECHO@ "Stopping ${name}." - @PREFIX@/bin/soundoff + if modstat -n oss >/dev/null; then + if [ -x @PREFIX@/sbin/soundoff ]; then + @ECHO@ "Stopping ${name}." + @PREFIX@/sbin/soundoff + fi fi } -- cgit v1.2.3