# HG changeset patch # User Christophe Lincoln # Date 1240751605 -7200 # Node ID 6d1034b2830e35ac60a05316a394d41d9d7a6510 # Parent 3ff9c51793312c7ba0463d795ffd2b865d5d75e0 rcS: get all earlier boot option at one time + home= wait for kernel usb delay diff -r 3ff9c5179331 -r 6d1034b2830e etc/init.d/bootopts.sh --- a/etc/init.d/bootopts.sh Sun Apr 26 14:10:28 2009 +0200 +++ b/etc/init.d/bootopts.sh Sun Apr 26 15:13:25 2009 +0200 @@ -33,8 +33,10 @@ mount_home() { echo "Home has been specified to $DEVICE..." - echo "Sleeping 10 s to let the kernel detect the device... " - sleep 10 + USBDELAY=`cat /sys/module/usb_storage/parameters/delay_use` + USBDELAY=$((1+$USBDELAY)) + echo "Sleeping $USBDELAY s to let the kernel detect the device... " + sleep $USBDELAY USER=`cat /etc/passwd | grep 1000 | cut -d ":" -f 1` DEVID=$DEVICE if [ -x /sbin/blkid ]; then diff -r 3ff9c5179331 -r 6d1034b2830e etc/init.d/rcS --- a/etc/init.d/rcS Sun Apr 26 14:10:28 2009 +0200 +++ b/etc/init.d/rcS Sun Apr 26 15:13:25 2009 +0200 @@ -8,6 +8,24 @@ . /etc/init.d/rc.functions . /etc/rcS.conf +# Parse cmdline args for earlier boot options. All other boot options +# are in /etc/init./bootopts.sh. +for opt in `cat cmdline` +do + case $opt in + *fastbootx*|*fbx*) + FAST_BOOT_X="yes" ;; + *cdrom=*) + CDROM=${opt#cdrom=} ;; + *modprobe=*) + MODPROBE="yes" ;; + *config=*) + CONFIG=${opt#config=} ;; + *) + continue ;; + esac +done + if [ "$1" != "logged" ]; then # logged echo "Processing /etc/init.d/rcS... " @@ -80,7 +98,7 @@ # keymap settings since Xvesa dump the console mapping and a correct # slim configuration for screen resolution. DBUS and HAL must also start # befor X session (manual login or autologin) to have devices in PCmanFM. -if [ "$FAST_BOOT_X" = "yes" ] || grep -q -w "fastbootx" /proc/cmdline; then +if [ "$FAST_BOOT_X" = "yes" ]; then /etc/init.d/i18n.sh /etc/init.d/dbus start /etc/init.d/hald start @@ -89,8 +107,8 @@ # Create /dev/cdrom if needed (symlink does not exist on LiveCD). # Also add /dev/cdrom to fstab if entry does not exist. -if grep -q " cdrom=" /proc/cmdline; then - DRIVE_NAME=`cat /proc/cmdline | sed 's/.* cdrom=\([^ ]*\).*/\1/'` +if [ -n "$CDROM" ]; then + DRIVE_NAME=${CDROM#/dev/} else DRIVE_NAME=`cat /proc/sys/dev/cdrom/info | grep "drive name" | cut -f 3` fi @@ -117,7 +135,7 @@ fi # Handle kernel cmdline parameter modprobe= -if grep -q " modprobe=" /proc/cmdline; then +if [ -n "$MODPROBE" ]; then MODULES=`sed -e 's/.* modprobe=\([^ ]*\).*/\1/' -e 's/,/\n/g' < /proc/cmdline` for i in $MODULES; do echo -n "Loading kernel module $i" @@ -128,8 +146,7 @@ # Handle kernel cmdline parameter config=, to source a # disk init script -if grep -q " config=" /proc/cmdline; then - CONFIG=`cat /proc/cmdline | sed 's/.* config=\([^ ]*\).*/\1/'` +if [ -n "$CONFIG" ]; then DEVICE=${CONFIG%,*} SCRIPT=${CONFIG#*,} echo "Probing $DEVICE... "