]> git.pld-linux.org Git - packages/alsa-udev.git/commitdiff
- initial PLD release (by lobo at chello pl)
authorPatryk Zawadzki <patrys@room-303.com>
Wed, 21 Dec 2005 20:25:46 +0000 (20:25 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    alsa-udev.conf -> 1.1
    alsa-udev.init -> 1.1
    alsa-udev.rules -> 1.1
    alsa-udev.sh -> 1.1
    alsa-udev.spec -> 1.1

alsa-udev.conf [new file with mode: 0644]
alsa-udev.init [new file with mode: 0644]
alsa-udev.rules [new file with mode: 0644]
alsa-udev.sh [new file with mode: 0644]
alsa-udev.spec [new file with mode: 0644]

diff --git a/alsa-udev.conf b/alsa-udev.conf
new file mode 100644 (file)
index 0000000..9d2978c
--- /dev/null
@@ -0,0 +1,8 @@
+# set this to yes if you want to load oss emulation
+# OSS_EMULATION=yes
+
+# list additional modules for first sound card
+# MODULES_0=""
+
+# postinstal script for first sound card
+# POST_INSTALL_0=""
diff --git a/alsa-udev.init b/alsa-udev.init
new file mode 100644 (file)
index 0000000..97a0594
--- /dev/null
@@ -0,0 +1,89 @@
+#!/bin/sh
+#
+# alsasave     This shell script takes care of stopping ALSA sound driver.
+#
+# This script requires /usr/sbin/alsactl program from alsa-utils package.
+#
+# Copyright (c) by Jaroslav Kysela <perex@jcu.cz> 
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+#
+# For PLD Linux Distribution:
+# chkconfig:   2345 80 14
+# description: ALSA driver
+#
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+alsactl=/usr/sbin/alsactl
+
+detect_stop()
+{
+  #
+  # remove all sound modules
+  #
+  /sbin/lsmod | awk '/^snd/ { print $0 }' | while read line; do \
+     /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \
+  done
+}
+
+
+driver_stop()
+{
+  #
+  # store driver settings
+  #
+  if [ -x $alsactl ]; then
+    $alsactl store
+  else
+    show '!!!alsactl not found!!!'; fail
+  fi
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       #Not Needed, its for udev
+       ;;
+  stop)
+       # Stop daemons.
+       if [ -d /proc/asound ]; then
+               show "Shutting down sound driver:"
+               busy
+               if [ -f /proc/asound/detect ]; then
+                       detect_stop
+               else
+                       driver_stop
+               fi
+               (rmmod isapnp; rmmod soundcore) 2> /dev/null
+               ok
+       else
+               msg_not_running "ALSA driver"
+       fi
+       ;;
+  save)
+       driver_stop
+       ;;
+  status)
+       #TODO
+       ;;
+  *)
+       msg_usage "$0 {start|stop|save|status}"
+       exit 3
+esac
+
+exit 0
diff --git a/alsa-udev.rules b/alsa-udev.rules
new file mode 100644 (file)
index 0000000..ef966e0
--- /dev/null
@@ -0,0 +1 @@
+SUBSYSTEM=="sound", KERNEL=="controlC*", RUN+="/etc/udev/scripts/alsa.sh %n"
diff --git a/alsa-udev.sh b/alsa-udev.sh
new file mode 100644 (file)
index 0000000..6b61e96
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+[ $# != 1 ] && exit 1
+
+CARD=$1
+
+. /etc/rc.d/init.d/functions
+[ -f /etc/sysconfig/alsa_udev ] && . /etc/sysconfig/alsa_udev
+
+case "$ACTION" in
+    add)
+       eval LOAD_MODULES="\$MODULES_$CARD"
+       for i in "$LOAD_MODULES"; do
+           /sbin/modprobe -q --ignore-install $i
+       done
+
+       if is_yes "$OSS_EMULATION"; then
+           /sbin/modprobe -q --ignore-install snd_pcm_oss
+           [ -e /dev/snd/seq ] && /sbin/modprobe -q --ignore-install snd_seq_oss
+       fi
+
+       /usr/sbin/alsactl restore "$CARD"
+
+       eval SCRIPT="\$POST_INSTALL_$CARD"
+       [ -n "$SCRIPT" ] && eval "$SCRIPT"
+    ;;
+    remove)
+       /usr/sbin/alsactl store "$CARD"
+    ;;
+esac
diff --git a/alsa-udev.spec b/alsa-udev.spec
new file mode 100644 (file)
index 0000000..b7ec2f2
--- /dev/null
@@ -0,0 +1,52 @@
+Summary:       udev rules and scripts for Advanced Linux Sound Architecture
+Summary(pl):   Regu³y i skrypty udev dla Advanced Linux Sound Architecture
+Name:          alsa-udev
+Version:       0.1
+Release:       0.1
+License:       GPL
+Group:         Applications/Sound
+Source0:       %{name}.rules
+Source1:       %{name}.sh
+Source2:       %{name}.conf
+Source3:       %{name}.init
+URL:           http://www.alsa-project.org/
+Requires(post,preun):  /sbin/chkconfig
+Requires:      awk
+Requires:      udev >= 075
+Obsoletes:     alsaconf
+Obsoletes:     alsa-init-tools
+Obsoletes:     alsa-utils-init
+BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+udev rules and scripts for Advanced Linux Sound Architecture.
+
+%description
+Regu³y i skrypty udev dla Advanced Linux Sound Architecture.
+
+%prep
+%install
+rm -rf $RPM_BUILD_ROOT
+
+install -D %{SOURCE0} $RPM_BUILD_ROOT/etc/udev/rules.d/alsa.rules
+install -D %{SOURCE1} $RPM_BUILD_ROOT/etc/udev/scripts/alsa.sh
+install -D %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/alsa_udev
+install -D %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/alsa-udev
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post
+/sbin/chkconfig --add alsa-udev
+
+%preun
+if [ "$1" = "0" ]; then
+       /sbin/chkconfig --del alsa-udev
+fi
+
+%files
+%defattr(644,root,root,755)
+%attr(754,root,root) /etc/rc.d/init.d/*
+%config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/*
+/etc/udev/rules.d/alsa.rules
+%attr(754,root,root) /etc/udev/scripts/alsa.sh
This page took 0.131946 seconds and 4 git commands to generate.