From 6b962b7043b26260500e98d882e3ee1c165627c2 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 7 May 2026 16:58:35 +0200 Subject: Kernel: T6847: add Intel I40E out-of-tree Kernel driver with custom patches The current version of the Intel i40e driver does not compile with a recent LTS Kernel due to missing internal Kernel API adjustments in the Intel driver. This commit contains custom patches to make the driver build. --- scripts/package-build/linux-kernel/package.toml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/package-build/linux-kernel/package.toml') diff --git a/scripts/package-build/linux-kernel/package.toml b/scripts/package-build/linux-kernel/package.toml index ffed8b39..834f97c2 100644 --- a/scripts/package-build/linux-kernel/package.toml +++ b/scripts/package-build/linux-kernel/package.toml @@ -52,6 +52,12 @@ commit_id = "v5.2.2" scm_url = "http://github.com/intel/ethernet-linux-ixgbevf" build_cmd = "build_intel_ixgbevf" +[[packages]] +name = "i40e" +commit_id = "v2.28.16" +scm_url = "http://github.com/intel/ethernet-linux-i40e" +build_cmd = "build_intel_i40e" + [[packages]] name = "jool" commit_id = "" -- cgit v1.2.3 From adc9b031da6c71d393e4c8320a48f0056b6110a8 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 7 May 2026 16:59:22 +0200 Subject: Kernel: T6847: add Intel ICE out-of-tree Kernel driver with custom patches The current version of the Intel ice driver does not compile with a recent LTS Kernel due to missing internal Kernel API adjustments in the Intel driver. This commit contains custom patches to make the driver build. --- data/architectures/amd64.toml | 1 + scripts/package-build/linux-kernel/build.py | 2 +- .../linux-kernel/config/arm64/vyos_defconfig | 3 +- .../linux-kernel/config/x86/vyos_defconfig | 4 +- scripts/package-build/linux-kernel/package.toml | 6 ++ ...ary-device-id-when-mod-devicetable-has-it.patch | 23 +++++++ ...02-auxiliary-bus-type-callback-prototypes.patch | 73 +++++++++++++++++++++ ...-full-ksrc-and-canonical-auxiliary-header.patch | 76 ++++++++++++++++++++++ 8 files changed, 182 insertions(+), 6 deletions(-) create mode 100644 scripts/package-build/linux-kernel/patches/ice/0001-kcompat-have-auxiliary-device-id-when-mod-devicetable-has-it.patch create mode 100644 scripts/package-build/linux-kernel/patches/ice/0002-auxiliary-bus-type-callback-prototypes.patch create mode 100644 scripts/package-build/linux-kernel/patches/ice/0003-check_aux_bus-full-ksrc-and-canonical-auxiliary-header.patch (limited to 'scripts/package-build/linux-kernel/package.toml') diff --git a/data/architectures/amd64.toml b/data/architectures/amd64.toml index 0a979869..9e3c85d0 100644 --- a/data/architectures/amd64.toml +++ b/data/architectures/amd64.toml @@ -8,6 +8,7 @@ packages = [ "vyos-intel-ixgbe", "vyos-intel-ixgbevf", "vyos-intel-i40e", + "vyos-intel-ice", "vyos-ipt-netflow", "intel-microcode", "amd64-microcode" diff --git a/scripts/package-build/linux-kernel/build.py b/scripts/package-build/linux-kernel/build.py index 2b4927eb..625726b9 100755 --- a/scripts/package-build/linux-kernel/build.py +++ b/scripts/package-build/linux-kernel/build.py @@ -145,7 +145,7 @@ def build_package(package: dict, dependencies: list) -> None: elif package['build_cmd'] == 'build_intel_qat': build_intel_qat() elif package['build_cmd'] in ['build_intel_igb', 'build_intel_ixgbe', 'build_intel_ixgbevf', - 'build_intel_i40e']: + 'build_intel_i40e', 'build_intel_ice']: build_intel(package['name'], package['commit_id'], package['scm_url']) elif package['build_cmd'] == 'build_mellanox_ofed': build_mellanox_ofed() diff --git a/scripts/package-build/linux-kernel/config/arm64/vyos_defconfig b/scripts/package-build/linux-kernel/config/arm64/vyos_defconfig index 7f7d1d58..738c0057 100644 --- a/scripts/package-build/linux-kernel/config/arm64/vyos_defconfig +++ b/scripts/package-build/linux-kernel/config/arm64/vyos_defconfig @@ -1835,8 +1835,7 @@ CONFIG_IGBVF=m # CONFIG_I40E is not set CONFIG_IAVF=m CONFIG_I40EVF=m -CONFIG_ICE=m -CONFIG_ICE_SWITCHDEV=y +# CONFIG_ICE is not set # CONFIG_FM10K is not set CONFIG_IGC=m CONFIG_JME=m diff --git a/scripts/package-build/linux-kernel/config/x86/vyos_defconfig b/scripts/package-build/linux-kernel/config/x86/vyos_defconfig index 0b9cbb24..e86c3fe4 100644 --- a/scripts/package-build/linux-kernel/config/x86/vyos_defconfig +++ b/scripts/package-build/linux-kernel/config/x86/vyos_defconfig @@ -1720,9 +1720,7 @@ CONFIG_IGBVF=m # CONFIG_I40E is not set CONFIG_IAVF=m CONFIG_I40EVF=m -CONFIG_ICE=m -CONFIG_ICE_SWITCHDEV=y -CONFIG_ICE_HWTS=y +# CONFIG_ICE is not set # CONFIG_FM10K is not set CONFIG_IGC=m CONFIG_JME=m diff --git a/scripts/package-build/linux-kernel/package.toml b/scripts/package-build/linux-kernel/package.toml index 834f97c2..f4df423b 100644 --- a/scripts/package-build/linux-kernel/package.toml +++ b/scripts/package-build/linux-kernel/package.toml @@ -58,6 +58,12 @@ commit_id = "v2.28.16" scm_url = "http://github.com/intel/ethernet-linux-i40e" build_cmd = "build_intel_i40e" +[[packages]] +name = "ice" +commit_id = "v2.5.4" +scm_url = "http://github.com/intel/ethernet-linux-ice" +build_cmd = "build_intel_ice" + [[packages]] name = "jool" commit_id = "" diff --git a/scripts/package-build/linux-kernel/patches/ice/0001-kcompat-have-auxiliary-device-id-when-mod-devicetable-has-it.patch b/scripts/package-build/linux-kernel/patches/ice/0001-kcompat-have-auxiliary-device-id-when-mod-devicetable-has-it.patch new file mode 100644 index 00000000..3326dd79 --- /dev/null +++ b/scripts/package-build/linux-kernel/patches/ice/0001-kcompat-have-auxiliary-device-id-when-mod-devicetable-has-it.patch @@ -0,0 +1,23 @@ +From: Christian Breunig +Date: Sun, 3 May 2026 20:18:00 +0000 +Subject: [PATCH 1/3] kcompat: HAVE_AUXILIARY_DEVICE_ID when mod_devicetable has it + +--- + src/kcompat-generator.sh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/src/kcompat-generator.sh ++++ b/src/kcompat-generator.sh +@@ -58,9 +58,10 @@ function gen-aux() { + fi + gen HAVE_AUXILIARY_DRIVER_INT_REMOVE if string "$HAVE_AUX_INT_REMOVE" equals 1 + +- # generate HAVE_AUXILIARY_DEVICE_ID only for cases when it's disabled in .config ++ # Whenever mod_devicetable.h defines struct auxiliary_device_id, vendor ++ # auxiliary_bus.h must not redefine it (true for CONFIG_AUXILIARY_BUS=y as well). + HAVE_AUX_DEV_ID=0 +- if ! config_has CONFIG_AUXILIARY_BUS && check struct auxiliary_device_id in "$mh" ; then ++ if check struct auxiliary_device_id in "$mh" ; then + HAVE_AUX_DEV_ID=1 + fi + gen HAVE_AUXILIARY_DEVICE_ID if string "$HAVE_AUX_DEV_ID" equals 1 diff --git a/scripts/package-build/linux-kernel/patches/ice/0002-auxiliary-bus-type-callback-prototypes.patch b/scripts/package-build/linux-kernel/patches/ice/0002-auxiliary-bus-type-callback-prototypes.patch new file mode 100644 index 00000000..76a92576 --- /dev/null +++ b/scripts/package-build/linux-kernel/patches/ice/0002-auxiliary-bus-type-callback-prototypes.patch @@ -0,0 +1,73 @@ +From: Christian Breunig +Date: Sun, 3 May 2026 19:44:00 +0000 +Subject: [PATCH 3/3] auxiliary: align bus callbacks with kernel prototypes + +--- + src/auxiliary.c | 25 ++++++++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +--- a/src/auxiliary.c ++++ b/src/auxiliary.c +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -31,7 +32,7 @@ static const struct auxiliary_device_id *auxiliary_match_id(const struct auxilia + return NULL; + } + +-static int auxiliary_match(struct device *dev, struct device_driver *drv) ++static int auxiliary_match_common(struct device *dev, struct device_driver *drv) + { + struct auxiliary_device *auxdev = to_auxiliary_dev(dev); + struct auxiliary_driver *auxdrv = to_auxiliary_drv(drv); +@@ -39,7 +40,23 @@ static int auxiliary_match(struct device *dev, struct device_driver *drv) + return !!auxiliary_match_id(auxdrv->id_table, auxdev); + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0) ++static int auxiliary_match(struct device *dev, const struct device_driver *drv) ++{ ++ return auxiliary_match_common(dev, (struct device_driver *)drv); ++} ++#else ++static int auxiliary_match(struct device *dev, struct device_driver *drv) ++{ ++ return auxiliary_match_common(dev, drv); ++} ++#endif ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) ++static int auxiliary_uevent(const struct device *dev, struct kobj_uevent_env *env) ++#else + static int auxiliary_uevent(struct device *dev, struct kobj_uevent_env *env) ++#endif + { + const char *name, *p; + +@@ -78,7 +95,11 @@ static int auxiliary_bus_probe(struct device *dev) + return ret; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) ++static void auxiliary_bus_remove(struct device *dev) ++#else + static int auxiliary_bus_remove(struct device *dev) ++#endif + { + struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); + struct auxiliary_device *auxdev = to_auxiliary_dev(dev); +@@ -87,7 +108,9 @@ static int auxiliary_bus_remove(struct device *dev) + auxdrv->remove(auxdev); + dev_pm_domain_detach(dev, true); + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) + return 0; ++#endif + } + + static void auxiliary_bus_shutdown(struct device *dev) diff --git a/scripts/package-build/linux-kernel/patches/ice/0003-check_aux_bus-full-ksrc-and-canonical-auxiliary-header.patch b/scripts/package-build/linux-kernel/patches/ice/0003-check_aux_bus-full-ksrc-and-canonical-auxiliary-header.patch new file mode 100644 index 00000000..01ef8efb --- /dev/null +++ b/scripts/package-build/linux-kernel/patches/ice/0003-check_aux_bus-full-ksrc-and-canonical-auxiliary-header.patch @@ -0,0 +1,76 @@ +--- a/scripts/check_aux_bus ++++ b/scripts/check_aux_bus +@@ -58,7 +58,14 @@ exit_not_found_failure() { exit 3; } + + find_aux_bus_inc() + { +- aux_bus_inc=$(find -L ${ksrc} -name "auxiliary_bus.h") ++ # Prefer the main tree include (VyOS/kernel build trees may also contain ++ # packaged headers under debian/; an unbounded `find` then returns multiple ++ # paths and `[ -f "$aux_bus_inc" ]` fails, forcing needless OOT auxiliary). ++ if [ -f "${ksrc}/${LINUX_INCLUDE_DIR}/auxiliary_bus.h" ]; then ++ aux_bus_inc="${ksrc}/${LINUX_INCLUDE_DIR}/auxiliary_bus.h" ++ else ++ aux_bus_inc=$(find -L "${ksrc}" -name "auxiliary_bus.h" -print -quit) ++ fi + msg "auxiliary_bus.h location: ${aux_bus_inc}" + } + +@@ -101,28 +108,36 @@ find_kernel_source() + + find_config_file() + { +- # only search for kernel .config file if build_kernel is pointing +- # in the same tree as ksrc (see not about ksrc and build_kernel +- # both set in the scripts header comment) +- if [[ "$ksrc" != *"/lib/modules/${build_kernel}"* ]]; then +- msg "ksrc=$ksrc not the same as location generated from build_kernel=\"/lib/modules/${build_kernel}\", not searching for kernel .config file" +- else +- kbuild_dir="/lib/modules/${build_kernel}/build" ++ kconfig="" + ++ # Installed-modules layout: autoconf under /lib/modules/${build_kernel}/build ++ if [ -n "${build_kernel}" ] && [[ "$ksrc" == *"/lib/modules/${build_kernel}"* ]]; then ++ kbuild_dir="/lib/modules/${build_kernel}/build" + file_locations=(${kbuild_dir}/include/generated/autoconf.h \ + ${kbuild_dir}/include/linux/autoconf.h \ + /boot/bmlinux.autoconf.h) +- + for file in "${file_locations[@]}"; do +- if [ -f ${file} ]; then ++ if [ -f "${file}" ]; then + kconfig=${file} + break + fi + done +- +- if [ -z ${kconfig} ]; then ++ if [ -z "${kconfig}" ]; then + msg "Kernel config file not found at any of the expected locations." + fi ++ return ++ fi ++ ++ # Full source tree as --ksrc (e.g. VyOS KERNEL_DIR): read generated autoconf ++ for file in "${ksrc}/include/generated/autoconf.h" "${ksrc}/include/linux/autoconf.h"; do ++ if [ -f "${file}" ]; then ++ kconfig=${file} ++ msg "Using kernel config from ${kconfig}" ++ break ++ fi ++ done ++ if [ -z "${kconfig}" ]; then ++ msg "Kernel config file not found under ${ksrc}; will probe auxiliary_bus.h only." + fi + } + +@@ -131,7 +146,8 @@ get_config_auxiliary_bus() + # CONFIG_AUXILIARY_BUS=0 corresponds to CONFIG_AUXILIARY_BUS=n + # CONFIG_AUXILIARY_BUS=1 corresponds to CONFIG_AUXILIARY_BUS=y + # CONFIG_AUXILIARY_BUS= corresponds to CONFIG_AUXILIARY_BUS not available in the kernel +- CONFIG_AUXILIARY_BUS=$(grep CONFIG_AUXILIARY_BUS ${kconfig} | awk -F" " '{print $3}') ++ # Match the core symbol only (avoid CONFIG_AUXILIARY_BUS_MODULE, etc.) ++ CONFIG_AUXILIARY_BUS=$(grep -E '^#define CONFIG_AUXILIARY_BUS[[:space:]]' "${kconfig}" | awk '{print $3}') + msg "CONFIG_AUXILIARY_BUS=${CONFIG_AUXILIARY_BUS}" + } + -- cgit v1.2.3 From 0e1197b2900559793f6eb746c7ebe5d5423e0973 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 8 May 2026 22:33:54 +0200 Subject: Kernel: T6847: use common build_intel_nic helper function Instead of one build function per driver (ixgbe, i40, ice) which will anyways result in the same Python code path to be executed - use one common helper name: build_intel_nic --- scripts/package-build/linux-kernel/build.py | 3 +-- scripts/package-build/linux-kernel/package.toml | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) (limited to 'scripts/package-build/linux-kernel/package.toml') diff --git a/scripts/package-build/linux-kernel/build.py b/scripts/package-build/linux-kernel/build.py index 625726b9..e73b2519 100755 --- a/scripts/package-build/linux-kernel/build.py +++ b/scripts/package-build/linux-kernel/build.py @@ -144,8 +144,7 @@ def build_package(package: dict, dependencies: list) -> None: create_tarball(f'{package["name"]}-{package["commit_id"]}', f'{package["name"]}') elif package['build_cmd'] == 'build_intel_qat': build_intel_qat() - elif package['build_cmd'] in ['build_intel_igb', 'build_intel_ixgbe', 'build_intel_ixgbevf', - 'build_intel_i40e', 'build_intel_ice']: + elif package['build_cmd'] in ['build_intel_nic']: build_intel(package['name'], package['commit_id'], package['scm_url']) elif package['build_cmd'] == 'build_mellanox_ofed': build_mellanox_ofed() diff --git a/scripts/package-build/linux-kernel/package.toml b/scripts/package-build/linux-kernel/package.toml index f4df423b..41389d10 100644 --- a/scripts/package-build/linux-kernel/package.toml +++ b/scripts/package-build/linux-kernel/package.toml @@ -38,31 +38,31 @@ build_cmd = "build_intel_qat" name = "igb" commit_id = "v5.19.10" scm_url = "https://github.com/intel/ethernet-linux-igb" -build_cmd = "build_intel_igb" +build_cmd = "build_intel_nic" [[packages]] name = "ixgbe" commit_id = "v6.3.6" scm_url = "https://github.com/intel/ethernet-linux-ixgbe" -build_cmd = "build_intel_ixgbe" +build_cmd = "build_intel_nic" [[packages]] name = "ixgbevf" commit_id = "v5.2.2" scm_url = "http://github.com/intel/ethernet-linux-ixgbevf" -build_cmd = "build_intel_ixgbevf" +build_cmd = "build_intel_nic" [[packages]] name = "i40e" commit_id = "v2.28.16" scm_url = "http://github.com/intel/ethernet-linux-i40e" -build_cmd = "build_intel_i40e" +build_cmd = "build_intel_nic" [[packages]] name = "ice" commit_id = "v2.5.4" scm_url = "http://github.com/intel/ethernet-linux-ice" -build_cmd = "build_intel_ice" +build_cmd = "build_intel_nic" [[packages]] name = "jool" -- cgit v1.2.3 From f3a221bf83c58f43059386f00237e0f00818de25 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 8 May 2026 22:38:39 +0200 Subject: Kernel: T6847: add Intel IAVF out-of-tree Kernel driver with custom patches The Intel iavf driver (formerly i40evf) is the Linux virtual function driver for modern Intel Ethernet adapters supporting SR-IOV, including the X700/E800 series. Renamed to iavf to support future devices, it replaced i40evf entirely by 2019. The driver facilitates high-performance networking in virtualized environments. This commit contains custom patches to make the driver build. --- data/architectures/amd64.toml | 1 + .../linux-kernel/config/arm64/vyos_defconfig | 4 +- .../linux-kernel/config/x86/vyos_defconfig | 5 +- scripts/package-build/linux-kernel/package.toml | 6 ++ ...ary-device-id-when-mod-devicetable-has-it.patch | 23 +++++++ ...02-auxiliary-bus-type-callback-prototypes.patch | 73 +++++++++++++++++++++ ...-full-ksrc-and-canonical-auxiliary-header.patch | 76 ++++++++++++++++++++++ 7 files changed, 181 insertions(+), 7 deletions(-) create mode 100644 scripts/package-build/linux-kernel/patches/iavf/0001-kcompat-have-auxiliary-device-id-when-mod-devicetable-has-it.patch create mode 100644 scripts/package-build/linux-kernel/patches/iavf/0002-auxiliary-bus-type-callback-prototypes.patch create mode 100644 scripts/package-build/linux-kernel/patches/iavf/0003-check_aux_bus-full-ksrc-and-canonical-auxiliary-header.patch (limited to 'scripts/package-build/linux-kernel/package.toml') diff --git a/data/architectures/amd64.toml b/data/architectures/amd64.toml index 9e3c85d0..e8edcd18 100644 --- a/data/architectures/amd64.toml +++ b/data/architectures/amd64.toml @@ -9,6 +9,7 @@ packages = [ "vyos-intel-ixgbevf", "vyos-intel-i40e", "vyos-intel-ice", + "vyos-intel-iavf", "vyos-ipt-netflow", "intel-microcode", "amd64-microcode" diff --git a/scripts/package-build/linux-kernel/config/arm64/vyos_defconfig b/scripts/package-build/linux-kernel/config/arm64/vyos_defconfig index 738c0057..a4b03f3b 100644 --- a/scripts/package-build/linux-kernel/config/arm64/vyos_defconfig +++ b/scripts/package-build/linux-kernel/config/arm64/vyos_defconfig @@ -1833,8 +1833,7 @@ CONFIG_IGBVF=m # CONFIG_IXGBE is not set # CONFIG_IXGBEVF is not set # CONFIG_I40E is not set -CONFIG_IAVF=m -CONFIG_I40EVF=m +# CONFIG_I40EVF is not set # CONFIG_ICE is not set # CONFIG_FM10K is not set CONFIG_IGC=m @@ -5672,7 +5671,6 @@ CONFIG_OBJAGG=m CONFIG_GENERIC_IOREMAP=y CONFIG_GENERIC_LIB_DEVMEM_IS_ALLOWED=y -CONFIG_PLDMFW=y CONFIG_DEBUG_MISC=y diff --git a/scripts/package-build/linux-kernel/config/x86/vyos_defconfig b/scripts/package-build/linux-kernel/config/x86/vyos_defconfig index e86c3fe4..22eb3271 100644 --- a/scripts/package-build/linux-kernel/config/x86/vyos_defconfig +++ b/scripts/package-build/linux-kernel/config/x86/vyos_defconfig @@ -1718,8 +1718,7 @@ CONFIG_IGBVF=m # CONFIG_IXGBE is not set # CONFIG_IXGBEVF is not set # CONFIG_I40E is not set -CONFIG_IAVF=m -CONFIG_I40EVF=m +# CONFIG_I40EVF is not set # CONFIG_ICE is not set # CONFIG_FM10K is not set CONFIG_IGC=m @@ -4628,8 +4627,6 @@ CONFIG_PARMAN=m CONFIG_OBJAGG=m # end of Library routines -CONFIG_PLDMFW=y - # CONFIG_DEBUG_MISC is not set # diff --git a/scripts/package-build/linux-kernel/package.toml b/scripts/package-build/linux-kernel/package.toml index 41389d10..085c4074 100644 --- a/scripts/package-build/linux-kernel/package.toml +++ b/scripts/package-build/linux-kernel/package.toml @@ -64,6 +64,12 @@ commit_id = "v2.5.4" scm_url = "http://github.com/intel/ethernet-linux-ice" build_cmd = "build_intel_nic" +[[packages]] +name = "iavf" +commit_id = "v4.13.20" +scm_url = "http://github.com/intel/ethernet-linux-iavf" +build_cmd = "build_intel_nic" + [[packages]] name = "jool" commit_id = "" diff --git a/scripts/package-build/linux-kernel/patches/iavf/0001-kcompat-have-auxiliary-device-id-when-mod-devicetable-has-it.patch b/scripts/package-build/linux-kernel/patches/iavf/0001-kcompat-have-auxiliary-device-id-when-mod-devicetable-has-it.patch new file mode 100644 index 00000000..3326dd79 --- /dev/null +++ b/scripts/package-build/linux-kernel/patches/iavf/0001-kcompat-have-auxiliary-device-id-when-mod-devicetable-has-it.patch @@ -0,0 +1,23 @@ +From: Christian Breunig +Date: Sun, 3 May 2026 20:18:00 +0000 +Subject: [PATCH 1/3] kcompat: HAVE_AUXILIARY_DEVICE_ID when mod_devicetable has it + +--- + src/kcompat-generator.sh | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/src/kcompat-generator.sh ++++ b/src/kcompat-generator.sh +@@ -58,9 +58,10 @@ function gen-aux() { + fi + gen HAVE_AUXILIARY_DRIVER_INT_REMOVE if string "$HAVE_AUX_INT_REMOVE" equals 1 + +- # generate HAVE_AUXILIARY_DEVICE_ID only for cases when it's disabled in .config ++ # Whenever mod_devicetable.h defines struct auxiliary_device_id, vendor ++ # auxiliary_bus.h must not redefine it (true for CONFIG_AUXILIARY_BUS=y as well). + HAVE_AUX_DEV_ID=0 +- if ! config_has CONFIG_AUXILIARY_BUS && check struct auxiliary_device_id in "$mh" ; then ++ if check struct auxiliary_device_id in "$mh" ; then + HAVE_AUX_DEV_ID=1 + fi + gen HAVE_AUXILIARY_DEVICE_ID if string "$HAVE_AUX_DEV_ID" equals 1 diff --git a/scripts/package-build/linux-kernel/patches/iavf/0002-auxiliary-bus-type-callback-prototypes.patch b/scripts/package-build/linux-kernel/patches/iavf/0002-auxiliary-bus-type-callback-prototypes.patch new file mode 100644 index 00000000..76a92576 --- /dev/null +++ b/scripts/package-build/linux-kernel/patches/iavf/0002-auxiliary-bus-type-callback-prototypes.patch @@ -0,0 +1,73 @@ +From: Christian Breunig +Date: Sun, 3 May 2026 19:44:00 +0000 +Subject: [PATCH 3/3] auxiliary: align bus callbacks with kernel prototypes + +--- + src/auxiliary.c | 25 ++++++++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +--- a/src/auxiliary.c ++++ b/src/auxiliary.c +@@ -7,6 +7,7 @@ + #include + #include + #include ++#include + #include + #include + #include +@@ -31,7 +32,7 @@ static const struct auxiliary_device_id *auxiliary_match_id(const struct auxilia + return NULL; + } + +-static int auxiliary_match(struct device *dev, struct device_driver *drv) ++static int auxiliary_match_common(struct device *dev, struct device_driver *drv) + { + struct auxiliary_device *auxdev = to_auxiliary_dev(dev); + struct auxiliary_driver *auxdrv = to_auxiliary_drv(drv); +@@ -39,7 +40,23 @@ static int auxiliary_match(struct device *dev, struct device_driver *drv) + return !!auxiliary_match_id(auxdrv->id_table, auxdev); + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0) ++static int auxiliary_match(struct device *dev, const struct device_driver *drv) ++{ ++ return auxiliary_match_common(dev, (struct device_driver *)drv); ++} ++#else ++static int auxiliary_match(struct device *dev, struct device_driver *drv) ++{ ++ return auxiliary_match_common(dev, drv); ++} ++#endif ++ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) ++static int auxiliary_uevent(const struct device *dev, struct kobj_uevent_env *env) ++#else + static int auxiliary_uevent(struct device *dev, struct kobj_uevent_env *env) ++#endif + { + const char *name, *p; + +@@ -78,7 +95,11 @@ static int auxiliary_bus_probe(struct device *dev) + return ret; + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0) ++static void auxiliary_bus_remove(struct device *dev) ++#else + static int auxiliary_bus_remove(struct device *dev) ++#endif + { + struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver); + struct auxiliary_device *auxdev = to_auxiliary_dev(dev); +@@ -87,7 +108,9 @@ static int auxiliary_bus_remove(struct device *dev) + auxdrv->remove(auxdev); + dev_pm_domain_detach(dev, true); + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) + return 0; ++#endif + } + + static void auxiliary_bus_shutdown(struct device *dev) diff --git a/scripts/package-build/linux-kernel/patches/iavf/0003-check_aux_bus-full-ksrc-and-canonical-auxiliary-header.patch b/scripts/package-build/linux-kernel/patches/iavf/0003-check_aux_bus-full-ksrc-and-canonical-auxiliary-header.patch new file mode 100644 index 00000000..01ef8efb --- /dev/null +++ b/scripts/package-build/linux-kernel/patches/iavf/0003-check_aux_bus-full-ksrc-and-canonical-auxiliary-header.patch @@ -0,0 +1,76 @@ +--- a/scripts/check_aux_bus ++++ b/scripts/check_aux_bus +@@ -58,7 +58,14 @@ exit_not_found_failure() { exit 3; } + + find_aux_bus_inc() + { +- aux_bus_inc=$(find -L ${ksrc} -name "auxiliary_bus.h") ++ # Prefer the main tree include (VyOS/kernel build trees may also contain ++ # packaged headers under debian/; an unbounded `find` then returns multiple ++ # paths and `[ -f "$aux_bus_inc" ]` fails, forcing needless OOT auxiliary). ++ if [ -f "${ksrc}/${LINUX_INCLUDE_DIR}/auxiliary_bus.h" ]; then ++ aux_bus_inc="${ksrc}/${LINUX_INCLUDE_DIR}/auxiliary_bus.h" ++ else ++ aux_bus_inc=$(find -L "${ksrc}" -name "auxiliary_bus.h" -print -quit) ++ fi + msg "auxiliary_bus.h location: ${aux_bus_inc}" + } + +@@ -101,28 +108,36 @@ find_kernel_source() + + find_config_file() + { +- # only search for kernel .config file if build_kernel is pointing +- # in the same tree as ksrc (see not about ksrc and build_kernel +- # both set in the scripts header comment) +- if [[ "$ksrc" != *"/lib/modules/${build_kernel}"* ]]; then +- msg "ksrc=$ksrc not the same as location generated from build_kernel=\"/lib/modules/${build_kernel}\", not searching for kernel .config file" +- else +- kbuild_dir="/lib/modules/${build_kernel}/build" ++ kconfig="" + ++ # Installed-modules layout: autoconf under /lib/modules/${build_kernel}/build ++ if [ -n "${build_kernel}" ] && [[ "$ksrc" == *"/lib/modules/${build_kernel}"* ]]; then ++ kbuild_dir="/lib/modules/${build_kernel}/build" + file_locations=(${kbuild_dir}/include/generated/autoconf.h \ + ${kbuild_dir}/include/linux/autoconf.h \ + /boot/bmlinux.autoconf.h) +- + for file in "${file_locations[@]}"; do +- if [ -f ${file} ]; then ++ if [ -f "${file}" ]; then + kconfig=${file} + break + fi + done +- +- if [ -z ${kconfig} ]; then ++ if [ -z "${kconfig}" ]; then + msg "Kernel config file not found at any of the expected locations." + fi ++ return ++ fi ++ ++ # Full source tree as --ksrc (e.g. VyOS KERNEL_DIR): read generated autoconf ++ for file in "${ksrc}/include/generated/autoconf.h" "${ksrc}/include/linux/autoconf.h"; do ++ if [ -f "${file}" ]; then ++ kconfig=${file} ++ msg "Using kernel config from ${kconfig}" ++ break ++ fi ++ done ++ if [ -z "${kconfig}" ]; then ++ msg "Kernel config file not found under ${ksrc}; will probe auxiliary_bus.h only." + fi + } + +@@ -131,7 +146,8 @@ get_config_auxiliary_bus() + # CONFIG_AUXILIARY_BUS=0 corresponds to CONFIG_AUXILIARY_BUS=n + # CONFIG_AUXILIARY_BUS=1 corresponds to CONFIG_AUXILIARY_BUS=y + # CONFIG_AUXILIARY_BUS= corresponds to CONFIG_AUXILIARY_BUS not available in the kernel +- CONFIG_AUXILIARY_BUS=$(grep CONFIG_AUXILIARY_BUS ${kconfig} | awk -F" " '{print $3}') ++ # Match the core symbol only (avoid CONFIG_AUXILIARY_BUS_MODULE, etc.) ++ CONFIG_AUXILIARY_BUS=$(grep -E '^#define CONFIG_AUXILIARY_BUS[[:space:]]' "${kconfig}" | awk '{print $3}') + msg "CONFIG_AUXILIARY_BUS=${CONFIG_AUXILIARY_BUS}" + } + -- cgit v1.2.3