From 98ab523da443e03f654f20b7a26c85af52e66189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Mon, 30 Mar 2015 21:30:58 +0200 Subject: [PATCH] Wait for udev to process all the events during volatile.img preparation Otherwise it could happen that the device will still be opened by udev, so can't be freed by kpartx --- linux/aux-tools/prepare-volatile-img.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/aux-tools/prepare-volatile-img.sh b/linux/aux-tools/prepare-volatile-img.sh index 28a8207f..60fb2ce3 100755 --- a/linux/aux-tools/prepare-volatile-img.sh +++ b/linux/aux-tools/prepare-volatile-img.sh @@ -40,7 +40,7 @@ kpartx -s -a "$FILENAME" loopdev=`losetup -j "$FILENAME"|tail -n 1 |cut -d: -f1` looppart=`echo $loopdev|sed 's:dev:dev/mapper:'` mkswap -f ${looppart}p1 > /dev/null -sync +udevadm settle kpartx -s -d ${loopdev} losetup -d ${loopdev} || : chown --reference `dirname "$FILENAME"` "$FILENAME"