From b22e0abf83093caa248175ad52536a3fa9df3fac Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Fri, 30 Dec 2022 18:22:12 +0800 Subject: [PATCH 1/7] fix shore --- fast-classifier/Makefile | 109 ----------------- shortcut-fe/files/etc/init.d/shortcut-fe | 51 -------- shortcut-fe/shortcut-fe/src/sfe.h | 114 ++++++++++++++++++ shortcut-fe/{ => shortcut-fe}/src/sfe_cm.h | 0 simulated-driver/Makefile | 60 --------- .../patches/200-nss-qdisc-support.patch | 11 -- 6 files changed, 114 insertions(+), 231 deletions(-) delete mode 100644 fast-classifier/Makefile delete mode 100755 shortcut-fe/files/etc/init.d/shortcut-fe create mode 100644 shortcut-fe/shortcut-fe/src/sfe.h rename shortcut-fe/{ => shortcut-fe}/src/sfe_cm.h (100%) delete mode 100644 simulated-driver/Makefile delete mode 100644 simulated-driver/patches/200-nss-qdisc-support.patch diff --git a/fast-classifier/Makefile b/fast-classifier/Makefile deleted file mode 100644 index 09c1174dd..000000000 --- a/fast-classifier/Makefile +++ /dev/null @@ -1,109 +0,0 @@ -# -# Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. -# Permission to use, copy, modify, and/or distribute this software for -# any purpose with or without fee is hereby granted, provided that the -# above copyright notice and this permission notice appear in all copies. -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=fast-classifier -PKG_RELEASE:=6 - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/fast-classifier/Default - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Support - DEPENDS:=+kmod-ipt-conntrack +kmod-shortcut-fe - TITLE:=Kernel driver for FAST Classifier - FILES:=$(PKG_BUILD_DIR)/fast-classifier.ko - KCONFIG:= \ - CONFIG_NF_CONNTRACK_EVENTS=y \ - CONFIG_NF_CONNTRACK_CHAIN_EVENTS=y \ - CONFIG_NF_CONNTRACK_MARK=y \ - CONFIG_XFRM=y - CONFLICTS:=kmod-shortcut-fe-drv kmod-shortcut-fe-cm -endef - -define KernelPackage/fast-classifier - $(call KernelPackage/fast-classifier/Default) -endef - -define KernelPackage/fast-classifier-noload - $(call KernelPackage/fast-classifier/Default) -endef - -define KernelPackage/fast-classifier/Default/description -FAST Classifier talks to SFE to make decisions about offloading connections -endef - -define KernelPackage/fast-classifier/description -$(call KernelPackage/fast-classifier/Default/description) -endef - -define KernelPackage/fast-classifier-noload/description -$(call KernelPackage/fast-classifier/Default/description) - -This package does not load fast-classifier at boot by default -endef - -define Package/fast-classifier-example - TITLE:=Example user space program for fast-classifier - DEPENDS:=+libnl +kmod-fast-classifier -endef - -define Package/fast-classifier-example/description -Example user space program that communicates with fast -classifier kernel module -endef - -HAVE_ECM:=$(CONFIG_PACKAGE_kmod-qca-nss-ecm-premium)$(CONFIG_PACKAGE_kmod-qca-nss-ecm-noload)$(CONFIG_PACKAGE_kmod-qca-nss-ecm-premium-noload)$(CONFIG_PACKAGE_kmod-qca-nss-ecm-standard) - -define Build/Compile/kmod - +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - $(KERNEL_MAKE_FLAGS) \ - $(PKG_MAKE_FLAGS) \ - M="$(PKG_BUILD_DIR)" \ - CONFIG_FAST_CLASSIFIER=m \ - EXTRA_CFLAGS+="-DSFE_SUPPORT_IPV6" \ - $(if $(HAVE_ECM),EXTRA_CFLAGS+="-DCONFIG_SFE_ECM" CONFIG_SFE_ECM=y,) \ - modules -endef - -define Build/Compile/example - $(TARGET_CC) -o $(PKG_BUILD_DIR)/userspace_fast_classifier \ - -I $(PKG_BUILD_DIR) \ - -I$(STAGING_DIR)/usr/include/libnl \ - -I$(STAGING_DIR)/usr/include/libnl3 \ - -lnl-genl-3 -lnl-3 \ - $(PKG_BUILD_DIR)/nl_classifier_test.c -endef - -define Build/Compile - $(Build/Compile/kmod) - $(if $(CONFIG_PACKAGE_fast-classifier-example),$(Build/Compile/example)) -endef - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include - $(CP) $(PKG_BUILD_DIR)/fast-classifier.h $(1)/usr/include/ -endef - -define Package/fast-classifier-example/install - $(INSTALL_DIR) $(1)/sbin - $(CP) $(PKG_BUILD_DIR)/userspace_fast_classifier $(1)/sbin/ -endef - -$(eval $(call KernelPackage,fast-classifier)) -#$(eval $(call KernelPackage,fast-classifier-noload)) -#$(eval $(call BuildPackage,fast-classifier-example)) diff --git a/shortcut-fe/files/etc/init.d/shortcut-fe b/shortcut-fe/files/etc/init.d/shortcut-fe deleted file mode 100755 index 838512a36..000000000 --- a/shortcut-fe/files/etc/init.d/shortcut-fe +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/sh /etc/rc.common -# -# Copyright (c) 2014-2015 The Linux Foundation. All rights reserved. -# Permission to use, copy, modify, and/or distribute this software for -# any purpose with or without fee is hereby granted, provided that the -# above copyright notice and this permission notice appear in all copies. -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# - -#SFE connection manager has a lower priority, it should be started after other connection manager -#to detect the existence of connection manager with higher priority -START=70 - -have_cm() { - [ -d "/sys/kernel/debug/ecm" ] && echo 1 && return - - echo 0 -} - -#load shortcut-fe and connection manager -load_sfe() { - local kernel_version=$(uname -r) - - [ -d "/sys/module/shortcut_fe" ] || insmod /lib/modules/$kernel_version/shortcut-fe.ko - [ -d "/sys/module/shortcut_fe_ipv6" ] || insmod /lib/modules/$kernel_version/shortcut-fe-ipv6.ko - - [ -e "/lib/modules/$kernel_version/shortcut-fe-cm.ko" ] && { - [ -d /sys/module/shortcut_fe_cm ] || insmod /lib/modules/$kernel_version/shortcut-fe-cm.ko - } - [ -e "/lib/modules/$kernel_version/fast-classifier.ko" ] && { - [ -d /sys/module/fast_classifier ] || insmod /lib/modules/$kernel_version/fast-classifier.ko - } -} - -start() { - [ "$(have_cm)" = "0" ] && load_sfe -} - -stop() { - [ -d "/sys/module/shortcut_fe_cm" ] && rmmod shortcut_fe_cm - [ -d "/sys/module/shortcut_fe_ipv6" ] && rmmod shortcut_fe_ipv6 - [ -d "/sys/module/shortcut_fe" ] && rmmod shortcut_fe - [ -d "/sys/module/shortcut_fe_drv" ] && rmmod shortcut_fe_drv - [ -d "/sys/module/fast_classifier" ] && rmmod fast_classifier -} diff --git a/shortcut-fe/shortcut-fe/src/sfe.h b/shortcut-fe/shortcut-fe/src/sfe.h new file mode 100644 index 000000000..279e7b3dc --- /dev/null +++ b/shortcut-fe/shortcut-fe/src/sfe.h @@ -0,0 +1,114 @@ +/* + * sfe.h + * Shortcut forwarding engine. + * + * Copyright (c) 2013-2017 The Linux Foundation. All rights reserved. + * Permission to use, copy, modify, and/or distribute this software for + * any purpose with or without fee is hereby granted, provided that the + * above copyright notice and this permission notice appear in all copies. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + + +/* + * The following are debug macros used throughout the SFE. + * + * The DEBUG_LEVEL enables the followings based on its value, + * when dynamic debug option is disabled. + * + * 0 = OFF + * 1 = ASSERTS / ERRORS + * 2 = 1 + WARN + * 3 = 2 + INFO + * 4 = 3 + TRACE + */ +#define DEBUG_LEVEL 2 + +#if (DEBUG_LEVEL < 1) +#define DEBUG_ASSERT(s, ...) +#define DEBUG_ERROR(s, ...) +#else +#define DEBUG_ASSERT(c, s, ...) if (!(c)) { pr_emerg("ASSERT: %s:%d:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__); BUG(); } +#define DEBUG_ERROR(s, ...) pr_err("%s:%d:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#endif + +#if defined(CONFIG_DYNAMIC_DEBUG) +/* + * Compile messages for dynamic enable/disable + */ +#define DEBUG_WARN(s, ...) pr_debug("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define DEBUG_INFO(s, ...) pr_debug("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#define DEBUG_TRACE(s, ...) pr_debug("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#else + +/* + * Statically compile messages at different levels + */ +#if (DEBUG_LEVEL < 2) +#define DEBUG_WARN(s, ...) +#else +#define DEBUG_WARN(s, ...) pr_warn("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#endif + +#if (DEBUG_LEVEL < 3) +#define DEBUG_INFO(s, ...) +#else +#define DEBUG_INFO(s, ...) pr_notice("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#endif + +#if (DEBUG_LEVEL < 4) +#define DEBUG_TRACE(s, ...) +#else +#define DEBUG_TRACE(s, ...) pr_info("%s[%d]:" s, __FUNCTION__, __LINE__, ##__VA_ARGS__) +#endif +#endif + +#ifdef CONFIG_NF_FLOW_COOKIE +typedef int (*flow_cookie_set_func_t)(u32 protocol, __be32 src_ip, __be16 src_port, + __be32 dst_ip, __be16 dst_port, u16 flow_cookie); +/* + * sfe_register_flow_cookie_cb + * register a function in SFE to let SFE use this function to configure flow cookie for a flow + * + * Hardware driver which support flow cookie should register a callback function in SFE. Then SFE + * can use this function to configure flow cookie for a flow. + * return: 0, success; !=0, fail + */ +int sfe_register_flow_cookie_cb(flow_cookie_set_func_t cb); + +/* + * sfe_unregister_flow_cookie_cb + * unregister function which is used to configure flow cookie for a flow + * + * return: 0, success; !=0, fail + */ +int sfe_unregister_flow_cookie_cb(flow_cookie_set_func_t cb); + +typedef int (*sfe_ipv6_flow_cookie_set_func_t)(u32 protocol, __be32 src_ip[4], __be16 src_port, + __be32 dst_ip[4], __be16 dst_port, u16 flow_cookie); + +/* + * sfe_ipv6_register_flow_cookie_cb + * register a function in SFE to let SFE use this function to configure flow cookie for a flow + * + * Hardware driver which support flow cookie should register a callback function in SFE. Then SFE + * can use this function to configure flow cookie for a flow. + * return: 0, success; !=0, fail + */ +int sfe_ipv6_register_flow_cookie_cb(sfe_ipv6_flow_cookie_set_func_t cb); + +/* + * sfe_ipv6_unregister_flow_cookie_cb + * unregister function which is used to configure flow cookie for a flow + * + * return: 0, success; !=0, fail + */ +int sfe_ipv6_unregister_flow_cookie_cb(sfe_ipv6_flow_cookie_set_func_t cb); + +#endif /*CONFIG_NF_FLOW_COOKIE*/ diff --git a/shortcut-fe/src/sfe_cm.h b/shortcut-fe/shortcut-fe/src/sfe_cm.h similarity index 100% rename from shortcut-fe/src/sfe_cm.h rename to shortcut-fe/shortcut-fe/src/sfe_cm.h diff --git a/simulated-driver/Makefile b/simulated-driver/Makefile deleted file mode 100644 index ecf9c41bd..000000000 --- a/simulated-driver/Makefile +++ /dev/null @@ -1,60 +0,0 @@ -# -# Copyright (c) 2015,2016 The Linux Foundation. All rights reserved. -# Permission to use, copy, modify, and/or distribute this software for -# any purpose with or without fee is hereby granted, provided that the -# above copyright notice and this permission notice appear in all copies. -# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT -# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -# - -include $(TOPDIR)/rules.mk -include $(INCLUDE_DIR)/kernel.mk - -PKG_NAME:=shortcut-fe-simulated-driver -PKG_RELEASE:=1 - -PKG_SOURCE_URL:=https://source.codeaurora.org/quic/qsdk/oss/lklm/shortcut-fe -PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-03-17 -PKG_SOURCE_VERSION:=697977d8d0ccf0ab596e5692d08608a75dd7f33d -PKG_MIRROR_HASH:=659fa82a431e15af797a6c7069faeee02810453ad8b576c51c29f95a1761a045 - -include $(INCLUDE_DIR)/package.mk - -define KernelPackage/shortcut-fe-drv - SECTION:=kernel - CATEGORY:=Kernel modules - SUBMENU:=Network Support - DEPENDS:=@TARGET_ipq806x||TARGET_ipq807x +kmod-shortcut-fe - KCONFIG:= \ - CONFIG_NET_CLS_ACT=y \ - CONFIG_XFRM=y - TITLE:=Simulated sfe driver for ECM - FILES:=$(PKG_BUILD_DIR)/simulated-driver/shortcut-fe-drv.ko -endef - -define KernelPackage/shortcut-fe-drv/Description -Simulated sfe driver which act as an adapter to convert message -between a connection manager and the SFE core engine. -endef - -define Build/Compile - $(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - $(KERNEL_MAKE_FLAGS) \ - $(PKG_MAKE_FLAGS) \ - M="$(PKG_BUILD_DIR)/simulated-driver" \ - EXTRA_CFLAGS="-DSFE_SUPPORT_IPV6" \ - modules -endef - -define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include/shortcut-fe - $(CP) -rf $(PKG_BUILD_DIR)/simulated-driver/sfe_drv.h $(1)/usr/include/shortcut-fe -endef - -$(eval $(call KernelPackage,shortcut-fe-drv)) diff --git a/simulated-driver/patches/200-nss-qdisc-support.patch b/simulated-driver/patches/200-nss-qdisc-support.patch deleted file mode 100644 index 638ad8a84..000000000 --- a/simulated-driver/patches/200-nss-qdisc-support.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./simulated-driver/sfe_drv.c.orig 2020-06-16 12:49:47.680153371 +0800 -+++ ./simulated-driver/sfe_drv.c 2020-06-16 12:50:18.540153371 +0800 -@@ -1167,7 +1167,7 @@ int sfe_drv_recv(struct sk_buff *skb) - * If ingress Qdisc configured, and packet not processed by ingress Qdisc yet - * We can not accelerate this packet. - */ -- if (dev->ingress_queue && !(skb->tc_verd & TC_NCLS)) { -+ if (dev->ingress_queue && !(skb->tc_verd_qca_nss & TC_NCLS)) { - return 0; - } - #endif From 6d39d0b1e6d713367b635aef707f16cef5ae3a78 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Wed, 18 Jan 2023 20:42:18 +0800 Subject: [PATCH 2/7] fix --- luci-app-cpufreq/Makefile | 2 +- luci-app-ipsec-server/Makefile | 2 +- luci-app-ipsec-vpnd/Makefile | 2 +- luci-app-zerotier/Makefile | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/luci-app-cpufreq/Makefile b/luci-app-cpufreq/Makefile index 5a95b059b..b85e91d22 100644 --- a/luci-app-cpufreq/Makefile +++ b/luci-app-cpufreq/Makefile @@ -11,6 +11,6 @@ PKG_NAME:=luci-app-cpufreq PKG_VERSION:=1 PKG_RELEASE:=$(COMMITCOUNT) -include ../../luci.mk +include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-ipsec-server/Makefile b/luci-app-ipsec-server/Makefile index 786a9e607..7b344a125 100644 --- a/luci-app-ipsec-server/Makefile +++ b/luci-app-ipsec-server/Makefile @@ -19,6 +19,6 @@ define Package/$(PKG_NAME)/conffiles /etc/config/luci-app-ipsec-server endef -include ../../luci.mk +include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-ipsec-vpnd/Makefile b/luci-app-ipsec-vpnd/Makefile index 9948a496d..f445cb15f 100644 --- a/luci-app-ipsec-vpnd/Makefile +++ b/luci-app-ipsec-vpnd/Makefile @@ -13,6 +13,6 @@ PKG_NAME:=luci-app-ipsec-vpnd PKG_VERSION:=1.0 PKG_RELEASE:=11 -include ../../luci.mk +include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature diff --git a/luci-app-zerotier/Makefile b/luci-app-zerotier/Makefile index 4946b5f37..11c26ca4f 100755 --- a/luci-app-zerotier/Makefile +++ b/luci-app-zerotier/Makefile @@ -14,6 +14,6 @@ PKG_NAME:=luci-app-zerotier PKG_VERSION:=1.0 PKG_RELEASE:=20 -include ../../luci.mk +include $(TOPDIR)/feeds/luci/luci.mk # call BuildPackage - OpenWrt buildroot signature From ce16bf98d139c5604412f50b6912991a2a3bf812 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Wed, 18 Jan 2023 23:31:24 +0800 Subject: [PATCH 3/7] fix upx --- upx/Makefile | 48 ++++++++++------------ upx/patches/010-fix-build-with-gcc11.patch | 28 +++++++++++++ 2 files changed, 50 insertions(+), 26 deletions(-) create mode 100644 upx/patches/010-fix-build-with-gcc11.patch diff --git a/upx/Makefile b/upx/Makefile index b58bd8cd2..7352625b6 100644 --- a/upx/Makefile +++ b/upx/Makefile @@ -7,27 +7,41 @@ include $(TOPDIR)/rules.mk PKG_NAME:=upx +PKG_VERSION:=3.96 PKG_RELEASE:=1 +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/upx/upx.git +PKG_SOURCE_VERSION:=d7ba31cab8ce8d95d2c10e88d2ec787ac52005ef +PKG_MIRROR_HASH:=15b4884dbe35d3b7bda27538429cab92aaeaca006d558deb49f2ef93e3c261b8 + PKG_MAINTAINER:=Xingwang Liao PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING LICENSE -PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2022-01-15 -PKG_SOURCE_VERSION:=a46b63817a9c6ad5af7cf519332e859f11558592 -PKG_SOURCE_URL:=https://github.com/upx/upx.git -PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz - HOST_BUILD_DEPENDS:=ucl/host +MAKE_PATH:=src -include $(INCLUDE_DIR)/host-build.mk include $(INCLUDE_DIR)/package.mk +include $(INCLUDE_DIR)/host-build.mk + +define Package/upx + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libucl +libstdcpp +zlib + TITLE:=The Ultimate Packer for eXecutables + URL:=https://upx.github.io/ +endef + +define Package/upx/description +UPX is a free, secure, portable, extendable, high-performance +executable packer for several executable formats. +endef define Host/Compile UPX_UCLDIR=$(STAGING_DIR_HOST) \ $(MAKE) -C $(HOST_BUILD_DIR)/src \ - CXXFLAGS_WERROR="" LDFLAGS="$(HOST_LDFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS)" \ CXX="$(HOSTCXX)" endef @@ -39,24 +53,6 @@ define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/upx endef -define Package/upx - SECTION:=utils - CATEGORY:=Utilities - DEPENDS:=+libucl +libstdcpp +zlib - TITLE:=The Ultimate Packer for eXecutables - URL:=https://upx.github.io/ -endef - -define Package/upx/description -UPX is a free, portable, extendable, high-performance executable packer for -several different executable formats. It achieves an excellent compression ratio -and offers very fast decompression. Your executables suffer no memory overhead -or other drawbacks for most of the formats supported, because of in-place -decompression. -endef - -MAKE_PATH := src - define Package/upx/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/upx.out $(1)/usr/bin/upx diff --git a/upx/patches/010-fix-build-with-gcc11.patch b/upx/patches/010-fix-build-with-gcc11.patch new file mode 100644 index 000000000..245812f28 --- /dev/null +++ b/upx/patches/010-fix-build-with-gcc11.patch @@ -0,0 +1,28 @@ +From 4121815fb9bc977ab0953558a2a69fa33550c53c Mon Sep 17 00:00:00 2001 +From: Martin Jansa +Date: Fri, 14 May 2021 02:26:13 -0700 +Subject: [PATCH] MyCom.h: fix build with gcc-11 + +* fixes: + ./../src/lzma-sdk/C/7zip/Compress/LZMA/LZMAEncoder.h: In member function 'virtual ULONG NCompress::NLZMA::CEncoder::Release()': + ./../src/lzma-sdk/C/7zip/Compress/LZMA/../../../Common/MyCom.h:159:32: error: this 'if' clause does not guard... [-Werror=misleading-indentation] + 159 | STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) \ + | ^~ + +Signed-off-by: Martin Jansa +--- + src/lzma-sdk/C/Common/MyCom.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/src/lzma-sdk/C/Common/MyCom.h ++++ b/src/lzma-sdk/C/Common/MyCom.h +@@ -156,8 +156,7 @@ class CMyUnknownImp + + #define MY_ADDREF_RELEASE \ + STDMETHOD_(ULONG, AddRef)() { return ++__m_RefCount; } \ +-STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) \ +- return __m_RefCount; delete this; return 0; } ++STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) return __m_RefCount; delete this; return 0; } + + #define MY_UNKNOWN_IMP_SPEC(i) \ + MY_QUERYINTERFACE_BEGIN \ From db9ce99e3a699c672dc0e0bd01923d55296fd1e2 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Wed, 18 Jan 2023 23:39:05 +0800 Subject: [PATCH 4/7] Revert "fix upx" This reverts commit ce16bf98d139c5604412f50b6912991a2a3bf812. --- upx/Makefile | 48 ++++++++++++---------- upx/patches/010-fix-build-with-gcc11.patch | 28 ------------- 2 files changed, 26 insertions(+), 50 deletions(-) delete mode 100644 upx/patches/010-fix-build-with-gcc11.patch diff --git a/upx/Makefile b/upx/Makefile index 7352625b6..b58bd8cd2 100644 --- a/upx/Makefile +++ b/upx/Makefile @@ -7,41 +7,27 @@ include $(TOPDIR)/rules.mk PKG_NAME:=upx -PKG_VERSION:=3.96 PKG_RELEASE:=1 -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/upx/upx.git -PKG_SOURCE_VERSION:=d7ba31cab8ce8d95d2c10e88d2ec787ac52005ef -PKG_MIRROR_HASH:=15b4884dbe35d3b7bda27538429cab92aaeaca006d558deb49f2ef93e3c261b8 - PKG_MAINTAINER:=Xingwang Liao PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING LICENSE +PKG_SOURCE_PROTO:=git +PKG_SOURCE_DATE:=2022-01-15 +PKG_SOURCE_VERSION:=a46b63817a9c6ad5af7cf519332e859f11558592 +PKG_SOURCE_URL:=https://github.com/upx/upx.git +PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz + HOST_BUILD_DEPENDS:=ucl/host -MAKE_PATH:=src -include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/host-build.mk - -define Package/upx - SECTION:=utils - CATEGORY:=Utilities - DEPENDS:=+libucl +libstdcpp +zlib - TITLE:=The Ultimate Packer for eXecutables - URL:=https://upx.github.io/ -endef - -define Package/upx/description -UPX is a free, secure, portable, extendable, high-performance -executable packer for several executable formats. -endef +include $(INCLUDE_DIR)/package.mk define Host/Compile UPX_UCLDIR=$(STAGING_DIR_HOST) \ $(MAKE) -C $(HOST_BUILD_DIR)/src \ - LDFLAGS="$(HOST_LDFLAGS)" \ + CXXFLAGS_WERROR="" LDFLAGS="$(HOST_LDFLAGS)" \ CXX="$(HOSTCXX)" endef @@ -53,6 +39,24 @@ define Host/Clean rm -f $(STAGING_DIR_HOST)/bin/upx endef +define Package/upx + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libucl +libstdcpp +zlib + TITLE:=The Ultimate Packer for eXecutables + URL:=https://upx.github.io/ +endef + +define Package/upx/description +UPX is a free, portable, extendable, high-performance executable packer for +several different executable formats. It achieves an excellent compression ratio +and offers very fast decompression. Your executables suffer no memory overhead +or other drawbacks for most of the formats supported, because of in-place +decompression. +endef + +MAKE_PATH := src + define Package/upx/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/upx.out $(1)/usr/bin/upx diff --git a/upx/patches/010-fix-build-with-gcc11.patch b/upx/patches/010-fix-build-with-gcc11.patch deleted file mode 100644 index 245812f28..000000000 --- a/upx/patches/010-fix-build-with-gcc11.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 4121815fb9bc977ab0953558a2a69fa33550c53c Mon Sep 17 00:00:00 2001 -From: Martin Jansa -Date: Fri, 14 May 2021 02:26:13 -0700 -Subject: [PATCH] MyCom.h: fix build with gcc-11 - -* fixes: - ./../src/lzma-sdk/C/7zip/Compress/LZMA/LZMAEncoder.h: In member function 'virtual ULONG NCompress::NLZMA::CEncoder::Release()': - ./../src/lzma-sdk/C/7zip/Compress/LZMA/../../../Common/MyCom.h:159:32: error: this 'if' clause does not guard... [-Werror=misleading-indentation] - 159 | STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) \ - | ^~ - -Signed-off-by: Martin Jansa ---- - src/lzma-sdk/C/Common/MyCom.h | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - ---- a/src/lzma-sdk/C/Common/MyCom.h -+++ b/src/lzma-sdk/C/Common/MyCom.h -@@ -156,8 +156,7 @@ class CMyUnknownImp - - #define MY_ADDREF_RELEASE \ - STDMETHOD_(ULONG, AddRef)() { return ++__m_RefCount; } \ --STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) \ -- return __m_RefCount; delete this; return 0; } -+STDMETHOD_(ULONG, Release)() { if (--__m_RefCount != 0) return __m_RefCount; delete this; return 0; } - - #define MY_UNKNOWN_IMP_SPEC(i) \ - MY_QUERYINTERFACE_BEGIN \ From 246a0ae73a5bd3eda8422de63b47c5ec8dfc6347 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Wed, 18 Jan 2023 23:39:21 +0800 Subject: [PATCH 5/7] Update Makefile --- upx/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upx/Makefile b/upx/Makefile index b58bd8cd2..9310bcf81 100644 --- a/upx/Makefile +++ b/upx/Makefile @@ -15,7 +15,7 @@ PKG_LICENSE_FILES:=COPYING LICENSE PKG_SOURCE_PROTO:=git PKG_SOURCE_DATE:=2022-01-15 -PKG_SOURCE_VERSION:=a46b63817a9c6ad5af7cf519332e859f11558592 +PKG_SOURCE_VERSION:=1050de5171f70fd4ba113016e4db994e898c7be3 PKG_SOURCE_URL:=https://github.com/upx/upx.git PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz From fdd9f87ba6b6b4b9ba2a4bff25465442d3477543 Mon Sep 17 00:00:00 2001 From: suyuan <175338101@qq.com> Date: Sat, 4 Feb 2023 23:06:08 +0800 Subject: [PATCH 6/7] Update Makefile --- openmptcprouter-full/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/openmptcprouter-full/Makefile b/openmptcprouter-full/Makefile index 6f0ec53b9..c8de9642d 100755 --- a/openmptcprouter-full/Makefile +++ b/openmptcprouter-full/Makefile @@ -76,7 +76,6 @@ MY_DEPENDS := \ !TARGET_mvebu:kmod-usb-serial !TARGET_mvebu:kmod-usb-serial-option !TARGET_mvebu:kmod-usb-serial-wwan !TARGET_mvebu:usb-modeswitch !TARGET_mvebu:uqmi \ !TARGET_mvebu:umbim !TARGET_mvebu:kmod-mii !TARGET_mvebu:kmod-usb-net !TARGET_mvebu:kmod-usb-wdm !TARGET_mvebu:kmod-usb-net-qmi-wwan !TARGET_mvebu:kmod-usb-net-cdc-mbim !TARGET_mvebu:umbim \ !TARGET_mvebu:kmod-usb-net-huawei-cdc-ncm !TARGET_mvebu:kmod-usb-net-rndis !TARGET_mvebu:kmod-usb-net-cdc-ether !TARGET_mvebu:kmod-usb-net-ipheth !TARGET_mvebu:usbmuxd !TARGET_mvebu:libusbmuxd \ - kmod-rt2800-usb kmod-rtl8xxxu kmod-rtl8192cu kmod-net-rtl8192su !LINUX_6_1:kmod-rtl8812au-ct \ !TARGET_mvebu:luci-proto-qmi wpad-basic kmod-mt7601u kmod-rtl8187 TARGET_r4s:kmod-r8168 (TARGET_x86||TARGET_x86_64):kmod-usb-net-rtl8152 \ !TARGET_mvebu:luci-app-mlvpn !TARGET_mvebu:mlvpn 464xlat kmod-zram kmod-swconfig swconfig kmod-ipt-nat kmod-ipt-nat6 luci-app-https-dns-proxy kmod-tcp-nanqinlang (TARGET_x86_64||aarch64):kmod-tcp-bbr2 iptables-mod-ipopt igmpproxy ss iptraf-ng \ luci-app-acl block-mount blockd fstools luci-app-shutdown libwebp luci-proto-gre tcptraceroute luci-proto-mbim kmod-rtl8xxxu kmod-ath9k-htc luci-app-ttyd luci-mod-dashboard (TARGET_x86||TARGET_x86_64):rtl8192eu-firmware kmod-usb2 libustream-openssl (TARGET_x86||TARGET_x86_64):kmod-ixgbevf (TARGET_x86||TARGET_x86_64):kmod-igbvf \ From be161404b06f3abaec009898f4ee100dc6a3e366 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Sat, 18 Feb 2023 18:11:35 +0100 Subject: [PATCH 7/7] Update omr-modemmanager --- luci-app-openmptcprouter/root/bin/omr-modemmanager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/luci-app-openmptcprouter/root/bin/omr-modemmanager b/luci-app-openmptcprouter/root/bin/omr-modemmanager index def3beb00..d53865837 100755 --- a/luci-app-openmptcprouter/root/bin/omr-modemmanager +++ b/luci-app-openmptcprouter/root/bin/omr-modemmanager @@ -7,7 +7,7 @@ timeout 1 mmcli -L | while read MODEM; do MODEM_INFO="$(timeout 1 mmcli -m $MODEM_ID --output-keyvalue)" if [ -n "$MODEM_INFO" ] && [ "$(echo "$MODEM_INFO" | grep 'modem.generic.device ' | awk -F": " '{print $2}')" = "$MODEM_INTF" ]; then PERCENT=$(echo "$MODEM_INFO" | grep 'modem.generic.signal-quality.value ' | awk -F": " '{print $2}') - [ -z "$PERCENT" ] && PERCENT=$(awk -v n="$(mmcli -m $MODEM_ID --command 'AT+CSQ)" 'BEGIN{ print int(n*10) }') + [ -z "$PERCENT" ] && PERCENT=$(awk -v n="$(mmcli -m $MODEM_ID --command 'AT+CSQ')" 'BEGIN{ print int(n*10) }') OPERATOR=$(echo "$MODEM_INFO" | grep 'modem.3gpp.operator-name ' | awk -F": " '{print $2}') [ -z "$OPERATOR" ] && OPERATOR=$(mmcli -m $MODEM_ID --command 'AT+QSPN' | awk -F[\"\"] '{ print $2 }') NUMBER=$(echo "$MODEM_INFO" | grep 'modem.generic.own-numbders.value[1]' | awk -F": " '{print $2}')