summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-10-11 20:46:02 +0200
committerChristian Breunig <christian@breunig.cc>2026-10-11 20:46:56 +0200
commit78005f0e70ca1f410a4edfc613c36e8a8dc3d29d (patch)
tree063b24eec462d99246a8f4e92dd33a9a0b07a16a /scripts
parent0f68fbb9d2f61ded7f9ba141d19cdde24bda7f39 (diff)
downloadvyos-build-78005f0e70ca1f410a4edfc613c36e8a8dc3d29d.tar.gz
vyos-build-78005f0e70ca1f410a4edfc613c36e8a8dc3d29d.zip
Kernel: T9197: package iwlwifi firmware the 6.18 driver actually loads
Firmware was selected by exact match against the names a driver declares. On 6.18 iwlwifi declares only its highest API version, while at runtime it falls back to lower versions, and for Wi-Fi 6/6E parts it caps the API at the MAC family limit. linux-firmware ships none of the declared names, so BE200, AX201, AX210, AX211 and AX411 were left without firmware. For each declared iwlwifi name, the newest available ucode at or below the declared version (core 99 falls back to API 101) is now packaged, together with its PNVM file. Names with no loadable firmware emit a build warning.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/package-build/linux-kernel/build-linux-firmware.sh24
-rw-r--r--scripts/package-build/linux-kernel/package.toml2
2 files changed, 25 insertions, 1 deletions
diff --git a/scripts/package-build/linux-kernel/build-linux-firmware.sh b/scripts/package-build/linux-kernel/build-linux-firmware.sh
index db6f69f9..b3ad6b7b 100755
--- a/scripts/package-build/linux-kernel/build-linux-firmware.sh
+++ b/scripts/package-build/linux-kernel/build-linux-firmware.sh
@@ -51,6 +51,30 @@ mkdir -p "${LINUX_FIRMWARE_BUILD_DIR}"
./copy-firmware.sh "${CWD}/${LINUX_FIRMWARE_BUILD_DIR}"
)
+# iwlwifi declares only its highest API/core version, but falls back to older
+# API versions at runtime - which are often the only ones linux-firmware ships.
+# Add the newest available ucode at or below the declared version, plus PNVM.
+IWL_DIR="${LINUX_FIRMWARE_BUILD_DIR}/intel/iwlwifi"
+for FW in $(echo "${FW_FILES}" | grep -E '^iwlwifi-.*-(c99|[0-9]+)\.ucode$' | sort -u); do
+ PREFIX=$(echo "${FW}" | sed -E 's/-(c99|[0-9]+)\.ucode$//')
+ MAX_API=$(echo "${FW}" | sed -E 's/.*-([0-9]+)\.ucode$/\1/')
+ # Driver fallback from core 99 continues with API 101
+ if echo "${FW}" | grep -q -- '-c99\.ucode$'; then
+ MAX_API=101
+ fi
+ API=$(ls "${IWL_DIR}" | sed -nE "s/^${PREFIX}-([0-9]+)\.ucode$/\1/p" | \
+ awk -v max=${MAX_API} '$1 <= max' | sort -n | tail -1)
+ if [ -n "${API}" ]; then
+ FW_FILES="${FW_FILES} ${PREFIX}-${API}.ucode"
+ else
+ echo "W: no loadable iwlwifi firmware found for: ${FW}"
+ fi
+ if [ -f "${IWL_DIR}/${PREFIX}.pnvm" ]; then
+ FW_FILES="${FW_FILES} ${PREFIX}.pnvm"
+ fi
+done
+FW_FILES=$(echo ${FW_FILES} | tr ' ' '\n' | sort -u)
+
# Copy firmware file from linux firmware build directory into
# assembly folder for the vyos-firmware package
SED_REPLACE="s@${CWD}/${LINUX_FIRMWARE}/@@"
diff --git a/scripts/package-build/linux-kernel/package.toml b/scripts/package-build/linux-kernel/package.toml
index 5295dd6b..28131787 100644
--- a/scripts/package-build/linux-kernel/package.toml
+++ b/scripts/package-build/linux-kernel/package.toml
@@ -12,7 +12,7 @@ build_cmd = "build_kernel"
[[packages]]
name = "linux-firmware"
-commit_id = "20260410"
+commit_id = "20260916"
scm_url = "https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git"
build_cmd = "build_linux_firmware"