summaryrefslogtreecommitdiff
path: root/lx-trainer-vm
diff options
context:
space:
mode:
authorJohn Ogness <john.ogness@linutronix.de>2018-09-06 11:06:11 +0200
committerJohn Ogness <john.ogness@linutronix.de>2018-09-06 11:06:11 +0200
commit5949b9031c9e75bc377f3cdb04f514f29bdcf69f (patch)
tree7f274309b165338ccf0d5e0fabfe355c1b5e9cb4 /lx-trainer-vm
parent8b3a88ab325a5b5bb04182a5711ae06059c12f3e (diff)
dd-multi: workaround mount/umount issue
It seems that calling umount directly after mount can lead to a busy error. With strace on umount the problem goes away. It must be a very small window. Someone should debug the umount syscall on this. It is reproducable with: ./dd-multi.sh lx-trainer.img /dev/sdx (i.e. regular training image and no layers) Implement a workaround for this for now. From the comments... If there were no layer files added, umount might return a busy error since we just mounted. (Possibly a kernel bug.) By accessing the filesytem before unmounting it, the mount/umount problem seems to go away. Use "ls" to access the filesystem. Signed-off-by: John Ogness <john.ogness@linutronix.de>
Diffstat (limited to 'lx-trainer-vm')
-rwxr-xr-xlx-trainer-vm/dd-multi.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/lx-trainer-vm/dd-multi.sh b/lx-trainer-vm/dd-multi.sh
index 2a0f9f9..f74171d 100755
--- a/lx-trainer-vm/dd-multi.sh
+++ b/lx-trainer-vm/dd-multi.sh
@@ -160,6 +160,12 @@ for tarball in $LAYERS; do
done
for dest in $DESTS; do
+ # If there were no layer files added, umount might return a busy
+ # error since we just mounted. (Possibly a kernel bug.) By
+ # accessing the filesytem before unmounting it, the mount/umount
+ # problem seems to go away. Use "ls" to access the filesystem.
+ ls ${TMP_ROOT}${dest}${ROOTPT}/home/ > /dev/null
+
# unmount partitions
umount ${TMP_ROOT}${dest}${ROOTPT}/home
umount ${TMP_ROOT}${dest}${ROOTPT}