summaryrefslogtreecommitdiff
path: root/scripts/package-build/linux-kernel/build-linux-firmware.sh
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-09-10 18:18:29 +0200
committerChristian Breunig <christian@breunig.cc>2026-09-10 18:18:29 +0200
commit48a0ff08fdae613eba090fca8736b5ec2b1bacf8 (patch)
tree1c9c6ef5edddc01f40a210dcfeb54f58574af1bd /scripts/package-build/linux-kernel/build-linux-firmware.sh
parentef1ee912347e5fa65ca4b20c2de0e695c2150b60 (diff)
downloadvyos-build-48a0ff08fdae613eba090fca8736b5ec2b1bacf8.tar.gz
vyos-build-48a0ff08fdae613eba090fca8736b5ec2b1bacf8.zip
Kernel: T9298: make linux-firmware package architecture aware
Currently when the Kernel is build and creates the vyos-linux-firmware package, the Kernel modules are inspected and the firmware file string is extracted. This is the case for years. Now with ARM64 on the doorstep, we would assemble the vyos-linux-firmware package twice, once for x86_64 and once for amd64. The generated package is for CPU architecture all - as the package is build twice, the longer running build will win -> perfect race condition.
Diffstat (limited to 'scripts/package-build/linux-kernel/build-linux-firmware.sh')
-rwxr-xr-xscripts/package-build/linux-kernel/build-linux-firmware.sh25
1 files changed, 23 insertions, 2 deletions
diff --git a/scripts/package-build/linux-kernel/build-linux-firmware.sh b/scripts/package-build/linux-kernel/build-linux-firmware.sh
index d542327d..db6f69f9 100755
--- a/scripts/package-build/linux-kernel/build-linux-firmware.sh
+++ b/scripts/package-build/linux-kernel/build-linux-firmware.sh
@@ -27,7 +27,10 @@ FW_FILES=$(find ${KERNEL_DIR}/debian/linux-image-${KERNEL_VERSION}${KERNEL_SUFFI
# Debian package will use the descriptive Git commit as version
GIT_COMMIT=$(cd ${CWD}/${LINUX_FIRMWARE}; git describe --always)
VYOS_FIRMWARE_NAME="vyos-linux-firmware"
-VYOS_FIRMWARE_DIR="${VYOS_FIRMWARE_NAME}_${GIT_COMMIT}-0_all"
+# The firmware blobs are selected from the modules of the kernel built on this
+# host, so the package content differs per architecture - build it arch-dependent.
+BUILD_ARCH=$(dpkg --print-architecture)
+VYOS_FIRMWARE_DIR="${VYOS_FIRMWARE_NAME}_${GIT_COMMIT}-0_${BUILD_ARCH}"
if [ -d ${VYOS_FIRMWARE_DIR} ]; then
# remove Debian package folder and deb file from previous runs
rm -rf ${VYOS_FIRMWARE_DIR}*
@@ -107,7 +110,7 @@ Standards-Version: 4.5.1
Rules-Requires-Root: no
Package: ${VYOS_FIRMWARE_NAME}
-Architecture: all
+Architecture: any
Depends: \${misc:Depends}
Description: Binary firmware for various drivers in the Linux kernel
Firmware blobs assembled from linux-firmware.git for the drivers built
@@ -127,6 +130,24 @@ override_dh_auto_build:
override_dh_auto_install:
mkdir -p \${PACKAGE_BUILD_DIR}
cp -a lib \${PACKAGE_BUILD_DIR}/
+
+# Firmware blobs must be shipped verbatim. Some of them are valid ELF objects,
+# so the binary mangling helpers - which only run for arch-dependent packages -
+# would happily strip them or try to resolve library dependencies on them.
+override_dh_strip:
+ @true
+
+override_dh_dwz:
+ @true
+
+override_dh_strip_nondeterminism:
+ @true
+
+override_dh_shlibdeps:
+ @true
+
+override_dh_makeshlibs:
+ @true
EOF
debuild