examples: add mdev example for Android phone

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2013-03-30 16:23:12 +01:00
parent 2c0508b4fa
commit e306c11367
2 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
#!/bin/sh
# Seconds to try to reread partition table
cnt=60
exec </dev/null
exec >"/tmp/${0##*/}.$$.out"
exec 2>&1
(
echo "Running: $0"
echo "Env:"
env | sort
while sleep 1; test $cnt != 0; do
echo "Trying to rereat partition table on $DEVNAME ($cnt)"
: $((cnt--))
test -e "$DEVNAME" || { echo "$DEVNAME doesn't exist, aborting"; exit 1; }
#echo "$DEVNAME exists"
blockdev --rereadpt "$DEVNAME" && break
echo "blockdev --rereadpt failed, exit code: $?"
done
echo "blockdev --rereadpt succeeded"
) &