diskimage-builder/elements/centos7/root.d/10-centos7-cloud-image
Ian Wienand 45afb6d86c Update to newer Centos7 images
Update to newer Centos7 images as announced at [1].

Changes included:
 * update to GA image
 * respect TMP_DIR for image working directory
 * use suffix-match rather than prefix-match to build RAW_IMAGE name
   to be more robust against weird names
 * partition layout work-arounds not needed any-more, all one
   partition.

Resulting image booted locally with kvm and virtualbox (after
conversion to vdi)

[1] https://www.redhat.com/archives/rdo-list/2014-August/msg00045.html

Closes-Bug: #1363146
Change-Id: Ie24033468b78587ea87188ee1b843b26895798ff
2014-09-18 10:48:40 +10:00

32 lines
950 B
Bash
Executable File

#!/bin/bash
set -eu
set -o pipefail
[ -n "$ARCH" ]
[ -n "$TARGET_ROOT" ]
if [ 'amd64' = "$ARCH" ] ; then
ARCH="x86_64"
fi
DIB_LOCAL_IMAGE=${DIB_LOCAL_IMAGE:-}
if [ -n "$DIB_LOCAL_IMAGE" ]; then
IMAGE_LOCATION=$DIB_LOCAL_IMAGE
# No need to copy a local image into the cache directory, so just specify
# the cached path as the original path.
CACHED_IMAGE=$IMAGE_LOCATION
BASE_IMAGE_FILE=$(basename $DIB_LOCAL_IMAGE)
BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz
else
DIB_RELEASE=${DIB_RELEASE:-GenericCloud-GA-7.0.1406_01}
DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://cloud.centos.org/centos/7/devel}
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-7-x86_64-$DIB_RELEASE.qcow2}
BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz
IMAGE_LOCATION=$DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE
CACHED_IMAGE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE
fi
$TMP_HOOKS_PATH/bin/extract-image $BASE_IMAGE_FILE $BASE_IMAGE_TAR $IMAGE_LOCATION $CACHED_IMAGE