yum-minimal: clean up release package installs

This started a long way from here, when I noticed that "top" on centos
9-stream images wasn't working because ncurses-base wasn't installed.

This led me to the extant install of bash/glibc/ncurses-libs from
Iecf7f7e4c992bb23437b6461cdd04cdca96aafa6.  However it didn't really
explain why these are brought in here.

Reading further it became clearer that over the years of distribution
additions, Fedora updates, etc. this has grown into a bit of a mess.

Refactor the release package installs into a more logical flow,
pulling out checks/comments for Fedora's of ancient history, etc.
Remove the 9-stream package installs; this isn't the place for them,
and the should be brought in by the base packages.

Ultimately, this is intendend to a be a no-op refactor.

Change-Id: Ie7d9a6497d0d20a3303ec0da3d0668c74efa2c3d
This commit is contained in:
Ian Wienand 2022-04-11 14:11:37 +10:00
parent 64bdd24e4e
commit 27903f90e2

View File

@ -85,39 +85,24 @@ function _install_repos {
# (see above) so ...
packages="${DIB_YUM_MINIMAL_BOOTSTRAP_PACKAGES:-} "
packages+="basesystem filesystem setup "
if [[ ${DISTRO_NAME} = fedora && ${DIB_RELEASE} -gt 29 ]]; then
if [[ ${DISTRO_NAME} = fedora ]]; then
packages+="fedora-release-cloud fedora-release-common "
elif [[ ${DISTRO_NAME} == 'centos' && ${DIB_RELEASE} = '9-stream' ]]; then
packages+="bash glibc ncurses-libs "
elif [[ ${DISTRO_NAME} == 'openeuler' ]]; then
packages+="openEuler-release "
else
packages+="${DISTRO_NAME}-release "
fi
# Starting in F21 this was split into a separate package
if [[ ${DISTRO_NAME} == 'fedora' ]]; then
packages+="fedora-repos "
fi
# F27 started putting gpg keys into this separate package
if [[ ${DISTRO_NAME} = fedora && ${DIB_RELEASE} -gt 26 ]]; then
packages+="fedora-gpg-keys "
fi
# CentOS 8.1 split repositories and GPG keys out into subpackages
if [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE%-stream} -gt 7 ]]; then
packages+="fedora-repos fedora-gpg-keys"
elif [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE%-stream} -gt 7 ]]; then
packages+="centos-gpg-keys "
if [[ "$DIB_RELEASE" =~ (stream) ]]; then
packages+="centos-stream-release centos-stream-repos "
else
packages+="centos-linux-release centos-linux-repos "
fi
fi
# For openEuler, install other required repos and gpy-keys packages.
if [[ ${DISTRO_NAME} == 'openeuler' ]]; then
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)