wok rev 4082

slitaz-loram-cdrom: add usb delay
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Sep 15 22:47:44 2009 +0200 (2009-09-15)
parents 939e9b93ed08
children 1d293d17e640
files slitaz-loram-cdrom/receipt
line diff
     1.1 --- a/slitaz-loram-cdrom/receipt	Tue Sep 15 18:46:39 2009 +0200
     1.2 +++ b/slitaz-loram-cdrom/receipt	Tue Sep 15 22:47:44 2009 +0200
     1.3 @@ -25,11 +25,11 @@
     1.4      i=$(($i-1))
     1.5      tag=$(grep "$tag" $1/etc/init.d/rcS)
     1.6      if [ "$2" = "-R" ]; then
     1.7 -    	line="-$(($i-61)),63 +$(($i-61)),2"
     1.8 +    	line="-$(($i-72)),74 +$(($i-72)),2"
     1.9  	i="-"
    1.10      else
    1.11          grep -q 'from slitaz-loram-cdrom package' $1/etc/init.d/rcS && return
    1.12 -    	line="-$i,2 +$i,63"
    1.13 +    	line="-$i,2 +$i,74"
    1.14  	i="+"
    1.15      fi
    1.16      patch -p0 <<EOF
    1.17 @@ -61,7 +61,18 @@
    1.18  $i		DEVICE=\${DIR%,*}
    1.19  $i		DIR=/\${DIR#*,}
    1.20  $i	fi
    1.21 -$i	if mount -o ro \$DEVICE /cdrom 2> /dev/null ; then
    1.22 +$i	if ! /bin/mount -r \$DEVICE /cdrom; then
    1.23 +$i		if echo \$DEVICE | grep -Eq "/dev/sd|UUID=|LABEL="; then
    1.24 +$i			USBDELAY=\`cat /sys/module/usb_storage/parameters/delay_use\`
    1.25 +$i			USBDELAY=\$((1+\$USBDELAY))
    1.26 +$i			echo "\$DEVICE is potentially a USB device: sleep for \$USBDELAY seconds"
    1.27 +$i			sleep \$USBDELAY
    1.28 +$i		fi
    1.29 +$i		if ! /bin/mount -r \$DEVICE /cdrom; then
    1.30 +$i			DEVICE=""
    1.31 +$i		fi
    1.32 +$i	fi
    1.33 +$i	if [ -n "\$DEVICE" ]; then
    1.34  $i		if [ -d /.usr.rw ]; then
    1.35  $i			echo -n "Mounting /usr read-write... "
    1.36  $i			usr=.usr.ro