mirror of
https://github.com/qosmio/nss-packages.git
synced 2025-12-16 08:12:53 +00:00
The way ECM uci config is handled is pretty ugly due to it not specifying a
named section for 'general'.
Current:
```
➤ uci show ecm
ecm.global=ecm
ecm.global.acceleration_engine='nss'
ecm.@general[0]=general
ecm.@general[0].enable_bridge_filtering='0'
ecm.@general[0].disable_offloads='0'
ecm.@general[0].disable_flow_control='0'
ecm.@general[0].disable_interrupt_moderation='0'
ecm.@general[0].disable_gro='0'
```
None of the options require the use of unnamed sections
(like /etc/config/dhcp does when defining configs for multiple hosts)
With this change the config would produce:
```
ecm.global=ecm
ecm.global.acceleration_engine='nss'
ecm.general=ecm
ecm.general.enable_bridge_filtering='0'
ecm.general.disable_offloads='0'
ecm.general.disable_flow_control='0'
ecm.general.disable_interrupt_moderation='0'
ecm.general.disable_gro='0'
```
Which is a lot easier to read, and access programmatically.
We can also merge `global` and `general` into a single section as it
doesn't really make sense why we need global/general when it's
technically "ALL" globally applied.
For now, to ease users on the change, let's just stick to 2 sections.
**PLEASE NOTE: For users building their own images, and storing their**
**configs in 'files/etc/config/ecm' you will need to manually update the**
**config before compiling.**
For users using **sysupgrade** or installing without custom config at build
time 'files/etc/config/ecm' should be OK.
The following can be run manually on the config file 'ecm'
```sh
conf=/etc/config/ecm
uci -q show ecm.general || {
echo "Converting 'ECM' config to new format."
sed -i "s/config.*general.*/config ecm 'general'/g" "$conf"
}
```
Signed-off-by: Sean Khan <datapronix@protonmail.com>
180 lines
5.3 KiB
Makefile
180 lines
5.3 KiB
Makefile
include $(TOPDIR)/rules.mk
|
|
|
|
PKG_NAME:=qca-nss-ecm
|
|
PKG_RELEASE:=5
|
|
|
|
PKG_SOURCE_URL:=https://git.codelinaro.org/clo/qsdk/oss/lklm/qca-nss-ecm.git
|
|
PKG_SOURCE_PROTO:=git
|
|
PKG_SOURCE_DATE:=2024-01-19
|
|
PKG_SOURCE_VERSION:=b311cdf
|
|
PKG_MIRROR_HASH:=79797be07df1b14306d47ec11c74b0a7e9d9d2005dd9de4f9f1d86d0eb87aa15
|
|
QSDK_VERSION:=12.4.5.r5
|
|
PKG_VERSION:=$(QSDK_VERSION)-$(PKG_SOURCE_DATE)-$(PKG_SOURCE_VERSION)
|
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
PKG_FLAGS:=nonshared
|
|
PKG_BUILD_FLAGS:=gc-sections lto
|
|
|
|
include $(INCLUDE_DIR)/kernel.mk
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
define KernelPackage/qca-nss-ecm
|
|
SECTION:=kernel
|
|
CATEGORY:=Kernel modules
|
|
SUBMENU:=Network Support
|
|
DEPENDS:=@(TARGET_qualcommax||TARGET_ipq807x||TARGET_ipq60xx) \
|
|
+ethtool \
|
|
+kmod-nf-conntrack \
|
|
+@NSS_DRV_IPV6_ENABLE \
|
|
+@NSS_DRV_VIRT_IF_ENABLE \
|
|
+PACKAGE_kmod-qca-nss-drv:kmod-qca-nss-drv \
|
|
+PACKAGE_kmod-qca-mcs:kmod-qca-mcs \
|
|
+PACKAGE_kmod-bonding:kmod-bonding \
|
|
+PACKAGE_kmod-vxlan:kmod-vxlan \
|
|
+PACKAGE_kmod-nat46:kmod-nat46 \
|
|
+PACKAGE_kmod-pppoe:kmod-pppoe \
|
|
+PACKAGE_kmod-pppoe:kmod-pptp \
|
|
+PACKAGE_kmod-pppoe:kmod-pppol2tp \
|
|
+@(PACKAGE_kmod-pppoe):NSS_DRV_PPPOE_ENABLE
|
|
TITLE:=QCA NSS Enhanced Connection Manager (ECM)
|
|
FILES:=$(PKG_BUILD_DIR)/ecm.ko
|
|
KCONFIG:=CONFIG_BRIDGE_NETFILTER=y \
|
|
CONFIG_NF_CONNTRACK_EVENTS=y \
|
|
CONFIG_NF_CONNTRACK_DSCPREMARK_EXT=y
|
|
endef
|
|
|
|
define KernelPackage/qca-nss-ecm/Description
|
|
This package contains the QCA NSS Enhanced Connection Manager
|
|
endef
|
|
|
|
define KernelPackage/qca-nss-ecm/conffiles
|
|
/etc/config/ecm
|
|
endef
|
|
|
|
define KernelPackage/qca-nss-ecm/install
|
|
$(INSTALL_DIR) $(1)/etc/firewall.d $(1)/etc/init.d $(1)/usr/bin $(1)/lib/netifd/offload $(1)/etc/config $(1)/etc/uci-defaults $(1)/etc/sysctl.d $(1)/etc/hotplug.d/net
|
|
$(INSTALL_DATA) ./files/qca-nss-ecm.firewall $(1)/etc/firewall.d/qca-nss-ecm
|
|
$(INSTALL_BIN) ./files/qca-nss-ecm.init $(1)/etc/init.d/qca-nss-ecm
|
|
$(INSTALL_BIN) ./files/ecm_dump.sh $(1)/usr/bin/
|
|
$(INSTALL_BIN) ./files/disable_offloads.sh $(1)/lib/netifd/offload
|
|
$(INSTALL_BIN) ./files/on-demand-down $(1)/lib/netifd/offload/on-demand-down
|
|
$(INSTALL_DATA) ./files/qca-nss-ecm.uci $(1)/etc/config/ecm
|
|
$(INSTALL_DATA) ./files/qca-nss-ecm.defaults $(1)/etc/uci-defaults/99-qca-nss-ecm
|
|
$(INSTALL_BIN) ./files/qca-nss-ecm.sysctl $(1)/etc/sysctl.d/qca-nss-ecm.conf
|
|
$(INSTALL_BIN) ./files/disable_offloads.hotplug $(1)/etc/hotplug.d/net/99-disable_offloads
|
|
endef
|
|
|
|
EXTRA_CFLAGS+= \
|
|
-I$(STAGING_DIR)/usr/include/qca-nss-drv \
|
|
-I$(STAGING_DIR)/usr/include/qca-mcs \
|
|
-I$(STAGING_DIR)/usr/include/nat46
|
|
|
|
ifneq (, $(findstring $(CONFIG_TARGET_BOARD), "qualcommax" "ipq60xx"))
|
|
ECM_MAKE_OPTS+=ECM_FRONT_END_NSS_ENABLE=y \
|
|
ECM_FRONT_END_SFE_ENABLE=n \
|
|
ECM_NON_PORTED_SUPPORT_ENABLE=y \
|
|
ECM_INTERFACE_VLAN_ENABLE=y \
|
|
ECM_CLASSIFIER_MARK_ENABLE=y \
|
|
ECM_CLASSIFIER_DSCP_ENABLE=y \
|
|
ECM_CLASSIFIER_PCC_ENABLE=n
|
|
endif
|
|
|
|
# Disable ECM IPv6 support when global IPv6 support is disabled.
|
|
ifneq ($(CONFIG_IPV6),)
|
|
ECM_MAKE_OPTS+=ECM_IPV6_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-igs),)
|
|
ECM_MAKE_OPTS+=ECM_CLASSIFIER_DSCP_IGS=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-ovpn-link),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_OVPN_ENABLE=y
|
|
endif
|
|
|
|
ifeq ($(CONFIG_PACKAGE_kmod-vxlan),y)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_VXLAN_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-qca-ovsmgr),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_OVS_BRIDGE_ENABLE=y \
|
|
ECM_CLASSIFIER_OVS_ENABLE=y
|
|
EXTRA_CFLAGS+= -I$(STAGING_DIR)/usr/include/qca-ovsmgr
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-macvlan),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_MACVLAN_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-qca-mcs),)
|
|
ECM_MAKE_OPTS+=ECM_MULTICAST_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-nat46),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_MAP_T_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-ipsec),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_IPSEC_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-pppoe),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_PPPOE_ENABLE=y \
|
|
ECM_INTERFACE_PPTP_ENABLE=y \
|
|
ECM_INTERFACE_PPP_ENABLE=y
|
|
else
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_PPPOE_ENABLE=n \
|
|
ECM_INTERFACE_PPTP_ENABLE=n \
|
|
ECM_INTERFACE_PPP_ENABLE=n
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-pppol2tp),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_L2TPV2_ENABLE=y
|
|
else
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_L2TPV2_ENABLE=n
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-gre)$(CONFIG_PACKAGE_kmod-gre6),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_GRE_TAP_ENABLE=y \
|
|
ECM_INTERFACE_GRE_TUN_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-sit),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_SIT_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-ip6-tunnel),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_TUNIPIP6_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-qca-nss-drv-mscs),)
|
|
ECM_MAKE_OPTS+=ECM_CLASSIFIER_MSCS_ENABLE=y
|
|
endif
|
|
|
|
ifneq ($(CONFIG_PACKAGE_kmod-bonding),)
|
|
ECM_MAKE_OPTS+=ECM_INTERFACE_BOND_ENABLE=y
|
|
endif
|
|
|
|
define Build/InstallDev
|
|
mkdir -p $(1)/usr/include/qca-nss-ecm
|
|
$(CP) $(PKG_BUILD_DIR)/exports/* $(1)/usr/include/qca-nss-ecm
|
|
endef
|
|
|
|
ifeq ($(CONFIG_TARGET_BOARD), "qualcommax")
|
|
SOC:=$(CONFIG_TARGET_SUBTARGET)
|
|
endif
|
|
|
|
define Build/Compile
|
|
+$(MAKE) -C "$(LINUX_DIR)" $(strip $(ECM_MAKE_OPTS)) \
|
|
CROSS_COMPILE="$(TARGET_CROSS)" \
|
|
ARCH="$(LINUX_KARCH)" \
|
|
M="$(PKG_BUILD_DIR)" \
|
|
EXTRA_CFLAGS="$(EXTRA_CFLAGS) -Wno-error=unused-function " \
|
|
SoC=$(SOC) \
|
|
$(KERNEL_MAKE_FLAGS) \
|
|
$(PKG_JOBS) \
|
|
modules
|
|
endef
|
|
|
|
$(eval $(call KernelPackage,qca-nss-ecm))
|