Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
# Full suite: all OSes
echo 'package_os_matrix=["fedora-43","fedora-44","fedora-45","centos-9","centos-10"]' >> "$GITHUB_OUTPUT"
echo 'integration_os_matrix=["fedora-43","fedora-44","centos-9","centos-10"]' >> "$GITHUB_OUTPUT"
echo 'upgrade_os_matrix=["fedora-43","centos-10"]' >> "$GITHUB_OUTPUT"
echo 'upgrade_os_matrix=["fedora-44","centos-10"]' >> "$GITHUB_OUTPUT"
echo 'run_heavy=true' >> "$GITHUB_OUTPUT"
elif echo "$LABELS" | jq -e 'index("ci/tier-1")' > /dev/null; then
# Tier-1 only: centos-10
Expand Down
4 changes: 2 additions & 2 deletions crates/initramfs/dracut/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ install() {
local service=bootc-root-setup.service
dracut_install /usr/lib/bootc/initramfs-setup
inst_simple "${systemdsystemunitdir}/${service}"
mkdir -p "${initdir}${systemdsystemconfdir}/initrd-root-fs.target.wants"
mkdir -p "${initdir}${systemdsystemunitdir}/initrd-root-fs.target.wants"
ln_r "${systemdsystemunitdir}/${service}" \
"${systemdsystemconfdir}/initrd-root-fs.target.wants/${service}"
"${systemdsystemunitdir}/initrd-root-fs.target.wants/${service}"
}
38 changes: 38 additions & 0 deletions hack/provision-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,44 @@ if ! rpm -q ostree 2>/dev/null | grep -q "2026\." ; then
esac
fi

# Temporary: downgrade kernel to last 6.x when 7.0 or 7.1 is present.
# Kernel 7.x broke composefs ("has no fs-verity digest"), fixed in 7.2.
# xref https://github.com/bootc-dev/bootc/issues/2174
# TODO: Remove once all base images ship kernel >= 7.2
kernel_ver=$(rpm -q --qf '%{VERSION}' kernel 2>/dev/null || true)
case "${kernel_ver}" in
7.0.*|7.1.*)
Comment thread
cgwalters marked this conversation as resolved.
arch=$(uname -m)
koji_kver="6.19.10"
koji_krel="300.fc44"
koji_base="https://kojipkgs.fedoraproject.org/packages/kernel/${koji_kver}/${koji_krel}/${arch}"
kernel_td=$(mktemp -d)
trap 'rm -rf "${kernel_td}"' EXIT
for pkg in kernel kernel-core kernel-modules kernel-modules-core; do
curl --retry 5 --retry-delay 5 --retry-all-errors -fL \
"${koji_base}/${pkg}-${koji_kver}-${koji_krel}.${arch}.rpm" \
-o "${kernel_td}/${pkg}.rpm"
done
# Skip scriptlets: kernel-core's posttrans runs `kernel-install add`
# which calls rpm-ostree, and that fails inside a container build.
# We manually run depmod afterward since it's the only useful
# scriptlet the kernel packages would otherwise execute.
dnf -y install --allowerasing --setopt=tsflags=noscripts "${kernel_td}"/*.rpm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using dnf install on an older kernel version will install it alongside the existing 7.x kernel rather than replacing it. Since the 7.x kernel has a higher version number, it will likely remain the default boot option. Deleting the module directory manually (lines 167-172) will leave the 7.x kernel in a broken state (missing modules) while still being the default. It is better to explicitly remove the 7.x kernel packages to ensure the 6.x kernel is preferred and the RPM database remains consistent.

Suggested change
dnf -y install --allowerasing --setopt=tsflags=noscripts "${kernel_td}"/*.rpm
dnf -y install --allowerasing --setopt=tsflags=noscripts "${kernel_td}"/*.rpm
dnf -y remove --setopt=tsflags=noscripts "kernel*-7.[01]*"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thought Gemini, but we actually set installonlyn in our base image to turn off that dnf behavior.

/sbin/depmod -a "${koji_kver}-${koji_krel}.$(uname -m)"
# Remove any leftover module directories for the old kernel (e.g.
# initramfs.img generated by the base image build is not RPM-owned
# so dnf does not clean it up).
for old_kmod_dir in /usr/lib/modules/*; do
kd_ver=$(basename "${old_kmod_dir}")
if [[ "${kd_ver}" != "${koji_kver}-"* ]]; then
rm -rf "${old_kmod_dir}"
fi
done
rm -rf "${kernel_td}"
trap - EXIT
;;
esac

dnf clean all
# Clean logs and caches
rm /var/log/* /var/cache /var/lib/{dnf,rpm-state,rhsm} -rf
10 changes: 10 additions & 0 deletions tmt/tests/Dockerfile.upgrade-source
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ if [[ "${variant}" == composefs* ]]; then
echo 'add_dracutmodules+=" bootc "' > /etc/dracut.conf.d/50-bootc-composefs.conf
kver=$(cd /usr/lib/modules && echo *)
dracut --force --kver "$kver" "/usr/lib/modules/$kver/initramfs.img"
else
. /usr/lib/os-release

if [[ $ID == "fedora" && $VERSION_ID == "44" ]]; then
# We skip kernel postinstall in "provision-fetch" which would've generated
# the initrd, so we do it ourselves here
kver=$(cd /usr/lib/modules && echo *)
dracut --force --kver "$kver" "/usr/lib/modules/$kver/initramfs.img"
fi
fi

rm -rf /run/provision
EORUN