From d8ec8eab7ff4c89bab4275d4f404018db09ca36e Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Fri, 9 Feb 2024 09:46:11 -0600 Subject: [PATCH] chore(ci): conditional pin to repo variable RPMFUSION_MIRROR (#495) --- .github/workflows/build.yml | 1 + Containerfile | 2 ++ install.sh | 19 +++++++++++-------- kmods-install.sh | 9 ++++++--- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 859b7ae0..f1dd1282 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -186,6 +186,7 @@ jobs: SOURCE_ORG=${{ env.SOURCE_ORG }} SOURCE_IMAGE=${{ env.SOURCE_IMAGE }} FEDORA_MAJOR_VERSION=${{ matrix.major_version }} + RPMFUSION_MIRROR=${{ vars.RPMFUSION_MIRROR }} labels: ${{ steps.meta.outputs.labels }} oci: false extra-args: | diff --git a/Containerfile b/Containerfile index 676abd4e..982b24f9 100644 --- a/Containerfile +++ b/Containerfile @@ -8,6 +8,7 @@ FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS nokmods ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}" ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}" +ARG RPMFUSION_MIRROR="" COPY github-release-install.sh \ install.sh \ @@ -38,6 +39,7 @@ FROM nokmods AS kmods ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}" ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}" +ARG RPMFUSION_MIRROR="" COPY kmods-install.sh /tmp/kmods-install.sh COPY kmods-sys_files /tmp/kmods-files diff --git a/install.sh b/install.sh index 522e6418..35ffce51 100755 --- a/install.sh +++ b/install.sh @@ -5,19 +5,22 @@ set -ouex pipefail RELEASE="$(rpm -E %fedora)" wget -P /tmp/rpms \ - http://mirror.fcix.net/rpmfusion/free/fedora/rpmfusion-free-release-${RELEASE}.noarch.rpm \ - http://mirror.fcix.net/rpmfusion/nonfree/fedora/rpmfusion-nonfree-release-${RELEASE}.noarch.rpm + https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-${RELEASE}.noarch.rpm \ + https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-${RELEASE}.noarch.rpm rpm-ostree install \ /tmp/rpms/*.rpm \ fedora-repos-archive -# force use of single rpmfusion mirror -sed -i.bak 's%^metalink=%#metalink=%' /etc/yum.repos.d/rpmfusion-*.repo -sed -i 's%^#baseurl=http://download1.rpmfusion.org%baseurl=http://mirror.fcix.net/rpmfusion%' /etc/yum.repos.d/rpmfusion-*.repo -# after F40 launches, bump to 41 -if [[ "${FEDORA_MAJOR_VERSION}" -ge 40 ]]; then - sed -i 's%free/fedora/releases%free/fedora/development%' /etc/yum.repos.d/rpmfusion-*.repo +if [ -n "${RPMFUSION_MIRROR}" ]; then + # force use of single rpmfusion mirror + echo "Using single rpmfusion mirror: ${RPMFUSION_MIRROR}" + sed -i.bak "s%^metalink=%#metalink=%" /etc/yum.repos.d/rpmfusion-*.repo + sed -i "s%^#baseurl=http://download1.rpmfusion.org%baseurl=${RPMFUSION_MIRROR}%" /etc/yum.repos.d/rpmfusion-*.repo + # after F40 launches, bump to 41 + if [[ "${FEDORA_MAJOR_VERSION}" -ge 40 ]]; then + sed -i "s%free/fedora/releases%free/fedora/development%" /etc/yum.repos.d/rpmfusion-*.repo + fi fi # run common packages script diff --git a/kmods-install.sh b/kmods-install.sh index 80b417cf..f2169a54 100755 --- a/kmods-install.sh +++ b/kmods-install.sh @@ -23,9 +23,12 @@ for REPO in $(rpm -ql ublue-os-akmods-addons|grep ^"/etc"|grep repo$); do sed -i '0,/enabled=0/{s/enabled=0/enabled=1/}' ${REPO} done -# force use of single rpmfusion mirror -sed -i.bak 's%^metalink=%#metalink=%' /etc/yum.repos.d/rpmfusion-*.repo -sed -i 's%^#baseurl=http://download1.rpmfusion.org%baseurl=http://mirrors.ocf.berkeley.edu/rpmfusion%' /etc/yum.repos.d/rpmfusion-*.repo +if [ -n "${RPMFUSION_MIRROR}" ]; then + # force use of single rpmfusion mirror + echo "Using single rpmfusion mirror: ${RPMFUSION_MIRROR}" + sed -i.bak "s%^metalink=%#metalink=%" /etc/yum.repos.d/rpmfusion-*.repo + sed -i "s%^#baseurl=http://download1.rpmfusion.org%baseurl=${RPMFUSION_MIRROR}%" /etc/yum.repos.d/rpmfusion-*.repo +fi rpm-ostree install \ kernel-devel-matched \