[PC-BSD Testing] sound-dev-changed.sh

N V vans9 at yandex.ru
Tue Oct 2 03:38:04 PDT 2012


Oops.

Lost the dircheck. I don't know what should be there: return or smth else.
Btw, I have little exp in shell scripting so there may be some rough places in 
the script.

Index: sound-dev-changed.sh
===================================================================
--- sound-dev-changed.sh	(revision 19575)
+++ sound-dev-changed.sh	(working copy)
@@ -5,9 +5,15 @@
 
 regen_ossconf()
 {
+PCM_OSS_CONF_DIR=/compat/linux/etc/alsa/pcm/
+PCM_OSS_CONF=${PCM_OSS_CONF_DIR}pcm-oss.conf
 
+if [ ! -d $PCM_OSS_CONF_DIR ]; then
+  return
+fi
+
 PCM=`egrep -o 'pcm[0-9]+' /dev/sndstat | egrep -o '[0-9]+'`
-cat > /tmp/pcm-oss.conf <<EOF
+OSSCONF=`cat <<EOF
 # pcm-oss plugin configuration
 
 pcm.oss {
@@ -25,11 +31,12 @@
                 description "Open Sound System"
         }
 }
+EOF`
 
-EOF
-
 for NUM in $PCM; do
-  cat >> /tmp/pcm-oss.conf <<EOF
+  OSSCONF_UNITS=${OSSCONF_UNITS}`cat <<EOF
+ 
+ 
 pcm.oss${NUM} {
 	type oss
 	device /dev/dsp${NUM}
@@ -45,11 +52,10 @@
 		description "Open Sound System Unit ${NUM}"
 	}
 }
+EOF`
+done
 
-EOF
-
-done
-mv /tmp/pcm-oss.conf /compat/linux/etc/alsa/pcm/pcm-oss.conf
+echo "${OSSCONF}${OSSCONF_UNITS}" > $PCM_OSS_CONF
 }
 
 set_new_dev()


Regards,
Vans.

On 25 сентября 2012 18:00:26 Kris Moore wrote:
> On 09/25/2012 04:40, N V wrote:
> > Hi.
> > 
> > I've found script sound-dev-changed.sh has been extended with the setting
> > of the default_unit. Let me notice that we should change default unit if
> > this unit have playback, imho. I have a plan to extend this script, but
> > that should be done before RC2. Is there RC2 somethere on the horizon?
> > 
> > Regards,
> > Vans.
> > _______________________________________________
> > Testing mailing list
> > Testing at lists.pcbsd.org
> > http://lists.pcbsd.org/mailman/listinfo/testing
> 
> RC2 is still in waiting, FreeBSD is still not RC2 yet...
> 
> If you want to extend the script, send a patch and I'll get it in!


More information about the Testing mailing list