From ca358884ff2ef01cb3afb59a04ff5ff9b5eb4cb4 Mon Sep 17 00:00:00 2001 From: Benjamin Sherman Date: Tue, 29 Oct 2024 12:57:44 -0500 Subject: [PATCH] chore: fix builds by enabling updates (#1853) --- build_files/build-base.sh | 1 + build_files/build-fix.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 build_files/build-fix.sh diff --git a/build_files/build-base.sh b/build_files/build-base.sh index 0581a46ad65..be17db91519 100755 --- a/build_files/build-base.sh +++ b/build_files/build-base.sh @@ -10,6 +10,7 @@ cp /ctx/system_files/shared/etc/ublue-update/ublue-update.toml /tmp/ublue-update rsync -rvK /ctx/system_files/shared/ / rsync -rvK /ctx/system_files/"${BASE_IMAGE_NAME}"/ / +/ctx/build_files/build-fix.sh /ctx/build_files/firmware.sh /ctx/build_files/cache_kernel.sh /ctx/build_files/copr-repos.sh diff --git a/build_files/build-fix.sh b/build_files/build-fix.sh new file mode 100755 index 00000000000..88ff5557a2f --- /dev/null +++ b/build_files/build-fix.sh @@ -0,0 +1,25 @@ +#!/usr/bin/bash + +set -eoux pipefail + +# This script provides fixes to packages known to have caused build skew. +# It works by force replacing packages on the FROM image with current +# packages from fedora update repos. + +repos=( + fedora-updates.repo + fedora-updates-archive.repo +) + +for repo in "${repos[@]}"; do + if [ $(grep -c "enabled=1" /etc/yum.repos.d/${repo}) -eq 0 ]; then + sed -i "0,/enabled=0/{s/enabled=0/enabled=1/}" /etc/yum.repos.d/${repo} + fi +done + +rpm-ostree override replace \ + --experimental \ + --from repo=updates \ + elfutils-libelf \ + elfutils-libs \ + || true