From e29cc0c10c398e5660d4e9edd5d8aad2637cf689 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Wed, 18 Sep 2013 14:09:24 -0700 Subject: [PATCH] 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 --- lib/img-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/img-functions b/lib/img-functions index 26042eb8..cfb3f548 100644 --- a/lib/img-functions +++ b/lib/img-functions @@ -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