fixup UBI logic

This commit is contained in:
Neil Hanlon 2023-11-21 21:06:58 -05:00
parent 414d2cf615
commit 94c0d094f7
Signed by: neil
GPG Key ID: 705BC21EC3C70F34
7 changed files with 31 additions and 24 deletions

View File

@ -1,2 +1,3 @@
export YUM="dnf" export YUM="dnf"
export DNF_VAR_contentdir=stg/rocky export DNF_VAR_contentdir=stg/rocky
export DIB_YUM_ROCKY_CONTAINER_TYPE="Base"

View File

@ -1,2 +1,2 @@
export YUM="microdnf" export YUM="microdnf"
export DIB_YUM_ROCKY_CONTAINER_MINIMAL=1 export DIB_YUM_ROCKY_CONTAINER_TYPE="Minimal"

View File

@ -0,0 +1 @@
export DIB_YUM_ROCKY_CONTAINER_TYPE="UBI"

View File

@ -1 +1 @@
export DIB_YUM_ROCKY_CONTAINER_MINIMAL="${DIB_YUM_ROCKY_CONTAINER_MINIMAL:-0}" export DIB_YUM_ROCKY_CONTAINER_TYPE="${DIB_YUM_ROCKY_CONTAINER:-'Base'}"

View File

@ -1,39 +1,39 @@
bash: bash:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
binutils: binutils:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
coreutils-single: coreutils-single:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
crypto-policies-scripts: crypto-policies-scripts:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
curl-minimal: curl-minimal:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
findutils: findutils:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
glibc-minimal-langpack: glibc-minimal-langpack:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
gzip: gzip:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
hostname: hostname:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
less: less:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
libcurl-minimal: libcurl-minimal:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
libusbx: libusbx:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
lsb_release: lsb_release:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
rootfiles: rootfiles:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
tar: tar:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
usermode: usermode:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
systemd-libs: systemd-libs:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
vim-minimal: vim-minimal:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'
yum: yum:
when: DIB_YUM_ROCKY_CONTAINER_MINIMAL!=1 when: DIB_YUM_ROCKY_CONTAINER_TYPE!='Minimal'

View File

@ -8,4 +8,9 @@ set -o pipefail
rm /etc/dnf/protected.d/sudo.conf rm /etc/dnf/protected.d/sudo.conf
${YUM} clean all ${YUM} clean all
${YUM} -y remove sudo python3 python-unversioned-command python3-pyyaml expat python3-libs python3-setuptools-wheel python3-pip-wheel ${YUM} -y remove sudo
if [[ $DIB_YUM_ROCKY_CONTAINER_TYPE =~ (Base|Minimal) ]]; then
${YUM} -y remove python3 python-unversioned-command python3-pyyaml expat python3-libs python3-setuptools-wheel python3-pip-wheel
fi

View File

@ -7,7 +7,7 @@ set -eu
set -o pipefail set -o pipefail
# Stay compatible # Stay compatible
echo 'container' > /etc/dnf/vars/infra echo "container-${DIB_YUM_ROCKY_CONTAINER_TYPE}" > /etc/dnf/vars/infra
#Generate installtime file record #Generate installtime file record
/bin/date +%Y%m%d_%H%M > /etc/BUILDTIME /bin/date +%Y%m%d_%H%M > /etc/BUILDTIME
@ -24,7 +24,7 @@ for dir in $(ls -d /usr/share/locale/* | grep -v 'en_US\|all_languages\|locale\.
rm -fr /usr/share/man rm -fr /usr/share/man
# Cleanup caches left by chroot # Cleanup caches left by chroot
find /usr/lib* -type d -name __pycache__ -print0 | xargs --null -I {} rm -frv {} find /usr/lib* -type d -name __pycache__ -print0 | xargs --null -I {} rm -fr {}
rm -fr /var/cache/dnf/* rm -fr /var/cache/dnf/*
rm -fr /var/lib/dnf/repos/* rm -fr /var/lib/dnf/repos/*
rm -fr /run rm -fr /run