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

Remove volume applet if no sound conf + rm more pkgs
author Christophe Lincoln <pankso@slitaz.org>
date Tue Mar 11 11:43:21 2008 +0100 (2008-03-11)
parents 07a3b7b65370
children d2ef967dc139
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 "sound=" /proc/cmdline; then
10 DRIVER=`cat /proc/cmdline | sed 's/.*sound=\([^ ]*\).*/\1/'`
11 case "$DRIVER" in
12 no)
13 echo -n "Removing all sound kernel modules..."
14 rm -rf /lib/modules/`uname -r`/kernel/sound
15 status
16 echo -n "Removing all sound packages..."
17 for i in $(grep -l '^DEPENDS=.*alsa-lib' /var/lib/tazpkg/installed/*/receipt) ; do
18 pkg=${i#/var/lib/tazpkg/installed/}
19 echo 'y' | tazpkg remove ${pkg%/*} > /dev/null
20 done
21 for i in alsa-lib mhwaveedit asunder libcddb ; do
22 echo 'y' | tazpkg remove $i > /dev/null
23 done
24 status;;
25 noconf)
26 echo "Sound configuration is disable from cmdline...";;
27 *)
28 echo "Using sound kernel module $DRIVER..."
29 echo "snd-$DRIVER" > /var/lib/sound-card-driver;;
30 esac
31 elif [ ! -f /var/lib/sound-card-driver ]; then
32 if [ -x /usr/sbin/soundconf ]; then
33 # Start soundconf to config driver and load module for Live mode
34 /usr/sbin/soundconf
35 else
36 echo "Unable to found: /usr/sbin/soundconf"
37 fi
38 fi
40 # Restore sound config for installed system.
41 if [ -f /var/lib/sound-card-driver ]; then
42 echo -n "Restoring last alsa configuration..."
43 alsactl restore
44 status
45 else
46 # Remove LXpanel volumealsa if no sound configuration.
47 if [ -f /usr/share/lxpanel/profile/default/config ]; then
48 sed -i s/'volumealsa'/'space'/ /usr/share/lxpanel/profile/default/config
49 fi
50 fi
52 # Screen size config for slim/Xvesa.
53 if [ ! -f /etc/X11/screen.conf -a -x /usr/bin/slim ]; then
54 if grep -q "screen=*" /proc/cmdline; then
55 export NEW_SCREEN=`cat /proc/cmdline | sed 's/.*screen=\([^ ]*\).*/\1/'`
56 if [ "$NEW_SCREEN" = "text" ]; then
57 echo -n "Disabling X login manager: slim..."
58 sed -i s/'slim'/''/ /etc/rcS.conf
59 status
60 else
61 tazx
62 fi
63 else
64 tazx
65 fi
66 fi