summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2019-02-01 14:59:43 +0106
committerJohn Ogness <john.ogness@linutronix.de>2019-02-01 14:59:43 +0106
commitc7e0e9598e55a4bc560cb70b78f5683a98e86b3c (patch)
treeb0e97c16d612c6214b136aace0100186c0dc74d4
parent1fc875cd2b3693c480a0bbf2d2d9191fe984dc98 (diff)
dd-multi.sh: add sleep for caution, copy vmdk in parallel
After calling partprobe, userspace may need a moment to delete any previously existing device nodes. Sleep a second to give userspace a chance to do this before checking for the nodes to appear. Also, copy the vmdk files in parallel. Otherwise it takes forever to setup the USB disks. Signed-off-by: John Ogness <john.ogness@linutronix.de>
-rwxr-xr-xlx-trainer-vm/dd-multi.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/lx-trainer-vm/dd-multi.sh b/lx-trainer-vm/dd-multi.sh
index d31482b..cb11656 100755
--- a/lx-trainer-vm/dd-multi.sh
+++ b/lx-trainer-vm/dd-multi.sh
@@ -148,6 +148,7 @@ while ! partprobe $DESTS 2> /dev/null; do
echo "waiting for partprobe..."
sleep 1
done
+sleep 1
# wait for partitions to appear
for dest in $DESTS; do
@@ -170,8 +171,12 @@ done
for dest in $DESTS; do
mkdir -p ${TMP_ROOT}${dest}${EXTRAPT}
mount ${dest}${EXTRAPT} ${TMP_ROOT}${dest}${EXTRAPT}
- cp -v $VMDK_FILE ${TMP_ROOT}${dest}${EXTRAPT}/training-hd.vmdk
- sync
+ cp -v $VMDK_FILE ${TMP_ROOT}${dest}${EXTRAPT}/training-hd.vmdk &
+done
+wait
+sync
+
+for dest in $DESTS; do
umount ${TMP_ROOT}${dest}${EXTRAPT}
done