lib.sh: Add delay after `kpartx -av` 03/49703/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 27 Dec 2017 16:22:55 +0000 (17:22 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Wed, 27 Dec 2017 16:22:55 +0000 (17:22 +0100)
On rare occassions, mapper bindings created by kpartx take longer
to show up, leading to errors when we try to mount them on.
Bring back the hardcoded delay to bypass such issues.

Change-Id: Ib386c04fc55cd85235a2156dba08fda378e4cdfd
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/scripts/lib.sh

index 982cc37..2e14182 100644 (file)
@@ -56,6 +56,7 @@ function mount_image {
   sudo qemu-nbd --connect="${OPNFV_NBD_DEV}" --aio=native --cache=none \
     "${image_dir}/${image}"
   sudo kpartx -av "${OPNFV_NBD_DEV}"
+  sleep 5 # /dev/nbdNp1 takes some time to come up
   # Hardcode partition index to 1, unlikely to change for Ubuntu UCA image
   if sudo growpart "${OPNFV_NBD_DEV}" 1; then
     sudo kpartx -u "${OPNFV_NBD_DEV}"