make it work for rocky

This commit is contained in:
Neil Hanlon 2023-11-15 11:43:48 -07:00
parent 0576fadab8
commit d06a66d0f0
Signed by untrusted user: neil
GPG Key ID: 705BC21EC3C70F34
4 changed files with 25 additions and 3 deletions

View File

@ -20,7 +20,7 @@
},
"family": {
"redhat": {
"lsb_release": "redhat-lsb-core"
"lsb_release": "ed hostname patch postfix tar time"
}
}
}

View File

@ -88,6 +88,8 @@ function _install_repos {
if [[ ${DISTRO_NAME} = fedora ]]; then
packages+="fedora-release-cloud fedora-release-common "
packages+="fedora-repos fedora-gpg-keys"
elif [[ ${DISTRO_NAME} = rocky ]]; then
packages+="rocky-release rocky-repos rocky-gpg-keys"
elif [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE%-stream} -gt 7 ]]; then
packages+="centos-gpg-keys "
if [[ "$DIB_RELEASE" =~ (stream) ]]; then
@ -167,6 +169,8 @@ function _install_repos {
if [[ ${DISTRO_NAME} == 'openeuler' ]]; then
sudo sed -i 's/enabled=0/enabled=1/' $TARGET_ROOT/etc/yum.repos.d/*.repo
fi
}
# _install_pkg_manager packages...
@ -211,7 +215,8 @@ function _install_pkg_manager {
local _extra_pkgs=""
if [[ $DISTRO_NAME == "fedora" ]] || \
[[ $DISTRO_NAME == "centos" && $DIB_RELEASE > "7" ]]; then
[[ $DISTRO_NAME == "centos" && $DIB_RELEASE > "7" ]] || \
[[ $DISTRO_NAME == 'rocky' ]]; 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
@ -238,6 +243,10 @@ function _install_pkg_manager {
sudo ln -s $TARGET_ROOT/etc/dnf/vars $TARGET_ROOT/etc/yum/vars
fi
if [[ ${DISTRO_NAME} == 'rocky' ]]; then
echo 'stg/rocky' | sudo tee /etc/dnf/vars/contentdir
fi
sudo -E ${HOST_YUM} -y \
--disableexcludes=all \
--setopt=cachedir=$YUM_CACHE/$ARCH/$DIB_RELEASE \
@ -308,7 +317,7 @@ _install_repos
# it seems, as it seems like as part of the Fedora modular updates
# (https://docs.fedoraproject.org/en-US/modularity/) we can pick up
# seemingly mismatched libraries.
if [[ ${DISTRO_NAME} =~ (fedora|openeuler) ]]; then
if [[ ${DISTRO_NAME} =~ (fedora|openeuler|rocky) ]]; then
_install_pkg_manager dnf dnf-plugins-core curl
elif [[ ${DISTRO_NAME} == centos && $DIB_RELEASE > "7" ]]; then
_install_pkg_manager dnf dnf-plugins-core curl libcurl
@ -343,6 +352,10 @@ if [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE%-stream} -le 7 ]]; then
YUM="${YUM} --releasever=${DIB_RELEASE}"
fi
if [[ ${DISTRO_NAME} == 'rocky' ]]; then
YUM="DNF_VAR_contentdir=stg/rocky ${YUM}"
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

View File

@ -134,6 +134,10 @@ if [ -n "$WHITELIST" ]; then
#
# [1] https://bugzilla.redhat.com/show_bug.cgi?id=965567
set -o xtrace
if [[ -n ${DIB_YUM_DNF_CONTENTDIR:-''} ]]; then
echo $DIB_YUM_DNF_CONTENTDIR | sudo tee /etc/dnf/vars/contentdir
sudo sed -i -e 's,^mirrorlist,#mirrorlist,' -e 's,^#baseurl,baseurl,' /etc/yum.repos.d/*.repo
fi
${YUM} -v -y $ACTION $EXTRA_ARGS $PKGS
if [ "$ACTION" == "install" ]; then

View File

@ -6,6 +6,11 @@ fi
set -eu
set -o pipefail
# if [[ -n ${DIB_YUM_DNF_CONTENTDIR:-''} ]]; then
# sudo sed -i 's,^#mirrorlist,mirrorlist,' -e 's,^baseurl,#baseurl,' /etc/yum.repos.d/rocky.repo
# fi
if [[ ${YUM} == "dnf" ]]; then
cfg=/etc/dnf/dnf.conf
cachedir=/var/cache/dnf