From 3c402ff3bd9c7e649f4956a55b588b37450b7baa Mon Sep 17 00:00:00 2001 From: Luke Browning Date: Fri, 10 Nov 2017 18:14:26 -0600 Subject: [PATCH] Enable other Ubuntu architectures to utilize diskimage-builder This is accomplished by parameterizing the -a arch argument which is currently hardcoded to amd64. For Ubuntu distributions, the package architecture as reported by Ubuntu will be passed into disk-image-create via the -a argument. This field controls which packages are installed by DIB. Note diskimage-builder invokes commands in a chroot'd environment, so cross architecture builds are not supported by definition. The platform architecture of the target image is always the same as the caller's. Change-Id: Ie91209681b2291cc7a21895ad21dd1af5e82f32a --- integration/scripts/functions_qemu | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/integration/scripts/functions_qemu b/integration/scripts/functions_qemu index 41b9682a2b..08807e95b5 100644 --- a/integration/scripts/functions_qemu +++ b/integration/scripts/functions_qemu @@ -18,11 +18,12 @@ function build_vm() { readonly SSH_DIR=${KEY_DIR:-${HOMEDIR}/.ssh} manage_ssh_keys + ARCH=amd64 if [ $DISTRO == 'ubuntu' ]; then export DIB_RELEASE=$RELEASE export DIB_CLOUD_IMAGES=cloud-images.ubuntu.com - fi - if [ $DISTRO == 'fedora' ]; then + ARCH=$(dpkg --print-architecture) + elif [ $DISTRO == 'fedora' ]; then EXTRA_ELEMENTS=selinux-permissive fi @@ -46,7 +47,7 @@ function build_vm() { export DIB_APT_CONF_DIR=/etc/apt/apt.conf.d export DIB_CLOUD_INIT_ETC_HOSTS=true local QEMU_IMG_OPTIONS="--qemu-img-options compat=1.1" - disk-image-create -a amd64 -o "${VM}" \ + disk-image-create -a ${ARCH} -o "${VM}" \ -x ${QEMU_IMG_OPTIONS} ${DISTRO} ${EXTRA_ELEMENTS} vm \ cloud-init-datasources ${DISTRO}-${RELEASE}-guest ${DISTRO}-${RELEASE}-${SERVICE_TYPE} }