summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371>2007-03-27 15:34:31 +0000
committerncopa <ncopa@f176ef85-8d20-0410-844a-e957b5a1c371>2007-03-27 15:34:31 +0000
commite9d96605064653c956c4fb352be7e11f4471a0d5 (patch)
tree549c942e572699f6b35de6e9a61d44b8713eddda
parentf3bf41bba7d32f88dece419efd5d5a806ee68b7b (diff)
downloadalpine-baselayout-e9d96605064653c956c4fb352be7e11f4471a0d5.tar.bz2
alpine-baselayout-e9d96605064653c956c4fb352be7e11f4471a0d5.tar.xz
version 1.3_beta2. init.d/runtimes: wait for usb-storage if necessary
-rw-r--r--Makefile2
-rwxr-xr-xinit.d/runtimes32
2 files changed, 31 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index c557bee..fc62cb8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION=1.3_beta1
+VERSION=1.3_beta2
PV =alpine-baselayout-$(VERSION)
TARBALL =$(PV).tar.gz
diff --git a/init.d/runtimes b/init.d/runtimes
index 2d0fa46..ff61383 100755
--- a/init.d/runtimes
+++ b/init.d/runtimes
@@ -214,6 +214,35 @@ set_apk_path() {
}
+# mount dev $2 with type $1 on /mnt
+mount_dev() {
+ local fs=$1
+ local dev=$2
+ local i mountok
+
+ # special handling for usb devices
+ case $dev in
+ usb*) # check for attatched devices
+ if grep usb-storage /sys/class/scsi_host/host*/proc_name >/dev/null 2>&1 ; then
+ ebegin "Waiting for usb-storage"
+ for i in $(seq 0 9); do
+ if mount -t $fs -o ro /dev/$dev /mnt >/dev/null 2>&1; then
+ eend 0
+ return 0
+ else
+ echo -n "."
+ sleep 2
+ fi
+ done
+ eend 1
+ return 1 # timed out...
+ fi
+ ;;
+ esac
+ # not usb, just try to mount as normal
+ mount -t $fs -o ro /dev/$dev /mnt >/dev/null 2>&1
+ return
+}
start() {
local cfgdevs m
@@ -237,8 +266,7 @@ start() {
mnt=$( awk '$1 ~ /^\/dev\/'$dev'/ { print $2 }' /proc/mounts )
if [ x$mnt = x ] ; then
skip_umount=""
- mount -t $fs -o ro /dev/$dev /mnt >/dev/null 2>&1 ||\
- continue
+ mount_dev $fs $dev || continue
mnt=/mnt
else
skip_umount=yes