From e8c7787ec84c436c3a9ef62fc57d6bf128023468 Mon Sep 17 00:00:00 2001 From: Vanou Ishii Date: Mon, 8 Aug 2022 22:49:13 +0900 Subject: [PATCH] Fix wrong yum.conf name of CentOS 9 Stream This commit fixes wrong name of yum.conf files on CentOS 9 Stream in centos element to correct ones. Change-Id: I25f0661fa79b7bc8ac1b8e3b2831a413c4161d1d --- .../elements/centos/pre-install.d/00-02-set-centos-mirror | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 cd02c374..ce97ecd4 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 @@ -14,7 +14,11 @@ DIB_DISTRIBUTION_MIRROR=${DIB_DISTRIBUTION_MIRROR:-} # 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 (e.g. 8-stream, 9-stream) +# CentOS Stream releases (9-stream) +elif [[ ${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) elif [[ ${DIB_RELEASE} =~ '-stream' ]]; then sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-BaseOS.repo sed -e "s,^#baseurl=http[s]*://mirror.centos.org/\$contentdir/,baseurl=$DIB_DISTRIBUTION_MIRROR/,;/^mirrorlist=/d" -i /etc/yum.repos.d/CentOS-Stream-AppStream.repo