slitaz-boot-scripts rev 306 5.1

Use tee to log boot and hide loadkey output
author Christophe Lincoln <pankso@slitaz.org>
date Sat Jun 02 01:43:00 2012 +0200 (2012-06-02)
parents 38802b3f2923
children ce60300bc0cf
files etc/init.d/rcS etc/init.d/system.sh
line diff
     1.1 --- a/etc/init.d/rcS	Sat Jun 02 00:22:08 2012 +0200
     1.2 +++ b/etc/init.d/rcS	Sat Jun 02 01:43:00 2012 +0200
     1.3 @@ -20,12 +20,11 @@
     1.4  
     1.5  colorize 34 "Processing: /etc/init.d/rcS..."
     1.6  
     1.7 -# Mount /proc.
     1.8 +# Mount /proc
     1.9  echo -n "Mounting proc filesystem on /proc"
    1.10  mount proc && status
    1.11  
    1.12 -# Mount /run as tmpfs to avoid pidfile and other runtime data behing
    1.13 -# writting to disk.
    1.14 +# Mount /run as tmpfs runtime data are not written to disk
    1.15  echo -n "Mounting tmpfs filesystem on: /run"
    1.16  mount -t tmpfs tmpfs /run
    1.17  status
    1.18 @@ -45,7 +44,7 @@
    1.19  	echo "" > /proc/sys/kernel/hotplug
    1.20  fi
    1.21  
    1.22 -# Busybox mdev is an udev alternative tu Udev.
    1.23 +# Busybox mdev is an udev alternative
    1.24  if [ "$UDEV" == "mdev" ]; then
    1.25  	echo -n "Executing mdev -s to populate /dev..."
    1.26  	mdev -s && echo "mdev" > /proc/sys/kernel/hotplug
    1.27 @@ -111,8 +110,8 @@
    1.28  
    1.29  # Handle kernel cmdline parameter modprobe=<module_list>
    1.30  if [ "$MODPROBE" ]; then
    1.31 -	MODULES=$(sed -e 's/.* modprobe=\([^ ]*\).*/\1/' -e 's/,/\n/g' < /proc/cmdline)
    1.32 -	for i in $MODULES; do
    1.33 +	mods=$(sed -e 's/.* modprobe=\([^ ]*\).*/\1/' -e 's/,/\n/g' < /proc/cmdline)
    1.34 +	for i in $mods; do
    1.35  		echo -n "Loading kernel module: $i"
    1.36  		modprobe $i
    1.37  		status
    1.38 @@ -146,7 +145,7 @@
    1.39  
    1.40  # Mount /proc/bus/usb
    1.41  if [ -d /proc/bus/usb ]; then
    1.42 -	echo -n "Mounting /proc/bus/usb filesystem..."
    1.43 +	echo -n "Mounting usbfs filesystem on: /proc/bus/usb"
    1.44  	mount -t usbfs usbfs /proc/bus/usb
    1.45  	status
    1.46  fi
    1.47 @@ -211,19 +210,17 @@
    1.48  
    1.49  *)
    1.50  	# --> readonly --> readwrite
    1.51 -	#if [ ! -s /tmp/boot.log ]; then
    1.52 -		#mount -t tmpfs tmpfs /tmp
    1.53 -		#mount -t devpts devpts /dev/pts
    1.54 -	#fi
    1.55 -	#script -aqc '/etc/init.d/rcS readonly' /tmp/boot.log
    1.56 -	/etc/init.d/rcS readonly
    1.57 -	#umount /tmp
    1.58 +	if [ ! -s /tmp/boot.log ]; then
    1.59 +		mount -t tmpfs tmpfs /tmp
    1.60 +	fi
    1.61 +	/etc/init.d/rcS readonly | tee /tmp/boot.log
    1.62  	# Lograde boot.log
    1.63  	last=.9
    1.64  	for i in .8 .7 .6 .5 .4 .3 .2 .1 .0 '' ; do
    1.65 -		mv -f /var/log/boot.log$i /var/log/boot.log$last 2>/dev/null
    1.66 +		mv -f /var/log/boot.log${i} /var/log/boot.log${last} 2>/dev/null
    1.67  		last=$i
    1.68  	done
    1.69 -	#mv -f /tmp/boot.log /var/log/boot.log
    1.70 -	script -aqc '/etc/init.d/rcS readwrite' /var/log/boot.log ;;
    1.71 +	mv -f /tmp/boot.log /var/log/boot.log
    1.72 +	umount /tmp
    1.73 +	/etc/init.d/rcS readwrite | tee -a /var/log/boot.log ;;
    1.74  esac
     2.1 --- a/etc/init.d/system.sh	Sat Jun 02 00:22:08 2012 +0200
     2.2 +++ b/etc/init.d/system.sh	Sat Jun 02 01:43:00 2012 +0200
     2.3 @@ -70,26 +70,27 @@
     2.4  	echo "Unable to configure sound card."
     2.5  fi
     2.6  
     2.7 -# Locale config.
     2.8 -echo "Checking if /etc/locale.conf exists... "
     2.9 +# Locale config
    2.10  if [ ! -s "/etc/locale.conf" ]; then
    2.11  	echo "Setting system locale to: POSIX (English)"
    2.12  	echo -e "LANG=POSIX\nLC_ALL=POSIX" > /etc/locale.conf
    2.13  fi
    2.14  . /etc/locale.conf
    2.15 -echo -n "Locale configuration: $LANG"
    2.16 -export LC_ALL
    2.17 +echo -n "Setting system locale: $LANG"
    2.18 +export LC_ALL=$LANG
    2.19  . /lib/libtaz.sh && status
    2.20  
    2.21 -# Keymap config. Default to us in live mode if kmap= was not used.
    2.22 +# Keymap config: Default to us in live mode if kmap= was not used.
    2.23  if [ ! -s "/etc/keymap.conf" ]; then
    2.24 +	echo "Setting system keymap to: us (USA)"
    2.25  	echo "us" > /etc/keymap.conf
    2.26  fi
    2.27  kmap=$(cat /etc/keymap.conf)
    2.28 -echo "Keymap configuration: $kmap"
    2.29 -/sbin/tazkeymap $kmap
    2.30 +echo -n "Loading console keymap: $kmap"
    2.31 +/sbin/tazkeymap $kmap >/dev/null
    2.32 +status
    2.33  
    2.34 -# Timezone config. Set timezone using the keymap config for fr, be, fr_CH
    2.35 +# Timezone config: Set timezone using the keymap config for fr, be, fr_CH
    2.36  # and ca with Montreal.
    2.37  if [ ! -s "/etc/TZ" ]; then
    2.38  	case "$kmap" in