Execute kpartx in sync mode to avoid race conditions
authorMichael Prokop <mika@grml.org>
Mon, 13 Oct 2014 13:22:55 +0000 (15:22 +0200)
committerMichael Prokop <mika@grml.org>
Mon, 13 Oct 2014 19:05:51 +0000 (21:05 +0200)
Otherwise the according loop device might not be present yet
when we're trying to access it (via mkfs).

grml-debootstrap

index 3658d05..5313e25 100755 (executable)
@@ -1036,7 +1036,7 @@ prepare_vm() {
     fi
   fi
 
-  DEVINFO=$(kpartx -av "$TARGET") # 'add map loop1p1 (253:0): 0 6289408 linear /dev/loop1 2048'
+  DEVINFO=$(kpartx -asv "$TARGET") # 'add map loop1p1 (253:0): 0 6289408 linear /dev/loop1 2048'
   if [ -z "${DEVINFO}" ] ; then
     eerror "Error setting up loopback device." ; eend 1
     bailout 1