diff --git a/diskimage_builder/elements/centos-minimal/README.rst b/diskimage_builder/elements/centos-minimal/README.rst index 04d2abc17..6aecabfa5 100644 --- a/diskimage_builder/elements/centos-minimal/README.rst +++ b/diskimage_builder/elements/centos-minimal/README.rst @@ -6,14 +6,5 @@ Create a minimal image based on CentOS Use of this element will require 'yum' and 'yum-utils' to be installed on Ubuntu and Debian. Nothing additional is needed on Fedora or CentOS. -By default this builds CentOS 7 images. Set ``DIB_RELEASE`` to ``7``, +By default this builds CentOS-Stream 9 images. Set ``DIB_RELEASE`` to ``8`` or ``8-stream`` to explicitly select the release. - -For CentOS 7, by default, ``DIB_YUM_MINIMAL_CREATE_INTERFACES`` is set -to enable the creation of -``/etc/sysconfig/network-scripts/ifcfg-eth[0|1]`` scripts to enable -DHCP on the ``eth0`` & ``eth1`` interfaces. If you do not have these -interfaces, or if you are using something else to setup the network -such as cloud-init, glean or network-manager, you would want to set -this to ``0``. For CentOS 8 and CentOS 8 Stream, this is set to ``0`` by -default as the system uses NetworkManager by default. diff --git a/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash b/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash index fc55bec96..a44f62ca3 100644 --- a/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash +++ b/diskimage_builder/elements/centos-minimal/environment.d/10-centos-distro-name.bash @@ -1,12 +1,5 @@ export DISTRO_NAME=centos -export DIB_RELEASE=${DIB_RELEASE:-7} +export DIB_RELEASE=${DIB_RELEASE:-9-stream} export EFI_BOOT_DIR="EFI/centos" - -# by default, enable DHCP configuration of eth0 & eth1 in network -# scripts for centos 7. See yum-minimal for full details. CentOS 8 -# does not come with network-scripts by default so avoid this there. -if [[ "${DIB_RELEASE}" < "8" ]]; then - export DIB_YUM_MINIMAL_CREATE_INTERFACES=${DIB_YUM_MINIMAL_CREATE_INTERFACES:-1} -else - export DIB_YUM_MINIMAL_CREATE_INTERFACES=${DIB_YUM_MINIMAL_CREATE_INTERFACES:-0} -fi +export YUM=dnf +export DIB_YUM_MINIMAL_CREATE_INTERFACES=${DIB_YUM_MINIMAL_CREATE_INTERFACES:-0} \ No newline at end of file diff --git a/diskimage_builder/elements/centos-minimal/environment.d/11-yum-dnf.bash b/diskimage_builder/elements/centos-minimal/environment.d/11-yum-dnf.bash deleted file mode 100644 index 270db9416..000000000 --- a/diskimage_builder/elements/centos-minimal/environment.d/11-yum-dnf.bash +++ /dev/null @@ -1,5 +0,0 @@ -if [[ $DIB_RELEASE == "7" ]]; then - export YUM=yum -else - export YUM=dnf -fi diff --git a/diskimage_builder/elements/centos-minimal/test-elements/7-build-succeeds/README.rst b/diskimage_builder/elements/centos-minimal/test-elements/7-build-succeeds/README.rst deleted file mode 100644 index fa1e50dc9..000000000 --- a/diskimage_builder/elements/centos-minimal/test-elements/7-build-succeeds/README.rst +++ /dev/null @@ -1 +0,0 @@ -Verify we can build a centos-minimal image. diff --git a/diskimage_builder/elements/centos-minimal/test-elements/7-build-succeeds/element-deps b/diskimage_builder/elements/centos-minimal/test-elements/7-build-succeeds/element-deps deleted file mode 100644 index 7791c84fc..000000000 --- a/diskimage_builder/elements/centos-minimal/test-elements/7-build-succeeds/element-deps +++ /dev/null @@ -1 +0,0 @@ -openstack-ci-mirrors \ No newline at end of file diff --git a/diskimage_builder/elements/centos-minimal/yum.repos.d/7/yum.repo b/diskimage_builder/elements/centos-minimal/yum.repos.d/7/yum.repo deleted file mode 100644 index 3085f0894..000000000 --- a/diskimage_builder/elements/centos-minimal/yum.repos.d/7/yum.repo +++ /dev/null @@ -1,6 +0,0 @@ -[centos] -name=CentOS-$releasever - Base -mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os -gpgcheck=0 -#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ -#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 diff --git a/diskimage_builder/elements/centos/environment.d/10-centos-distro-name.bash b/diskimage_builder/elements/centos/environment.d/10-centos-distro-name.bash index ca893816e..e6d8389b2 100644 --- a/diskimage_builder/elements/centos/environment.d/10-centos-distro-name.bash +++ b/diskimage_builder/elements/centos/environment.d/10-centos-distro-name.bash @@ -1,3 +1,4 @@ export DISTRO_NAME=centos -export DIB_RELEASE=${DIB_RELEASE:-8} +export DIB_RELEASE=${DIB_RELEASE:-9-stream} export EFI_BOOT_DIR="EFI/centos" +export YUM=dnf diff --git a/diskimage_builder/elements/centos/environment.d/11-yum-dnf.bash b/diskimage_builder/elements/centos/environment.d/11-yum-dnf.bash deleted file mode 100644 index 35766e22d..000000000 --- a/diskimage_builder/elements/centos/environment.d/11-yum-dnf.bash +++ /dev/null @@ -1,7 +0,0 @@ -# since CentOS 8, dnf is the yum replacement. - -if [[ $DIB_RELEASE == "7" ]]; then - export YUM=yum -else - export YUM=dnf -fi diff --git a/diskimage_builder/elements/centos/pre-install.d/00-02-set-centos-mirror b/diskimage_builder/elements/centos/pre-install.d/00-02-set-centos-mirror index ce97ecd4b..2a197aa41 100755 --- a/diskimage_builder/elements/centos/pre-install.d/00-02-set-centos-mirror +++ b/diskimage_builder/elements/centos/pre-install.d/00-02-set-centos-mirror @@ -12,10 +12,8 @@ DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-} # Only set the mirror for the Base, Extras and Updates repositories # The others aren't enabled and do not exist on all mirrors -if [[ ${DIB_RELEASE} == '7' ]]; then - sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\(centos\|altarch\)/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Base.repo # CentOS Stream releases (9-stream) -elif [[ ${DIB_RELEASE} =~ '9-stream' ]]; then +if [[ ${DIB_RELEASE} =~ '9-stream' ]]; then sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/centos.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/centos-addons.repo # CentOS Stream releases (8-stream) diff --git a/diskimage_builder/elements/centos/root.d/10-centos-cloud-image b/diskimage_builder/elements/centos/root.d/10-centos-cloud-image index d2529046a..d0f08469d 100755 --- a/diskimage_builder/elements/centos/root.d/10-centos-cloud-image +++ b/diskimage_builder/elements/centos/root.d/10-centos-cloud-image @@ -9,37 +9,21 @@ set -o pipefail [ -n "$ARCH" ] [ -n "$TARGET_ROOT" ] -if [[ "${DIB_RELEASE}" = 7 ]]; then - if [[ "amd64 x86_64" =~ "$ARCH" ]]; then +if [[ "amd64 x86_64 arm64 aarch64 ppc64le" =~ "$ARCH" ]]; then + if [[ "amd64" =~ "$ARCH" ]]; then ARCH="x86_64" - DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://cloud.centos.org/centos/${DIB_RELEASE}/images} - elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then + elif [[ "arm64" =~ "$ARCH" ]]; then ARCH="aarch64" - DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://cloud.centos.org/altarch/${DIB_RELEASE}/images/aarch64} - elif [[ "ppc64le" =~ "$ARCH" ]]; then - DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://cloud.centos.org/altarch/${DIB_RELEASE}/images/ppc64le} - else - echo 'centos root element only support the x86_64, aarch64 and ppc64le values for $ARCH' - exit 1 fi + if [[ "${DIB_RELEASE}" == "9" ]]; then + dib_release_path=9-stream + else + dib_release_path=${DIB_RELEASE} + fi + DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://cloud.centos.org/centos/${dib_release_path}/${ARCH}/images} else - if [[ "amd64 x86_64 arm64 aarch64 ppc64le" =~ "$ARCH" ]]; then - if [[ "amd64" =~ "$ARCH" ]]; then - ARCH="x86_64" - elif [[ "arm64" =~ "$ARCH" ]]; then - ARCH="aarch64" - fi - if [[ "${DIB_RELEASE}" == "9" ]]; then - dib_release_path=9-stream - else - dib_release_path=${DIB_RELEASE} - fi - DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://cloud.centos.org/centos/${dib_release_path}/${ARCH}/images} - else - echo 'centos root element only support the x86_64, aarch64 and ppc64le values for $ARCH' - exit 1 - fi - + echo 'centos root element only support the x86_64, aarch64 and ppc64le values for $ARCH' + exit 1 fi DIB_LOCAL_IMAGE=${DIB_LOCAL_IMAGE:-} @@ -53,16 +37,12 @@ if [ -n "$DIB_LOCAL_IMAGE" ]; then BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz else DIB_FLAVOR=${DIB_FLAVOR:-GenericCloud} - if [[ "${DIB_RELEASE}" = 7 ]]; then - BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-CentOS-${DIB_RELEASE}-${ARCH}-${DIB_FLAVOR}.qcow2.xz} + if [[ "${DIB_RELEASE}" == "9" ]]; then + dib_release_path=9-stream else - if [[ "${DIB_RELEASE}" == "9" ]]; then - dib_release_path=9-stream - else - dib_release_path=${DIB_RELEASE} - fi - BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$(head -1 < <(curl -s https://cloud.centos.org/centos/${dib_release_path}/${ARCH}/images/ | grep -o "CentOS-.[^>]*${DIB_FLAVOR}-.[^>]*.qcow2" | sort -r))} + dib_release_path=${DIB_RELEASE} fi + BASE_IMAGE_FILE=${BASE_IMAGE_FILE:-$(head -1 < <(curl -s https://cloud.centos.org/centos/${dib_release_path}/${ARCH}/images/ | grep -o "CentOS-.[^>]*${DIB_FLAVOR}-.[^>]*.qcow2" | sort -r))} BASE_IMAGE_TAR=$BASE_IMAGE_FILE.tgz IMAGE_LOCATION=$DIB_CLOUD_IMAGES/$BASE_IMAGE_FILE CACHED_IMAGE=$DIB_IMAGE_CACHE/$BASE_IMAGE_FILE diff --git a/diskimage_builder/elements/centos7/README.rst b/diskimage_builder/elements/centos7/README.rst deleted file mode 100644 index 1c896d2b4..000000000 --- a/diskimage_builder/elements/centos7/README.rst +++ /dev/null @@ -1,29 +0,0 @@ -======= -centos7 -======= - -.. warning:: - - This element is deprecated and is left only for backward compatibility. - Use the `centos` element instead. Note that you should set DIB_RELEASE to 7 - to indicate which release you are using. Please read the notes. - -Use CentOS 7 cloud images as the baseline for built disk images. - -For further details see the redhat-common README. - -DIB_DISTRIBUTION_MIRROR: - :Required: No - :Default: None - :Description: To use a CentOS Yum mirror, set this variable to the mirror URL - before running bin/disk-image-create. This URL should point to - the directory containing the ``5/6/7`` directories. - :Example: ``DIB_DISTRIBUTION_MIRROR=http://amirror.com/centos`` - -DIB_CLOUD_IMAGES: - :Required: No - :Description: Set the desired URL to fetch the images from. ppc64le: - Currently the CentOS community is working on providing the - ppc64le images. Until then you'll need to set this to a local - image file. - :Example: ``DIB_CLOUD_IMAGES=/path/to/my/centos/7/CentOS-7-x86_64-GenericCloud.qcow2.xz`` diff --git a/diskimage_builder/elements/centos7/element-deps b/diskimage_builder/elements/centos7/element-deps deleted file mode 100644 index b813af90a..000000000 --- a/diskimage_builder/elements/centos7/element-deps +++ /dev/null @@ -1 +0,0 @@ -centos diff --git a/diskimage_builder/elements/centos7/environment.d/00-centos7-element-deprecation.bash b/diskimage_builder/elements/centos7/environment.d/00-centos7-element-deprecation.bash deleted file mode 100644 index 8de1e7761..000000000 --- a/diskimage_builder/elements/centos7/environment.d/00-centos7-element-deprecation.bash +++ /dev/null @@ -1 +0,0 @@ -echo "The centos7 element is deprecated and will be removed in future releases. Use the centos element instead." diff --git a/diskimage_builder/elements/centos7/environment.d/09-centos7-distro-name.bash b/diskimage_builder/elements/centos7/environment.d/09-centos7-distro-name.bash deleted file mode 100644 index dc87ae51c..000000000 --- a/diskimage_builder/elements/centos7/environment.d/09-centos7-distro-name.bash +++ /dev/null @@ -1,7 +0,0 @@ -# For backward compat (centos vs centos7) -export DIB_FLAVOR=${DIB_RELEASE:-GenericCloud} -export DIB_RELEASE=7 - -# Useful for elements that work with fedora (dnf) & centos -export YUM=${YUM:-yum} - diff --git a/diskimage_builder/elements/centos7/environment.d/10-centos7-distro-name.bash b/diskimage_builder/elements/centos7/environment.d/10-centos7-distro-name.bash deleted file mode 100644 index 11aa38c02..000000000 --- a/diskimage_builder/elements/centos7/environment.d/10-centos7-distro-name.bash +++ /dev/null @@ -1,7 +0,0 @@ -export DISTRO_NAME=centos7 -export DIB_RELEASE=7 -export EFI_BOOT_DIR="EFI/centos" - -# Useful for elements that work with fedora (dnf) & centos -export YUM=${YUM:-yum} - diff --git a/diskimage_builder/elements/centos7/test-elements/build-succeeds/README.rst b/diskimage_builder/elements/centos7/test-elements/build-succeeds/README.rst deleted file mode 100644 index e69de29bb..000000000 diff --git a/diskimage_builder/elements/centos7/test-elements/build-succeeds/element-deps b/diskimage_builder/elements/centos7/test-elements/build-succeeds/element-deps deleted file mode 100644 index 3a391e3e9..000000000 --- a/diskimage_builder/elements/centos7/test-elements/build-succeeds/element-deps +++ /dev/null @@ -1,3 +0,0 @@ -base -epel -openstack-ci-mirrors diff --git a/diskimage_builder/elements/dhcp-all-interfaces/README.rst b/diskimage_builder/elements/dhcp-all-interfaces/README.rst index 1fdf7044f..ee667bebc 100644 --- a/diskimage_builder/elements/dhcp-all-interfaces/README.rst +++ b/diskimage_builder/elements/dhcp-all-interfaces/README.rst @@ -46,6 +46,6 @@ DIB_DHCP_CLIENT :Description: When NetworkManager is in use, this setting conveys which DHCP client is in use for acquiring a DHCP address for the node. In some specific cases, where known that dhclient is the tested or most compatible default, - specifically for Centos 7, 8, and 8-Stream, as well as derived distributions. + specifically for Centos 8, and 8-Stream, as well as derived distributions. Otherwise, the "internal" dhcp client is the default. :Example: DIB_DHCP_CLIENT diff --git a/diskimage_builder/elements/dib-python/environment.d/50-dib-python-version b/diskimage_builder/elements/dib-python/environment.d/50-dib-python-version index 703987ab1..0a61fd35d 100644 --- a/diskimage_builder/elements/dib-python/environment.d/50-dib-python-version +++ b/diskimage_builder/elements/dib-python/environment.d/50-dib-python-version @@ -14,19 +14,8 @@ if [ -z "${DIB_PYTHON_VERSION:-}" ]; then DIB_PYTHON_VERSION=2 fi ;; - centos7) - DIB_PYTHON_VERSION=2 - ;; - rhel7) - # TODO(nmagnezi): Remove this when the 'rhel7' element gets replaced by 'rhel' - DIB_PYTHON_VERSION=2 - ;; rhel|centos) - if [ "$DIB_RELEASE" == "7" ]; then - DIB_PYTHON_VERSION=2 - else - DIB_PYTHON_VERSION=3 - fi + DIB_PYTHON_VERSION=3 ;; opensuse) if [ "${DIB_RELEASE:0:2}" == "42" ]; then diff --git a/diskimage_builder/elements/dib-python/pre-install.d/01-dib-python b/diskimage_builder/elements/dib-python/pre-install.d/01-dib-python index e1f388b6e..94daf13a3 100755 --- a/diskimage_builder/elements/dib-python/pre-install.d/01-dib-python +++ b/diskimage_builder/elements/dib-python/pre-install.d/01-dib-python @@ -6,8 +6,8 @@ fi set -eu set -o pipefail -if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} > 7 ]]; then - # RHEL8 has a system python, separate from the user python. What +if [[ ${DISTRO_NAME} =~ (centos|rhel) ]]; then + # RHEL8 onwards has a system python, separate from the user python. What # a good idea, abstracting the python binary for system scripts! # :) Use it for dib-python. python_path=/usr/libexec/platform-python diff --git a/diskimage_builder/elements/epel/pkg-map b/diskimage_builder/elements/epel/pkg-map index 790b69915..4ed25af86 100644 --- a/diskimage_builder/elements/epel/pkg-map +++ b/diskimage_builder/elements/epel/pkg-map @@ -4,18 +4,10 @@ "wget": "wget", "yum-utils": "yum-utils" }, - "centos7": { - "wget": "wget", - "yum-utils": "yum-utils" - }, "centos": { "wget": "wget", "yum-utils": "yum-utils" }, - "rhel7": { - "wget": "wget", - "yum-utils": "yum-utils" - }, "rocky": { "wget": "wget", "yum-utils": "yum-utils" diff --git a/diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release b/diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release index 268bfa1c1..15ea29d56 100755 --- a/diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release +++ b/diskimage_builder/elements/epel/pre-install.d/05-rpm-epel-release @@ -10,27 +10,9 @@ if [[ (${DISTRO_NAME} =~ "almalinux" || ${DISTRO_NAME} =~ "centos" || ${DISTRO_N # Centos has "epel-release" in extras, which is default enabled. ${YUM} install -y epel-release else - # For RHEL, we have to scrape the download page to find the latest - # release and install that - [ -n "$ARCH" ] - if [ 'amd64' = "$ARCH" ] ; then - ARCH="x86_64" - fi - - BASE_URL=${DIB_EPEL_MIRROR:-https://dl.fedoraproject.org/pub/epel} - case "$DISTRO_NAME" in - rhel7) - RELEASE=7 - URL=$BASE_URL/$RELEASE/x86_64/Packages/e/ - ;; - *) - echo "$DISTRO_NAME is not supported" - # Not really a failure; we just don't do anything - exit 0 - ;; - esac - PKG_NAME=$(wget -q $URL -O - |grep -oE "(href=\"epel-release-$RELEASE-[0-9,.].*)" | cut -d'"' -f2) - rpm -q epel-release || yum install -y $URL/$PKG_NAME + echo "$DISTRO_NAME is not supported" + # Not really a failure; we just don't do anything + exit 0 fi if [ ${DIB_EPEL_DISABLED:-0} -ne 0 ]; then diff --git a/diskimage_builder/elements/iso/cleanup.d/100-build-iso b/diskimage_builder/elements/iso/cleanup.d/100-build-iso index 81c31a1e1..cb5ebdcb6 100755 --- a/diskimage_builder/elements/iso/cleanup.d/100-build-iso +++ b/diskimage_builder/elements/iso/cleanup.d/100-build-iso @@ -29,7 +29,7 @@ function build_efiboot_img() { # Ubuntu: grub-efi-amd64-signed and shim-signed # Fedora: grub2-efi and shim - if [[ $DISTRO_NAME = "fedora" || $DISTRO_NAME = "rhel7" ]] ; then + if [[ $DISTRO_NAME = "fedora" ]] ; then cp $TMP_BOOTLOADER_DIR/shim.efi $TMP_BUILD_DIR/bootx64.efi cp $TMP_BOOTLOADER_DIR/grubx64.efi $TMP_BUILD_DIR/grubx64.efi elif [[ $DISTRO_NAME = "centos" ]] ; then diff --git a/diskimage_builder/elements/iso/post-install.d/01-copy-bootloaders b/diskimage_builder/elements/iso/post-install.d/01-copy-bootloaders index 53a1bc15e..eff92bec9 100755 --- a/diskimage_builder/elements/iso/post-install.d/01-copy-bootloaders +++ b/diskimage_builder/elements/iso/post-install.d/01-copy-bootloaders @@ -28,12 +28,6 @@ elif [[ $DISTRO_NAME = "ubuntu" || $DISTRO_NAME = "debian" ]]; then SHIM_FILE="/usr/lib/shim/shimx64.efi.signed" SYSLINUX_FILE="/usr/lib/ISOLINUX/isolinux.bin" LDLINUX_FILE="/usr/lib/syslinux/modules/bios/ldlinux.c32" -#rhel7 -elif [ $DISTRO_NAME = "rhel7" ]; then - GRUB_FILE="/boot/efi/EFI/redhat/grubx64.efi" - SHIM_FILE="/boot/efi/EFI/redhat/shim.efi" - SYSLINUX_FILE="/usr/share/syslinux/isolinux.bin" - LDLINUX_FILE="/usr/share/syslinux/ldlinux.c32" #other else GRUB_FILE="/usr/lib/grub/x86_64-efi-signed/grubx64.efi.signed" diff --git a/diskimage_builder/elements/openstack-ci-mirrors/environment.d/11-dib-distribution-mirror.bash b/diskimage_builder/elements/openstack-ci-mirrors/environment.d/11-dib-distribution-mirror.bash index dc5c00051..6f85c9322 100644 --- a/diskimage_builder/elements/openstack-ci-mirrors/environment.d/11-dib-distribution-mirror.bash +++ b/diskimage_builder/elements/openstack-ci-mirrors/environment.d/11-dib-distribution-mirror.bash @@ -38,9 +38,6 @@ elif [[ "${DISTRO_NAME}" == "centos" ]]; then export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_CENTOS_MIRROR export DIB_EPEL_MIRROR=$NODEPOOL_EPEL_MIRROR fi -elif [[ "${DISTRO_NAME}" == "centos7" ]]; then - export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_CENTOS_MIRROR - export DIB_EPEL_MIRROR=$NODEPOOL_EPEL_MIRROR elif [[ "${DISTRO_NAME}" == "opensuse" ]]; then export DIB_DISTRIBUTION_MIRROR=$NODEPOOL_OPENSUSE_MIRROR fi diff --git a/diskimage_builder/elements/pip-and-virtualenv/environment.d/51-pip-and-virutalenv-default.bash b/diskimage_builder/elements/pip-and-virtualenv/environment.d/51-pip-and-virutalenv-default.bash index 5e50c7c25..33b66ad9d 100644 --- a/diskimage_builder/elements/pip-and-virtualenv/environment.d/51-pip-and-virutalenv-default.bash +++ b/diskimage_builder/elements/pip-and-virtualenv/environment.d/51-pip-and-virutalenv-default.bash @@ -2,7 +2,7 @@ # upgrading packaged system pip/setuptools/virtualenv binaries with # upstream non-packaged versions, we wish to avoid this completely on # modern distros. -if [[ $DISTRO_NAME =~ (centos|rhel) && $DIB_RELEASE > 7 ]]; then +if [[ $DISTRO_NAME =~ (centos|rhel) ]]; then export DIB_INSTALLTYPE_pip_and_virtualenv=${DIB_INSTALLTYPE_pip_and_virtualenv:-package} if [[ ${DIB_INSTALLTYPE_pip_and_virtualenv} == "source" ]]; then @@ -10,7 +10,6 @@ if [[ $DISTRO_NAME =~ (centos|rhel) && $DIB_RELEASE > 7 ]]; then exit 1 fi fi - # The default variables setup below are only useful during the phases # that dib-python exists if [[ ! -e /usr/local/bin/dib-python ]]; then diff --git a/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip b/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip index be816eb70..6640fd04e 100755 --- a/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip +++ b/diskimage_builder/elements/pip-and-virtualenv/install.d/pip-and-virtualenv-source-install/04-install-pip @@ -27,7 +27,7 @@ function install_python2_pip { # force things to happen so our assumptions hold pip_args="-U --force-reinstall" -if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then +if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|rhel) ]]; then # Default packages _do_py3=0 @@ -35,7 +35,7 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then # see notes below on this var... _clear_old_files=0 case "$DISTRO_NAME" in - centos*|rhel7) + centos*) # note python2-pip in epel _extra_repo="--enablerepo=epel" packages="python-virtualenv python2-pip" @@ -65,17 +65,6 @@ if [[ $DISTRO_NAME =~ (opensuse|fedora|centos|centos7|rhel|rhel7) ]]; then _clear_old_files=0 packages=" python3-virtualenv python3-pip python3-setuptools" ;; - 7) - # note python2-pip in epel - _extra_repo="--enablerepo=epel" - _clear_old_files=1 - packages="python-virtualenv python2-pip" - if [[ "$(rpm -q --qf '[%{obsoletes}\n]' python2-setuptools)" == "python-setuptools" ]]; then - packages+=" python2-setuptools" - else - packages+=" python-setuptools" - fi - ;; esac ;; opensuse) diff --git a/diskimage_builder/elements/pkg-map/bin/pkg-map b/diskimage_builder/elements/pkg-map/bin/pkg-map index 45b4b8e35..146b8ba3b 100755 --- a/diskimage_builder/elements/pkg-map/bin/pkg-map +++ b/diskimage_builder/elements/pkg-map/bin/pkg-map @@ -26,9 +26,8 @@ log = logging.getLogger() def os_family(distro): family = None - if distro in ['almalinux', 'fedora', 'rhel', 'rhel7', 'centos', 'centos7', - 'openeuler', - 'rocky']: + if distro in ['almalinux', 'fedora', 'rhel', 'centos', 'openeuler', + 'rocky']: family = 'redhat' elif distro in ['debian', 'ubuntu']: family = 'debian' diff --git a/diskimage_builder/elements/rax-nova-agent/install.d/05-xen-tools b/diskimage_builder/elements/rax-nova-agent/install.d/05-xen-tools index 5a8c5a576..fb13186d3 100755 --- a/diskimage_builder/elements/rax-nova-agent/install.d/05-xen-tools +++ b/diskimage_builder/elements/rax-nova-agent/install.d/05-xen-tools @@ -30,7 +30,7 @@ case "$DISTRO_NAME" in source versions.deb dpkg -i $XE_GUEST_UTILITIES_PKG_FILE_amd64 ;; - 'fedora'|'centos'|'centos7'|'opensuse') + 'fedora'|'centos'|'opensuse') source versions.rpm rpm -Uvh $XE_GUEST_UTILITIES_PKG_FILE_x86_64 ;; diff --git a/diskimage_builder/elements/rax-nova-agent/install.d/10-nova-agent b/diskimage_builder/elements/rax-nova-agent/install.d/10-nova-agent index d0017802c..ecbad8fee 100755 --- a/diskimage_builder/elements/rax-nova-agent/install.d/10-nova-agent +++ b/diskimage_builder/elements/rax-nova-agent/install.d/10-nova-agent @@ -85,7 +85,7 @@ respawn exec /sbin/getty -L 115200 hvc0 vt102 EOF ;; - 'fedora'|'centos'|'centos7'|'opensuse') + 'fedora'|'centos'|'opensuse') cat > /usr/local/bin/run-nova-agent.sh <<'EOF' #!/bin/bash diff --git a/diskimage_builder/elements/redhat-common/README.rst b/diskimage_builder/elements/redhat-common/README.rst index f2e35c714..c4385f488 100644 --- a/diskimage_builder/elements/redhat-common/README.rst +++ b/diskimage_builder/elements/redhat-common/README.rst @@ -21,7 +21,7 @@ DIB_LOCAL_IMAGE diskimage-builder as input. The cloud image does not have to have been built by diskimage-builder. It should be a full disk image, not just a filesystem image. - :Example: ``DIB_LOCAL_IMAGE=rhel-guest-image-7.1-20150224.0.x86_64.qcow2`` + :Example: ``DIB_LOCAL_IMAGE=rhel-9.4-x86_64-kvm.qcow2`` DIB_DISABLE_KERNEL_CLEANUP :Required: No diff --git a/diskimage_builder/elements/redhat-common/pkg-map b/diskimage_builder/elements/redhat-common/pkg-map deleted file mode 100644 index 6ba118115..000000000 --- a/diskimage_builder/elements/redhat-common/pkg-map +++ /dev/null @@ -1,18 +0,0 @@ -{ - "release": { - "rhel": { - "7": { - "python3-libselinux": "libselinux-python", - "python3-policycoreutils": "policycoreutils", - "policycoreutils-python-utils": "policycoreutils-python" - } - }, - "centos": { - "7": { - "python3-libselinux": "libselinux-python", - "python3-policycoreutils": "policycoreutils", - "policycoreutils-python-utils": "policycoreutils-python" - } - } - } -} diff --git a/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration b/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration index ed6f8fea3..bed453119 100755 --- a/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration +++ b/diskimage_builder/elements/rhel-common/pre-install.d/00-rhel-registration @@ -13,10 +13,7 @@ arch=$(uname -m) repos="repos " base_repos= -if [ "${DIB_RELEASE:-7}" == "7" ]; then - base_repos="rhel-7-server-rpms" - satellite_repo="${REG_SAT_REPO:-"rhel-7-server-satellite-client-6-rpms"}" -elif [ "${DIB_RELEASE}" == "8" ]; then +if [ "${DIB_RELEASE}" == "8" ]; then if [ -n "${REG_RELEASE:-}" ]; then base_repos="rhel-8-for-${arch}-appstream-eus-rpms rhel-8-for-${arch}-baseos-eus-rpms" else diff --git a/diskimage_builder/elements/rhel/README.rst b/diskimage_builder/elements/rhel/README.rst index fb550e415..328e3a882 100644 --- a/diskimage_builder/elements/rhel/README.rst +++ b/diskimage_builder/elements/rhel/README.rst @@ -10,8 +10,8 @@ path to the resulting file to disk-image-create as the ``DIB_LOCAL_IMAGE`` environment variable. The cloud image can be found at (login required): -RHEL8: https://access.redhat.com/downloads/content/479/ver=/rhel---8/8.0/x86_64/product-software -RHEL7: https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.1/x86_64/product-downloads +RHEL8: https://access.redhat.com/downloads/content/479/ver=/rhel---8/8.10/x86_64/product-software +RHEL9: https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.4/x86_64/product-software Then before running the image build, define DIB_LOCAL_IMAGE (replace the file @@ -19,7 +19,7 @@ name with the one downloaded, if it differs from the example): .. code-block:: bash - export DIB_LOCAL_IMAGE=rhel-8.0-x86_64-kvm.qcow2 + export DIB_LOCAL_IMAGE=rhel-9.4-x86_64-kvm.qcow2 The downloaded file will then be used as the basis for any subsequent image builds. @@ -33,8 +33,8 @@ Environment Variables DIB_LOCAL_IMAGE :Required: Yes :Default: None - :Description: The RHEL 8 base image you have downloaded. See the element + :Description: The RHEL base image you have downloaded. See the element description above for more details. - :Example: ``DIB_LOCAL_IMAGE=/tmp/rhel8-cloud.qcow2`` + :Example: ``DIB_LOCAL_IMAGE=/tmp/rhel-9.4-x86_64-kvm.qcow2`` diff --git a/diskimage_builder/elements/rhel/environment.d/10-rhel-distro-name.bash b/diskimage_builder/elements/rhel/environment.d/10-rhel-distro-name.bash index ab8126eaf..9787ddae9 100644 --- a/diskimage_builder/elements/rhel/environment.d/10-rhel-distro-name.bash +++ b/diskimage_builder/elements/rhel/environment.d/10-rhel-distro-name.bash @@ -1,3 +1,4 @@ export DISTRO_NAME=rhel export DIB_RELEASE=${DIB_RELEASE:-8} export EFI_BOOT_DIR="EFI/redhat" +export YUM=dnf diff --git a/diskimage_builder/elements/rhel/environment.d/11-yum-dnf.bash b/diskimage_builder/elements/rhel/environment.d/11-yum-dnf.bash deleted file mode 100644 index 0ab96fdd9..000000000 --- a/diskimage_builder/elements/rhel/environment.d/11-yum-dnf.bash +++ /dev/null @@ -1,7 +0,0 @@ -# since RHEL8, dnf is the yum replacement. - -if [[ $DIB_RELEASE == "7" ]]; then - export YUM=yum -else - export YUM=dnf -fi diff --git a/diskimage_builder/elements/rhel7/README.rst b/diskimage_builder/elements/rhel7/README.rst deleted file mode 100644 index e5cc61796..000000000 --- a/diskimage_builder/elements/rhel7/README.rst +++ /dev/null @@ -1,42 +0,0 @@ -===== -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 -download the RHEL 7 cloud image from the Red Hat Customer Portal and pass the -path to the resulting file to disk-image-create as the ``DIB_LOCAL_IMAGE`` -environment variable. - -The cloud image can be found at (login required): -https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.1/x86_64/product-downloads - -Then before running the image build, define DIB_LOCAL_IMAGE (replace the file -name with the one downloaded, if it differs from the example): - -.. code-block:: bash - - export DIB_LOCAL_IMAGE=rhel-guest-image-7.1-20150224.0.x86_64.qcow2 - -The downloaded file will then be used as the basis for any subsequent image -builds. - -For further details about building RHEL 7 images, see the rhel-common and -redhat-common element README files. - -Environment Variables ---------------------- - -DIB_LOCAL_IMAGE - :Required: Yes - :Default: None - :Description: The RHEL 7 base image you have downloaded. See the element - description above for more details. - :Example: ``DIB_LOCAL_IMAGE=/tmp/rhel7-cloud.qcow2`` diff --git a/diskimage_builder/elements/rhel7/element-deps b/diskimage_builder/elements/rhel7/element-deps deleted file mode 100644 index 476fbc012..000000000 --- a/diskimage_builder/elements/rhel7/element-deps +++ /dev/null @@ -1 +0,0 @@ -rhel \ No newline at end of file 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 deleted file mode 100644 index ff03c1421..000000000 --- a/diskimage_builder/elements/rhel7/environment.d/00-rhel7-element-deprecation.bash +++ /dev/null @@ -1 +0,0 @@ -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 deleted file mode 100644 index d64b367ab..000000000 --- a/diskimage_builder/elements/rhel7/environment.d/10-rhel7-distro-name.bash +++ /dev/null @@ -1 +0,0 @@ -export DIB_RELEASE=7 diff --git a/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager b/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager index 40aae8eaa..c9d3f303b 100644 --- a/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager +++ b/diskimage_builder/elements/simple-init/environment.d/15-simple-init-networkmanager @@ -4,7 +4,7 @@ else export DIB_SIMPLE_INIT_NETWORKMANAGER=${DIB_SIMPLE_INIT_NETWORKMANAGER:-0} fi -if [[ (${DISTRO_NAME} == "almalinux" || ${DISTRO_NAME} == "centos" || ${DISTRO_NAME} == "rocky") && $DIB_RELEASE > 7 ]] || [[ ${DISTRO_NAME} == "fedora" ]]; then +if [[ (${DISTRO_NAME} == "almalinux" || ${DISTRO_NAME} == "rocky") && $DIB_RELEASE > 7 ]] || [[ ${DISTRO_NAME} == "fedora" ]]; then if [[ $DIB_SIMPLE_INIT_NETWORKMANAGER == 0 ]]; then echo "simple-init only supports NetworkManager mode on Fedora and AlmaLinux/CentOS/Rocky 8 & 9" exit 1 diff --git a/diskimage_builder/elements/simple-init/post-install.d/80-simple-init b/diskimage_builder/elements/simple-init/post-install.d/80-simple-init index 8971b85ca..ca7cad038 100755 --- a/diskimage_builder/elements/simple-init/post-install.d/80-simple-init +++ b/diskimage_builder/elements/simple-init/post-install.d/80-simple-init @@ -12,15 +12,7 @@ case "$DIB_INIT_SYSTEM" in exit 0 ;; systemd) - if [[ ${DISTRO_NAME} == centos && ${DIB_RELEASE} == 7 ]]; then - if [[ ${DIB_SIMPLE_INIT_NETWORKMANAGER} != 1 ]]; then - # NOTE(pabelanger): Glean requires network.service for - # these platforms when not using networkmanager - # Not available on Centos 8 - # NOTE(ianw) we should evaluate if Fedora needs this - systemctl enable network.service - fi - elif [[ ${DISTRO_NAME} =~ (opensuse) ]]; then + if [[ ${DISTRO_NAME} =~ (opensuse) ]]; then # on suse, this is named wicked.service, but it's the same # as network.service. systemctl enable wicked.service diff --git a/diskimage_builder/elements/svc-map/extra-data.d/10-merge-svc-map-files b/diskimage_builder/elements/svc-map/extra-data.d/10-merge-svc-map-files index 89ff2c3b7..7dbce5f3d 100755 --- a/diskimage_builder/elements/svc-map/extra-data.d/10-merge-svc-map-files +++ b/diskimage_builder/elements/svc-map/extra-data.d/10-merge-svc-map-files @@ -21,7 +21,7 @@ import yaml def os_family(distro): "Given a distribution, returns a operating system family." family = None - if distro in ['centos', 'centos7', 'fedora', 'rhel', 'rhel7']: + if distro in ['centos', 'fedora', 'rhel']: family = 'redhat' elif distro in ['debian', 'ubuntu']: family = 'debian' diff --git a/diskimage_builder/elements/yum-minimal/package-installs.yaml b/diskimage_builder/elements/yum-minimal/package-installs.yaml index 3ed6955ef..b82b756ee 100644 --- a/diskimage_builder/elements/yum-minimal/package-installs.yaml +++ b/diskimage_builder/elements/yum-minimal/package-installs.yaml @@ -11,10 +11,5 @@ linux-firmware: uninstall: true linux-firmware-whence: uninstall: true -# NOTE(ianw) pkg-map restricts this to !rhel/centos 7; in 7 -# the "initscripts" package handles basic networking, in -# 8+ it's the role of NetworkManager and dhcp-client. This -# mirrors the default packages installed in upstream cloud images -# to facilitate a basic network. NetworkManager: dhcp-client: diff --git a/diskimage_builder/elements/yum-minimal/pkg-map b/diskimage_builder/elements/yum-minimal/pkg-map index edb041685..713657337 100644 --- a/diskimage_builder/elements/yum-minimal/pkg-map +++ b/diskimage_builder/elements/yum-minimal/pkg-map @@ -1,10 +1,6 @@ { "release": { "centos": { - "7": { - "NetworkManager": "", - "dhcp-client": "" - }, "9-stream": { "lsb_release": "ed hostname patch postfix tar time" } diff --git a/diskimage_builder/elements/yum-minimal/pre-install.d/03-yum-cleanup b/diskimage_builder/elements/yum-minimal/pre-install.d/03-yum-cleanup index e77e4bf2c..7f3dd2d88 100755 --- a/diskimage_builder/elements/yum-minimal/pre-install.d/03-yum-cleanup +++ b/diskimage_builder/elements/yum-minimal/pre-install.d/03-yum-cleanup @@ -23,56 +23,6 @@ set -o pipefail # effectively: febootstrap-minimize --keep-zoneinfo --keep-rpmdb --keep-services "$target" -# This is only required on CentOS7 ... see notes in -# root.d/08-yum-chroot about %_install_langs -if [[ $DISTRO_NAME == "centos" && $DIB_RELEASE == "7" ]]; then - - # Stripping *all* locales is a bad idea. For now, we take the - # suggestion in [1] for reducing this - # [1] https://bugzilla.redhat.com/show_bug.cgi?id=156477 - - if [ ! -f /usr/lib/locale/locale-archive ]; then - die "locale-archive not found? Can not do cleanup." - fi - - # now the archive has everything in it, and is about 100MiB. Strip it - # to just en_US (basically, this is the locale we support if you ssh - # in, other than POSIX) - localedef --delete-from-archive \ - $(localedef --list-archive | grep -v '^en_US' | xargs) - - # This removes the locales from the archive index but doesn't rebuild - # the file, so it is still the same size (maybe it is sparse? - # presumably as it's mmapped you don't want to fiddle with the offsets - # of locales in the archive on a live system. We are not live). - - # build-locale-archive is a tool provided by the RH packaging of - # glibc. Documentation is scarce, but it takes the pre-built locales - # in the tmpl file and creates an archive. It seems originally the - # installer would set some flags to rpm to tell the package what - # languages to pick out of the template, but along the way, this was - # reverted to install them (size considered less important than locale - # support). - - # We hack this by moving the locale-archive we've removed the extra - # locales from to the template, then re-run the build. - mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl - - # rebuild archive from template - /usr/sbin/build-locale-archive - - # leave empty template behind as package does. I think this stops - # upgrades redoing things - echo > /usr/lib/locale/locale-archive.tmpl - - # remove the unnecessary source locale files and iconv files - pushd /usr/share/locale - find . ! -name 'locale.alias' -delete - popd - rm -rf {lib.lib64}/gconv - -fi - # docs rm -rf /usr/share/{doc,info,gnome/help} # i18n diff --git a/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot b/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot index 8bc81e252..3c29d1b9b 100755 --- a/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot +++ b/diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot @@ -88,7 +88,7 @@ function _install_repos { if [[ ${DISTRO_NAME} = fedora ]]; then packages+="fedora-release-cloud fedora-release-common " packages+="fedora-repos fedora-gpg-keys" - elif [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE%-stream} -gt 7 ]]; then + elif [[ ${DISTRO_NAME} = centos ]]; then packages+="centos-gpg-keys " if [[ "$DIB_RELEASE" =~ (stream) ]]; then packages+="centos-stream-release centos-stream-repos " @@ -98,11 +98,6 @@ function _install_repos { elif [[ ${DISTRO_NAME} == 'openeuler' ]]; then packages+="openEuler-release " packages+="openEuler-repos openEuler-gpg-keys " - else - # NOTE(ianw) 2022-04-20 : can probably remove when we don't - # support centos 7, unlikely anything else ends up here at - # this point. - packages+="${DISTRO_NAME}-release " fi # By default, parent elements (fedora-minimal, centos-minimal) @@ -210,8 +205,7 @@ function _install_pkg_manager { local _lang_pack="" local _extra_pkgs="" - if [[ $DISTRO_NAME == "fedora" ]] || \ - [[ $DISTRO_NAME == "centos" && $DIB_RELEASE > "7" ]]; then + if [[ $DISTRO_NAME == "fedora" ]]; then # glibc from F24 onwards has split locales into "langpack" # packages. Host yum doesn't understand the # weak-dependencies glibc now uses to get the @@ -310,7 +304,7 @@ _install_repos # seemingly mismatched libraries. if [[ ${DISTRO_NAME} =~ (fedora|openeuler) ]]; then _install_pkg_manager dnf dnf-plugins-core curl -elif [[ ${DISTRO_NAME} == centos && $DIB_RELEASE > "7" ]]; then +elif [[ ${DISTRO_NAME} == centos ]]; then _install_pkg_manager dnf dnf-plugins-core curl libcurl else _install_pkg_manager yum @@ -324,25 +318,6 @@ function _run_chroot { sudo -E chroot $TARGET_ROOT env -u TMPDIR sh -c "$cmd" } -# The rpmdb has been created by the host RPM. CentOS 7 only -# understands bdb-based db's, while the host is (likey as not) a more -# modern rpm that has created a sqlite db. These don't share files in -# common, so to the in-chroot rpm the db just looks empty. This is a -# super-weird state that the system is in, because everything is -# installed and working, but packages don't look like they are. One -# consequence of this is that yum's querying to setup the $releasever -# variable fails and it remains unset. Because the default .repo -# files use this we get invalid repo paths for any yum commands. The -# easiest way around this seems to be to manually set --releasever=7; -# this way yum can rebuild itself and recreate the rpmdb as it likes. -# This is a mess that can hopefully go away when we don't care about -# CentOS 7. For this reason, we only do this for CentOS 7, to avoid -# hiding any problems on other distros. We only need to do this -# for these initial steps, after that the db is correct. -if [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE%-stream} -le 7 ]]; then - YUM="${YUM} --releasever=${DIB_RELEASE}" -fi - # we just installed yum/dnf with "outside" tools (yum/rpm) which # might have created /var/lib/[yum|rpm] (etc) that are slighlty # incompatible. Refresh everything with the in-chroot tools diff --git a/diskimage_builder/elements/yum/README.rst b/diskimage_builder/elements/yum/README.rst index 6ee06d4cc..6cb78f436 100644 --- a/diskimage_builder/elements/yum/README.rst +++ b/diskimage_builder/elements/yum/README.rst @@ -33,11 +33,3 @@ DIB_DNF_MODULE_STREAMS stream for the given module is first disabled prior to enabling the specified stream. :Example: ``DIB_DNF_MODULE_STREAMS='virt:8.2 container-tools:3.0'`` - -DIB_CENTOS_7_PREINSTALL_EPEL_URL_PACKAGE - :Required: No - :Default: https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm - :Description: The environment variable is used to override default value in pre-install - stage to install epel repository from custom source - :Example: ``DIB_CENTOS_7_PREINSTALL_EPEL_URL_PACKAGE=http://repos.example.com/epel/epel-latest-7.noarch.rpm`` - diff --git a/diskimage_builder/elements/yum/pre-install.d/01-00-centos-python3 b/diskimage_builder/elements/yum/pre-install.d/01-00-centos-python3 index d0233530f..8716bf6cf 100755 --- a/diskimage_builder/elements/yum/pre-install.d/01-00-centos-python3 +++ b/diskimage_builder/elements/yum/pre-install.d/01-00-centos-python3 @@ -10,18 +10,8 @@ set -o pipefail # early (even before package-installs, which is written in Python and # uses YAML). -if [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} == 7 ]]; then - # Our package map and install stuff doesn't have a way to say - # "install this from EPEL". So we hack in an install of it here - # from EPEL. Nothing else should have installed EPEL at this - # early stage. - yum install -y python3 - # NOTE(dpawlik) The epel-release package is not available in RHEL. - yum install -y ${DIB_CENTOS_7_PREINSTALL_EPEL_URL_PACKAGE:-https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm} - yum install -y python36-PyYAML - yum remove -y epel-release -elif [[ ${DISTRO_NAME} =~ (centos|rhel) && ${DIB_RELEASE} > 7 ]]; then - # For 8 and above ensure the "user" python3 package is installed +if [[ ${DISTRO_NAME} =~ (centos|rhel) ]]; then + # Ensure the "user" python3 package is installed # so we have /usr/bin/python3 and pyyaml. dnf install -y python3 python3-pyyaml fi diff --git a/diskimage_builder/lib/disk-image-create b/diskimage_builder/lib/disk-image-create index a79686a4d..f49a0f1a7 100755 --- a/diskimage_builder/lib/disk-image-create +++ b/diskimage_builder/lib/disk-image-create @@ -19,8 +19,7 @@ set -eE # Set/override locale. This ensures consistency in sorting etc. We # need to choose a lowest-common denominator locale, as this is # applied when running in the building chroot too (maybe a bug and we -# should prune this?). Thus "C" --centOS 7 doesn't include C.utf-8 -# (fedora does, centos 8 probably will). Note: LC_ALL to really +# should prune this?). Note: LC_ALL to really # override this; it overrides LANG and all other LC_ vars export LC_ALL=C diff --git a/diskimage_builder/lib/ramdisk-functions b/diskimage_builder/lib/ramdisk-functions index 68bea8396..cbc821752 100644 --- a/diskimage_builder/lib/ramdisk-functions +++ b/diskimage_builder/lib/ramdisk-functions @@ -34,7 +34,7 @@ function create_ramdisk_base () { mkdir -p "${TMP_MOUNT_PATH}/"{lib/udev/rules.d,var/{lib/dhcp,run}} case "$DISTRO_NAME" in - fedora|rhel|rhel7|opensuse) + fedora|rhel|opensuse) mkdir -p "$TMP_MOUNT_PATH/usr" ln -s ../lib "$TMP_MOUNT_PATH/usr/lib" if [[ "`uname -m`" =~ x86_64|ppc64 ]]; then diff --git a/doc/source/developer/developing_elements.rst b/doc/source/developer/developing_elements.rst index 71bf00620..589078b87 100644 --- a/doc/source/developer/developing_elements.rst +++ b/doc/source/developer/developing_elements.rst @@ -477,7 +477,7 @@ example if one were building tripleo-images, the variable would be set like: .. sourcecode:: sh export ELEMENTS_PATH=tripleo-image-elements/elements - disk-image-create rhel7 cinder-api + disk-image-create rhel cinder-api Linting ------- diff --git a/doc/source/user_guide/supported_distros.rst b/doc/source/user_guide/supported_distros.rst index bda43ae33..3916b37d1 100644 --- a/doc/source/user_guide/supported_distros.rst +++ b/doc/source/user_guide/supported_distros.rst @@ -89,7 +89,7 @@ is correct. As of Feburary 2022, the default end-to-end testing covers the following elements on x86-64 -* ``centos-minimal``: CentOS 7, 8-stream and 9-stream +* ``centos-minimal``: 8-stream and 9-stream * ``fedora-containerfile``: the latest Fedora. * ``ubuntu-minimal``: Ubuntu Xenial, Bionic and Focal * ``opensuse-minimal``: Leap 15.3 and Tumbleweed (non-voting) diff --git a/releasenotes/notes/eol-centos7-rhel7-e34abb41caff312e.yaml b/releasenotes/notes/eol-centos7-rhel7-e34abb41caff312e.yaml new file mode 100644 index 000000000..55d16a2df --- /dev/null +++ b/releasenotes/notes/eol-centos7-rhel7-e34abb41caff312e.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + It is no longer possible to build images using CentOS 7 or RHEL 7 as a base + image as these reached EOL on 30th June 2024. The centos and centos-minimal + elements now default to a ``DIB_RELEASE`` value of ``9-stream``. \ No newline at end of file diff --git a/roles/dib-setup-gate-mirrors/tasks/main.yaml b/roles/dib-setup-gate-mirrors/tasks/main.yaml index 0a329fdd9..9064eb205 100644 --- a/roles/dib-setup-gate-mirrors/tasks/main.yaml +++ b/roles/dib-setup-gate-mirrors/tasks/main.yaml @@ -5,23 +5,6 @@ - debug: msg="zuul site mirror {{ zuul_site_mirror_fqdn }}" - debug: msg="mirror_fqdn {{ mirror_fqdn }}" -- name: Create centos-minimal 7 directory - file: - path: "{{ dib_gate_mirror_repos }}/centos-minimal/7/yum.repos.d" - state: directory - mode: 0775 - recurse: yes - -- name: Install centos-minimal 7 repo files - template: - dest: "{{ dib_gate_mirror_repos }}/centos-minimal/7/yum.repos.d/dib-mirror-{{ item }}" - mode: 0644 - src: "centos-minimal/7/{{ item }}.j2" - with_items: - - base.repo - - updates.repo - - extras.repo - - name: Create centos-minimal 8-stream directory file: path: "{{ dib_gate_mirror_repos }}/centos-minimal/8-stream/yum.repos.d" diff --git a/tests/run_functests.sh b/tests/run_functests.sh index cfb388e5c..1d7f36142 100755 --- a/tests/run_functests.sh +++ b/tests/run_functests.sh @@ -39,7 +39,6 @@ DEFAULT_SKIP_TESTS=( # better caching for the images opensuse/build-succeeds opensuse/opensuse15-build-succeeds - centos7/build-succeeds debian/build-succeeds fedora/build-succeeds ubuntu/trusty-build-succeeds