From f925a59982c04be9a28a4d0c5ab03502d88bfb8b Mon Sep 17 00:00:00 2001 From: Noel Georgi Date: Tue, 19 Nov 2024 15:36:15 +0530 Subject: [PATCH] chore: combine i915/amdgpu firmware+drivers Combine the i915/amdgpu firmware and drivers and package them together. Fixes: https://github.com/siderolabs/talos/issues/9728 Signed-off-by: Noel Georgi --- .kres.yaml | 4 +- Makefile | 9 +++-- README.md | 15 ++++--- drm/amdgpu/files/modules.txt | 5 +++ .../amdgpu}/manifest.yaml | 4 +- drm/amdgpu/pkg.yaml | 39 +++++++++++++++++++ drm/amdgpu/vars.yaml | 1 + drm/i915/files/modules.txt | 4 ++ .../i915-ucode => drm/i915}/manifest.yaml | 4 +- drm/i915/pkg.yaml | 39 +++++++++++++++++++ drm/i915/vars.yaml | 1 + firmware/amdgpu-firmware/pkg.yaml | 25 ------------ firmware/amdgpu-firmware/vars.yaml | 1 - firmware/i915-ucode/pkg.yaml | 25 ------------ firmware/i915-ucode/vars.yaml | 1 - hack/release.toml | 8 ++++ 16 files changed, 118 insertions(+), 67 deletions(-) create mode 100644 drm/amdgpu/files/modules.txt rename {firmware/amdgpu-firmware => drm/amdgpu}/manifest.yaml (60%) create mode 100644 drm/amdgpu/pkg.yaml create mode 100644 drm/amdgpu/vars.yaml create mode 100644 drm/i915/files/modules.txt rename {firmware/i915-ucode => drm/i915}/manifest.yaml (59%) create mode 100644 drm/i915/pkg.yaml create mode 100644 drm/i915/vars.yaml delete mode 100644 firmware/amdgpu-firmware/pkg.yaml delete mode 100644 firmware/amdgpu-firmware/vars.yaml delete mode 100644 firmware/i915-ucode/pkg.yaml delete mode 100644 firmware/i915-ucode/vars.yaml diff --git a/.kres.yaml b/.kres.yaml index f8d4a0d7..19d50615 100644 --- a/.kres.yaml +++ b/.kres.yaml @@ -2,7 +2,7 @@ kind: pkgfile.Build spec: targets: - - amdgpu-firmware + - amdgpu - amd-ucode - binfmt-misc - bnx2-bnx2x @@ -18,7 +18,7 @@ spec: - gvisor - gvisor-debug - hello-world-service - - i915-ucode + - i915 - intel-ice-firmware - intel-ucode - iscsi-tools diff --git a/Makefile b/Makefile index 7fa2b768..8c98fc6d 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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)" @@ -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 @@ -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 diff --git a/README.md b/README.md index 770114bf..f9c53ead 100644 --- a/README.md +++ b/README.md @@ -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](drm/amdgpu/) | [ghcr.io/siderolabs/amdgpu](https://github.com/siderolabs/extensions/pkgs/container/amdgpu) | AMD GPU firmware and drivers | `linux firmware version`-`talos version` | +| [i915](drm/i915/) | [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 | @@ -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` | diff --git a/drm/amdgpu/files/modules.txt b/drm/amdgpu/files/modules.txt new file mode 100644 index 00000000..17ceac73 --- /dev/null +++ b/drm/amdgpu/files/modules.txt @@ -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 diff --git a/firmware/amdgpu-firmware/manifest.yaml b/drm/amdgpu/manifest.yaml similarity index 60% rename from firmware/amdgpu-firmware/manifest.yaml rename to drm/amdgpu/manifest.yaml index e6279a3e..10fed7ee 100644 --- a/firmware/amdgpu-firmware/manifest.yaml +++ b/drm/amdgpu/manifest.yaml @@ -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" diff --git a/drm/amdgpu/pkg.yaml b/drm/amdgpu/pkg.yaml new file mode 100644 index 00000000..0d8606c2 --- /dev/null +++ b/drm/amdgpu/pkg.yaml @@ -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//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: / diff --git a/drm/amdgpu/vars.yaml b/drm/amdgpu/vars.yaml new file mode 100644 index 00000000..65478e12 --- /dev/null +++ b/drm/amdgpu/vars.yaml @@ -0,0 +1 @@ +VERSION: "{{ .LINUX_FIRMWARE_VERSION }}-{{ .BUILD_ARG_TAG }}" diff --git a/drm/i915/files/modules.txt b/drm/i915/files/modules.txt new file mode 100644 index 00000000..30a4616d --- /dev/null +++ b/drm/i915/files/modules.txt @@ -0,0 +1,4 @@ +modules.order +modules.builtin +modules.builtin.modinfo +kernel/drivers/gpu/drm/i915/i915.ko diff --git a/firmware/i915-ucode/manifest.yaml b/drm/i915/manifest.yaml similarity index 59% rename from firmware/i915-ucode/manifest.yaml rename to drm/i915/manifest.yaml index 4aa8b212..e355ce21 100644 --- a/firmware/i915-ucode/manifest.yaml +++ b/drm/i915/manifest.yaml @@ -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" diff --git a/drm/i915/pkg.yaml b/drm/i915/pkg.yaml new file mode 100644 index 00000000..a3cc091e --- /dev/null +++ b/drm/i915/pkg.yaml @@ -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//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: / diff --git a/drm/i915/vars.yaml b/drm/i915/vars.yaml new file mode 100644 index 00000000..65478e12 --- /dev/null +++ b/drm/i915/vars.yaml @@ -0,0 +1 @@ +VERSION: "{{ .LINUX_FIRMWARE_VERSION }}-{{ .BUILD_ARG_TAG }}" diff --git a/firmware/amdgpu-firmware/pkg.yaml b/firmware/amdgpu-firmware/pkg.yaml deleted file mode 100644 index 67d52798..00000000 --- a/firmware/amdgpu-firmware/pkg.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: amdgpu-firmware -variant: scratch -shell: /toolchain/bin/bash -dependencies: - - stage: base - - image: "{{ .BUILD_ARG_PKGS_PREFIX }}/linux-firmware:{{ .BUILD_ARG_PKGS }}" -steps: - - prepare: - - | - sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml - install: - - | - mkdir -p /rootfs/lib/firmware - cp -R -p /lib/firmware/amdgpu /rootfs/lib/firmware - test: - - | - 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}" -finalize: - - from: /rootfs - to: /rootfs - - from: /pkg/manifest.yaml - to: / diff --git a/firmware/amdgpu-firmware/vars.yaml b/firmware/amdgpu-firmware/vars.yaml deleted file mode 100644 index 4d4aca48..00000000 --- a/firmware/amdgpu-firmware/vars.yaml +++ /dev/null @@ -1 +0,0 @@ -VERSION: "{{ .LINUX_FIRMWARE_VERSION }}" diff --git a/firmware/i915-ucode/pkg.yaml b/firmware/i915-ucode/pkg.yaml deleted file mode 100644 index 3dd76d3e..00000000 --- a/firmware/i915-ucode/pkg.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: i915-ucode -variant: scratch -shell: /toolchain/bin/bash -dependencies: - - stage: base - - image: "{{ .BUILD_ARG_PKGS_PREFIX }}/linux-firmware:{{ .BUILD_ARG_PKGS }}" -steps: - - prepare: - - | - sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml - install: - - | - mkdir -p /rootfs/lib/firmware - cp -R -p /lib/firmware/i915 /rootfs/lib/firmware - test: - - | - 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}" -finalize: - - from: /rootfs - to: /rootfs - - from: /pkg/manifest.yaml - to: / diff --git a/firmware/i915-ucode/vars.yaml b/firmware/i915-ucode/vars.yaml deleted file mode 100644 index 4d4aca48..00000000 --- a/firmware/i915-ucode/vars.yaml +++ /dev/null @@ -1 +0,0 @@ -VERSION: "{{ .LINUX_FIRMWARE_VERSION }}" diff --git a/hack/release.toml b/hack/release.toml index 386e31cb..83cd6656 100644 --- a/hack/release.toml +++ b/hack/release.toml @@ -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]