diff options
Diffstat (limited to 'scripts/package-build/linux-kernel')
3 files changed, 62 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 6fc44067..9bf74ed2 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" diff --git a/scripts/package-build/linux-kernel/patches/ipt-netflow/0005-Fix-build-with-sockaddr_unsized-bind-callbacks.patch b/scripts/package-build/linux-kernel/patches/ipt-netflow/0005-Fix-build-with-sockaddr_unsized-bind-callbacks.patch new file mode 100644 index 00000000..61f18372 --- /dev/null +++ b/scripts/package-build/linux-kernel/patches/ipt-netflow/0005-Fix-build-with-sockaddr_unsized-bind-callbacks.patch @@ -0,0 +1,37 @@ +From: Christian Breunig <christian@vyos.io> +Subject: [PATCH] Fix build with sockaddr_unsized proto_ops bind() + +Kernel commit 0e50474fa514 ("net: Convert proto_ops bind() callbacks to +use sockaddr_unsized") changed the bind() callback to take a +struct sockaddr_unsized pointer. It was backported to 6.18.y stable, so +detect it with a compile test instead of a version check. +--- +diff --git a/gen_compat_def b/gen_compat_def +index d267b5a..134df99 100755 +--- a/gen_compat_def ++++ b/gen_compat_def +@@ -152,6 +152,8 @@ kbuild_test_ref totalram_pages linux/mm.h + kbuild_test_member nf_ct_event_notifier.ct_event net/netfilter/nf_conntrack_ecache.h + # 6.4: 0199849acd07 ("sysctl: remove register_sysctl_paths()") + kbuild_test_symbol register_sysctl_paths linux/sysctl.h ++# 0e50474fa514 ("net: Convert proto_ops bind() callbacks to use sockaddr_unsized") ++kbuild_test_struct sockaddr_unsized linux/socket.h + + echo "// End of compat_def.h" + +diff --git a/ipt_NETFLOW.c b/ipt_NETFLOW.c +index 7ed9fe6..69f5c40 100644 +--- a/ipt_NETFLOW.c ++++ b/ipt_NETFLOW.c +@@ -1936,7 +1936,11 @@ static struct socket *usock_open_sock(struct ipt_netflow_sock *usock) + salen = sizeof(struct sockaddr_in); + else if (usock->saddr.ss_family == AF_INET6) + salen = sizeof(struct sockaddr_in6); ++#ifdef HAVE_SOCKADDR_UNSIZED ++ if ((error = sock->ops->bind(sock, (struct sockaddr_unsized *)&usock->saddr, salen)) < 0) { ++#else + if ((error = sock->ops->bind(sock, (struct sockaddr *)&usock->saddr, salen)) < 0) { ++#endif + printk(KERN_ERR "ipt_NETFLOW: error binding socket %d\n", -error); + goto err_free_sock; + } |
