slitaz-boot-scripts diff etc/init.d/rcS @ rev 306

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 6ea85ee8bde8
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