Skip to content

Commit

Permalink
examples/mdev.conf.change_blockdev.sh: update
Browse files Browse the repository at this point in the history
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
  • Loading branch information
Denys Vlasenko committed Apr 2, 2013
1 parent e306c11 commit 2df1c64
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions examples/mdev.conf.change_blockdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
) &

0 comments on commit 2df1c64

Please sign in to comment.