Skip to content

Commit

Permalink
feat: add kernel-bazzite to cache
Browse files Browse the repository at this point in the history
  • Loading branch information
antheas committed Oct 18, 2024
1 parent a768ce0 commit eae3673
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
- asus
- fsync
- fsync-ba
- bazzite
- surface
- main
- coreos-stable
Expand All @@ -51,6 +52,8 @@ jobs:
kernel_flavor: fsync
- fedora_version: 41
kernel_flavor: fsync-ba
- fedora_version: 39
kernel_flavor: bazzite
- fedora_version: 41
kernel_flavor: coreos-stable
- fedora_version: 41
Expand Down Expand Up @@ -144,6 +147,11 @@ jobs:
$dnf copr enable -y sentry/kernel-ba
linux=$($dnf repoquery --repoid copr:copr.fedorainfracloud.org:sentry:kernel-ba --whatprovides kernel | sort -V | tail -n1 | sed 's/.*://')
;;
"bazzite")
latest="$(curl "https://api.github.com/repos/hhd-dev/kernel-bazzite/releases/latest" )"
linux=$(echo -E "$latest" | jq -r '.assets[].name' | grep -E 'kernel-.*.rpm' | grep "fc${{ matrix.fedora_version }}" | head -1 | sed "s/kernel-//g" | sed "s/.rpm//g" )
build_tag=$(echo -E $latest | jq -r '.tag_name')
;;
"surface")
$dnf config-manager --add-repo=https://pkg.surfacelinux.com/fedora/linux-surface.repo
linux=$($dnf repoquery --repoid linux-surface --whatprovides kernel-surface | sort -V | tail -n1 | sed 's/.*://')
Expand Down Expand Up @@ -171,6 +179,7 @@ jobs:
kernel_major_minor_patch="${major}.${minor}.${patch}"
echo "Kernel Version is ${linux}"
echo "kernel_release=${linux}" >> $GITHUB_ENV
echo "kernel_build_tag=${build_tag}" >> $GITHUB_ENV
echo "kernel_major_minor_patch=${kernel_major_minor_patch}" >> $GITHUB_ENV
- name: Generate Tags
Expand Down Expand Up @@ -253,6 +262,7 @@ jobs:
build-args: |
FEDORA_VERSION=${{ matrix.fedora_version }}
KERNEL_VERSION=${{ env.kernel_release }}
KERNEL_BUILD_TAG=${{ env.kernel_build_tag }}
KERNEL_FLAVOR=${{ matrix.kernel_flavor }}
DUAL_SIGN=true
labels: ${{ steps.meta.outputs.labels }}
Expand Down
18 changes: 17 additions & 1 deletion fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -eoux pipefail

kernel_version="${KERNEL_VERSION}"
kernel_flavor="${KERNEL_FLAVOR}"
build_tag="${KERNEL_BUILD_TAG}"

# CoreOS pool repo
# curl -LsSf -o /etc/yum.repos.d/fedora-coreos-pool.repo \
Expand Down Expand Up @@ -57,7 +58,15 @@ elif [[ "${kernel_flavor}" == "surface" ]]; then
iptsd \
libwacom-surface \
libwacom-surface-data

elif [[ "${kernel_flavor}" == "bazzite" ]]; then
# Using curl for bazzite release
curl -LO https://github.com/hhd-dev/kernel-bazzite/releases/download/"$build_tag"/kernel-"$kernel_version".rpm
curl -LO https://github.com/hhd-dev/kernel-bazzite/releases/download/"$build_tag"/kernel-modules-"$kernel_version".rpm
curl -LO https://github.com/hhd-dev/kernel-bazzite/releases/download/"$build_tag"/kernel-modules-core-"$kernel_version".rpm
curl -LO https://github.com/hhd-dev/kernel-bazzite/releases/download/"$build_tag"/kernel-modules-extra-"$kernel_version".rpm
curl -LO https://github.com/hhd-dev/kernel-bazzite/releases/download/"$build_tag"/kernel-devel-"$kernel_version".rpm
curl -LO https://github.com/hhd-dev/kernel-bazzite/releases/download/"$build_tag"/kernel-devel-matched-"$kernel_version".rpm
curl -LO https://github.com/hhd-dev/kernel-bazzite/releases/download/"$build_tag"/kernel-uki-virt-"$kernel_version".rpm
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)"
Expand Down Expand Up @@ -107,6 +116,13 @@ elif [[ "${kernel_flavor}" =~ surface ]]; then
/kernel-surface-modules-core-"$kernel_version".rpm \
/kernel-surface-modules-extra-"$kernel_version".rpm \
kernel-surface-core-"${kernel_version}"
elif [[ "${kernel_flavor}" == "bazzite" ]]; then
dnf install -y \
/kernel-"$kernel_version".rpm \
/kernel-core-"$kernel_version".rpm \
/kernel-modules-"$kernel_version".rpm \
/kernel-modules-core-"$kernel_version".rpm \
/kernel-modules-extra-"$kernel_version".rpm
else
dnf install -y \
/kernel-"$kernel_version".rpm \
Expand Down

0 comments on commit eae3673

Please sign in to comment.