From 390dd59a09012154a1160c3cf3a15fd5344821a3 Mon Sep 17 00:00:00 2001 From: Antheas Kapenekakis <5252246+antheas@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:44:34 +0200 Subject: [PATCH] feat: add kernel-bazzite to cache (#29) * 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 <69128853+m2Giles@users.noreply.github.com> --- .github/workflows/reusable-build.yml | 10 ++++++++++ Containerfile | 1 + fetch.sh | 22 +++++++++++++++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 22cb545..1c46dfa 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -30,6 +30,7 @@ jobs: - asus - fsync - fsync-ba + - bazzite - surface - main - coreos-stable @@ -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 @@ -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/.*://') @@ -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 @@ -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 }} diff --git a/Containerfile b/Containerfile index 22608c6..0966659 100644 --- a/Containerfile +++ b/Containerfile @@ -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 diff --git a/fetch.sh b/fetch.sh index b9d1f13..0928491 100755 --- a/fetch.sh +++ b/fetch.sh @@ -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 \ @@ -28,6 +29,8 @@ case "$kernel_flavor" in ;; "coreos-testing") ;; + "bazzite") + ;; "main") ;; *) @@ -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)" @@ -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 \