Skip to content

Commit 4ca3907

Browse files
authored
Merge branch 'main' into dependabot/github_actions/sigstore/cosign-installer-3.5.0
2 parents 23e7a07 + 5ae851e commit 4ca3907

14 files changed

+145
-199
lines changed

.github/workflows/reusable-build.yml

Lines changed: 77 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
required: true
88
type: string
99
env:
10-
IMAGE_NAME: akmods
10+
IMAGE_BASE_NAME: akmods
1111
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
1212

1313
concurrency:
@@ -36,14 +36,7 @@ jobs:
3636
cfile_suffix:
3737
- common
3838
- nvidia
39-
nvidia_version:
40-
- 0
41-
- 550
4239
exclude:
43-
- cfile_suffix: common
44-
nvidia_version: 550
45-
- cfile_suffix: nvidia
46-
nvidia_version: 0
4740
- kernel_flavor: asus
4841
fedora_version: 38
4942
- kernel_flavor: surface
@@ -56,7 +49,6 @@ jobs:
5649
kernel_flavor: fsync # kernel-fsync packages are not being built for F40 yet.
5750
- fedora_version: 40
5851
kernel_flavor: fsync-lts
59-
6052
steps:
6153
# Checkout push-to-registry action GitHub repository
6254
- name: Checkout Push to Registry action
@@ -65,26 +57,25 @@ jobs:
6557
- name: Matrix Variables
6658
shell: bash
6759
run: |
68-
if [[ "${{ matrix.fedora_version }}" -ge "41" ]]; then
69-
# when we are confident of official fedora images we can switch to them
70-
echo "SOURCE_IMAGE=fedora-silverblue" >> $GITHUB_ENV
71-
echo "SOURCE_ORG=fedora" >> $GITHUB_ENV
60+
if [ "common" == "${{ matrix.cfile_suffix }}" ]; then
61+
echo "IMAGE_NAME=${{ env.IMAGE_BASE_NAME }}" >> $GITHUB_ENV
7262
else
73-
echo "SOURCE_IMAGE=base" >> $GITHUB_ENV
74-
echo "SOURCE_ORG=fedora-ostree-desktops" >> $GITHUB_ENV
63+
echo "IMAGE_NAME=${{ env.IMAGE_BASE_NAME }}-${{ matrix.cfile_suffix }}" >> $GITHUB_ENV
7564
fi
65+
export SOURCE_IMAGE=base
66+
export SOURCE_ORG=fedora-ostree-desktops
67+
echo "SOURCE_IMAGE=${SOURCE_IMAGE}" >> $GITHUB_ENV
68+
echo "SOURCE_ORG=${SOURCE_ORG}" >> $GITHUB_ENV
69+
echo "FQ_SOURCE_IMAGE=quay.io/${SOURCE_ORG}/${SOURCE_IMAGE}:${{ matrix.fedora_version }}" >> $GITHUB_ENV
70+
7671
7772
- name: Generate tags
7873
id: generate-tags
7974
shell: bash
8075
run: |
8176
# Generate a timestamp for creating an image version history
8277
TIMESTAMP="$(date +%Y%m%d)"
83-
if [[ "${{ matrix.cfile_suffix }}" == "nvidia" ]]; then
84-
VARIANT="${{ matrix.kernel_flavor }}-${{ matrix.fedora_version }}-${{ matrix.nvidia_version }}"
85-
else
86-
VARIANT="${{ matrix.kernel_flavor }}-${{ matrix.fedora_version }}"
87-
fi
78+
VARIANT="${{ matrix.kernel_flavor }}-${{ matrix.fedora_version }}"
8879
8980
COMMIT_TAGS=()
9081
BUILD_TAGS=()
@@ -125,69 +116,103 @@ jobs:
125116
# DEBUG: get character count of key
126117
wc -c certs/private_key.priv
127118
128-
- name: Get current version
129-
id: labels
130-
uses: Wandalen/wretry.action@v2.1.0
119+
- name: Pull build image
120+
uses: Wandalen/wretry.action@v3.4.0
131121
with:
132122
attempt_limit: 3
133123
attempt_delay: 15000
134124
command: |
135-
set -eo pipefail
136-
skopeo inspect docker://quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.fedora_version }} > inspect.json
137-
ver=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json)
125+
# pull the base image used for FROM in containerfile so
126+
# we can retry on that unfortunately common failure case
127+
podman pull ${{ env.FQ_SOURCE_IMAGE }}
128+
129+
- name: Get current version
130+
run: |
131+
set -eo pipefail
132+
133+
# skopeo must always run to inspect image labels for build version
134+
skopeo inspect docker://${{ env.FQ_SOURCE_IMAGE }} > inspect.json
135+
ver=$(jq -r '.Labels["org.opencontainers.image.version"]' inspect.json)
136+
if [ -z "$ver" ] || [ "null" = "$ver" ]; then
137+
echo "inspected image version must not be empty or null"
138+
exit 1
139+
fi
140+
141+
if [ "main" == "${{ matrix.kernel_flavor }}" ]; then
142+
# main kernel_flavor: use ostree.linux to determine kernel version
138143
linux=$(jq -r '.Labels["ostree.linux"]' inspect.json)
139-
if [ -z "$ver" ] || [ "null" = "$ver" ]; then
140-
echo "inspected image version must not be empty or null"
141-
exit 1
142-
fi
143-
if [ -z "$linux" ] || [ "null" = "$linux" ]; then
144-
echo "inspected image linux version must not be empty or null"
145-
exit 1
146-
fi
147-
echo "SOURCE_IMAGE_VERSION=$ver" >> $GITHUB_ENV
148-
echo "SOURCE_IMAGE_LINUX=$linux" >> $GITHUB_ENV
144+
else
145+
# other kernel_flavor: start container use dnf to find kernel version
146+
container_name="fq-$(uuidgen)"
147+
podman run --entrypoint /bin/bash --name "$container_name" -dt "${{ env.FQ_SOURCE_IMAGE }}"
148+
podman exec $container_name rpm-ostree install dnf dnf-plugins-core
149+
150+
# Fetch kernel version
151+
dnf="podman exec $container_name dnf"
152+
case "${{ matrix.kernel_flavor }}" in
153+
"asus")
154+
$dnf copr enable -y lukenukem/asus-kernel
155+
linux=$($dnf repoquery --repoid copr:copr.fedorainfracloud.org:lukenukem:asus-kernel --whatprovides kernel | tail -n1 | sed 's/.*://')
156+
;;
157+
"fsync")
158+
$dnf copr enable -y sentry/kernel-fsync
159+
linux=$($dnf repoquery --repoid copr:copr.fedorainfracloud.org:sentry:kernel-fsync --whatprovides kernel | tail -n1 | sed 's/.*://')
160+
;;
161+
"fsync-lts")
162+
$dnf copr enable -y sentry/kernel-ba
163+
linux=$($dnf repoquery --repoid copr:copr.fedorainfracloud.org:sentry:kernel-ba --whatprovides kernel | tail -n1 | sed 's/.*://')
164+
;;
165+
"main")
166+
linux=$($dnf repoquery --whatprovides kernel | tail -n1 | sed 's/.*://')
167+
;;
168+
"surface")
169+
$dnf config-manager --add-repo=https://pkg.surfacelinux.com/fedora/linux-surface.repo
170+
linux=$($dnf repoquery --repoid linux-surface --whatprovides kernel-surface | tail -n1 | sed 's/.*://')
171+
;;
172+
*)
173+
echo "unexpected kernel_flavor '${{ matrix.kernel_flavor }}' for dnf repoquery"
174+
;;
175+
esac
176+
fi
177+
178+
if [ -z "$linux" ] || [ "null" = "$linux" ]; then
179+
echo "inspected image linux version must not be empty or null"
180+
exit 1
181+
fi
182+
echo "SOURCE_IMAGE_VERSION=$ver" >> $GITHUB_ENV
183+
echo "KERNEL_VERSION=$linux" >> $GITHUB_ENV
149184
150185
# Build metadata
151186
- name: Image Metadata
152187
uses: docker/metadata-action@v5
153188
id: meta
154189
with:
155190
images: |
156-
${{ 'nvidia' == matrix.cfile_suffix && format('{0}-nvidia', env.IMAGE_NAME) || format('{0}', env.IMAGE_NAME) }}
191+
${{ env.IMAGE_NAME }}
157192
labels: |
158-
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
193+
org.opencontainers.image.title=${{ env.IMAGE_BASE_NAME }}
159194
org.opencontainers.image.description=A caching layer for pre-built akmod RPMs
160195
org.opencontainers.image.version=${{ env.SOURCE_IMAGE_VERSION }}
161-
ostree.linux=${{ env.SOURCE_IMAGE_LINUX }}
196+
ostree.linux=${{ env.KERNEL_VERSION }}
162197
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/main/README.md
163198
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/1728152?s=200&v=4
164199
165-
- name: Pull build image
166-
uses: Wandalen/wretry.action@v2.1.0
167-
with:
168-
attempt_limit: 3
169-
attempt_delay: 15000
170-
command: |
171-
# pull the base image used for FROM in containerfile so
172-
# we can retry on that unfortunately common failure case
173-
podman pull quay.io/${{ env.SOURCE_ORG }}/${{ env.SOURCE_IMAGE }}:${{ matrix.fedora_version }}
174-
175200
# Build image using Buildah action
176201
- name: Build Image
177202
id: build_image
178203
uses: redhat-actions/buildah-build@v2
179204
with:
180205
containerfiles: |
181206
./Containerfile.${{ matrix.cfile_suffix }}
182-
image: ${{ 'nvidia' == matrix.cfile_suffix && format('{0}-nvidia', env.IMAGE_NAME) || format('{0}', env.IMAGE_NAME) }}
207+
image: ${{ env.IMAGE_NAME }}
183208
tags: |
184209
${{ steps.generate-tags.outputs.alias_tags }}
185210
build-args: |
186211
SOURCE_IMAGE=${{ env.SOURCE_IMAGE }}
187212
SOURCE_ORG=${{ env.SOURCE_ORG }}
188213
KERNEL_FLAVOR=${{ matrix.kernel_flavor }}
214+
KERNEL_VERSION=${{ env.KERNEL_VERSION }}
189215
FEDORA_MAJOR_VERSION=${{ matrix.fedora_version }}
190-
NVIDIA_MAJOR_VERSION=${{ matrix.nvidia_version }}
191216
RPMFUSION_MIRROR=${{ vars.RPMFUSION_MIRROR }}
192217
labels: ${{ steps.meta.outputs.labels }}
193218
oci: false
@@ -202,7 +227,7 @@ jobs:
202227

203228

204229
- name: Push To GHCR
205-
uses: Wandalen/wretry.action@v2.1.0
230+
uses: Wandalen/wretry.action@v3.4.0
206231
id: push
207232
if: github.event_name != 'pull_request'
208233
env:

Containerfile.common

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}"
1111
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder
1212
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}"
1313
ARG KERNEL_FLAVOR="{KERNEL_FLAVOR:-main}"
14+
ARG KERNEL_VERSION=""
1415
ARG RPMFUSION_MIRROR=""
1516

1617
COPY build*.sh /tmp
@@ -37,16 +38,11 @@ RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \
3738
/tmp/build-kmod-evdi.sh \
3839
; fi && \
3940
if grep -qv "fsync" <<< "${KERNEL_FLAVOR}"; then \
40-
/tmp/build-kmod-winesync.sh && \
41-
/tmp/build-kmod-openrgb.sh && \
42-
/tmp/build-kmod-steamdeck.sh \
41+
/tmp/build-kmod-openrgb.sh \
4342
; fi && \
4443
/tmp/build-kmod-ayaneo-platform.sh && \
4544
/tmp/build-kmod-ayn-platform.sh && \
46-
/tmp/build-kmod-bmi160.sh && \
47-
/tmp/build-kmod-bmi260.sh && \
48-
/tmp/build-kmod-bmi323.sh && \
49-
/tmp/build-kmod-gcadapter_oc.sh && \
45+
/tmp/build-kmod-kvmfr.sh && \
5046
/tmp/build-kmod-nct6687d.sh && \
5147
/tmp/build-kmod-openrazer.sh && \
5248
/tmp/build-kmod-ryzen-smu.sh && \

Containerfile.nvidia

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
###
2-
### Containerfile.nvidia - used to build ONLY NVIDIA kmods (one driver version per build)
2+
### Containerfile.nvidia - used to build ONLY NVIDIA kmods
33
###
44

5-
#Build from base, simpley because it's the smallest image
5+
#Build from base, simply because it's the smallest image
66
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-base}"
77
ARG SOURCE_ORG="${SOURCE_ORG:-fedora-ostree-desktops}"
88
ARG BASE_IMAGE="quay.io/${SOURCE_ORG}/${SOURCE_IMAGE}"
99
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}"
1010

1111
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder
1212
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-39}"
13-
ARG NVIDIA_MAJOR_VERSION="${NVIDIA_MAJOR_VERSION:-550}"
1413
ARG KERNEL_FLAVOR="{KERNEL_FLAVOR:-main}"
14+
ARG KERNEL_VERSION=""
1515
ARG RPMFUSION_MIRROR=""
1616

1717
COPY build*.sh /tmp
@@ -39,7 +39,7 @@ RUN if grep -qv "surface" <<< "${KERNEL_FLAVOR}"; then \
3939
; else \
4040
export KERNEL_NAME="kernel-surface" \
4141
; fi && \
42-
/tmp/build-kmod-nvidia.sh ${NVIDIA_MAJOR_VERSION}
42+
/tmp/build-kmod-nvidia.sh 550
4343

4444
RUN cp /tmp/ublue-os-nvidia-addons/rpmbuild/RPMS/noarch/ublue-os-nvidia-addons*.rpm \
4545
/var/cache/rpms/ublue-os/

README.md

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,16 @@ Feel free to PR more kmod build scripts into this repo!
1414
- [nvidia-container-tookkit repo](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#installing-with-yum-or-dnf) - version 1.14 (and newer) provide CDI for podman use of nvidia gpus
1515
- [ayaneo-platform](https://github.com/ShadowBlip/ayaneo-platform) - Linux drivers for AYANEO x86 handhelds (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
1616
- [ayn-platform](https://github.com/ShadowBlip/ayn-platform) - Linux drivers for AYN x86 handhelds (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
17-
- [bmi160](https://github.com/hhd-dev/bmi160) - kernel module driver for the BMI160 IMU (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
18-
- [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/))
19-
- [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/))
2017
- [evdi](www.displaylink.com) - kernel module required for use of displaylink (akmod from [negativo17 multimedia repo](https://negativo17.org/multimedia/)
21-
- [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/))
18+
- [kvmfr](https://github.com/gnif/looking-glass) - KVM framebuffer relay kernel module for use with Looking Glass (akmod from [hikariknight/looking-glass-kvmfr-akmod copr](https://copr.fedorainfracloud.org/coprs/hikariknight/looking-glass-kvmfr/))
2219
- [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/))
2320
- [nvidia](https://rpmfusion.org/Howto/NVIDIA) - nvidia GPU drivers built from rpmfusion
2421
- [openrazer](https://openrazer.github.io/) - kernel module adding additional features to Razer hardware (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
2522
- [openrgb](https://gitlab.com/CalcProgrammer1/OpenRGB/-/raw/master/OpenRGB.patch) - kernel module with i2c-nct6775 and patched i2c-piix4 for use with OpenRGB (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
2623
- rtl8814au - Realtek RTL8814AU Driver (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
2724
- rtl88xxau - Realtek RTL8812AU/21AU and RTL8814AU driver (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
2825
- [ryzen_smu](https://gitlab.com/leogx9r/ryzen_smu) - A Linux kernel driver that exposes access to the SMU (System Management Unit) for certain AMD Ryzen Processors (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
29-
- [steamdeck](https://lkml.org/lkml/2022/2/5/391) - platform driver for Valve's Steam Deck handheld PC (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
3026
- [v4l2loopback](https://github.com/umlaeute/v4l2loopback) - allows creating "virtual video devices"
31-
- [winesync](https://repo.or.cz/linux/zf.git/shortlog/refs/heads/winesync4) - Support for Winesync/Fastsync/NTSync primitives (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
3227
- [wl (broadcom)](https://github.com/rpmfusion/broadcom-wl/) - support for some legacy broadcom wifi devices
3328
- [xpadneo](https://github.com/atar-axis/xpadneo) - xbox one controller bluetooth driver (akmod from [negativo17 steam repo](https://negativo17.org/steam/)
3429
- [xonedo](https://github.com/BoukeHaarsma23/xonedo/) - xbox one controller USB wired/RF driver modified to work along-side xpad (akmod from [ublue-os/akmods copr](https://copr.fedorainfracloud.org/coprs/ublue-os/akmods/))
@@ -40,21 +35,21 @@ The [`akmods` image](https://github.com/orgs/ublue-os/packages/container/package
4035

4136
Here's a rundown on how it's organized.
4237

43-
We do our best to support all current builds of Fedora, current versions of the kernel modules listed, and in the case of NVIDIA current (550).
44-
**Note: NVIDIA legacy driver version 470 is no longer provided as RPMfusion has ceased updates to the package and it no longer builds with kernel 6.8 which has now released for Fedora 38 and 39.**
38+
We do our best to support all current builds of Fedora, current versions of the kernel modules listed, and the latest NVIDIA driver.
39+
**Note: NVIDIA legacy driver version 470 is no longer provided as RPMfusion has ceased updates to the package and it no longer builds with kernel 6.8 which has now released for Fedora 38 and 39. Also the `-550` extra driver version tag has been removed as the latest driver will always be included.**
4540

4641
The majority of the drivers are tagged with `KERNEL_TYPE-FEDORA_RELEASE`. NVIDIA drivers are bundled distinctly with tag `KERNEL_TYPE-FEDORA_RELEASE-NVIDIA_VERSION`.
4742

4843
| KERNEL_TYPE | FEDORA_RELEASE | TAG |
4944
| - | - | - |
50-
| Fedora stock kernel | 38 | `main-38`, `main-38-550` |
51-
| | 39 | `main-39`, `main-39-550` |
52-
| | 40 | `main-40`, `main-40-550` |
53-
| [patched for ASUS devices](https://copr.fedorainfracloud.org/coprs/lukenukem/asus-kernel) | 39 | `asus-39`, `asus-39-550` |
54-
| | 40 | `asus-40`, `asus-40-550` |
55-
| [patched fsync](https://copr.fedorainfracloud.org/coprs/sentry/kernel-fsync) | 39 | `fsync-39`, `fsync-39-550` |
56-
| [patched Microsoft Surface devices](https://github.com/linux-surface/linux-surface/) | 39 | `surface-39`, `surface-39-550` |
57-
| | 40 | `surface-40`, `surface-40-550` |
45+
| Fedora stock kernel | 38 | `main-38` |
46+
| | 39 | `main-39` |
47+
| | 40 | `main-40` |
48+
| [patched for ASUS devices](https://copr.fedorainfracloud.org/coprs/lukenukem/asus-kernel) | 39 | `asus-39`|
49+
| | 40 | `asus-40` |
50+
| [patched fsync](https://copr.fedorainfracloud.org/coprs/sentry/kernel-fsync) | 39 | `fsync-39` |
51+
| [patched Microsoft Surface devices](https://github.com/linux-surface/linux-surface/) | 39 | `surface-39` |
52+
| | 40 | `surface-40` |
5853

5954

6055

build-kmod-bmi160.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

build-kmod-bmi260.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

build-kmod-bmi323.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)