diskimage-builder/elements/rhel7/root.d/10-rhel7-cloud-image
Ryan Brady 646da5b464 Update RHEL7 element since release
This patch updates the RHEL7 element to work
properly now that it has changed from beta to
release status.  It includes a repo update to
locate os-config rpms not in epel yet and an
update to the latest cloud image name.

Change-Id: I05607d62193c8f8fb1c1bece9872d456b19c5a08
2014-07-21 16:20:18 -04:00

33 lines
945 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:-latest}
DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-http://rhn.redhat.com}
BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-rhel-guest-image-7.0-20140506.1.x86_64.qcow2}
BASE_IMAGE_TAR=$DIB_RELEASE-rhel-server-$ARCH-latest.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