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

Enhanced screen= kernel parameter
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Feb 25 21:59:53 2008 +0000 (2008-02-25)
parents 8d77d0bba811
children 3da6316620ef
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%/*} > /dev/null
17 done
18 echo 'y' | tazpkg remove alsa-lib > /dev/null
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
36 # Restore sound config for installed system.
37 if [ -f /var/lib/sound-card-driver ]; then
38 echo -n "Restoring last alsa configuration..."
39 alsactl restore
40 status
41 fi
43 # Screen size config for slim/Xvesa.
44 if [ ! -f /etc/X11/screen.conf -a -x /usr/bin/slim ]; then
45 if grep -q "screen=*" /proc/cmdline; then
46 export NEW_SCREEN=`cat /proc/cmdline | sed 's/.*screen=\([^ ]*\).*/\1/'`
47 if [ "$NEW_SCREEN" = "text" ]; then
48 echo -n "Disabling X login manager: slim..."
49 sed -i s/'slim'/''/ /etc/rcS.conf
50 status
51 else
52 tazx
53 fi
54 else
55 tazx
56 fi
57 fi