From 7173658df2bc12b6c308eef6592400798d1eac97 Mon Sep 17 00:00:00 2001 From: Paul Belanger Date: Fri, 4 May 2018 10:58:00 -0400 Subject: [PATCH] Add support for Fedora 28, remove EOL Fedora 26 This updates diskimage-builder to support current Fedora releases (27 and 28) and removes support for Fedora 26 which is EOL as of June 2018. Change-Id: I602b22ed4d5397b39dc1eef67964f6fbdcd93060 Signed-off-by: Paul Belanger --- contrib/setup-gate-mirrors.sh | 2 +- .../environment.d/10-fedora-distro-name.bash | 2 +- .../elements/fedora-minimal/yum.repos.d/yum.repo | 4 ++-- .../fedora/environment.d/10-fedora-distro-name.bash | 8 ++++---- .../fedora/pre-install.d/01-set-fedora-mirror | 8 ++++++++ .../elements/fedora/root.d/10-fedora-cloud-image | 12 ++++++++++-- doc/source/user_guide/supported_distros.rst | 4 ++-- 7 files changed, 28 insertions(+), 12 deletions(-) diff --git a/contrib/setup-gate-mirrors.sh b/contrib/setup-gate-mirrors.sh index 7cd7010c..bf50f867 100755 --- a/contrib/setup-gate-mirrors.sh +++ b/contrib/setup-gate-mirrors.sh @@ -42,7 +42,7 @@ cat < $FEDORA_MIN_DIR/dib-mirror-fedora-updates.repo [updates] name=Fedora \$releasever - \$basearch - Updates failovermethod=priority -baseurl=$NODEPOOL_FEDORA_MIRROR/updates/\$releasever/\$basearch/ +baseurl=$NODEPOOL_FEDORA_MIRROR/updates/\$releasever/Everything/\$basearch/ enabled=1 gpgcheck=0 metadata_expire=6h diff --git a/diskimage_builder/elements/fedora-minimal/environment.d/10-fedora-distro-name.bash b/diskimage_builder/elements/fedora-minimal/environment.d/10-fedora-distro-name.bash index 6439a368..7c889e5d 100644 --- a/diskimage_builder/elements/fedora-minimal/environment.d/10-fedora-distro-name.bash +++ b/diskimage_builder/elements/fedora-minimal/environment.d/10-fedora-distro-name.bash @@ -1,2 +1,2 @@ export DISTRO_NAME=fedora -export DIB_RELEASE=${DIB_RELEASE:-27} +export DIB_RELEASE=${DIB_RELEASE:-28} diff --git a/diskimage_builder/elements/fedora-minimal/yum.repos.d/yum.repo b/diskimage_builder/elements/fedora-minimal/yum.repos.d/yum.repo index 7495b874..469ed9b9 100644 --- a/diskimage_builder/elements/fedora-minimal/yum.repos.d/yum.repo +++ b/diskimage_builder/elements/fedora-minimal/yum.repos.d/yum.repo @@ -1,7 +1,7 @@ [fedora] name=Fedora $releasever - $basearch failovermethod=priority -#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/ +#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch gpgcheck=0 skip_if_unavailable=False @@ -9,7 +9,7 @@ skip_if_unavailable=False [updates] name=Fedora $releasever - $basearch - Updates failovermethod=priority -#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/$basearch/ +#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/Everything/$basearch/ metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch enabled=1 gpgcheck=0 diff --git a/diskimage_builder/elements/fedora/environment.d/10-fedora-distro-name.bash b/diskimage_builder/elements/fedora/environment.d/10-fedora-distro-name.bash index 37434eaf..90af79c0 100644 --- a/diskimage_builder/elements/fedora/environment.d/10-fedora-distro-name.bash +++ b/diskimage_builder/elements/fedora/environment.d/10-fedora-distro-name.bash @@ -1,5 +1,5 @@ export DISTRO_NAME=fedora -export DIB_RELEASE=${DIB_RELEASE:-27} +export DIB_RELEASE=${DIB_RELEASE:-28} # Note the filename URL has a "sub-release" in it # http:// ... Fedora-Cloud-Base-25-1.3.x86_64.qcow2 @@ -11,10 +11,10 @@ export DIB_RELEASE=${DIB_RELEASE:-27} # # [1] https://lists.fedoraproject.org/archives/list/cloud@lists.fedoraproject.org/thread/2WFO2FKIGUQYRQXIR35UVJGRHF7LQENJ/ -if [[ ${DIB_RELEASE} == '26' ]]; then - export DIB_FEDORA_SUBRELEASE=1.5 -elif [[ ${DIB_RELEASE} == '27' ]]; then +if [[ ${DIB_RELEASE} == '27' ]]; then export DIB_FEDORA_SUBRELEASE=1.6 +elif [[ ${DIB_RELEASE} == '28' ]]; then + export DIB_FEDORA_SUBRELEASE=1.1 else echo "Unsupported Fedora release" exit 1 diff --git a/diskimage_builder/elements/fedora/pre-install.d/01-set-fedora-mirror b/diskimage_builder/elements/fedora/pre-install.d/01-set-fedora-mirror index 180263bb..c008e2e8 100755 --- a/diskimage_builder/elements/fedora/pre-install.d/01-set-fedora-mirror +++ b/diskimage_builder/elements/fedora/pre-install.d/01-set-fedora-mirror @@ -10,6 +10,14 @@ DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-} [ -n "$DIB_DISTRIBUTION_MIRROR" ] || exit 0 +if [[ ${DIB_RELEASE} -gt 27 ]]; then + # urgh, the repo is wrong in the "baseurl" line, see + # https://pagure.io/fedora/repos/issue/70 + for FILE in /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/fedora-updates-testing.repo; do + sed -i "s|/os/||" $FILE + done +fi + for FILE in /etc/yum.repos.d/fedora.repo /etc/yum.repos.d/fedora-updates.repo /etc/yum.repos.d/fedora-updates-testing.repo; do sudo sed -e "s|^#baseurl=http://download.fedoraproject.org/pub/fedora/linux|baseurl=$DIB_DISTRIBUTION_MIRROR|;/^metalink/d" -i $FILE done diff --git a/diskimage_builder/elements/fedora/root.d/10-fedora-cloud-image b/diskimage_builder/elements/fedora/root.d/10-fedora-cloud-image index 4ec3372e..be7a3fbc 100755 --- a/diskimage_builder/elements/fedora/root.d/10-fedora-cloud-image +++ b/diskimage_builder/elements/fedora/root.d/10-fedora-cloud-image @@ -26,10 +26,18 @@ else # note default DIB_RELEASE set in environment setup case ${ARCH} in x86_64) - DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://download.fedoraproject.org/pub/fedora/linux/releases/${DIB_RELEASE}/CloudImages/${ARCH}/images} + if [[ ${DIB_RELEASE} -ge 28 ]]; then + DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://download.fedoraproject.org/pub/fedora/linux/releases/${DIB_RELEASE}/Cloud/${ARCH}/images} + else + DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://download.fedoraproject.org/pub/fedora/linux/releases/${DIB_RELEASE}/CloudImages/${ARCH}/images} + fi ;; aarch64|ppc64|ppc64le) - DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://dl.fedoraproject.org/pub/fedora-secondary/releases/${DIB_RELEASE}/CloudImages/${ARCH}/images} + if [[ ${DIB_RELEASE} -ge 28 ]]; then + DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://dl.fedoraproject.org/pub/fedora-secondary/releases/${DIB_RELEASE}/Cloud/${ARCH}/images} + else + DIB_CLOUD_IMAGES=${DIB_CLOUD_IMAGES:-https://dl.fedoraproject.org/pub/fedora-secondary/releases/${DIB_RELEASE}/CloudImages/${ARCH}/images} + fi ;; *) echo "Error: unknown ARCH: ${ARCH}" diff --git a/doc/source/user_guide/supported_distros.rst b/doc/source/user_guide/supported_distros.rst index 2c5d2873..74559e2a 100644 --- a/doc/source/user_guide/supported_distros.rst +++ b/doc/source/user_guide/supported_distros.rst @@ -5,7 +5,7 @@ Distributions which are supported as a build host: - Centos 6, 7 - Debian 8 ("jessie") -- Fedora 26, 27 +- Fedora 27, 28 - RHEL 6, 7 - Ubuntu 14.04 ("trusty") - Gentoo @@ -16,7 +16,7 @@ Distributions which are supported as a target for an image: - Centos 6, 7 - Debian 8 ("jessie") -- Fedora 26, 27 +- Fedora 27, 28 - RHEL 6, 7 - Ubuntu 12.04 ("precise"), 14.04 ("trusty") - Gentoo