%post --erroronfail set -x MACHINE_ARCH="$(uname -m)" DNF_RELEASEVER="$(dnf config-manager --dump-variables | grep 'releasever' | awk '{print $3}')" # import the key manually, since it does not get automatically get imported... wget "https://download.rockylinux.org/pub/sig/${DNF_RELEASEVER}/altarch/${MACHINE_ARCH}/altarch-common/RPM-GPG-KEY-Rocky-SIG-AltArch" rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9 rpm --import RPM-GPG-KEY-Rocky-SIG-AltArch rm RPM-GPG-KEY-Rocky-SIG-AltArch # Setup networking temporarily [ -f /etc/resolv.conf ] || echo "nameserver 1.1.1.1" > /etc/resolv.conf # This repository is a given since it provides 'uboot-images-armv8' and # 'uboot-tools', which are **required**. dnf config-manager --assumeyes --add-repo "https://download.rockylinux.org/pub/sig/${DNF_RELEASEVER}/altarch/${MACHINE_ARCH}/altarch-common" if ! dnf repolist --enabled | grep "download.rockylinux.org_pub_sig_${DNF_RELEASEVER}_altarch_${MACHINE_ARCH}_altarch-common" > /dev/null; then dnf config-manager --set-enabled "download.rockylinux.org_pub_sig_${DNF_RELEASEVER}_altarch_${MACHINE_ARCH}_altarch-common" || exit 1 fi # Enable EPEL if packages are installed from EPEL if dnf list installed | grep '@epel' > /dev/null || dnf list installed | grep 'epel-release' > /dev/null; then dnf install --assumeyes epel-release if ! dnf repolist --enabled | grep 'crb' > /dev/null; then dnf config-manager --set-enabled crb || exit 1 fi if ! dnf repolist --enabled | grep 'epel' > /dev/null; then dnf config-manager --set-enabled epel || exit 1 fi fi # Enable my COPR for regular updates for the Stable and LTS kernels. dnf copr enable --assumeyes prathampatel/kernel-tfg "rhel-${DNF_RELEASEVER}-${MACHINE_ARCH}" if ! dnf repolist --enabled | grep 'copr:copr.fedorainfracloud.org:prathampatel:kernel-tfg' > /dev/null; then dnf config-manager --set-enabled 'copr:copr.fedorainfracloud.org:prathampatel:kernel-tfg' || exit 1 fi # Enable my testing COPR in case the user installed something from there if dnf list installed | grep '@COPR-kernel-testing-tfg' > /dev/null; then dnf copr enable --assumeyes prathampatel/kernel-testing-tfg "rhel-${DNF_RELEASEVER}-${MACHINE_ARCH}" if ! dnf repolist --enabled | grep 'copr:copr.fedorainfracloud.org:prathampatel:kernel-testing-tfg' > /dev/null; then dnf config-manager --set-enabled 'copr:copr.fedorainfracloud.org:prathampatel:kernel-testing-tfg' || exit 1 fi fi # upgrade all packages for the user's happy smile dnf clean expire-cache dnf upgrade -y # Remove the temporary 'resolv.conf' file rm -v -f /etc/resolv.conf %end