From 35544801034f059ed9aabe58f39523907e92450d Mon Sep 17 00:00:00 2001 From: John Crispin Date: Mon, 9 Dec 2024 08:36:25 +0100 Subject: [PATCH] ucode: update to latest HEAD Signed-off-by: John Crispin --- .../0035-ucode-add-TIP-specific-fixes.patch | 384 ++++++++++++++++-- ...-ucode-update-to-Git-HEAD-2024-04-15.patch | 324 --------------- .../0077-ucode-improve-hostpkg-compile.patch | 42 -- 3 files changed, 355 insertions(+), 395 deletions(-) delete mode 100644 patches/0036-ucode-update-to-Git-HEAD-2024-04-15.patch delete mode 100644 patches/0077-ucode-improve-hostpkg-compile.patch diff --git a/patches/0035-ucode-add-TIP-specific-fixes.patch b/patches/0035-ucode-add-TIP-specific-fixes.patch index ae107758..dc1d182c 100644 --- a/patches/0035-ucode-add-TIP-specific-fixes.patch +++ b/patches/0035-ucode-add-TIP-specific-fixes.patch @@ -1,68 +1,332 @@ -From 164fcae0ac392407bc7d7000216a13d9af920363 Mon Sep 17 00:00:00 2001 +From 4518f576101ccc759c5a8716320aaa04358ee918 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Fri, 28 Jul 2023 16:51:13 +0200 -Subject: [PATCH 35/68] ucode: add TIP specific fixes +Subject: [PATCH] ucode: add TIP specific fixes Signed-off-by: John Crispin --- - package/utils/ucode/Makefile | 13 +++- - .../ucode/patches/000-nl80211_copy.patch | 11 ++++ - package/utils/ucode/patches/0001-fixes.patch | 59 +++++++++++++++++++ - 3 files changed, 82 insertions(+), 1 deletion(-) + package/utils/ucode/Makefile | 240 +++++++----------- + .../ucode/patches/000-nl80211_copy.patch | 12 + + package/utils/ucode/patches/0001-fixes.patch | 59 +++++ + ...tended-feature-and-EHT-rate-info-att.patch | 56 ++++ + 4 files changed, 220 insertions(+), 147 deletions(-) create mode 100644 package/utils/ucode/patches/000-nl80211_copy.patch create mode 100644 package/utils/ucode/patches/0001-fixes.patch + create mode 100644 package/utils/ucode/patches/0001-nl80211-cover-extended-feature-and-EHT-rate-info-att.patch diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile -index e2fe4c8bad..fe401f69b1 100644 +index e2fe4c8bad..493ef845a2 100644 --- a/package/utils/ucode/Makefile +++ b/package/utils/ucode/Makefile -@@ -37,6 +37,13 @@ CMAKE_HOST_OPTIONS += \ - -DUCI_SUPPORT=OFF \ - -DULOOP_SUPPORT=OFF +@@ -12,21 +12,34 @@ PKG_RELEASE:=1 + PKG_SOURCE_PROTO:=git + PKG_SOURCE_URL=https://github.com/jow-/ucode.git +-PKG_SOURCE_DATE:=2023-06-06 +-PKG_SOURCE_VERSION:=c7d84aae09691a99ae3db427c0b2463732ef84f4 +-PKG_MIRROR_HASH:=38826ae70d886d1d7ada3fc6591ac807169aa28107f60f7f2e617520083525fb ++PKG_MIRROR_HASH:=7a4d35d14ede7d853b2095ee239a86aab0b17da2b8cfac814dfa58fabec6374b ++PKG_SOURCE_DATE:=2024-04-15 ++PKG_SOURCE_VERSION:=cfe137be068a7ba1895d3c9bcb7b38d21e5a95dd + PKG_MAINTAINER:=Jo-Philipp Wich + PKG_LICENSE:=ISC + +-PKG_ABI_VERSION:=20220812 ++PKG_ABI_VERSION:=20230711 + + include $(INCLUDE_DIR)/package.mk + include $(INCLUDE_DIR)/host-build.mk + include $(INCLUDE_DIR)/cmake.mk + +-CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION) ++CMAKE_OPTIONS += \ ++ -DSOVERSION=$(PKG_ABI_VERSION) ++ ++CMAKE_HOST_OPTIONS += \ ++ -DCMAKE_SKIP_RPATH=FALSE \ ++ -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib" ++ ++ifeq ($(HOST_OS),Darwin) ++ CMAKE_HOST_OPTIONS += \ ++ -DCMAKE_MACOSX_RPATH=1 ++else ++ CMAKE_HOST_OPTIONS += \ ++ -DUSE_RPATH="${STAGING_DIR_HOSTPKG}/lib" ++endif ++ + CMAKE_HOST_OPTIONS += \ +- -DSOVERSION=$(PKG_ABI_VERSION) \ + -DFS_SUPPORT=ON \ + -DMATH_SUPPORT=ON \ + -DNL80211_SUPPORT=OFF \ +@@ -35,8 +48,17 @@ CMAKE_HOST_OPTIONS += \ + -DSTRUCT_SUPPORT=ON \ + -DUBUS_SUPPORT=OFF \ + -DUCI_SUPPORT=OFF \ +- -DULOOP_SUPPORT=OFF ++ -DULOOP_SUPPORT=OFF \ ++ -DDEBUG_SUPPORT=ON \ ++ -DLOG_SUPPORT=OFF ++ +ifeq ($(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx),y) +TARGET_CFLAGS += -DQCA_WIFI_7 +endif -+ + +ifeq ($(CONFIG_TARGET_ipq807x)$(CONFIG_TARGET_ipq60xx)$(CONFIG_TARGET_ipq50xx)$(CONFIG_TARGET_ipq40xx),y) +TARGET_CFLAGS += -DQCA_v4_4 +endif define Package/ucode/default SUBMENU:=ucode -@@ -96,7 +103,7 @@ endef - define Package/ucode-mod-nl80211 - $(Package/ucode/default) - TITLE+= (nl80211 module) +@@ -66,109 +88,38 @@ define Package/libucode + DEPENDS:=+libjson-c + endef + +-define Package/libucode/description +- The libucode package provides the shared runtime library for the ucode interpreter. +-endef +- +- +-define Package/ucode-mod-fs +- $(Package/ucode/default) +- TITLE+= (filesystem module) +- DEPENDS:=ucode +-endef +- +-define Package/ucode-mod-fs/description +- The filesystem plugin module allows interaction with the local file system. +-endef +- +- +-define Package/ucode-mod-math +- $(Package/ucode/default) +- TITLE+= (math module) +- DEPENDS:=ucode +-endef +- +-define Package/ucode-mod-math/description +- The math plugin provides access to various procedures. +-endef +- +- +-define Package/ucode-mod-nl80211 +- $(Package/ucode/default) +- TITLE+= (nl80211 module) +- DEPENDS:=ucode +libnl-tiny +libubox +-endef +- +-define Package/ucode-mod-nl80211/description +- The nl80211 plugin provides access to the Linux wireless 802.11 netlink API. +-endef +- +- +-define Package/ucode-mod-resolv +- $(Package/ucode/default) +- TITLE+= (resolv module) +- DEPENDS:=ucode +-endef +- +-define Package/ucode-mod-resolv/description +- The resolv plugin implements simple DNS resolving. +-endef +- +- +-define Package/ucode-mod-rtnl +- $(Package/ucode/default) +- TITLE+= (rtnl module) - DEPENDS:=ucode +libnl-tiny +libubox -+ DEPENDS:=ucode +libnl-tiny +libubox +kmod-mac80211 - endef - - define Package/ucode-mod-nl80211/description -@@ -171,6 +178,10 @@ define Package/ucode-mod-uloop/description - loop implementation. - endef - +define Build/Prepare + $(Build/Prepare/Default) + $(CP) $(STAGING_DIR)/usr/include/mac80211/uapi/linux/nl80211.h $(PKG_BUILD_DIR)/nl80211_copy.h -+endef + endef - define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include/ucode +-define Package/ucode-mod-rtnl/description +- The rtnl plugin provides access to the Linux routing netlink API. +-endef +- +- +-define Package/ucode-mod-struct +- $(Package/ucode/default) +- TITLE+= (struct module) +- DEPENDS:=ucode +-endef +- +-define Package/ucode-mod-struct/description +- The struct plugin implements Python 3 compatible struct.pack/unpack functionality. +-endef +- +- +-define Package/ucode-mod-ubus +- $(Package/ucode/default) +- TITLE+= (ubus module) +- DEPENDS:=ucode +libubus +libblobmsg-json +-endef +- +-define Package/ucode-mod-ubus/description +- The ubus module allows ucode template scripts to enumerate and invoke ubus +- procedures. ++define Package/libucode/description ++ The libucode package provides the shared runtime library for the ucode interpreter. + endef + ++# 1: name ++# 2: cmake symbol ++# 3: depends ++# 4: description ++define UcodeModule ++ UCODE_MODULES += ucode-mod-$(strip $(1)) ++ CMAKE_OPTIONS += -D$(strip $(2))=$(if $(CONFIG_PACKAGE_ucode-mod-$(strip $(1))),ON,OFF) ++ PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_ucode-mod-$(strip $(1)) + +-define Package/ucode-mod-uci ++ define Package/ucode-mod-$(strip $(1)) + $(Package/ucode/default) +- TITLE+= (uci module) +- DEPENDS:=ucode +libuci +-endef +- +-define Package/ucode-mod-uci/description +- The uci module allows templates to read and modify uci configuration. +-endef ++ TITLE+= ($(strip $(1)) module) ++ DEPENDS:=ucode $(3) ++ endef + ++ define Package/ucode-mod-$(strip $(1))/description ++ $(strip $(4)) ++ endef + +-define Package/ucode-mod-uloop +- $(Package/ucode/default) +- TITLE+= (uloop module) +- DEPENDS:=ucode +libubox +-endef +- +-define Package/ucode-mod-uloop/description +- The uloop module allows ucode scripts to interact with OpenWrt uloop event +- loop implementation. ++ define Package/ucode-mod-$(strip $(1))/install ++ $(INSTALL_DIR) $$(1)/usr/lib/ucode ++ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/$(strip $(1)).so $$(1)/usr/lib/ucode/ ++ endef + endef + + +@@ -189,60 +140,55 @@ define Package/libucode/install + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/ + endef + +-define Package/ucode-mod-fs/install +- $(INSTALL_DIR) $(1)/usr/lib/ucode +- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/ +-endef + +-define Package/ucode-mod-math/install +- $(INSTALL_DIR) $(1)/usr/lib/ucode +- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/ +-endef ++$(eval $(call UcodeModule, \ ++ debug, DEBUG_SUPPORT, +libubox +libucode, \ ++ The debug plugin module provides runtime debugging and introspection facilities.)) + +-define Package/ucode-mod-nl80211/install +- $(INSTALL_DIR) $(1)/usr/lib/ucode +- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/nl80211.so $(1)/usr/lib/ucode/ +-endef ++$(eval $(call UcodeModule, \ ++ fs, FS_SUPPORT, , \ ++ The filesystem plugin module allows interaction with the local file system.)) + +-define Package/ucode-mod-resolv/install +- $(INSTALL_DIR) $(1)/usr/lib/ucode +- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/resolv.so $(1)/usr/lib/ucode/ +-endef ++$(eval $(call UcodeModule, \ ++ log, LOG_SUPPORT, +libubox, \ ++ The log plugin module provides access to the syslog and libubox ulog APIs.)) + +-define Package/ucode-mod-rtnl/install +- $(INSTALL_DIR) $(1)/usr/lib/ucode +- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/rtnl.so $(1)/usr/lib/ucode/ +-endef ++$(eval $(call UcodeModule, \ ++ math, MATH_SUPPORT, , \ ++ The math plugin provides access to various procedures.)) + +-define Package/ucode-mod-struct/install +- $(INSTALL_DIR) $(1)/usr/lib/ucode +- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/struct.so $(1)/usr/lib/ucode/ +-endef ++$(eval $(call UcodeModule, \ ++ nl80211, NL80211_SUPPORT, +libnl-tiny +libubox +kmod-mac80211, \ ++ The nl80211 plugin provides access to the Linux wireless 802.11 netlink API.)) + +-define Package/ucode-mod-ubus/install +- $(INSTALL_DIR) $(1)/usr/lib/ucode +- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/ +-endef ++$(eval $(call UcodeModule, \ ++ resolv, RESOLV_SUPPORT, , \ ++ The resolv plugin implements simple DNS resolving.)) + +-define Package/ucode-mod-uci/install +- $(INSTALL_DIR) $(1)/usr/lib/ucode +- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/ +-endef ++$(eval $(call UcodeModule, \ ++ rtnl, RTNL_SUPPORT, +libnl-tiny +libubox, \ ++ The rtnl plugin provides access to the Linux routing netlink API.)) + +-define Package/ucode-mod-uloop/install +- $(INSTALL_DIR) $(1)/usr/lib/ucode +- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uloop.so $(1)/usr/lib/ucode/ +-endef ++$(eval $(call UcodeModule, \ ++ struct, STRUCT_SUPPORT, , \ ++ The struct plugin implements Python 3 compatible struct.pack/unpack functionality.)) ++ ++$(eval $(call UcodeModule, \ ++ ubus, UBUS_SUPPORT, +libubus +libblobmsg-json, \ ++ The ubus module allows ucode template scripts to enumerate and invoke ubus procedures.)) ++ ++$(eval $(call UcodeModule, \ ++ uci, UCI_SUPPORT, +libuci, \ ++ The uci module allows templates to read and modify uci configuration.)) ++ ++$(eval $(call UcodeModule, \ ++ uloop, ULOOP_SUPPORT, +libubox, \ ++ The uloop module allows ucode scripts to interact with OpenWrt uloop event loop implementation.)) + + $(eval $(call BuildPackage,libucode)) + $(eval $(call BuildPackage,ucode)) +-$(eval $(call BuildPackage,ucode-mod-fs)) +-$(eval $(call BuildPackage,ucode-mod-math)) +-$(eval $(call BuildPackage,ucode-mod-nl80211)) +-$(eval $(call BuildPackage,ucode-mod-resolv)) +-$(eval $(call BuildPackage,ucode-mod-rtnl)) +-$(eval $(call BuildPackage,ucode-mod-struct)) +-$(eval $(call BuildPackage,ucode-mod-ubus)) +-$(eval $(call BuildPackage,ucode-mod-uci)) +-$(eval $(call BuildPackage,ucode-mod-uloop)) ++ ++$(foreach mod,$(UCODE_MODULES), \ ++ $(eval $(call BuildPackage,$(mod)))) ++ + $(eval $(call HostBuild)) diff --git a/package/utils/ucode/patches/000-nl80211_copy.patch b/package/utils/ucode/patches/000-nl80211_copy.patch new file mode 100644 -index 0000000000..ff20e3e7e2 +index 0000000000..fb268cb964 --- /dev/null +++ b/package/utils/ucode/patches/000-nl80211_copy.patch -@@ -0,0 +1,11 @@ +@@ -0,0 +1,12 @@ +--- a/lib/nl80211.c ++++ b/lib/nl80211.c -+@@ -38,7 +38,7 @@ limitations under the License. ++@@ -37,7 +37,8 @@ limitations under the License. + #include + #include + +-#include +++#define BIT(_n) (1UL << (_n)) ++#include "../nl80211_copy.h" + #include + #include @@ -132,6 +396,68 @@ index 0000000000..a8f96fc71d + } + }; + +diff --git a/package/utils/ucode/patches/0001-nl80211-cover-extended-feature-and-EHT-rate-info-att.patch b/package/utils/ucode/patches/0001-nl80211-cover-extended-feature-and-EHT-rate-info-att.patch +new file mode 100644 +index 0000000000..71c4c712d3 +--- /dev/null ++++ b/package/utils/ucode/patches/0001-nl80211-cover-extended-feature-and-EHT-rate-info-att.patch +@@ -0,0 +1,56 @@ ++From 1423ad7b8411a2cb727bfd4e4f3511469abb3214 Mon Sep 17 00:00:00 2001 ++From: Jo-Philipp Wich ++Date: Wed, 23 Oct 2024 14:31:49 +0200 ++Subject: [PATCH] nl80211: cover extended feature and EHT rate info attributes ++ ++These new attributes are required when dealing with WiFi 7 radios. ++ ++Reported-by: John Crispin ++Signed-off-by: Jo-Philipp Wich ++--- ++ lib/nl80211.c | 9 +++++++-- ++ 1 file changed, 7 insertions(+), 2 deletions(-) ++ ++--- a/lib/nl80211.c +++++ b/lib/nl80211.c ++@@ -687,7 +687,7 @@ static const uc_nl_nested_spec_t nl80211 ++ ++ static const uc_nl_nested_spec_t nl80211_sta_info_bitrate_nla = { ++ .headsize = 0, ++- .nattrs = 18, +++ .nattrs = 22, ++ .attrs = { ++ { NL80211_RATE_INFO_BITRATE, "bitrate", DT_U16, 0, NULL }, ++ { NL80211_RATE_INFO_BITRATE32, "bitrate32", DT_U32, 0, NULL }, ++@@ -701,10 +701,14 @@ static const uc_nl_nested_spec_t nl80211 ++ { NL80211_RATE_INFO_HE_GI, "he_gi", DT_U8, 0, NULL }, ++ { NL80211_RATE_INFO_HE_DCM, "he_dcm", DT_U8, 0, NULL }, ++ { NL80211_RATE_INFO_HE_RU_ALLOC, "he_ru_alloc", DT_U8, 0, NULL }, +++ { NL80211_RATE_INFO_EHT_MCS, "eht_mcs", DT_U8, 0, NULL }, +++ { NL80211_RATE_INFO_EHT_NSS, "eht_nss", DT_U8, 0, NULL }, +++ { NL80211_RATE_INFO_EHT_GI, "eht_gi", DT_U8, 0, NULL }, ++ { NL80211_RATE_INFO_40_MHZ_WIDTH, "width_40", DT_FLAG, 0, NULL }, ++ { NL80211_RATE_INFO_80_MHZ_WIDTH, "width_80", DT_FLAG, 0, NULL }, ++ { NL80211_RATE_INFO_80P80_MHZ_WIDTH, "width_80p80", DT_FLAG, 0, NULL }, ++ { NL80211_RATE_INFO_160_MHZ_WIDTH, "width_160", DT_FLAG, 0, NULL }, +++ { NL80211_RATE_INFO_320_MHZ_WIDTH, "width_320", DT_FLAG, 0, NULL }, ++ { NL80211_RATE_INFO_10_MHZ_WIDTH, "width_10", DT_FLAG, 0, NULL }, ++ { NL80211_RATE_INFO_5_MHZ_WIDTH, "width_5", DT_FLAG, 0, NULL }, ++ } ++@@ -829,7 +833,7 @@ static const uc_nl_nested_spec_t nl80211 ++ ++ static const uc_nl_nested_spec_t nl80211_msg = { ++ .headsize = 0, ++- .nattrs = 127, +++ .nattrs = 128, ++ .attrs = { ++ { NL80211_ATTR_4ADDR, "4addr", DT_U8, 0, NULL }, ++ { NL80211_ATTR_AIRTIME_WEIGHT, "airtime_weight", DT_U16, 0, NULL }, ++@@ -856,6 +860,7 @@ static const uc_nl_nested_spec_t nl80211 ++ { NL80211_ATTR_DFS_REGION, "dfs_region", DT_U8, 0, NULL }, ++ { NL80211_ATTR_DTIM_PERIOD, "dtim_period", DT_U32, 0, NULL }, ++ { NL80211_ATTR_DURATION, "duration", DT_U32, 0, NULL }, +++ { NL80211_ATTR_EXT_FEATURES, "extended_features", DT_U8, DF_ARRAY, NULL }, ++ { NL80211_ATTR_FEATURE_FLAGS, "feature_flags", DT_U32, 0, NULL }, ++ { NL80211_ATTR_FRAME, "frame", DT_STRING, DF_BINARY, NULL }, ++ { NL80211_ATTR_FRAME_MATCH, "frame_match", DT_STRING, DF_BINARY, NULL }, -- 2.34.1 diff --git a/patches/0036-ucode-update-to-Git-HEAD-2024-04-15.patch b/patches/0036-ucode-update-to-Git-HEAD-2024-04-15.patch deleted file mode 100644 index 2476be8e..00000000 --- a/patches/0036-ucode-update-to-Git-HEAD-2024-04-15.patch +++ /dev/null @@ -1,324 +0,0 @@ -From 1442fba1d8691e8f93260574f9bb54a85a6e12b3 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Thu, 16 Nov 2023 16:06:18 +0100 -Subject: [PATCH 36/68] ucode: update to Git HEAD (2024-04-15) - -96f74b5be829 ubus: make ubus_context first in uc_ubus_connection_t -7e5830edfb38 nl80211: fix datatype of NL80211_BAND_IFTYPE_ATTR_HE_CAP_{MAC,PHY} attrs -5c8fd34bac42 nl80211: fix parsing of NL80211_BAND_ATTR_VHT_MCS_SET attribute -e8d4e4fe967d nl80211: fix decoding of NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET attribute -30a3f7ad0433 rtnl: store callback in listener registry only on success -9cbe8294909f rtnl: optimize reception of rtnl events -534417132e18 rtnl: increase event socket rx buffer size limit to 1 MiB -3f9811d2f7b7 compiler: close upvalues on loop control statements -ee4af9b55cb4 vm: rework object iteration -a275399dd8e2 uci: refactor uci.changes() to match documentation -1220992631d5 ubus: automatically clear error information -d6fd94014eea uci: automatically clear error information -99837f280b61 uloop: automatically clear error information -ba3855ae3775 lib: fix documentation typo for `pop()` function -be767ae197ba vm: rework `in` operator semantics -4ade84e8fb81 ubus: add explicit support for deferring incoming requests -cfe137be068a uci: remove incorrectly documentated reorder() parameter - -Signed-off-by: Felix Fietkau ---- - package/utils/ucode/Makefile | 232 +++++++++++++---------------------- - 1 file changed, 82 insertions(+), 150 deletions(-) - -diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile -index fe401f69b1..e59691026d 100644 ---- a/package/utils/ucode/Makefile -+++ b/package/utils/ucode/Makefile -@@ -12,21 +12,31 @@ PKG_RELEASE:=1 - - PKG_SOURCE_PROTO:=git - PKG_SOURCE_URL=https://github.com/jow-/ucode.git --PKG_SOURCE_DATE:=2023-06-06 --PKG_SOURCE_VERSION:=c7d84aae09691a99ae3db427c0b2463732ef84f4 --PKG_MIRROR_HASH:=38826ae70d886d1d7ada3fc6591ac807169aa28107f60f7f2e617520083525fb -+PKG_MIRROR_HASH:=7a4d35d14ede7d853b2095ee239a86aab0b17da2b8cfac814dfa58fabec6374b -+PKG_SOURCE_DATE:=2024-04-15 -+PKG_SOURCE_VERSION:=cfe137be068a7ba1895d3c9bcb7b38d21e5a95dd - PKG_MAINTAINER:=Jo-Philipp Wich - PKG_LICENSE:=ISC - --PKG_ABI_VERSION:=20220812 -+PKG_ABI_VERSION:=20230711 - - include $(INCLUDE_DIR)/package.mk - include $(INCLUDE_DIR)/host-build.mk - include $(INCLUDE_DIR)/cmake.mk - - CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION) -+ -+ifeq ($(HOST_OS),Darwin) -+ CMAKE_HOST_OPTIONS += \ -+ -DCMAKE_SKIP_RPATH=FALSE \ -+ -DCMAKE_MACOSX_RPATH=1 \ -+ -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib" -+else -+ CMAKE_HOST_OPTIONS += \ -+ -DSOVERSION=$(PKG_ABI_VERSION) -+endif -+ - CMAKE_HOST_OPTIONS += \ -- -DSOVERSION=$(PKG_ABI_VERSION) \ - -DFS_SUPPORT=ON \ - -DMATH_SUPPORT=ON \ - -DNL80211_SUPPORT=OFF \ -@@ -35,7 +45,9 @@ CMAKE_HOST_OPTIONS += \ - -DSTRUCT_SUPPORT=ON \ - -DUBUS_SUPPORT=OFF \ - -DUCI_SUPPORT=OFF \ -- -DULOOP_SUPPORT=OFF -+ -DULOOP_SUPPORT=OFF \ -+ -DDEBUG_SUPPORT=ON \ -+ -DLOG_SUPPORT=OFF - - ifeq ($(CONFIG_TARGET_ipq95xx)$(CONFIG_TARGET_ipq53xx),y) - TARGET_CFLAGS += -DQCA_WIFI_7 -@@ -73,115 +85,40 @@ define Package/libucode - DEPENDS:=+libjson-c - endef - --define Package/libucode/description -- The libucode package provides the shared runtime library for the ucode interpreter. --endef -- -- --define Package/ucode-mod-fs -- $(Package/ucode/default) -- TITLE+= (filesystem module) -- DEPENDS:=ucode --endef -- --define Package/ucode-mod-fs/description -- The filesystem plugin module allows interaction with the local file system. --endef -- -- --define Package/ucode-mod-math -- $(Package/ucode/default) -- TITLE+= (math module) -- DEPENDS:=ucode --endef -- --define Package/ucode-mod-math/description -- The math plugin provides access to various procedures. --endef -- -- --define Package/ucode-mod-nl80211 -- $(Package/ucode/default) -- TITLE+= (nl80211 module) -- DEPENDS:=ucode +libnl-tiny +libubox +kmod-mac80211 --endef -- --define Package/ucode-mod-nl80211/description -- The nl80211 plugin provides access to the Linux wireless 802.11 netlink API. --endef -- -- --define Package/ucode-mod-resolv -- $(Package/ucode/default) -- TITLE+= (resolv module) -- DEPENDS:=ucode --endef -- --define Package/ucode-mod-resolv/description -- The resolv plugin implements simple DNS resolving. --endef -- -- --define Package/ucode-mod-rtnl -- $(Package/ucode/default) -- TITLE+= (rtnl module) -- DEPENDS:=ucode +libnl-tiny +libubox --endef -- --define Package/ucode-mod-rtnl/description -- The rtnl plugin provides access to the Linux routing netlink API. --endef -- -- --define Package/ucode-mod-struct -- $(Package/ucode/default) -- TITLE+= (struct module) -- DEPENDS:=ucode --endef -- --define Package/ucode-mod-struct/description -- The struct plugin implements Python 3 compatible struct.pack/unpack functionality. --endef -- -- --define Package/ucode-mod-ubus -- $(Package/ucode/default) -- TITLE+= (ubus module) -- DEPENDS:=ucode +libubus +libblobmsg-json -+define Build/Prepare -+ $(Build/Prepare/Default) -+ $(CP) $(STAGING_DIR)/usr/include/mac80211/uapi/linux/nl80211.h $(PKG_BUILD_DIR)/nl80211_copy.h - endef - --define Package/ucode-mod-ubus/description -- The ubus module allows ucode template scripts to enumerate and invoke ubus -- procedures. -+define Package/libucode/description -+ The libucode package provides the shared runtime library for the ucode interpreter. - endef - -+# 1: name -+# 2: cmake symbol -+# 3: depends -+# 4: description -+define UcodeModule -+ UCODE_MODULES += ucode-mod-$(strip $(1)) -+ CMAKE_OPTIONS += -D$(strip $(2))=$(if $(CONFIG_PACKAGE_ucode-mod-$(strip $(1))),ON,OFF) -+ PKG_CONFIG_DEPENDS += CONFIG_PACKAGE_ucode-mod-$(strip $(1)) - --define Package/ucode-mod-uci -+ define Package/ucode-mod-$(strip $(1)) - $(Package/ucode/default) -- TITLE+= (uci module) -- DEPENDS:=ucode +libuci --endef -+ TITLE+= ($(strip $(1)) module) -+ DEPENDS:=ucode $(3) -+ endef - --define Package/ucode-mod-uci/description -- The uci module allows templates to read and modify uci configuration. --endef -+ define Package/ucode-mod-$(strip $(1))/description -+ $(strip $(4)) -+ endef - -- --define Package/ucode-mod-uloop -- $(Package/ucode/default) -- TITLE+= (uloop module) -- DEPENDS:=ucode +libubox -+ define Package/ucode-mod-$(strip $(1))/install -+ $(INSTALL_DIR) $$(1)/usr/lib/ucode -+ $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/$(strip $(1)).so $$(1)/usr/lib/ucode/ -+ endef - endef - --define Package/ucode-mod-uloop/description -- The uloop module allows ucode scripts to interact with OpenWrt uloop event -- loop implementation. --endef -- --define Build/Prepare -- $(Build/Prepare/Default) -- $(CP) $(STAGING_DIR)/usr/include/mac80211/uapi/linux/nl80211.h $(PKG_BUILD_DIR)/nl80211_copy.h --endef - - define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/lib $(1)/usr/include/ucode -@@ -200,60 +137,55 @@ define Package/libucode/install - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libucode.so.* $(1)/usr/lib/ - endef - --define Package/ucode-mod-fs/install -- $(INSTALL_DIR) $(1)/usr/lib/ucode -- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/fs.so $(1)/usr/lib/ucode/ --endef - --define Package/ucode-mod-math/install -- $(INSTALL_DIR) $(1)/usr/lib/ucode -- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/math.so $(1)/usr/lib/ucode/ --endef -+$(eval $(call UcodeModule, \ -+ debug, DEBUG_SUPPORT, +libubox +libucode, \ -+ The debug plugin module provides runtime debugging and introspection facilities.)) - --define Package/ucode-mod-nl80211/install -- $(INSTALL_DIR) $(1)/usr/lib/ucode -- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/nl80211.so $(1)/usr/lib/ucode/ --endef -+$(eval $(call UcodeModule, \ -+ fs, FS_SUPPORT, , \ -+ The filesystem plugin module allows interaction with the local file system.)) - --define Package/ucode-mod-resolv/install -- $(INSTALL_DIR) $(1)/usr/lib/ucode -- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/resolv.so $(1)/usr/lib/ucode/ --endef -+$(eval $(call UcodeModule, \ -+ log, LOG_SUPPORT, +libubox, \ -+ The log plugin module provides access to the syslog and libubox ulog APIs.)) - --define Package/ucode-mod-rtnl/install -- $(INSTALL_DIR) $(1)/usr/lib/ucode -- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/rtnl.so $(1)/usr/lib/ucode/ --endef -+$(eval $(call UcodeModule, \ -+ math, MATH_SUPPORT, , \ -+ The math plugin provides access to various procedures.)) - --define Package/ucode-mod-struct/install -- $(INSTALL_DIR) $(1)/usr/lib/ucode -- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/struct.so $(1)/usr/lib/ucode/ --endef -+$(eval $(call UcodeModule, \ -+ nl80211, NL80211_SUPPORT, +libnl-tiny +libubox +kmod-mac80211, \ -+ The nl80211 plugin provides access to the Linux wireless 802.11 netlink API.)) - --define Package/ucode-mod-ubus/install -- $(INSTALL_DIR) $(1)/usr/lib/ucode -- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/ubus.so $(1)/usr/lib/ucode/ --endef -+$(eval $(call UcodeModule, \ -+ resolv, RESOLV_SUPPORT, , \ -+ The resolv plugin implements simple DNS resolving.)) - --define Package/ucode-mod-uci/install -- $(INSTALL_DIR) $(1)/usr/lib/ucode -- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uci.so $(1)/usr/lib/ucode/ --endef -+$(eval $(call UcodeModule, \ -+ rtnl, RTNL_SUPPORT, +libnl-tiny +libubox, \ -+ The rtnl plugin provides access to the Linux routing netlink API.)) - --define Package/ucode-mod-uloop/install -- $(INSTALL_DIR) $(1)/usr/lib/ucode -- $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/ucode/uloop.so $(1)/usr/lib/ucode/ --endef -+$(eval $(call UcodeModule, \ -+ struct, STRUCT_SUPPORT, , \ -+ The struct plugin implements Python 3 compatible struct.pack/unpack functionality.)) -+ -+$(eval $(call UcodeModule, \ -+ ubus, UBUS_SUPPORT, +libubus +libblobmsg-json, \ -+ The ubus module allows ucode template scripts to enumerate and invoke ubus procedures.)) -+ -+$(eval $(call UcodeModule, \ -+ uci, UCI_SUPPORT, +libuci, \ -+ The uci module allows templates to read and modify uci configuration.)) -+ -+$(eval $(call UcodeModule, \ -+ uloop, ULOOP_SUPPORT, +libubox, \ -+ The uloop module allows ucode scripts to interact with OpenWrt uloop event loop implementation.)) - - $(eval $(call BuildPackage,libucode)) - $(eval $(call BuildPackage,ucode)) --$(eval $(call BuildPackage,ucode-mod-fs)) --$(eval $(call BuildPackage,ucode-mod-math)) --$(eval $(call BuildPackage,ucode-mod-nl80211)) --$(eval $(call BuildPackage,ucode-mod-resolv)) --$(eval $(call BuildPackage,ucode-mod-rtnl)) --$(eval $(call BuildPackage,ucode-mod-struct)) --$(eval $(call BuildPackage,ucode-mod-ubus)) --$(eval $(call BuildPackage,ucode-mod-uci)) --$(eval $(call BuildPackage,ucode-mod-uloop)) -+ -+$(foreach mod,$(UCODE_MODULES), \ -+ $(eval $(call BuildPackage,$(mod)))) -+ - $(eval $(call HostBuild)) --- -2.34.1 - diff --git a/patches/0077-ucode-improve-hostpkg-compile.patch b/patches/0077-ucode-improve-hostpkg-compile.patch deleted file mode 100644 index 155bb79f..00000000 --- a/patches/0077-ucode-improve-hostpkg-compile.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 86ed23223bec723c9280f329eb995762baac8b16 Mon Sep 17 00:00:00 2001 -From: John Crispin -Date: Sun, 22 Sep 2024 14:04:17 +0200 -Subject: [PATCH] ucode: improve hostpkg compile - -Signed-off-by: John Crispin ---- - package/utils/ucode/Makefile | 13 ++++++++----- - 1 file changed, 8 insertions(+), 5 deletions(-) - -diff --git a/package/utils/ucode/Makefile b/package/utils/ucode/Makefile -index e59691026d..493ef845a2 100644 ---- a/package/utils/ucode/Makefile -+++ b/package/utils/ucode/Makefile -@@ -24,16 +24,19 @@ include $(INCLUDE_DIR)/package.mk - include $(INCLUDE_DIR)/host-build.mk - include $(INCLUDE_DIR)/cmake.mk - --CMAKE_OPTIONS += -DSOVERSION=$(PKG_ABI_VERSION) -+CMAKE_OPTIONS += \ -+ -DSOVERSION=$(PKG_ABI_VERSION) - --ifeq ($(HOST_OS),Darwin) -- CMAKE_HOST_OPTIONS += \ -+CMAKE_HOST_OPTIONS += \ - -DCMAKE_SKIP_RPATH=FALSE \ -- -DCMAKE_MACOSX_RPATH=1 \ - -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib" -+ -+ifeq ($(HOST_OS),Darwin) -+ CMAKE_HOST_OPTIONS += \ -+ -DCMAKE_MACOSX_RPATH=1 - else - CMAKE_HOST_OPTIONS += \ -- -DSOVERSION=$(PKG_ABI_VERSION) -+ -DUSE_RPATH="${STAGING_DIR_HOSTPKG}/lib" - endif - - CMAKE_HOST_OPTIONS += \ --- -2.34.1 -