aboutsummaryrefslogtreecommitdiffstats
path: root/patches/opnfv-fuel/0014-AArch64-base-image-pre-install-salt-minion.patch
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-12-28 18:41:09 +0100
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2018-01-05 23:14:01 +0100
commit0e8a4fc5a553bb55c22590c0620ebfd770394e96 (patch)
tree58fdd861d2efbe06bf2749aadcf31a60ccdfbe39 /patches/opnfv-fuel/0014-AArch64-base-image-pre-install-salt-minion.patch
parent11f5bc3ca9191039b9b22e2da8a6e29538d2f6ea (diff)
MaaS: preseed Armband repo via curtin
Instead of installing upstream vanilla kernel from Ubuntu just to upgrade to the one from Armband repo later, preseed Armband repo config via curtin. This allows us to drop a kernel update cycle, thus saving a few minutes at each deploy. While at it, switch salt repo addition to use the maas region reclass section instead of adding a dedicated mechanism for it in the curtin template (only for arm64). [ stable/ euphrates ] Preseed all Armband repos, since Ocata does not have a "common" repo. JIRA: ARMBAND-280 Change-Id: Iad5953a7de80d728f11a4ce3113bd7725100c31c Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com> (cherry picked from commit 648ec98613d31e3d9701b9ac1d87aed640b245f3)
Diffstat (limited to 'patches/opnfv-fuel/0014-AArch64-base-image-pre-install-salt-minion.patch')
-rw-r--r--patches/opnfv-fuel/0014-AArch64-base-image-pre-install-salt-minion.patch104
1 files changed, 104 insertions, 0 deletions
diff --git a/patches/opnfv-fuel/0014-AArch64-base-image-pre-install-salt-minion.patch b/patches/opnfv-fuel/0014-AArch64-base-image-pre-install-salt-minion.patch
new file mode 100644
index 00000000..ce28bfc4
--- /dev/null
+++ b/patches/opnfv-fuel/0014-AArch64-base-image-pre-install-salt-minion.patch
@@ -0,0 +1,104 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2017 Enea AB and others.
+:
+: All rights reserved. This program and the accompanying materials
+: are made available under the terms of the Apache License, Version 2.0
+: which accompanies this distribution, and is available at
+: http://www.apache.org/licenses/LICENSE-2.0
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Mon, 27 Nov 2017 01:29:32 +0100
+Subject: [PATCH] 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>
+---
+ ci/deploy.sh | 4 ++--
+ mcp/config/scenario/defaults-aarch64.yaml | 2 ++
+ mcp/scripts/lib.sh | 8 +++++++-
+ mcp/scripts/user-data.template | 2 +-
+ 4 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/ci/deploy.sh b/ci/deploy.sh
+index 2c4b7fa..92319ad 100755
+--- a/ci/deploy.sh
++++ b/ci/deploy.sh
+@@ -272,10 +272,10 @@ pushd "${DEPLOY_DIR}" > /dev/null
+ # Install required packages
+ [ -n "$(command -v apt-get)" ] && sudo apt-get install -y \
+ git make rsync mkisofs curl virtinst cpu-checker qemu-kvm uuid-runtime \
+- libvirt-bin
++ libvirt-bin cloud-guest-utils e2fsprogs
+ [ -n "$(command -v yum)" ] && sudo yum install -y --skip-broken \
+ git make rsync genisoimage curl virt-install qemu-kvm util-linux \
+- libvirt
++ libvirt cloud-utils-growpart e2fsprogs
+
+ # For baremetal, python is indirectly required for PDF parsing
+ if [ "${DEPLOY_TYPE}" = 'baremetal' ]; then
+diff --git a/mcp/config/scenario/defaults-aarch64.yaml b/mcp/config/scenario/defaults-aarch64.yaml
+index d989819..edcd8d9 100644
+--- a/mcp/config/scenario/defaults-aarch64.yaml
++++ b/mcp/config/scenario/defaults-aarch64.yaml
+@@ -17,6 +17,7 @@ virtual:
+ - https://linux.enea.com/mcp-repos/ocata/xenial/archive-mcpocata.key
+ repos:
+ # <repo name> <repo prio> deb [arch=<arch>] <repo url> <repo dist> <repo comp>
++ - saltstack 500 deb [arch=arm64] http://linux.enea.com/saltstack/apt/ubuntu/16.04/arm64/2016.11 xenial main
+ - armband_openstack 1100 deb [arch=arm64] http://linux.enea.com/mcp-repos/ocata/xenial ocata main
+ - armband_mk_openstack 1100 deb [arch=arm64] http://linux.enea.com/apt-mk/xenial nightly ocata
+ # NOTE(armband): Empty repo, keep commented out as reference
+@@ -25,6 +26,7 @@ virtual:
+ install:
+ - linux-image-generic-hwe-16.04-edge
+ - linux-headers-generic-hwe-16.04-edge
++ - salt-minion
+ control:
+ pkg:
+ install:
+diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
+index 6a9be97..5a69609 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 {
+diff --git a/mcp/scripts/user-data.template b/mcp/scripts/user-data.template
+index 6752039..b654477 100644
+--- a/mcp/scripts/user-data.template
++++ b/mcp/scripts/user-data.template
+@@ -11,7 +11,7 @@ if [ "$(uname -i)" = "aarch64" ]; then
+ SALT_REPO=linux.enea.com/saltstack/apt/ubuntu/16.04/arm64/2016.11
+ fi
+ wget -O - "https://${SALT_REPO}/SALTSTACK-GPG-KEY.pub" | sudo apt-key add -
+-echo "deb https://${SALT_REPO} xenial main" > /etc/apt/sources.list.d/salt.list
++echo "deb https://${SALT_REPO} xenial main" > /etc/apt/sources.list.d/saltstack.list
+ apt update
+ apt-get install -y salt-minion
+ rm /etc/salt/minion_id