diff --git a/elements/rhel7/README.md b/elements/rhel7/README.md new file mode 100644 index 000000000..0a69bf3a9 --- /dev/null +++ b/elements/rhel7/README.md @@ -0,0 +1,8 @@ +Use RHEL 7 cloud images as the baseline for built disk images. + +Note: As of this writing, RHEL 7 is still in beta, so final download +locations are not available. This element defaults to using the RHEL 6.5 +image, but that will need to be overridden using the appropriate DIB_* +environment variables to point at a RHEL 7 image. + +For further details see the redhat-common README. diff --git a/elements/rhel7/element-deps b/elements/rhel7/element-deps new file mode 100644 index 000000000..c6e5925f9 --- /dev/null +++ b/elements/rhel7/element-deps @@ -0,0 +1,6 @@ +cache-url +dib-run-parts +redhat-common +rpm-distro +source-repositories +yum diff --git a/elements/rhel7/pre-install.d/05-yum-repos b/elements/rhel7/pre-install.d/05-yum-repos new file mode 100755 index 000000000..bad61e272 --- /dev/null +++ b/elements/rhel7/pre-install.d/05-yum-repos @@ -0,0 +1,21 @@ +#!/bin/bash + +cat << EOF > /etc/yum.repos.d/rhel7.repo +[rhel7] +name=RHEL7 +failovermethod=priority +baseurl=http://ftp.redhat.com/redhat/rhel/beta/7/x86_64/os/ +enabled=1 +metadata_expire=7d +gpgcheck=0 +EOF + +cat << EOF > /etc/yum.repos.d/epel.repo +[epel] +name=epel +failovermethod=priority +baseurl=http://download-i2.fedoraproject.org/pub/epel/beta/7/x86_64/ +enabled=1 +metadata_expire=7d +gpgcheck=0 +EOF diff --git a/elements/rhel7/root.d/10-rhel-cloud-image b/elements/rhel7/root.d/10-rhel-cloud-image new file mode 100755 index 000000000..6a53a721f --- /dev/null +++ b/elements/rhel7/root.d/10-rhel-cloud-image @@ -0,0 +1,31 @@ +#!/bin/bash + +set -eu + +[ -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-6-6.5-20131115.0-1.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 diff --git a/elements/rhel7/source-repository-rhel7 b/elements/rhel7/source-repository-rhel7 new file mode 100644 index 000000000..1d6a0c857 --- /dev/null +++ b/elements/rhel7/source-repository-rhel7 @@ -0,0 +1 @@ +lsb-release file /opt/stack/lsb-release/lsb_release https://bzr.linuxfoundation.org/loggerhead/lsb/devel/si/download/head:/lsb_release-20060624065236-gakl5b7e37gwk5mg-12/lsb_release