Skip to content

Commit

Permalink
feat: enable Fedora 41 builds (#27)
Browse files Browse the repository at this point in the history
* feat: enable Fedora 41 builds

* chore: improve logging of kernel version extraction

* fix: unset variable and list root directory contents

* fix: use curl rather than dnf download

* fix: add noprep flag

* fix: rpmrebuild use symlink and specified buildroot

* fix: disable not yet built F41 kernels

---------

Co-authored-by: m2 <69128853+m2Giles@users.noreply.github.com>
  • Loading branch information
p5 and m2Giles authored Oct 2, 2024
1 parent 396f4ae commit a768ce0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
fedora_version:
- 39
- 40
- 41
exclude:
- fedora_version: 39
kernel_flavor: asus
Expand All @@ -46,6 +47,16 @@ jobs:
kernel_flavor: fsync
- fedora_version: 39
kernel_flavor: fsync-ba
- fedora_version: 41
kernel_flavor: fsync
- fedora_version: 41
kernel_flavor: fsync-ba
- fedora_version: 41
kernel_flavor: coreos-stable
- fedora_version: 41
kernel_flavor: coreos-testing
- fedora_version: 41
kernel_flavor: surface

steps:
- name: Checkout Push to Registry action
Expand Down Expand Up @@ -89,6 +100,7 @@ jobs:
echo "Querying koji for ${coreos_version} kernel: $kernel_version"
echo "$URL"
HTTP_RESP=$(curl -sI "$URL" | grep ^HTTP)
linux=""
if grep -qv "200 OK" <<< "${HTTP_RESP}"; then
echo "Koji failed to find $coreos_version kernel: $kernel_version"
case "$kernel_rel_part" in
Expand Down
28 changes: 15 additions & 13 deletions fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -eoux pipefail
kernel_version="${KERNEL_VERSION}"
kernel_flavor="${KERNEL_FLAVOR}"

#CoreOS pool repo
# CoreOS pool repo
# curl -LsSf -o /etc/yum.repos.d/fedora-coreos-pool.repo \
# https://raw.githubusercontent.com/coreos/fedora-coreos-config/testing-devel/fedora-coreos-pool.repo

Expand Down Expand Up @@ -58,20 +58,19 @@ elif [[ "${kernel_flavor}" == "surface" ]]; then
libwacom-surface \
libwacom-surface-data


else
KERNEL_MAJOR_MINOR_PATCH=$(echo "$kernel_version" | cut -d '-' -f 1)
KERNEL_RELEASE="$(echo "$kernel_version" | cut -d - -f 2 | cut -d . -f 1).$(echo "$kernel_version" | cut -d - -f 2 | cut -d . -f 2)"
ARCH=$(uname -m)
dnf download -y \
https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-"$kernel_version".rpm \
https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-modules-"$kernel_version".rpm \
https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-modules-core-"$kernel_version".rpm \
https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-modules-extra-"$kernel_version".rpm \
https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-devel-"$kernel_version".rpm \
https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-devel-matched-"$kernel_version".rpm \
https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-uki-virt-"$kernel_version".rpm


# Using curl instead of dnf download for https links
curl -LO https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-"$kernel_version".rpm
curl -LO https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-modules-"$kernel_version".rpm
curl -LO https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-modules-core-"$kernel_version".rpm
curl -LO https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-modules-extra-"$kernel_version".rpm
curl -LO https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-devel-"$kernel_version".rpm
curl -LO https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-devel-matched-"$kernel_version".rpm
curl -LO https://kojipkgs.fedoraproject.org//packages/kernel/"$KERNEL_MAJOR_MINOR_PATCH"/"$KERNEL_RELEASE"/"$ARCH"/kernel-uki-virt-"$kernel_version".rpm
fi

if [[ "${kernel_flavor}" =~ fsync|fsync-ba ]]; then
Expand All @@ -93,6 +92,7 @@ openssl x509 -in /tmp/certs/public_key.der -out /tmp/certs/public_key.crt
install -Dm644 /tmp/certs/public_key.crt "$PUBLIC_KEY_PATH"
install -Dm644 /tmp/certs/private_key.priv "$PRIVATE_KEY_PATH"

ls -la /
if [[ "${kernel_flavor}" =~ asus|fsync|fsync-ba ]]; then
dnf install -y \
/kernel-"$kernel_version".rpm \
Expand Down Expand Up @@ -154,9 +154,11 @@ if [[ ${DUAL_SIGN:-} == "true" ]]; then
rm -f "$SECOND_PRIVATE_KEY_PATH" "$SECOND_PUBLIC_KEY_PATH"
fi

ln -s / /tmp/buildroot

# Rebuild RPMs and Verify
if [[ "${kernel_flavor}" =~ surface ]]; then
rpmrebuild --batch kernel-surface-core-"${kernel_version}"
rpmrebuild --additional=--buildroot=/tmp/buildroot --batch kernel-surface-core-"${kernel_version}"
rm -f /usr/lib/modules/"${kernel_version}"/vmlinuz
dnf reinstall -y \
/kernel-surface-"$kernel_version".rpm \
Expand All @@ -165,7 +167,7 @@ if [[ "${kernel_flavor}" =~ surface ]]; then
/kernel-surface-modules-extra-"$kernel_version".rpm \
/root/rpmbuild/RPMS/"$(uname -m)"/kernel-*.rpm
else
rpmrebuild --batch kernel-core-"${kernel_version}"
rpmrebuild --additional=--buildroot=/tmp/buildroot --batch kernel-core-"${kernel_version}"
rm -f /usr/lib/modules/"${kernel_version}"/vmlinuz
dnf reinstall -y \
/kernel-"$kernel_version".rpm \
Expand Down

0 comments on commit a768ce0

Please sign in to comment.