Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo authored Apr 3, 2024
2 parents 5a40542 + 09137c9 commit 5af3531
Show file tree
Hide file tree
Showing 27 changed files with 166 additions and 75 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build-38.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: ublue akmods 38
on:
pull_request:
merge_group:
schedule:
- cron: '10 14 * * *' # 2pm-ish UTC everyday (timed against official fedora container pushes, and after 'config')
workflow_dispatch:

jobs:
build:
name: build
uses: ./.github/workflows/reusable-build.yml
secrets: inherit
with:
fedora_version: 38
15 changes: 15 additions & 0 deletions .github/workflows/build-39.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: ublue akmods 39
on:
pull_request:
merge_group:
schedule:
- cron: '0 14 * * *' # 2pm-ish UTC everyday (timed against official fedora container pushes, and after 'config')
workflow_dispatch:

jobs:
build:
name: build
uses: ./.github/workflows/reusable-build.yml
secrets: inherit
with:
fedora_version: 39
15 changes: 15 additions & 0 deletions .github/workflows/build-40.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: ublue akmods 40
on:
pull_request:
merge_group:
schedule:
- cron: '5 14 * * *' # 2pm-ish UTC everyday (timed against official fedora container pushes, and after 'config')
workflow_dispatch:

jobs:
build:
name: build
uses: ./.github/workflows/reusable-build.yml
secrets: inherit
with:
fedora_version: 40
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
name: build-ublue
on:
pull_request:
merge_group:
schedule:
- cron: '0 14 * * *' # 2pm UTC everyday (timed against official fedora container pushes, and after 'config')
workflow_dispatch:
workflow_call:
inputs:
fedora_version:
description: 'The Fedora release version: 38, 39, 40, etc'
required: true
type: string
env:
IMAGE_NAME: akmods
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ inputs.fedora_version }}
cancel-in-progress: true

jobs:
push-ghcr:
build_ublue:
name: akmods
runs-on: ubuntu-22.04
permissions:
Expand All @@ -20,21 +25,40 @@ jobs:
strategy:
fail-fast: false
matrix:
kernel_flavor: [main, asus, fsync, surface]
cfile_suffix: [common, nvidia]
major_version: [38, 39]
nvidia_version: [0, 470, 550]
fedora_version:
- ${{ inputs.fedora_version }}
kernel_flavor:
- main
- asus
- fsync
- surface
cfile_suffix:
- common
- nvidia
nvidia_version:
- 0
- 470
- 550
exclude:
- cfile_suffix: common
nvidia_version: 470
- cfile_suffix: common
nvidia_version: 550
- cfile_suffix: nvidia
nvidia_version: 0
- kernel_flavor: fsync
major_version: 38
- kernel_flavor: 6.7.9-207.fsync
fedora_version: 38
- kernel_flavor: asus
fedora_version: 38
- kernel_flavor: surface
fedora_version: 38
- kernel_flavor: surface
nvidia_version: 470
- fedora_version: 40
nvidia_version: 470 # rpmfusion packages nvidia 470 for F40 but won't compile yet.
- fedora_version: 40
kernel_flavor: 6.7.9-207.fsync # kernel-fsync packages are not being built for F40 yet.

steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
Expand All @@ -43,7 +67,8 @@ jobs:
- name: Matrix Variables
shell: bash
run: |
if [[ "${{ matrix.major_version }}" -ge "40" ]]; then
if [[ "${{ matrix.fedora_version }}" -ge "41" ]]; then
# when we are confident of official fedora images we can switch to them
echo "SOURCE_IMAGE=fedora-silverblue" >> $GITHUB_ENV
echo "SOURCE_ORG=fedora" >> $GITHUB_ENV
else
Expand All @@ -58,9 +83,9 @@ jobs:
# Generate a timestamp for creating an image version history
TIMESTAMP="$(date +%Y%m%d)"
if [[ "${{ matrix.cfile_suffix }}" == "nvidia" ]]; then
VARIANT="${{ matrix.kernel_flavor }}-${{ matrix.major_version }}-${{ matrix.nvidia_version }}"
VARIANT="${{ matrix.kernel_flavor }}-${{ matrix.fedora_version }}-${{ matrix.nvidia_version }}"
else
VARIANT="${{ matrix.kernel_flavor }}-${{ matrix.major_version }}"
VARIANT="${{ matrix.kernel_flavor }}-${{ matrix.fedora_version }}"
fi
COMMIT_TAGS=()
Expand Down Expand Up @@ -104,13 +129,13 @@ jobs:
- name: Get current version
id: labels
uses: Wandalen/wretry.action@v1.4.4
uses: Wandalen/wretry.action@v2.1.0
with:
attempt_limit: 3
attempt_delay: 15000
command: |
set -eo pipefail
skopeo inspect docker://quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.major_version }} > inspect.json
skopeo inspect docker://quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.fedora_version }} > inspect.json
ver=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json)
linux=$(jq -r '.Labels["ostree.linux"]' inspect.json)
if [ -z "$ver" ] || [ "null" = "$ver" ]; then
Expand All @@ -121,8 +146,8 @@ jobs:
echo "inspected image linux version must not be empty or null"
exit 1
fi
echo "VERSION=$ver" >> $GITHUB_OUTPUT
echo "LINUX=$linux" >> $GITHUB_OUTPUT
echo "SOURCE_IMAGE_VERSION=$ver" >> $GITHUB_ENV
echo "SOURCE_IMAGE_LINUX=$linux" >> $GITHUB_ENV
# Build metadata
- name: Image Metadata
Expand All @@ -134,20 +159,20 @@ jobs:
labels: |
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
org.opencontainers.image.description=A caching layer for pre-built akmod RPMs
org.opencontainers.image.version=${{ steps.labels.outputs.VERSION }}
ostree.linux=${{ steps.labels.outputs.LINUX }}
org.opencontainers.image.version=${{ env.SOURCE_IMAGE_VERSION }}
ostree.linux=${{ env.SOURCE_IMAGE_LINUX }}
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/main/README.md
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/1728152?s=200&v=4
- name: Pull build image
uses: Wandalen/wretry.action@v1.4.4
uses: Wandalen/wretry.action@v2.1.0
with:
attempt_limit: 3
attempt_delay: 15000
command: |
# pull the base image used for FROM in containerfile so
# we can retry on that unfortunately common failure case
podman pull quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.major_version }}
podman pull quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.fedora_version }}
# Build image using Buildah action
- name: Build Image
Expand All @@ -163,7 +188,7 @@ jobs:
SOURCE_IMAGE=${{ env.SOURCE_IMAGE }}
SOURCE_ORG=${{ env.SOURCE_ORG }}
KERNEL_FLAVOR=${{ matrix.kernel_flavor }}
FEDORA_MAJOR_VERSION=${{ matrix.major_version }}
FEDORA_MAJOR_VERSION=${{ matrix.fedora_version }}
NVIDIA_MAJOR_VERSION=${{ matrix.nvidia_version }}
RPMFUSION_MIRROR=${{ vars.RPMFUSION_MIRROR }}
labels: ${{ steps.meta.outputs.labels }}
Expand All @@ -179,7 +204,7 @@ jobs:


- name: Push To GHCR
uses: Wandalen/wretry.action@v1.4.4
uses: Wandalen/wretry.action@v2.1.0
id: push
if: github.event_name != 'pull_request'
env:
Expand Down Expand Up @@ -225,10 +250,14 @@ jobs:
echo "${{ toJSON(steps.push.outputs) }}"
check:
name: Check all builds successful
name: Check all ${{ inputs.fedora_version }} builds successful
runs-on: ubuntu-latest
needs: [push-ghcr]
needs: [build_ublue]
steps:
- name: Exit on failure
if: ${{ needs.build_ublue.result == 'failure' }}
shell: bash
run: exit 1
- name: Exit
shell: bash
run: exit 0
4 changes: 1 addition & 3 deletions Containerfile.common
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ COPY ublue-os-akmods-addons.spec /tmp/ublue-os-akmods-addons/ublue-os-akmods-add
ADD https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/repo/fedora-${FEDORA_MAJOR_VERSION}/ublue-os-akmods-fedora-${FEDORA_MAJOR_VERSION}.repo \
/tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo
ADD https://negativo17.org/repos/fedora-multimedia.repo \
/tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/negativo17-fedora-multimedia.repo
/tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/negativo17-fedora-multimedia.repo

RUN /tmp/build-prep.sh

RUN /tmp/build-ublue-os-akmods-addons.sh

# Set kernel name
# Exclude negativo17 kmods from Fedora 39
RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \
export KERNEL_NAME="kernel" \
; else \
Expand All @@ -48,7 +47,6 @@ RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \
/tmp/build-kmod-bmi160.sh && \
/tmp/build-kmod-bmi260.sh && \
/tmp/build-kmod-bmi323.sh && \
/tmp/build-kmod-gasket.sh && \
/tmp/build-kmod-gcadapter_oc.sh && \
/tmp/build-kmod-nct6687d.sh && \
/tmp/build-kmod-openrazer.sh && \
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![build-ublue](https://github.com/ublue-os/akmods/actions/workflows/build.yml/badge.svg)](https://github.com/ublue-os/akmods/actions/workflows/build.yml)
[![build-38](https://github.com/ublue-os/akmods/actions/workflows/build-38.yml/badge.svg)](https://github.com/ublue-os/akmods/actions/workflows/build-38.yml) [![build-39](https://github.com/ublue-os/akmods/actions/workflows/build-39.yml/badge.svg)](https://github.com/ublue-os/akmods/actions/workflows/build-39.yml) [![build-40](https://github.com/ublue-os/akmods/actions/workflows/build-40.yml/badge.svg)](https://github.com/ublue-os/akmods/actions/workflows/build-40.yml)

# ublue-os akmods

Expand All @@ -18,7 +18,6 @@ Feel free to PR more kmod build scripts into this repo!
- [bmi260](https://github.com/hhd-dev/bmi260) - kernel module driver for the Bosch BMI260 IMU (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
- [bmi323](https://github.com/hhd-dev/bmi260) - kernel module driver for the Bosch BMI323 IMU (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
- [evdi](www.displaylink.com) - kernel module required for use of displaylink (akmod from [negativo17 multimedia repo](https://negativo17.org/multimedia/)
- [gasket/apex](https://github.com/google/gasket-driver) - kernel module for Coral Gasket Driver, allowing usage of the Coral EdgeTPU on Linux systems (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
- [gcadapter_oc](https://github.com/hannesmann/gcadapter-oc-kmod) - kernel module for overclocking the Nintendo Wii U/Mayflash GameCube adapter (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
- [nct6687d](https://github.com/Fred78290/nct6687d) - Linux kernel module for Nuvoton NCT6687-R found on AMD B550 chipset motherboards (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
- [nvidia](https://rpmfusion.org/Howto/NVIDIA) - nvidia GPU drivers built from rpmfusion
Expand Down Expand Up @@ -90,3 +89,7 @@ These images are signed with sisgstore's [cosign](https://docs.sigstore.dev/cosi

cosign verify --key cosign.pub ghcr.io/ublue-os/akmods:RELEASE

# Metrics

![Alt](https://repobeats.axiom.co/api/embed/a7ddeb1a3d2e0ce534ccf7cfa75c33b35183b106.svg "Repobeats analytics image")

4 changes: 2 additions & 2 deletions build-kmod-ayaneo-platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -oeux pipefail

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

ARCH="$(rpm -E '%_arch')"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

rpm-ostree install \
akmod-ayaneo-platform-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod ayaneo-platform
Expand Down
4 changes: 2 additions & 2 deletions build-kmod-ayn-platform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -oeux pipefail

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

ARCH="$(rpm -E '%_arch')"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

rpm-ostree install \
akmod-ayn-platform-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod ayn-platform
Expand Down
4 changes: 2 additions & 2 deletions build-kmod-bmi160.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -oeux pipefail

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

ARCH="$(rpm -E '%_arch')"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

rpm-ostree install \
akmod-bmi160-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod bmi160
Expand Down
4 changes: 2 additions & 2 deletions build-kmod-bmi260.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -oeux pipefail

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

ARCH="$(rpm -E '%_arch')"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

rpm-ostree install \
akmod-bmi260-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod bmi260
Expand Down
4 changes: 2 additions & 2 deletions build-kmod-bmi323.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

set -oeux pipefail

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

ARCH="$(rpm -E '%_arch')"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

rpm-ostree install \
akmod-bmi323-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod bmi323
Expand Down
3 changes: 1 addition & 2 deletions build-kmod-evdi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
set -oeux pipefail


cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/negativo17-fedora-multimedia.repo /etc/yum.repos.d/

ARCH="$(rpm -E '%_arch')"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/negativo17-fedora-multimedia.repo /etc/yum.repos.d/

### BUILD evdi (succeed or fail-fast with debug output)
export CFLAGS="-fno-pie -no-pie"
Expand Down
9 changes: 7 additions & 2 deletions build-kmod-gasket.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@

set -oeux pipefail

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

ARCH="$(rpm -E '%_arch')"
KERNEL="$(rpm -q "${KERNEL_NAME}" --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
RELEASE="$(rpm -E '%fedora')"

if [[ "${KERNEL}" =~ "6.8" ]]; then
echo "SKIPPED BUILD of gasket: compile failure on kernel 6.8 as of 2024-03-17"
exit 0
fi

cp /tmp/ublue-os-akmods-addons/rpmbuild/SOURCES/_copr_ublue-os-akmods.repo /etc/yum.repos.d/

rpm-ostree install \
akmod-gasket-*.fc${RELEASE}.${ARCH}
akmods --force --kernels "${KERNEL}" --kmod gasket
Expand Down
Loading

0 comments on commit 5af3531

Please sign in to comment.