Skip to content

Commit

Permalink
feat: add kernel-bazzite to cache (#29)
Browse files Browse the repository at this point in the history
* feat: add kernel-bazzite to cache

* fix: Pass BUILD_TAG to Containerfile

* fix: add bazzite tag to fetch

* fix: add missing kernel-core module

---------

Co-authored-by: m2 <[email protected]>
  • Loading branch information
antheas and m2Giles authored Oct 18, 2024
1 parent a768ce0 commit 390dd59
Show file tree
Hide file tree
Showing 3 changed files with 32 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
1 change: 1 addition & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ARG KERNEL_VERSION="${:-6.8.11-300.fc40.x86_64}"
ARG FEDORA_VERSION="${FEDORA_VERSION:-40}"
ARG KERNEL_FLAVOR="${:-coreos-stable}"
ARG DUAL_SIGN="${:-true}"
ARG KERNEL_BUILD_TAG="${:-}"

COPY fetch.sh /tmp
COPY certs /tmp/certs
Expand Down
22 changes: 21 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:-latest}"

# CoreOS pool repo
# curl -LsSf -o /etc/yum.repos.d/fedora-coreos-pool.repo \
Expand All @@ -28,6 +29,8 @@ case "$kernel_flavor" in
;;
"coreos-testing")
;;
"bazzite")
;;
"main")
;;
*)
Expand Down Expand Up @@ -57,7 +60,17 @@ 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-core-"$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
# curl -LO https://github.com/hhd-dev/kernel-bazzite/releases/download/"$build_tag"/kernel-uki-virt-addons-"$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 +120,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 390dd59

Please sign in to comment.