slitaz-boot-scripts rev 110
rcS: fix config= for usb
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Wed Jul 23 10:19:50 2008 +0000 (2008-07-23) |
parents | 10d28491bea5 |
children | 444e44898f27 |
files | etc/init.d/rcS |
line diff
1.1 --- a/etc/init.d/rcS Tue Jul 22 22:25:02 2008 +0000 1.2 +++ b/etc/init.d/rcS Wed Jul 23 10:19:50 2008 +0000 1.3 @@ -98,8 +98,20 @@ 1.4 CONFIG=`cat /proc/cmdline | sed 's/.* config=\([^ ]*\).*/\1/'` 1.5 DEVICE=${CONFIG%,*} 1.6 SCRIPT=${CONFIG#*,} 1.7 + echo "Probing $DEVICE... " 1.8 + if ! /bin/mount -r $DEVICE /mnt; then 1.9 + if echo $DEVICE | grep -q "/dev/sd"; then 1.10 + USBDELAY=`cat /sys/module/usb_storage/parameters/delay_use` 1.11 + USBDELAY=$((1+$USBDELAY)) 1.12 + echo "$DEVICE is potentially a USB device: sleep for $USBDELAY seconds" 1.13 + sleep $USBDELAY 1.14 + fi 1.15 + if ! /bin/mount -r $DEVICE /mnt; then 1.16 + CONFIG="" 1.17 + fi 1.18 + fi 1.19 echo -n "Source $SCRIPT from $DEVICE... " 1.20 - if /bin/mount -r $DEVICE /mnt; then 1.21 + if [ -n "$CONFIG" ]; then 1.22 . /mnt/$SCRIPT 1.23 /bin/umount /mnt 1.24 fi