Skip to content

Commit

Permalink
chore: combine i915/amdgpu firmware+drivers
Browse files Browse the repository at this point in the history
Combine the i915/amdgpu firmware and drivers and package them together.

Fixes: siderolabs/talos#9728

Signed-off-by: Noel Georgi <git@frezbo.dev>
  • Loading branch information
frezbo committed Nov 19, 2024
1 parent 9753dd5 commit ab2ef2d
Show file tree
Hide file tree
Showing 16 changed files with 118 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .kres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
kind: pkgfile.Build
spec:
targets:
- amdgpu-firmware
- amdgpu
- amd-ucode
- binfmt-misc
- bnx2-bnx2x
Expand All @@ -18,7 +18,7 @@ spec:
- gvisor
- gvisor-debug
- hello-world-service
- i915-ucode
- i915
- intel-ice-firmware
- intel-ucode
- iscsi-tools
Expand Down
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-11-13T13:17:18Z by kres c0e2b63.
# Generated on 2024-11-19T09:18:52Z by kres a8af16d.

# common variables

Expand Down Expand Up @@ -36,12 +36,13 @@ PLATFORM ?= linux/amd64,linux/arm64
PROGRESS ?= auto
PUSH ?= false
CI_ARGS ?=
BUILDKIT_MULTI_PLATFORM ?= 1
COMMON_ARGS = --file=Pkgfile
COMMON_ARGS += --provenance=false
COMMON_ARGS += --progress=$(PROGRESS)
COMMON_ARGS += --platform=$(PLATFORM)
COMMON_ARGS += --build-arg=SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH)
COMMON_ARGS += --build-arg=BUILDKIT_MULTI_PLATFORM=1
COMMON_ARGS += --build-arg=BUILDKIT_MULTI_PLATFORM=$(BUILDKIT_MULTI_PLATFORM)
COMMON_ARGS += --build-arg=TAG="$(TAG)"
COMMON_ARGS += --build-arg=PKGS="$(PKGS)"
COMMON_ARGS += --build-arg=PKGS_PREFIX="$(PKGS_PREFIX)"
Expand All @@ -54,7 +55,7 @@ PKGS_PREFIX ?= ghcr.io/siderolabs

# targets defines all the available targets

TARGETS = amdgpu-firmware
TARGETS = amdgpu
TARGETS += amd-ucode
TARGETS += binfmt-misc
TARGETS += bnx2-bnx2x
Expand All @@ -70,7 +71,7 @@ TARGETS += glibc
TARGETS += gvisor
TARGETS += gvisor-debug
TARGETS += hello-world-service
TARGETS += i915-ucode
TARGETS += i915
TARGETS += intel-ice-firmware
TARGETS += intel-ucode
TARGETS += iscsi-tools
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,20 @@ cosign verify --certificate-identity-regexp '@siderolabs\.com$' --certificate-oi
| Name | Image | Description | Version Format |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | --------------------------- | ------------------------ |
| [amd-ucode](firmware/amd-ucode/) | [ghcr.io/siderolabs/amd-ucode](https://github.com/siderolabs/extensions/pkgs/container/amd-ucode) | AMD CPU microcode updates | `linux firmware version` |
| [amdgpu-firmware](firmware/amdgpu-firmware/) | [ghcr.io/siderolabs/amdgpu-firmware](https://github.com/siderolabs/extensions/pkgs/container/amdgpu-firmware) | AMD GPU firmware | `linux firmware version` |
| [bnx2-bnx2x](firmware/bnx2-bnx2x/) | [ghcr.io/siderolabs/bnx2-bnx2x](https://github.com/siderolabs/extensions/pkgs/container/bnx2-bnx2x) | Broadcom NetXtreme firmware | `linux firmware version` |
| [chelsio-firmware](firmware/chelsio-firmware/) | [ghcr.io/siderolabs/chelsio-firmware](https://github.com/siderolabs/extensions/pkgs/container/chelsio-firmware) | Chelsio NIC firmware | `linux firmware version` |
| [i915-ucode](firmware/i915-ucode/) | [ghcr.io/siderolabs/i915-ucode](https://github.com/siderolabs/extensions/pkgs/container/i915-ucode) | Intel GPU firmware | `linux firmware version` |
| [intel-ice-firmware](firmware/intel-ice-firmware/) | [ghcr.io/siderolabs/intel-ice-firmware](https://github.com/siderolabs/extensions/pkgs/container/intel-ice-firmware) | Intel ICE NIC firmware | `linux firmware version` |
| [intel-ucode](firmware/intel-ucode/) | [ghcr.io/siderolabs/intel-ucode](https://github.com/siderolabs/extensions/pkgs/container/intel-ucode) | Intel CPU microcode updates | `upstream version` |
| [qlogic-firmware](firmware/qlogic-firmware/) | [ghcr.io/siderolabs/qlogic-firmware](https://github.com/siderolabs/extensions/pkgs/container/qlogic-firmware) | Qlogic firmware | `linux firmware version` |
| [realtek-firmware](firmware/realtek-firmware/) | [ghcr.io/siderolabs/realtek-firmware](https://github.com/siderolabs/extensions/pkgs/container/realtek-firmware) | Realtek firmware | `linux firmware version` |

### Direct Rendering Manager (DRM)

| Name | Image | Description | Version Format |
| ----------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------ | ---------------------------------------- |
| [amdgpu](firmware/amdgpu-firmware/) | [ghcr.io/siderolabs/amdgpu](https://github.com/siderolabs/extensions/pkgs/container/amdgpu) | AMD GPU firmware and drivers | `linux firmware version`-`talos version` |
| [i915](firmware/i915-ucode/) | [ghcr.io/siderolabs/i915](https://github.com/siderolabs/extensions/pkgs/container/i915) | Intel GPU firmware and drivers | `linux firmware version`-`talos version` |

### Drivers

| Name | Image | Description | Version Format |
Expand Down Expand Up @@ -103,14 +108,14 @@ cosign verify --certificate-identity-regexp '@siderolabs\.com$' --certificate-oi

### Power

| Name | Image | Description | Version Format |
| ------------------------------- | --------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------ |
| Name | Image | Description | Version Format |
| ------------------------------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ------------------ |
| [nut-client](power/nut-client/) | [ghcr.io/siderolabs/nut-client](https://github.com/siderolabs/extensions/pkgs/container/nut-client) | [Network UPS Tools](https://networkupstools.org) upsmon client | `upstream version` |

### Guest Agents

| Name | Image | Description | Version Format |
|------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------|--------------------|
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------------ |
| [metal-agent](guest-agents/metal-agent/) | [ghcr.io/siderolabs/metal-agent](https://github.com/siderolabs/extensions/pkgs/container/metal-agent) | [Talos Metal Agent](https://github.com/siderolabs/talos-metal-agent) | `upstream version` |
| [qemu-guest-agent](guest-agents/qemu-guest-agent/) | [ghcr.io/siderolabs/qemu-guest-agent](https://github.com/siderolabs/extensions/pkgs/container/qemu-guest-agent) | [QEMU Guest Agent](https://wiki.qemu.org/Features/GuestAgent) | `upstream version` |
| [xe-guest-utilities](guest-agents/xe-guest-utilities/) | [ghcr.io/siderolabs/xe-guest-utilities](https://github.com/siderolabs/extensions/pkgs/container/xe-guest-utilities) | [xe-guest-utilities](https://github.com/xenserver/xe-guest-utilitiest) | `upstream version` |
Expand Down
5 changes: 5 additions & 0 deletions drm/amdgpu/files/modules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
modules.order
modules.builtin
modules.builtin.modinfo
kernel/drivers/gpu/drm/amd/amdgpu/amdgpu.ko
kernel/drivers/gpu/drm/amd/amdxcp/amdxcp.ko
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: v1alpha1
metadata:
name: amdgpu-firmware
name: amdgpu
version: "$VERSION"
author: Sidero Labs
description: |
This system extension provides AMDGPU firmware binaries.
This system extension provides AMDGPU firmware binaries and kernel modules.
compatibility:
talos:
version: ">= v1.0.0"
39 changes: 39 additions & 0 deletions drm/amdgpu/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: amdgpu
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: base
# The pkgs version for a particular release of Talos as defined in
# https://github.com/siderolabs/talos/blob/<talos version>/pkg/machinery/gendata/data/pkgs
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/kernel:{{ .BUILD_ARG_PKGS }}"
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/linux-firmware:{{ .BUILD_ARG_PKGS }}"
steps:
- prepare:
- |
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
mkdir -p /rootfs
# {{ if eq .ARCH "x86_64" }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- install:
- |
export KERNELRELEASE=$(find /lib/modules -type d -name "*-talos" -exec basename {} \+)
xargs -a /pkg/files/modules.txt -I {} install -D /lib/modules/${KERNELRELEASE}/{} /rootfs/lib/modules/${KERNELRELEASE}/{}
- |
mkdir -p /rootfs/lib/firmware
cp -R -p /lib/firmware/amdgpu /rootfs/lib/firmware
- test:
- |
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
# {{ end }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
finalize:
- from: /rootfs
to: /rootfs
- from: /pkg/manifest.yaml
to: /
1 change: 1 addition & 0 deletions drm/amdgpu/vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION: "{{ .LINUX_FIRMWARE_VERSION }}-{{ .BUILD_ARG_TAG }}"
4 changes: 4 additions & 0 deletions drm/i915/files/modules.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
modules.order
modules.builtin
modules.builtin.modinfo
kernel/drivers/gpu/drm/i915/i915.ko
4 changes: 2 additions & 2 deletions firmware/i915-ucode/manifest.yaml → drm/i915/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
version: v1alpha1
metadata:
name: i915-ucode
name: i915
version: "$VERSION"
author: Sidero Labs
description: |
This system extension provides Intel GPU microcode binaries.
This system extension provides Intel GPU microcode binaries and kernel modules.
compatibility:
talos:
version: ">= v1.0.0"
39 changes: 39 additions & 0 deletions drm/i915/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: i915
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: base
# The pkgs version for a particular release of Talos as defined in
# https://github.com/siderolabs/talos/blob/<talos version>/pkg/machinery/gendata/data/pkgs
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/kernel:{{ .BUILD_ARG_PKGS }}"
- image: "{{ .BUILD_ARG_PKGS_PREFIX }}/linux-firmware:{{ .BUILD_ARG_PKGS }}"
steps:
- prepare:
- |
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
mkdir -p /rootfs
# {{ if eq .ARCH "x86_64" }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- install:
- |
export KERNELRELEASE=$(find /lib/modules -type d -name "*-talos" -exec basename {} \+)
xargs -a /pkg/files/modules.txt -I {} install -D /lib/modules/${KERNELRELEASE}/{} /rootfs/lib/modules/${KERNELRELEASE}/{}
- |
mkdir -p /rootfs/lib/firmware
cp -R -p /lib/firmware/i915 /rootfs/lib/firmware
- test:
- |
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+
- |
mkdir -p /extensions-validator-rootfs
cp -r /rootfs/ /extensions-validator-rootfs/rootfs
cp /pkg/manifest.yaml /extensions-validator-rootfs/manifest.yaml
/extensions-validator validate --rootfs=/extensions-validator-rootfs --pkg-name="${PKG_NAME}"
# {{ end }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
finalize:
- from: /rootfs
to: /rootfs
- from: /pkg/manifest.yaml
to: /
1 change: 1 addition & 0 deletions drm/i915/vars.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VERSION: "{{ .LINUX_FIRMWARE_VERSION }}-{{ .BUILD_ARG_TAG }}"
25 changes: 0 additions & 25 deletions firmware/amdgpu-firmware/pkg.yaml

This file was deleted.

1 change: 0 additions & 1 deletion firmware/amdgpu-firmware/vars.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions firmware/i915-ucode/pkg.yaml

This file was deleted.

1 change: 0 additions & 1 deletion firmware/i915-ucode/vars.yaml

This file was deleted.

8 changes: 8 additions & 0 deletions hack/release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ See [Talos Linux documentation](https://www.talos.dev/v1.9/talos-guides/configur
title = "LLDP"
description = """\
lldpd is now available as a system extension.
"""

[notes.drm]
title = "Direct Rendering Manager (DRM)"
description = """\
New `i915` and `amdgpu` extensions are now available.
This combines the previous `i915-ucode` and `amdgpu-firmware` extensions along with the matching kernel modules.
Upgrades via Image Factory will automatically include the new extensions if previously `i915-ucode` or `amdgpu-firmware` were used.
"""

[notes.updates]
Expand Down

0 comments on commit ab2ef2d

Please sign in to comment.