diff --git a/diskimage_builder/elements/rhel7/README.rst b/diskimage_builder/elements/rhel7/README.rst index 00d4d589..e5cc6179 100644 --- a/diskimage_builder/elements/rhel7/README.rst +++ b/diskimage_builder/elements/rhel7/README.rst @@ -1,6 +1,13 @@ ===== rhel7 ===== + +.. warning:: + + This element is deprecated and is left only for backward compatibility. + Use the `rhel` element instead. Note that you should set DIB_RELEASE to 7 + to indicate which release you are using. Please read the notes. + Use RHEL 7 cloud images as the baseline for built disk images. Because RHEL 7 base images are not publicly available, it is necessary to first diff --git a/diskimage_builder/elements/rhel7/element-deps b/diskimage_builder/elements/rhel7/element-deps index 81585c43..476fbc01 100644 --- a/diskimage_builder/elements/rhel7/element-deps +++ b/diskimage_builder/elements/rhel7/element-deps @@ -1,6 +1 @@ -cache-url -redhat-common -rhel-common -rpm-distro -source-repositories -yum +rhel \ No newline at end of file diff --git a/diskimage_builder/elements/rhel7/element-provides b/diskimage_builder/elements/rhel7/element-provides deleted file mode 100644 index a72e0496..00000000 --- a/diskimage_builder/elements/rhel7/element-provides +++ /dev/null @@ -1 +0,0 @@ -operating-system diff --git a/diskimage_builder/elements/rhel7/environment.d/00-rhel7-element-deprecation.bash b/diskimage_builder/elements/rhel7/environment.d/00-rhel7-element-deprecation.bash new file mode 100644 index 00000000..ff03c142 --- /dev/null +++ b/diskimage_builder/elements/rhel7/environment.d/00-rhel7-element-deprecation.bash @@ -0,0 +1 @@ +echo "The rhel7 element is deprecated and will be removed in future releases. Use the rhel element instead." diff --git a/diskimage_builder/elements/rhel7/environment.d/10-rhel7-distro-name.bash b/diskimage_builder/elements/rhel7/environment.d/10-rhel7-distro-name.bash index 07578d0e..d64b367a 100644 --- a/diskimage_builder/elements/rhel7/environment.d/10-rhel7-distro-name.bash +++ b/diskimage_builder/elements/rhel7/environment.d/10-rhel7-distro-name.bash @@ -1 +1 @@ -export DISTRO_NAME=rhel7 +export DIB_RELEASE=7 diff --git a/diskimage_builder/elements/rhel7/root.d/10-rhel7-cloud-image b/diskimage_builder/elements/rhel7/root.d/10-rhel7-cloud-image deleted file mode 100755 index 2016576c..00000000 --- a/diskimage_builder/elements/rhel7/root.d/10-rhel7-cloud-image +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then - set -x -fi -set -eu -set -o pipefail - -[ -n "$ARCH" ] -[ -n "$TARGET_ROOT" ] - -if [[ "amd64 x86_64" =~ "$ARCH" ]]; then - ARCH="x86_64" -elif [[ "ppc64le" =~ "$ARCH" ]]; then - # We don't need to do anything here other than avoid the else clause - : -else - echo 'rhel7 root element only supports x86_64 and ppc64le values for $ARCH' - exit 1 -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 - if [ -z "${BASE_IMAGE_FILE:-}" -o -z "${DIB_CLOUD_IMAGES:-}" ]; then - echo "No source for a base image file configured." - echo "See rhel7 element readme for details on how to obtain and use a base image." - exit 1 - fi - DIB_RELEASE=${DIB_RELEASE:-latest} - 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/releasenotes/notes/rhel7-element-deprecation-b0c1b57be8cd06ac.yaml b/releasenotes/notes/rhel7-element-deprecation-b0c1b57be8cd06ac.yaml new file mode 100644 index 00000000..a8107397 --- /dev/null +++ b/releasenotes/notes/rhel7-element-deprecation-b0c1b57be8cd06ac.yaml @@ -0,0 +1,7 @@ +--- +deprecations: + - | + The rhel7 element is deprecated and is left only for backwards + compatibility. Use the `rhel` element instead. Note that you should set + DIB_RELEASE to 7 to indicate which release you are using. Please read the + notes.