From 06576a02f09d1326cad342bc0901334e4c79722e Mon Sep 17 00:00:00 2001 From: Dan Radez Date: Wed, 18 Jan 2017 15:49:20 -0500 Subject: [PATCH] Adding aarch64 support for CentOS7 Using delorian and delorian-deps for aarch64 this will produce an overcloud-full image Change-Id: Id0dc83d9c558b0c0bbfaed7727883541d140472c --- .../elements/centos7/root.d/10-centos7-cloud-image | 10 +++++++--- .../rpm-distro/pre-install.d/01-override-yum-arch | 2 +- diskimage_builder/lib/common-defaults | 1 + diskimage_builder/lib/disk-image-create | 2 +- doc/source/developer/components.rst | 12 +++++++----- doc/source/developer/developing_elements.rst | 4 ++-- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/diskimage_builder/elements/centos7/root.d/10-centos7-cloud-image b/diskimage_builder/elements/centos7/root.d/10-centos7-cloud-image index 7db1557de..73a41b97b 100755 --- a/diskimage_builder/elements/centos7/root.d/10-centos7-cloud-image +++ b/diskimage_builder/elements/centos7/root.d/10-centos7-cloud-image @@ -11,8 +11,12 @@ set -o pipefail if [[ "amd64 x86_64" =~ "$ARCH" ]]; then ARCH="x86_64" + DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud.centos.org/centos/7/images} +elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then + ARCH="aarch64" + DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud.centos.org/altarch/7/images/aarch64} else - echo 'centos7 root element only support the x86_64 $ARCH value.' + echo 'centos7 root element only support the x86_64 and aarch64 $ARCH value.' exit 1 fi @@ -27,8 +31,8 @@ if [ -n "$DIB_LOCAL_IMAGE" ]; then BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz else DIB_RELEASE=${DIB_RELEASE:-GenericCloud} - DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud.centos.org/centos/7/images} - BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-7-x86_64-$DIB_RELEASE.qcow2.xz} + DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES} + BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-7-${ARCH}-$DIB_RELEASE.qcow2.xz} BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz IMAGE_LOCATION=$DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE CACHED_IMAGE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE diff --git a/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch b/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch index 3e11e7d3a..c61114e79 100755 --- a/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch +++ b/diskimage_builder/elements/rpm-distro/pre-install.d/01-override-yum-arch @@ -18,7 +18,7 @@ elif [[ "$ARCH" = "ppc64" ]]; then elif [[ "$ARCH" = "ppc64el" ]]; then basearch=ppc64el arch=ppc64el -elif [[ "$ARCH" = "aarch64" ]]; then +elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then basearch=aarch64 arch=aarch64 else diff --git a/diskimage_builder/lib/common-defaults b/diskimage_builder/lib/common-defaults index c5dc15f2c..a7d571276 100644 --- a/diskimage_builder/lib/common-defaults +++ b/diskimage_builder/lib/common-defaults @@ -27,6 +27,7 @@ else _ARCH="armhf" ;; "aarch64") + _ARCH="arm64" ;; *) echo "WARNING: Unknown architecture: $_ARCH" diff --git a/diskimage_builder/lib/disk-image-create b/diskimage_builder/lib/disk-image-create index de52b7f5e..5fc401432 100644 --- a/diskimage_builder/lib/disk-image-create +++ b/diskimage_builder/lib/disk-image-create @@ -46,7 +46,7 @@ function show_options () { echo "Usage: ${SCRIPTNAME} [OPTION]... [ELEMENT]..." echo echo "Options:" - echo " -a i386|amd64|armhf -- set the architecture of the image(default amd64)" + echo " -a i386|amd64|armhf|arm64 -- set the architecture of the image(default amd64)" echo " -o imagename -- set the imagename of the output image file(default image)" echo " -t qcow2,tar,tgz,squashfs,vhd,docker,aci,raw -- set the image types of the output image files (default qcow2)" echo " File types should be comma separated. VHD outputting requires the vhd-util" diff --git a/doc/source/developer/components.rst b/doc/source/developer/components.rst index 8720623d4..7ca40b614 100644 --- a/doc/source/developer/components.rst +++ b/doc/source/developer/components.rst @@ -1,15 +1,17 @@ Components ========== -`disk-image-create [-a i386|amd64|armhf] -o filename {element} [{element} ...]` +`disk-image-create [-a i386|amd64|armhf|arm64] -o filename {element} [{element} ...]` Create an image of element {element}, optionally mixing in other elements. Element dependencies are automatically included. Support for other architectures depends on your environment being able to run binaries of - that platform. For instance, to enable armhf on Ubuntu install the - qemu-user-static package. The default output format from disk-image-create - is qcow2. To instead output a tarball pass in "-t tar". This tarball could - then be used as an image for a linux container(see docs/docker.md). + that platform and/or packages being available for the architecture. For + instance, to enable armhf on Ubuntu install the qemu-user-static package, + or to enable arm64 on CentOS setup the RDO aarch64 package repositories. + The default output format from disk-image-create is qcow2. To instead + output a tarball pass in "-t tar". This tarball could then be used as an + image for a linux container(see docs/docker.md). `ramdisk-image-create -o filename {element} [{element} ...]` diff --git a/doc/source/developer/developing_elements.rst b/doc/source/developer/developing_elements.rst index 80fb5c9a8..63a5d813f 100644 --- a/doc/source/developer/developing_elements.rst +++ b/doc/source/developer/developing_elements.rst @@ -85,7 +85,7 @@ The phases are: * runs: **outside chroot** * inputs: - * ``$ARCH=i386|amd64|armhf`` + * ``$ARCH=i386|amd64|armhf|arm64`` * ``$TARGET_ROOT=/path/to/target/workarea`` ``extra-data.d`` @@ -154,7 +154,7 @@ The phases are: * runs: outside chroot * inputs: - * ``$ARCH=i386|amd64|armhf`` + * ``$ARCH=i386|amd64|armhf|arm64`` * ``$TARGET_ROOT=/path/to/target/workarea``