slitaz-boot-scripts annotate etc/init.d/hwconf.sh @ rev 156

network.sh: speed up udhcp lease time
author Christophe Lincoln <pankso@slitaz.org>
date Sun Apr 26 01:14:33 2009 +0200 (2009-04-26)
parents 4ae0810cb439
children c366b7b0620e
rev   line source
pankso@11 1 #!/bin/sh
pankso@153 2 # /etc/init.d/hwconf.sh - SliTaz hardware configuration.
pankso@153 3 #
pankso@153 4 # This script configure the sound card and screen. Tazhw is used earlier
pankso@153 5 # at boot time to autoconfigure PCI and USB devices.
pankso@11 6 #
pankso@12 7 . /etc/init.d/rc.functions
pankso@11 8
pankso@81 9 # Sound configuration stuff. First check if sound=no and remove all
pankso@76 10 # sound Kernel modules.
pascal@48 11 if grep -q "sound=" /proc/cmdline; then
pascal@42 12 DRIVER=`cat /proc/cmdline | sed 's/.*sound=\([^ ]*\).*/\1/'`
pascal@42 13 case "$DRIVER" in
pascal@42 14 no)
pascal@42 15 echo -n "Removing all sound kernel modules..."
pascal@42 16 rm -rf /lib/modules/`uname -r`/kernel/sound
pascal@42 17 status
pascal@42 18 echo -n "Removing all sound packages..."
pascal@42 19 for i in $(grep -l '^DEPENDS=.*alsa-lib' /var/lib/tazpkg/installed/*/receipt) ; do
pascal@42 20 pkg=${i#/var/lib/tazpkg/installed/}
pascal@42 21 echo 'y' | tazpkg remove ${pkg%/*} > /dev/null
pascal@42 22 done
pankso@53 23 for i in alsa-lib mhwaveedit asunder libcddb ; do
pankso@53 24 echo 'y' | tazpkg remove $i > /dev/null
pankso@53 25 done
pascal@42 26 status;;
pascal@42 27 noconf)
MikeDSmith25@107 28 echo "Sound configuration was disabled from cmdline...";;
pascal@42 29 *)
pascal@61 30 if [ -x /usr/sbin/soundconf ]; then
pascal@61 31 echo "Using sound kernel module $DRIVER..."
pascal@61 32 /usr/sbin/soundconf -M $DRIVER
pascal@61 33 fi;;
pascal@42 34 esac
MikeDSmith25@107 35 # Sound card may already be detected by PCI-detect.
pankso@76 36 elif [ -d /proc/asound ]; then
pankso@136 37 # Restore sound config for installed system.
pankso@136 38 if [ -s /etc/asound.state ]; then
pankso@136 39 echo -n "Restoring last alsa configuration..."
pankso@136 40 alsactl restore
pankso@136 41 status
pankso@136 42 else
pankso@136 43 /usr/sbin/setmixer
pankso@136 44 fi
pankso@140 45 # Start soundconf to config driver and load module for Live mode
pankso@140 46 # if not yet detected.
pankso@140 47 /usr/bin/amixer >/dev/null || /usr/sbin/soundconf
pankso@140 48 else
pankso@140 49 echo "Unable to configure sound card."
pankso@11 50 fi
pascal@42 51
MikeDSmith25@107 52 # Screen size config for slim/Xvesa (last config dialog before login).
pascal@80 53 if [ ! -s /etc/X11/screen.conf -a -x /usr/bin/slim ]; then
pankso@76 54 # $HOME is not yet set.
pankso@76 55 HOME=/root
pascal@145 56 if grep -q "xarg=*" /proc/cmdline; then
pascal@145 57 # Add an extra argument to xserver_arguments (xarg=-2button)
pascal@145 58 XARG=`cat /proc/cmdline | sed 's/.*xarg=\([^ ]*\).*/\1/'`
pascal@145 59 sed -i "s|-screen|$XARG -screen|" /etc/slim.conf
pascal@145 60 fi
pascal@40 61 if grep -q "screen=*" /proc/cmdline; then
pascal@40 62 export NEW_SCREEN=`cat /proc/cmdline | sed 's/.*screen=\([^ ]*\).*/\1/'`
pascal@40 63 if [ "$NEW_SCREEN" = "text" ]; then
pascal@40 64 echo -n "Disabling X login manager: slim..."
pascal@40 65 sed -i s/'slim'/''/ /etc/rcS.conf
pascal@40 66 status
pascal@40 67 else
pankso@64 68 tazx `cat /etc/X11/wm.default`
pascal@40 69 fi
pascal@40 70 else
pankso@64 71 tazx `cat /etc/X11/wm.default`
pascal@40 72 fi
pankso@28 73 fi