Skip to content

Commit

Permalink
linux/modules: fix some v4.4 dependencies
Browse files Browse the repository at this point in the history
NFT has different deps on v4.4.

Signed-off-by: John Crispin <john@phrozen.org>
  • Loading branch information
blogic authored and aiamadeus committed Mar 18, 2022
1 parent 2c9d9a0 commit 555279f
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 19 deletions.
1 change: 1 addition & 0 deletions config/Config-images.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ menu "Target Images"
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_lantiq
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
default TARGET_INITRAMFS_COMPRESSION_GZIP if TARGET_ipq60xx
default TARGET_INITRAMFS_COMPRESSION_NONE
depends on TARGET_ROOTFS_INITRAMFS
help
Expand Down
2 changes: 2 additions & 0 deletions include/kernel-version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ ifdef CONFIG_TESTING_KERNEL
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif

LINUX_VERSION-4.4 = .60
LINUX_VERSION-4.14 = .267

LINUX_KERNEL_HASH-4.4.60 = 10f619f7f9ab9f2776d0e34d37138b1ca14e9a026b91790dbdb1eb6c8d15edc6
LINUX_KERNEL_HASH-4.14.267 = 8c343f885cfe25a51a8d40595afe5268ce09eaf8f531f9546ecf20831924188e

remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
Expand Down
15 changes: 8 additions & 7 deletions include/netfilter.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ $(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MATCH_LIMIT, $(P_XT)xt_limit))
$(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MATCH_MAC, $(P_XT)xt_mac))
$(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MATCH_MULTIPORT, $(P_XT)xt_multiport))
$(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MATCH_COMMENT, $(P_XT)xt_comment))
$(eval $(call nf_add,IPT_CORE,CONFIG_NETFILTER_XT_MATCH_ID, $(P_XT)xt_id))

#cluster
$(eval $(call nf_add,IPT_CLUSTER,CONFIG_NETFILTER_XT_MATCH_CLUSTER, $(P_XT)xt_cluster))
Expand Down Expand Up @@ -185,8 +186,8 @@ $(eval $(call nf_add,IPT_IPV6_EXTRA,CONFIG_IP6_NF_MATCH_RT, $(P_V6)ip6t_rt))

# kernel only
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT, $(P_XT)nf_nat),))
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_REDIRECT, $(P_XT)nf_nat_redirect, ge 3.19.0),))
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_IPV4, $(P_V4)nf_nat_ipv4),))
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_REDIRECT, $(P_XT)nf_nat_redirect, lt 4.18),))
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_IPV4, $(P_V4)nf_nat_ipv4, lt 4.18),))
$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT,CONFIG_NF_NAT_MASQUERADE_IPV4, $(P_V4)nf_nat_masquerade_ipv4, lt 4.18),))

$(eval $(if $(NF_KMOD),$(call nf_add,NF_NAT6,CONFIG_NF_NAT_IPV6, $(P_V6)nf_nat_ipv6),))
Expand All @@ -202,8 +203,8 @@ $(eval $(if $(NF_KMOD),$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_NPT, $(P_V6)i
$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT,CONFIG_NF_NAT, ipt_SNAT ipt_DNAT)))
$(eval $(if $(NF_KMOD),,$(call nf_add,IPT_NAT6,CONFIG_IP6_NF_TARGET_NPT, ip6t_DNPT ip6t_SNPT)))

$(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_MASQUERADE, $(P_V4)ipt_MASQUERADE))
$(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_REDIRECT, $(P_XT)xt_REDIRECT))
$(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_MASQUERADE, $(P_V4)ipt_MASQUERADE, lt 4.18))
$(eval $(call nf_add,IPT_NAT,CONFIG_IP_NF_TARGET_REDIRECT, $(P_XT)xt_REDIRECT, lt 4.18))


# nat-extra
Expand Down Expand Up @@ -349,9 +350,9 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_LIMIT, $(P_XT)nft_limit
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REJECT, $(P_XT)nft_reject $(P_V4)nft_reject_ipv4 $(P_V6)nft_reject_ipv6),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REJECT_INET, $(P_XT)nft_reject_inet),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV4, $(P_V4)nf_tables_ipv4, lt 4.17),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV4, $(P_V4)nft_chain_route_ipv4),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV4, $(P_V4)nft_chain_route_ipv4, lt 4.9.0),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NF_TABLES_IPV6, $(P_V6)nf_tables_ipv6, lt 4.17),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV6, $(P_V6)nft_chain_route_ipv6),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_CHAIN_ROUTE_IPV6, $(P_V6)nft_chain_route_ipv6, lt 4.9.0),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_REDIR, $(P_XT)nft_redir, ge 3.19.0),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_CORE,CONFIG_NFT_QUOTA, $(P_XT)nft_quota, ge 4.9.0),))

Expand All @@ -362,7 +363,7 @@ $(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NFT_BRIDGE_META, $(P_EBT)
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_BRIDGE,CONFIG_NFT_BRIDGE_REJECT, $(P_EBT)nft_reject_bridge),))

$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_NAT, $(P_XT)nft_nat),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_CHAIN_NAT_IPV4, $(P_V4)nft_chain_nat_ipv4),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_CHAIN_NAT_IPV4, $(P_V4)nft_chain_nat_ipv4, lt 4.9.0),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_REDIR_IPV4, $(P_V4)nft_redir_ipv4, ge 3.19.0),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_MASQ, $(P_XT)nft_masq),))
$(eval $(if $(NF_KMOD),$(call nf_add,NFT_NAT,CONFIG_NFT_MASQ_IPV4, $(P_V4)nft_masq_ipv4),))
Expand Down
8 changes: 4 additions & 4 deletions include/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ ifdef CONFIG_USE_MIPS16
TARGET_CFLAGS += -mips16 -minterlink-mips16
endif
endif
ifeq ($(strip $(PKG_IREMAP)),1)
IREMAP_CFLAGS = $(call iremap,$(PKG_BUILD_DIR),$(notdir $(PKG_BUILD_DIR)))
TARGET_CFLAGS += $(IREMAP_CFLAGS)
endif
#ifeq ($(strip $(PKG_IREMAP)),1)
# IREMAP_CFLAGS = $(call iremap,$(PKG_BUILD_DIR),$(notdir $(PKG_BUILD_DIR)))
# TARGET_CFLAGS += $(IREMAP_CFLAGS)
#endif

include $(INCLUDE_DIR)/hardening.mk
include $(INCLUDE_DIR)/prereq.mk
Expand Down
4 changes: 4 additions & 0 deletions include/quilt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ define Kernel/Patch/Default
echo "generic patches directory is present. please move your patches to the pending directory" ; \
exit 1; \
fi
ifneq ($(CONFIG_TARGET_ipq60xx),y)
$(call PatchDir,$(LINUX_DIR),$(GENERIC_BACKPORT_DIR),generic-backport/)
$(call PatchDir,$(LINUX_DIR),$(GENERIC_PATCH_DIR),generic/)
$(call PatchDir,$(LINUX_DIR),$(GENERIC_HACK_DIR),generic-hack/)
$(call PatchDir,$(LINUX_DIR),$(PATCH_DIR),platform/)
endif
endef

define Quilt/RefreshDir
Expand All @@ -130,10 +132,12 @@ define Quilt/Refresh/Kernel
echo "All kernel patches must start with either generic/ or platform/"; \
false; \
}
ifneq ($(CONFIG_TARGET_ipq60xx),y)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_BACKPORT_DIR),generic-backport/)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_PATCH_DIR),generic/)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(GENERIC_HACK_DIR),generic-hack/)
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR),platform/)
endif
endef

define Quilt/Template
Expand Down
7 changes: 7 additions & 0 deletions include/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,18 @@ ifneq ($(TARGET_BUILD)$(if $(DUMP),,1),)
include $(INCLUDE_DIR)/kernel-version.mk
endif

ifeq ($(CONFIG_TARGET_ipq60xx),y)
GENERIC_BACKPORT_DIR :=
GENERIC_PATCH_DIR :=
GENERIC_HACK_DIR :=
GENERIC_FILES_DIR :=
else
GENERIC_PLATFORM_DIR := $(TOPDIR)/target/linux/generic
GENERIC_BACKPORT_DIR := $(GENERIC_PLATFORM_DIR)/backport$(if $(wildcard $(GENERIC_PLATFORM_DIR)/backport-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
GENERIC_PATCH_DIR := $(GENERIC_PLATFORM_DIR)/pending$(if $(wildcard $(GENERIC_PLATFORM_DIR)/pending-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
GENERIC_HACK_DIR := $(GENERIC_PLATFORM_DIR)/hack$(if $(wildcard $(GENERIC_PLATFORM_DIR)/hack-$(KERNEL_PATCHVER)),-$(KERNEL_PATCHVER))
GENERIC_FILES_DIR := $(foreach dir,$(wildcard $(GENERIC_PLATFORM_DIR)/files $(GENERIC_PLATFORM_DIR)/files-$(KERNEL_PATCHVER)),"$(dir)")
endif

__config_name_list = $(1)/config-$(KERNEL_PATCHVER) $(1)/config-default
__config_list = $(firstword $(wildcard $(call __config_name_list,$(1))))
Expand Down
2 changes: 1 addition & 1 deletion package/kernel/linux/modules/iio.mk
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ $(eval $(call KernelPackage,iio-dht11))
define KernelPackage/iio-bmp280
SUBMENU:=$(IIO_MENU)
TITLE:=BMP180/BMP280/BME280 pressure/temperatur sensor
DEPENDS:=+kmod-iio-core +kmod-regmap-core
DEPENDS:=@!LINUX_4_14 +kmod-iio-core +kmod-regmap-core
KCONFIG:=CONFIG_BMP280
FILES:=$(LINUX_DIR)/drivers/iio/pressure/bmp280.ko
endef
Expand Down
8 changes: 4 additions & 4 deletions package/kernel/linux/modules/netfilter.mk
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ define KernelPackage/ipt-ipopt
KCONFIG:=$(KCONFIG_IPT_IPOPT)
FILES:=$(foreach mod,$(IPT_IPOPT-m),$(LINUX_DIR)/net/$(mod).ko)
AUTOLOAD:=$(call AutoProbe,$(notdir $(IPT_IPOPT-m)))
$(call AddDepends/ipt)
$(call AddDepends/ipt,+kmod-nf-conntrack)
endef

define KernelPackage/ipt-ipopt/description
Expand Down Expand Up @@ -1160,9 +1160,9 @@ define KernelPackage/nft-netdev
CONFIG_NFT_FWD_NETDEV
FILES:= \
$(LINUX_DIR)/net/netfilter/nf_tables_netdev.ko@lt4.17 \
$(LINUX_DIR)/net/netfilter/nf_dup_netdev.ko \
$(LINUX_DIR)/net/netfilter/nft_dup_netdev.ko \
$(LINUX_DIR)/net/netfilter/nft_fwd_netdev.ko
$(LINUX_DIR)/net/netfilter/nf_dup_netdev.ko@ge4.5 \
$(LINUX_DIR)/net/netfilter/nft_dup_netdev.ko@ge4.5 \
$(LINUX_DIR)/net/netfilter/nft_fwd_netdev.ko@ge4.5
AUTOLOAD:=$(call AutoProbe,nf_tables_netdev nf_dup_netdev nft_dup_netdev nft_fwd_netdev)
endef

Expand Down
8 changes: 5 additions & 3 deletions package/kernel/linux/modules/usb.mk
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,11 @@ $(eval $(call KernelPackage,usb-dwc3))

define KernelPackage/usb-dwc3-of-simple
TITLE:=DWC3 USB simple OF driver
DEPENDS:=@!LINUX_4_19 @(TARGET_ipq40xx||TARGET_ipq806x) +kmod-usb-dwc3
DEPENDS:=@!LINUX_4_19 @(TARGET_ipq40xx||TARGET_ipq60xx) +kmod-usb-dwc3
KCONFIG:= CONFIG_USB_DWC3_OF_SIMPLE
FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3-of-simple.ko
FILES:= \
$(LINUX_DIR)/drivers/usb/dwc3/dwc3-of-simple.ko \
$(LINUX_DIR)/drivers/usb/dwc3/dbm.ko
AUTOLOAD:=$(call AutoLoad,53,dwc3-of-simple,1)
$(call AddDepends/usb)
endef
Expand All @@ -498,7 +500,7 @@ $(eval $(call KernelPackage,usb-dwc3-of-simple))

define KernelPackage/usb-dwc3-qcom
TITLE:=DWC3 Qualcomm USB driver
DEPENDS:=@LINUX_4_19 @(TARGET_ipq40xx||TARGET_ipq806x) +kmod-usb-dwc3
DEPENDS:=@LINUX_4_19 @(TARGET_ipq40xx||TARGET_ipq60xx) +kmod-usb-dwc3
KCONFIG:= CONFIG_USB_DWC3_QCOM
FILES:= $(LINUX_DIR)/drivers/usb/dwc3/dwc3-qcom.ko
AUTOLOAD:=$(call AutoLoad,53,dwc3-qcom,1)
Expand Down

0 comments on commit 555279f

Please sign in to comment.