From 8cfd0e203c1b03f31c1ae76dadec45dbe1d73696 Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Sat, 21 Sep 2019 18:13:31 +0000 Subject: audio/oss: Improve handling when sound.ko is compiled into the kernel. Now, soundon checks for its presence and fails with an appropriate error. While here, add it to pkg-message. I use this still as I have a Xonar D2X which FreeBSD's drivers don't support, so I'll take maintainership. PR: ports/240200 --- audio/oss/Makefile | 3 ++- audio/oss/files/patch-setup_FreeBSD_sbin_soundon | 32 ++++++++++++++++++------ audio/oss/pkg-message | 5 ++++ 3 files changed, 32 insertions(+), 8 deletions(-) (limited to 'audio/oss') diff --git a/audio/oss/Makefile b/audio/oss/Makefile index 0662b0b8ae53..f89d78e7a107 100644 --- a/audio/oss/Makefile +++ b/audio/oss/Makefile @@ -3,11 +3,12 @@ PORTNAME= oss DISTVERSION= 4.2-build2019 +PORTREVISION= 1 CATEGORIES= audio MASTER_SITES= http://www.opensound.com/developer/sources/stable/bsd/ DISTNAME= ${PORTNAME}-v${DISTVERSION}-src-bsd -MAINTAINER= ports@FreeBSD.org +MAINTAINER= crees@FreeBSD.org COMMENT= Open Sound System from 4Front Technologies LICENSE= BSD2CLAUSE diff --git a/audio/oss/files/patch-setup_FreeBSD_sbin_soundon b/audio/oss/files/patch-setup_FreeBSD_sbin_soundon index ac0076f71181..55c6a36cafb2 100644 --- a/audio/oss/files/patch-setup_FreeBSD_sbin_soundon +++ b/audio/oss/files/patch-setup_FreeBSD_sbin_soundon @@ -1,5 +1,5 @@ ---- setup/FreeBSD/sbin/soundon.orig 2014-02-14 22:59:55 UTC -+++ setup/FreeBSD/sbin/soundon +--- setup/FreeBSD/sbin/soundon.orig 2014-02-14 22:59:55.000000000 +0000 ++++ setup/FreeBSD/sbin/soundon 2019-09-21 19:07:29.295818000 +0100 @@ -1,10 +1,10 @@ #!/bin/sh @@ -14,7 +14,7 @@ fi LOG=/var/log/soundon.log -@@ -29,7 +29,7 @@ fi +@@ -29,7 +29,7 @@ if test -f $OSSLIBDIR/etc/license.asc then @@ -23,7 +23,25 @@ fi OPTIONS= -@@ -70,7 +70,7 @@ do +@@ -42,6 +42,17 @@ + fi + fi + ++if kldstat -v |grep -q sound; then ++ if kldstat |grep -q sound\\\.ko; then ++ echo Please remove the FreeBSD sound modules and try again ++ echo 'You can do this with # kldunload sound' ++ else ++ echo You must recompile your kernel without the built in sound ++ echo drivers\; please refer to the FreeBSD Handbook ++ fi ++ exit 4 ++fi ++ + if ! /sbin/kldload $OSSLIBDIR/modules/osscore.ko + then + echo Loading the osscore module failed +@@ -70,7 +81,7 @@ done echo "+++ ossinfo -v3 +++" >> $LOG @@ -32,7 +50,7 @@ echo "+++ /dev/sndstat +++" >> $LOG cat /dev/sndstat >> $LOG 2>&1 echo "+++ dmesg +++" >> $LOG -@@ -85,11 +85,11 @@ then +@@ -85,11 +96,11 @@ sh $OSSLIBDIR/etc/legacy_devices >> $LOG 2>&1 fi @@ -46,7 +64,7 @@ if test -x $OSSLIBDIR/soundon.user then -@@ -97,7 +97,7 @@ then +@@ -97,7 +108,7 @@ $OSSLIBDIR/soundon.user >> $LOG 2>&1 fi @@ -55,7 +73,7 @@ then echo echo "************************************************************" -@@ -108,7 +108,7 @@ then +@@ -108,7 +119,7 @@ sleep 1 fi diff --git a/audio/oss/pkg-message b/audio/oss/pkg-message index 44bda4113561..dd9a694738a7 100644 --- a/audio/oss/pkg-message +++ b/audio/oss/pkg-message @@ -6,6 +6,11 @@ the one used by 4Front and is not supported by them. All bug reports should go to the port maintainer via the usual PR mechanism. To load OSS at boot, add oss_enable="YES" to your /etc/rc.conf. + +It is necessary to ensure that your kernel does not have sound.ko +compiled in, which is always the case for GENERIC. Please refer to +the Handbook for advice on this. + EOM } ] -- cgit v1.2.3