slitaz-boot-scripts view etc/init.d/hwconf.sh @ rev 12

Fixed hwconf.sh 'status' + sound=no + rcS msg
author Christophe Lincoln <pankso@slitaz.org>
date Thu Dec 06 11:07:55 2007 +0100 (2007-12-06)
parents a5e2677812ab
children 85ab292e4c67
line source
1 #!/bin/sh
2 # /etc/init.d/hwconf.sh - SliTaz hardware autoconfiguration.
3 #
4 . /etc/init.d/rc.functions
6 # Sound configuration stuff. First check if sound=no and remoce all sound
7 # Kernel modules.
8 #
9 if grep -q -w "sound=no" /proc/cmdline; then
10 echo -n "Removing all sound kernel modules..."
11 rm -rf /lib/modules/`uname -r`/kernel/sound
12 status
13 echo -n "Removing all sound packages..."
14 for i in $(grep -l '^DEPENDS=.*alsa-lib' /var/lib/tazpkg/installed/*/receipt) ; do
15 pkg=${i#/var/lib/tazpkg/installed/}
16 echo 'y' | tazpkg remove ${pkg%/*} >-
17 done
18 echo 'y' | tazpkg remove alsa-lib >-
19 status
20 else
21 # Config or not config
22 if grep -q -w "sound=noconf" /proc/cmdline; then
23 echo "Sound configuration is disable from cmdline..."
24 elif [ ! -f /var/lib/sound-card-driver ]; then
25 if [ -f /usr/sbin/soundconf ]; then
26 # Start soundconf to config driver and load module for Live mode
27 /usr/sbin/soundconf
28 else
29 echo "Unable to found : /usr/sbin/soundconf"
30 fi
31 else
32 # /var/lib/sound-card-driver exist so sound is already configured.
33 continue
34 fi
35 fi
37 # Creat /dev/cdrom if needed (symlink does not exist on LiveCD.
38 #
39 if [ ! "`readlink /dev/cdrom`" ]; then
40 DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | cut -f 3`
41 echo -n "Creating symlink : /dev/cdrom..."
42 ln -s /dev/$DRIVE_NAME /dev/cdrom
43 status
44 fi