From 37654176b0edec665e9c0933545118f3b93d6f59 Mon Sep 17 00:00:00 2001 From: Noel Georgi Date: Thu, 14 Sep 2023 13:53:23 +0200 Subject: [PATCH] chore: use kernel image for upstream modules Use the published kernel image to depend on modules coming from upstream kernel. Part of: https://github.com/siderolabs/pkgs/issues/805 Signed-off-by: Noel Georgi --- drivers/thunderbolt/files/modules.txt | 5 ++++ drivers/thunderbolt/pkg.yaml | 13 +++++++--- drivers/usb-modem/files/modules.txt | 37 +++++++++++++++++++++++++++ drivers/usb-modem/pkg.yaml | 13 +++++++--- storage/btrfs/files/modules.txt | 8 ++++++ storage/btrfs/pkg.yaml | 13 +++++++--- 6 files changed, 80 insertions(+), 9 deletions(-) create mode 100644 drivers/thunderbolt/files/modules.txt create mode 100644 drivers/usb-modem/files/modules.txt create mode 100644 storage/btrfs/files/modules.txt diff --git a/drivers/thunderbolt/files/modules.txt b/drivers/thunderbolt/files/modules.txt new file mode 100644 index 00000000..4ad4e5ac --- /dev/null +++ b/drivers/thunderbolt/files/modules.txt @@ -0,0 +1,5 @@ +modules.order +modules.builtin +modules.builtin.modinfo +kernel/drivers/thunderbolt/thunderbolt.ko +kernel/drivers/net/thunderbolt-net.ko diff --git a/drivers/thunderbolt/pkg.yaml b/drivers/thunderbolt/pkg.yaml index e23c5296..fb50f8db 100644 --- a/drivers/thunderbolt/pkg.yaml +++ b/drivers/thunderbolt/pkg.yaml @@ -5,16 +5,23 @@ 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: "{{ .PKGS_PREFIX }}/thunderbolt-pkg:{{ .BUILD_ARG_PKGS }}" + - image: "{{ .PKGS_PREFIX }}/kernel:{{ .BUILD_ARG_PKGS }}" steps: - prepare: - | sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml - install: - | - mkdir -p /rootfs/lib/modules + export KERNELRELEASE=$(find /lib/modules -type d -name "*-talos" -exec basename {} \+) - cp -R /lib/modules/* /rootfs/lib/modules + mkdir -p /rootfs + + xargs -a /pkg/files/modules.txt -I {} install -D /lib/modules/${KERNELRELEASE}/{} /rootfs/lib/modules/${KERNELRELEASE}/{} + depmod -b /rootfs ${KERNELRELEASE} + - 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~' {} \+ finalize: - from: /rootfs to: /rootfs diff --git a/drivers/usb-modem/files/modules.txt b/drivers/usb-modem/files/modules.txt new file mode 100644 index 00000000..2ce67174 --- /dev/null +++ b/drivers/usb-modem/files/modules.txt @@ -0,0 +1,37 @@ +modules.order +modules.builtin +modules.builtin.modinfo +kernel/drivers/net/usb/dm9601.ko +kernel/drivers/net/usb/rndis_host.ko +kernel/drivers/net/usb/smsc75xx.ko +kernel/drivers/net/usb/sierra_net.ko +kernel/drivers/net/usb/cdc_subset.ko +kernel/drivers/net/usb/int51x1.ko +kernel/drivers/net/usb/cdc_eem.ko +kernel/drivers/net/usb/cdc_ncm.ko +kernel/drivers/net/usb/zaurus.ko +kernel/drivers/net/usb/net1080.ko +kernel/drivers/net/usb/qmi_wwan.ko +kernel/drivers/net/usb/mcs7830.ko +kernel/drivers/net/usb/aqc111.ko +kernel/drivers/net/usb/sr9700.ko +kernel/drivers/net/usb/usbnet.ko +kernel/drivers/net/usb/sr9800.ko +kernel/drivers/net/usb/plusb.ko +kernel/drivers/net/usb/lg-vl600.ko +kernel/drivers/net/usb/cdc-phonet.ko +kernel/drivers/net/usb/smsc95xx.ko +kernel/drivers/net/usb/gl620a.ko +kernel/drivers/net/usb/r8153_ecm.ko +kernel/drivers/net/usb/cdc_ether.ko +kernel/drivers/net/usb/cx82310_eth.ko +kernel/drivers/net/usb/huawei_cdc_ncm.ko +kernel/drivers/net/usb/kalmia.ko +kernel/drivers/net/usb/asix.ko +kernel/drivers/net/usb/cdc_mbim.ko +kernel/drivers/net/usb/ax88179_178a.ko +kernel/drivers/net/phy/smsc.ko +kernel/drivers/net/phy/ax88796b.ko +kernel/drivers/usb/class/cdc-wdm.ko +kernel/drivers/usb/serial/usb_wwan.ko +kernel/drivers/usb/serial/option.ko diff --git a/drivers/usb-modem/pkg.yaml b/drivers/usb-modem/pkg.yaml index e3f7bb0c..91043fec 100644 --- a/drivers/usb-modem/pkg.yaml +++ b/drivers/usb-modem/pkg.yaml @@ -5,16 +5,23 @@ 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: "{{ .PKGS_PREFIX }}/usb-modem-drivers-pkg:{{ .BUILD_ARG_PKGS }}" + - image: "{{ .PKGS_PREFIX }}/kernel:{{ .BUILD_ARG_PKGS }}" steps: - prepare: - | sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml - install: - | - mkdir -p /rootfs/lib/modules + export KERNELRELEASE=$(find /lib/modules -type d -name "*-talos" -exec basename {} \+) - cp -R /lib/modules/* /rootfs/lib/modules + mkdir -p /rootfs + + xargs -a /pkg/files/modules.txt -I {} install -D /lib/modules/${KERNELRELEASE}/{} /rootfs/lib/modules/${KERNELRELEASE}/{} + depmod -b /rootfs ${KERNELRELEASE} + - 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~' {} \+ finalize: - from: /rootfs to: /rootfs diff --git a/storage/btrfs/files/modules.txt b/storage/btrfs/files/modules.txt new file mode 100644 index 00000000..ecc8e6b4 --- /dev/null +++ b/storage/btrfs/files/modules.txt @@ -0,0 +1,8 @@ +modules.order +modules.builtin +modules.builtin.modinfo +kernel/crypto/blake2b_generic.ko +kernel/crypto/zstd.ko +kernel/crypto/xxhash_generic.ko +kernel/lib/zstd/zstd_compress.ko +kernel/fs/btrfs/btrfs.ko diff --git a/storage/btrfs/pkg.yaml b/storage/btrfs/pkg.yaml index 0160dcd6..5bc3e73b 100644 --- a/storage/btrfs/pkg.yaml +++ b/storage/btrfs/pkg.yaml @@ -5,16 +5,23 @@ 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: "{{ .PKGS_PREFIX }}/btrfs-pkg:{{ .BUILD_ARG_PKGS }}" + - image: "{{ .PKGS_PREFIX }}/kernel:{{ .BUILD_ARG_PKGS }}" steps: - prepare: - | sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml - install: - | - mkdir -p /rootfs/lib/modules + export KERNELRELEASE=$(find /lib/modules -type d -name "*-talos" -exec basename {} \+) - cp -R /lib/modules/* /rootfs/lib/modules + mkdir -p /rootfs + + xargs -a /pkg/files/modules.txt -I {} install -D /lib/modules/${KERNELRELEASE}/{} /rootfs/lib/modules/${KERNELRELEASE}/{} + depmod -b /rootfs ${KERNELRELEASE} + - 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~' {} \+ finalize: - from: /rootfs to: /rootfs