slitaz-boot-scripts diff etc/init.d/bootopts.sh @ rev 302

Huge clean, colored rcS, faster, fix sound and other devices (used need a devtmpfs mounted on /dev) disabled logging for now
author Christophe Lincoln <pankso@slitaz.org>
date Fri Jun 01 21:46:07 2012 +0200 (2012-06-01)
parents 1dbfd813e21e
children 03d0b5dd9213
line diff
     1.1 --- a/etc/init.d/bootopts.sh	Wed May 02 00:04:50 2012 +0200
     1.2 +++ b/etc/init.d/bootopts.sh	Fri Jun 01 21:46:07 2012 +0200
     1.3 @@ -1,21 +1,13 @@
     1.4  #!/bin/sh
     1.5 -# /etc/init.d/bootopts.sh - SliTaz boot options from the cmdline.
     1.6 +#
     1.7 +# /etc/init.d/bootopts.sh : SliTaz boot options from the cmdline
     1.8  #
     1.9  # Earlier boot options are in rcS, ex: config= and modprobe=
    1.10  #
    1.11  . /etc/init.d/rc.functions
    1.12  
    1.13 -# Update fstab for swapon/swapoff
    1.14 -add_swap_in_fstab()
    1.15 -{
    1.16 -	grep -q "$1	" /etc/fstab || cat >> /etc/fstab <<EOT
    1.17 -$1	swap	swap	default	0 0
    1.18 -EOT
    1.19 -}
    1.20 -
    1.21  # Get first usb disk
    1.22 -usb_device()
    1.23 -{
    1.24 +usb_device() {
    1.25  	cd /sys/block
    1.26  	for i in sd* sda ; do
    1.27  		grep -qs 1 $i/removable && break
    1.28 @@ -29,7 +21,7 @@
    1.29  # effect on an installed system.
    1.30  if ! grep -q "100[0-9]:100[0-9]" /etc/passwd; then
    1.31  	if fgrep -q "user=" /proc/cmdline; then
    1.32 -		USER=`cat /proc/cmdline | sed 's/.*user=\([^ ]*\).*/\1/'`
    1.33 +		USER=$(cat /proc/cmdline | sed 's/.*user=\([^ ]*\).*/\1/')
    1.34  		# Avoid usage of an existing system user or root.
    1.35  		if grep -q ^$USER /etc/passwd; then
    1.36  			USER=tux
    1.37 @@ -54,9 +46,9 @@
    1.38  fi
    1.39  
    1.40  # Parse /proc/cmdline for boot options.
    1.41 -echo "Parsing kernel cmdline for SliTaz live options... "
    1.42 +echo "Checking for SliTaz cmdline options..."
    1.43  
    1.44 -for opt in `cat /proc/cmdline`
    1.45 +for opt in $(cat /proc/cmdline)
    1.46  do
    1.47  	case $opt in
    1.48  		eject)
    1.49 @@ -140,12 +132,6 @@
    1.50  				cp -a /home/boot/rootfs/* /
    1.51  			fi ;;
    1.52  		laptop)
    1.53 -			# Laptop option to load related Kernel modules.
    1.54 -			echo "Loading laptop modules: ac, battery, fan, yenta_socket..."
    1.55 -			for mod in ac battery fan yenta_socket
    1.56 -			do
    1.57 -				modprobe $mod
    1.58 -			done
    1.59  			# Enable Kernel Laptop mode.
    1.60  			echo "5" > /proc/sys/vm/laptop_mode ;;
    1.61  		mount)
    1.62 @@ -199,15 +185,3 @@
    1.63  if [ ! -f /etc/X11/wm.default ]; then
    1.64  	echo "openbox" > /etc/X11/wm.default
    1.65  fi
    1.66 -
    1.67 -# Activate an eventual swap file or partition.
    1.68 -if [ "`fdisk -l | grep swap`" ]; then
    1.69 -	for SWAP_DEV in `fdisk -l | sed '/swap/!d;s/ .*//'`; do
    1.70 -		echo "Swap memory detected on: $SWAP_DEV"
    1.71 -		add_swap_in_fstab $SWAP_DEV
    1.72 -	done
    1.73 -fi
    1.74 -if grep -q swap /etc/fstab; then
    1.75 -	echo "Activating swap memory..."
    1.76 -	swapon -a
    1.77 -fi