slitaz-boot-scripts rev 237

Reenable udevd (after everything is mounted), improve graphical boot with fbsplash
author Christophe Lincoln <pankso@slitaz.org>
date Thu Mar 10 01:12:56 2011 +0100 (2011-03-10)
parents 6a5dca101eaa
children 07c1d9c8ac36 97ba499fdb2c
files etc/init.d/rcS
line diff
     1.1 --- a/etc/init.d/rcS	Tue Mar 08 23:12:29 2011 +0100
     1.2 +++ b/etc/init.d/rcS	Thu Mar 10 01:12:56 2011 +0100
     1.3 @@ -11,17 +11,17 @@
     1.4  # Boot time.
     1.5  bootdate=`date +%s`
     1.6  
     1.7 +if [ "$1" != "logged" ]; then # logged
     1.8 +
     1.9  # Graphical boot start.
    1.10  if [ "$FBSPLASH" == "yes" ]; then
    1.11  	reset && fbsplash -c \
    1.12  		-s /etc/fbsplash/$FBSPLASH_THEME/fbsplash.ppm \
    1.13  		-i /etc/fbsplash/$FBSPLASH_THEME/fbsplash.cfg \
    1.14  		-f /etc/fbsplash/fifo &
    1.15 -	echo "0" > /etc/fbsplash/fifo
    1.16 +	echo "0" > /etc/fbsplash/fifo && sleep 1
    1.17  fi
    1.18  
    1.19 -if [ "$1" != "logged" ]; then # logged
    1.20 -
    1.21  echo "Processing /etc/init.d/rcS..."
    1.22  
    1.23  # Mount /proc.
    1.24 @@ -53,16 +53,6 @@
    1.25  
    1.26  [ "$FBSPLASH" == "yes" ] && echo "20" > /etc/fbsplash/fifo
    1.27  
    1.28 -# Trigger Udev and handle hotplug events
    1.29 -if [ "$UDEV" = "yes" ]; then
    1.30 -	echo -n "Udevadm requesting events from the Kernel..."
    1.31 -	udevadm trigger
    1.32 -	status
    1.33 -	echo -n "Using Udev for hotplugging..."
    1.34 -	echo "/sbin/udevd" > /proc/sys/kernel/hotplug
    1.35 -	status
    1.36 -fi
    1.37 -
    1.38  # Before mounting filesystems we check fs specified in the file
    1.39  # /etc/rcS.conf and variable $CHECK_FS.
    1.40  if [ -n "$CHECK_FS" ]; then
    1.41 @@ -78,6 +68,22 @@
    1.42  echo "Remounting rootfs read/write..."
    1.43  /bin/mount -o remount,rw /
    1.44  
    1.45 +# Trigger Udev and handle hotplug events
    1.46 +if [ "$UDEV" = "yes" ]; then
    1.47 +	echo -n "Starting udev daemon..."
    1.48 +	/sbin/udevd --daemon
    1.49 +	status
    1.50 +	echo -n "Udevadm requesting events from the Kernel..."
    1.51 +	udevadm trigger
    1.52 +	status
    1.53 +	echo -n "Udevadm waiting for the event queue to finish..."
    1.54 +	udevadm settle
    1.55 +	status
    1.56 +	echo -n "Using Udev for hotplugging..."
    1.57 +	echo "/sbin/udevd" > /proc/sys/kernel/hotplug
    1.58 +	status
    1.59 +fi
    1.60 +
    1.61  [ "$FBSPLASH" == "yes" ] && echo "30" > /etc/fbsplash/fifo
    1.62  
    1.63  # Mount filesystems in /etc/fstab.
    1.64 @@ -227,13 +233,7 @@
    1.65  	/sbin/tazhw init
    1.66  fi
    1.67  
    1.68 -# Call udevadm trigger to ensure /dev is fully populate now that all 
    1.69 -# modules are loaded.
    1.70 -if [ "$UDEV" = "yes" ]; then
    1.71 -	echo -n "Requesting events from the Kernel..."
    1.72 -	udevadm trigger
    1.73 -	status
    1.74 -fi
    1.75 +[ "$FBSPLASH" == "yes" ] && echo "80" > /etc/fbsplash/fifo
    1.76  
    1.77  # Start all scripts specified with $RUN_SCRIPTS.
    1.78  echo "Executing all initialization scripts..."
    1.79 @@ -244,7 +244,7 @@
    1.80  	fi
    1.81  done
    1.82  
    1.83 -[ "$FBSPLASH" == "yes" ] && echo "80" > /etc/fbsplash/fifo
    1.84 +[ "$FBSPLASH" == "yes" ] && echo "90" > /etc/fbsplash/fifo
    1.85  
    1.86  # Re-source main config file. In Live mode, daemons list can be modified 
    1.87  # by boot options (screen=text will remove slim).
    1.88 @@ -259,7 +259,7 @@
    1.89  	fi
    1.90  done
    1.91  
    1.92 -[ "$FBSPLASH" == "yes" ] && echo "90" > /etc/fbsplash/fifo
    1.93 +[ "$FBSPLASH" == "yes" ] && echo "100" > /etc/fbsplash/fifo
    1.94  
    1.95  # Back to a verbose mode.
    1.96  echo "7 4 1 7" > /proc/sys/kernel/printk
    1.97 @@ -270,12 +270,11 @@
    1.98  	echo -e "\033[1m$MESSAGE\033[0m"
    1.99  fi
   1.100  
   1.101 -[ "$FBSPLASH" == "yes" ] && echo "100" > /etc/fbsplash/fifo
   1.102 -
   1.103  # Display and log boot time.
   1.104  time=$((`date +%s` - $bootdate))
   1.105  echo $time > /var/log/boot-time
   1.106  echo "SliTaz boot time: ${time}s"
   1.107 +
   1.108  [ "$FBSPLASH" == "yes" ] && echo "exit" > /etc/fbsplash/fifo
   1.109  
   1.110  fi # logged