[lib] Limit cloud img partition resize to Xenial 68/68168/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 1 Jul 2019 14:20:19 +0000 (16:20 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 1 Jul 2019 14:20:19 +0000 (16:20 +0200)
All cloud images except Ubuntu Xenial (CentOS 7, Ubuntu 18.04) already
have enough free space on the predefined partitions, so skip the resize
to avoid dealing with the newer e2fsprogs required by Ubuntu 18.04.

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

index d3ccd6e..40910f4 100644 (file)
@@ -124,7 +124,8 @@ function __mount_image {
   sudo kpartx -av "${OPNFV_NBD_DEV}"
   # Hardcode partition index to 1, unlikely to change for Ubuntu UCA image
   sudo partx -uvn 1:1 "${OPNFV_NBD_DEV}"
-  if sudo growpart "${OPNFV_NBD_DEV}" 1; then
+  if [[ "${MCP_OS:-}" =~ ubuntu1604 ]] && sudo growpart "${OPNFV_NBD_DEV}" 1
+  then
     sudo kpartx -u "${OPNFV_NBD_DEV}"
     sudo e2fsck -pf "${OPNFV_MAP_DEV}"
     sudo resize2fs "${OPNFV_MAP_DEV}"