diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2017-11-27 01:29:32 +0100 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2018-01-04 00:06:54 +0100 |
commit | 72618c6029969f26b574438f5b07a881b072ee90 (patch) | |
tree | 6752146470aaac2ea1cdd96f1af9d9fc8e245840 /mcp/scripts/lib.sh | |
parent | 4c32ab7cd0c86254019542fea65b6130248ea2e6 (diff) |
AArch64: base image: pre-install salt-minion
While at it, rename apt repo in foundation node user-data template
from "salt" to "saltstack", to align with reclass model naming.
Change-Id: I5b216492349ae187b568884b1ab4046c52b1c6b2
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
(cherry picked from commit feb877785544a31a18ae2f0ee2900a82e7ac4337)
Diffstat (limited to 'mcp/scripts/lib.sh')
-rw-r--r-- | mcp/scripts/lib.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh index d3555e38c..0e7ac5809 100644 --- a/mcp/scripts/lib.sh +++ b/mcp/scripts/lib.sh @@ -51,11 +51,15 @@ function mount_image { OPNFV_LOOP_DEV=$(losetup -f) export OPNFV_MNT_DIR OPNFV_LOOP_DEV [ -n "${OPNFV_NBD_DEV}" ] && [ -n "${OPNFV_LOOP_DEV}" ] || exit 1 + qemu-img resize "${image_dir}/${image}" 3G sudo qemu-nbd --connect="${OPNFV_NBD_DEV}" --aio=native --cache=none \ "${image_dir}/${image}" sleep 5 # /dev/nbdNp1 takes some time to come up - # grub-update does not like /dev/nbd*, so use a loop device to work around it # Hardcode partition index to 1, unlikely to change for Ubuntu UCA image + if sudo growpart "${OPNFV_NBD_DEV}" 1; then + sudo e2fsck -yf "${OPNFV_NBD_DEV}p1" && sudo resize2fs "${OPNFV_NBD_DEV}p1" + fi + # grub-update does not like /dev/nbd*, so use a loop device to work around it sudo losetup "${OPNFV_LOOP_DEV}" "${OPNFV_NBD_DEV}p1" mkdir -p "${OPNFV_MNT_DIR}" sudo mount "${OPNFV_LOOP_DEV}" "${OPNFV_MNT_DIR}" @@ -66,6 +70,8 @@ function mount_image { sudo cp /etc/resolv.conf "${OPNFV_MNT_DIR}/run/resolvconf" echo "GRUB_DISABLE_OS_PROBER=true" | \ sudo tee -a "${OPNFV_MNT_DIR}/etc/default/grub" + sudo sed -i -e 's/^\(GRUB_TIMEOUT\)=.*$/\1=1/g' -e 's/^GRUB_HIDDEN.*$//g' \ + "${OPNFV_MNT_DIR}/etc/default/grub" } function apt_repos_pkgs_image { |