summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2013-04-02 11:26:24 (GMT)
committer Denys Vlasenko <vda.linux@googlemail.com>2013-04-02 11:26:24 (GMT)
commit2df1c64f388576f113abd6f7a3696fa8bef58304 (patch)
treee92c06bdeda0ff96733fbad6767a91ab21247ca1
parente306c1136787b0430592289347efab6098dae64e (diff)
downloadbusybox-2df1c64f388576f113abd6f7a3696fa8bef58304.tar.gz
busybox-2df1c64f388576f113abd6f7a3696fa8bef58304.tar.bz2
examples/mdev.conf.change_blockdev.sh: update
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rwxr-xr-xexamples/mdev.conf.change_blockdev.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/mdev.conf.change_blockdev.sh b/examples/mdev.conf.change_blockdev.sh
index a479a96..512e43f 100755
--- a/examples/mdev.conf.change_blockdev.sh
+++ b/examples/mdev.conf.change_blockdev.sh
@@ -13,12 +13,17 @@ echo "Env:"
env | sort
while sleep 1; test $cnt != 0; do
- echo "Trying to rereat partition table on $DEVNAME ($cnt)"
+ echo "Trying to reread partition table on $DEVNAME ($cnt)"
: $((cnt--))
+ # If device node doesn't exist, it means the device was removed.
+ # Stop trying.
test -e "$DEVNAME" || { echo "$DEVNAME doesn't exist, aborting"; exit 1; }
#echo "$DEVNAME exists"
- blockdev --rereadpt "$DEVNAME" && break
+ if blockdev --rereadpt "$DEVNAME"; then
+ echo "blockdev --rereadpt succeeded"
+ exit 0
+ fi
echo "blockdev --rereadpt failed, exit code: $?"
done
-echo "blockdev --rereadpt succeeded"
+echo "Timed out"
) &