summaryrefslogtreecommitdiff
path: root/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling
diff options
context:
space:
mode:
authorRod Whitby <rod@whitby.id.au>2005-08-17 14:46:23 +0000
committerOpenEmbedded Project <openembedded-devel@lists.openembedded.org>2005-08-17 14:46:23 +0000
commit6200652ca41dc16d2ca46cc5fbd4db6f73c3ae70 (patch)
tree61601b4fd4177ca701e5ac6893d62468015ff0d2 /packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling
parentaf162b6adfdef389698f30260374f4c3cd3d36dc (diff)
Updated unsling to wait for a mounted rw disk.
Diffstat (limited to 'packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling')
-rwxr-xr-xpackages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling23
1 files changed, 18 insertions, 5 deletions
diff --git a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling
index ce2e528c92..bed1789a6f 100755
--- a/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling
+++ b/packages/nslu2-binary-only/unslung-rootfs-2.3r63/unsling
@@ -11,9 +11,11 @@ fi
if [ $# -eq 1 ] ; then
if [ "$1" = "disk1" ] ; then
+ mtch="/dev/sdb1 /share/hdd/data ext3 rw 0 0"
targ=/share/hdd/data
flag=.sda1root
elif [ "$1" = "disk2" ] ; then
+ mtch="/dev/sda1 /share/flash/data ext3 rw 0 0"
targ=/share/flash/data
flag=.sdb1root
else
@@ -27,11 +29,22 @@ fi
# Check it's a real mount point
-if grep $targ /proc/mounts >/dev/null 2>&1 ; then
- echo "Target disk is $targ"
-else
- echo "Error: $targ is not a mounted disk"
- exit 1
+echo "Waiting for $targ"
+CNT=120
+while [ $CNT -gt 0 ]
+do
+ if grep "$mtch" /proc/mounts >/dev/null 2>&1 ; then
+ echo "Target disk is $targ"
+ CNT=-1
+ else
+ echo -ne "\r$CNT "
+ sleep 1
+ CNT=`expr $CNT - 1`
+ fi
+done
+if [ $CNT -eq 0 ] ; then
+ echo "Error: $targ is not a mounted disk"
+ exit 1
fi
# Start at the root directory