Skip to content

Commit

Permalink
chore: use kernel image for upstream modules
Browse files Browse the repository at this point in the history
Use the published kernel image to depend on modules coming from upstream
kernel.

Part of: siderolabs/pkgs#805

Signed-off-by: Noel Georgi <git@frezbo.dev>
  • Loading branch information
frezbo committed Sep 14, 2023
1 parent 8fa50a2 commit 3765417
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 9 deletions.
5 changes: 5 additions & 0 deletions drivers/thunderbolt/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/thunderbolt/thunderbolt.ko
kernel/drivers/net/thunderbolt-net.ko
13 changes: 10 additions & 3 deletions drivers/thunderbolt/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/<talos version>/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
Expand Down
37 changes: 37 additions & 0 deletions drivers/usb-modem/files/modules.txt
Original file line number Diff line number Diff line change
@@ -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
13 changes: 10 additions & 3 deletions drivers/usb-modem/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/<talos version>/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
Expand Down
8 changes: 8 additions & 0 deletions storage/btrfs/files/modules.txt
Original file line number Diff line number Diff line change
@@ -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
13 changes: 10 additions & 3 deletions storage/btrfs/pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/<talos version>/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
Expand Down

0 comments on commit 3765417

Please sign in to comment.