Merge "Adding aarch64 support for CentOS7"

This commit is contained in:
Jenkins 2017-04-05 05:10:05 +00:00 committed by Gerrit Code Review
commit 221c44f24c
6 changed files with 19 additions and 12 deletions

View File

@ -11,8 +11,12 @@ set -o pipefail
if [[ "amd64 x86_64" =~ "$ARCH" ]]; then if [[ "amd64 x86_64" =~ "$ARCH" ]]; then
ARCH="x86_64" 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 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 exit 1
fi fi
@ -27,8 +31,8 @@ if [ -n "$DIB_LOCAL_IMAGE" ]; then
BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz
else else
DIB_RELEASE=${DIB_RELEASE:-GenericCloud} DIB_RELEASE=${DIB_RELEASE:-GenericCloud}
DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud.centos.org/centos/7/images} DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES}
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-7-x86_64-$DIB_RELEASE.qcow2.xz} BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-7-${ARCH}-$DIB_RELEASE.qcow2.xz}
BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz
IMAGE_LOCATION=$DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE IMAGE_LOCATION=$DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE
CACHED_IMAGE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE CACHED_IMAGE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE

View File

@ -18,7 +18,7 @@ elif [[ "$ARCH" = "ppc64" ]]; then
elif [[ "$ARCH" = "ppc64el" ]]; then elif [[ "$ARCH" = "ppc64el" ]]; then
basearch=ppc64el basearch=ppc64el
arch=ppc64el arch=ppc64el
elif [[ "$ARCH" = "aarch64" ]]; then elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then
basearch=aarch64 basearch=aarch64
arch=aarch64 arch=aarch64
else else

View File

@ -27,6 +27,7 @@ else
_ARCH="armhf" _ARCH="armhf"
;; ;;
"aarch64") "aarch64")
_ARCH="arm64"
;; ;;
*) *)
echo "WARNING: Unknown architecture: $_ARCH" echo "WARNING: Unknown architecture: $_ARCH"

View File

@ -46,7 +46,7 @@ function show_options () {
echo "Usage: ${SCRIPTNAME} [OPTION]... [ELEMENT]..." echo "Usage: ${SCRIPTNAME} [OPTION]... [ELEMENT]..."
echo echo
echo "Options:" 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 " -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 " -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" echo " File types should be comma separated. VHD outputting requires the vhd-util"

View File

@ -1,15 +1,17 @@
Components 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. Create an image of element {element}, optionally mixing in other elements.
Element dependencies are automatically included. Support for other Element dependencies are automatically included. Support for other
architectures depends on your environment being able to run binaries of architectures depends on your environment being able to run binaries of
that platform. For instance, to enable armhf on Ubuntu install the that platform and/or packages being available for the architecture. For
qemu-user-static package. The default output format from disk-image-create instance, to enable armhf on Ubuntu install the qemu-user-static package,
is qcow2. To instead output a tarball pass in "-t tar". This tarball could or to enable arm64 on CentOS setup the RDO aarch64 package repositories.
then be used as an image for a linux container(see docs/docker.md). 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} ...]` `ramdisk-image-create -o filename {element} [{element} ...]`

View File

@ -85,7 +85,7 @@ The phases are:
* runs: **outside chroot** * runs: **outside chroot**
* inputs: * inputs:
* ``$ARCH=i386|amd64|armhf`` * ``$ARCH=i386|amd64|armhf|arm64``
* ``$TARGET_ROOT=/path/to/target/workarea`` * ``$TARGET_ROOT=/path/to/target/workarea``
``extra-data.d`` ``extra-data.d``
@ -154,7 +154,7 @@ The phases are:
* runs: outside chroot * runs: outside chroot
* inputs: * inputs:
* ``$ARCH=i386|amd64|armhf`` * ``$ARCH=i386|amd64|armhf|arm64``
* ``$TARGET_ROOT=/path/to/target/workarea`` * ``$TARGET_ROOT=/path/to/target/workarea``