summaryrefslogtreecommitdiff
path: root/lx-trainer-vm
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2018-02-23 16:25:23 +0100
committerJohn Ogness <john.ogness@linutronix.de>2018-02-23 16:25:23 +0100
commit37ff02a265dd82f4cbaec1b1a1ef85fd0af69c49 (patch)
tree68398fa0169af8bcef4722c180f4fa648e186183 /lx-trainer-vm
parent8549e7b26a9d770e12dbc98da91664fd8821dab2 (diff)
dd-multi.sh: wait for new partitions
There is a latency between when partprobe is called and when udev actually creates the device nodes. Wait for the desired device nodes to appear before continuing. Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'lx-trainer-vm')
-rwxr-xr-xlx-trainer-vm/dd-multi.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/lx-trainer-vm/dd-multi.sh b/lx-trainer-vm/dd-multi.sh
index 2049be8..2408a66 100755
--- a/lx-trainer-vm/dd-multi.sh
+++ b/lx-trainer-vm/dd-multi.sh
@@ -73,11 +73,18 @@ partprobe $DESTS
for dest in $DESTS; do
/bin/echo -e "n\np\n\n\n\nw" | fdisk $dest
done
-sync
# rescan devices
partprobe $DESTS
+# wait for partitions to appear
+for dest in $DESTS; do
+ while [ ! -b ${dest}2 ]; do
+ echo "waiting for ${dest}2..."
+ sleep 1
+ done
+done
+
# create ext4 on 2nd partition
for dest in $DESTS; do
mkfs.ext4 -L lxhome ${dest}2 &