Use lazy umount to avoid race problems with dev

A problem with unmounting the dev filesystem in Ubuntu images caused
the umount of the /dev bind mount to fail, which left it there to be
removed during the mv -t step, causing the build host's /dev to be
wiped out.

The lazy umount will detach it from the filesystem hierarchy and then
clean up the mount reference later.

Change-Id: I8f8cea857c445fb0b4fd02bc063722fb1553c947
This commit is contained in:
Clint Byrum 2013-09-18 14:09:24 -07:00
parent b50dbb0571
commit e29cc0c10c

View File

@ -25,7 +25,7 @@ function unmount_image () {
local MOUNTS
MOUNTS=$(grep < /proc/mounts " $TMP_BUILD_DIR/mnt" | awk '{ print $2 }' | sort -r)
for M in $MOUNTS; do
sudo umount -f $M || true
sudo umount -fl $M || true
done
if [ -n "$EXTRA_UNMOUNT" ]; then
$EXTRA_UNMOUNT