diff options
| author | John Ogness <john.ogness@linutronix.de> | 2018-02-23 16:25:23 +0100 |
|---|---|---|
| committer | John Ogness <john.ogness@linutronix.de> | 2018-02-23 16:25:23 +0100 |
| commit | 37ff02a265dd82f4cbaec1b1a1ef85fd0af69c49 (patch) | |
| tree | 68398fa0169af8bcef4722c180f4fa648e186183 | |
| parent | 8549e7b26a9d770e12dbc98da91664fd8821dab2 (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>
| -rwxr-xr-x | lx-trainer-vm/dd-multi.sh | 9 |
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 & |
