Advertisement
Guest User

iptables_kn #3

a guest
Jul 19th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.35 KB | None | 0 0
  1. xxx@zzz:/Entware
  2. ➜ make package/{iptables,iptables_kn}/{clean,compile}
  3. make[2]: Entering directory '/work/stable/Entware/scripts/config'
  4. make[2]: Leaving directory '/work/stable/Entware/scripts/config'
  5. make[1] package/iptables/clean
  6. make[2] -C package/network/utils/iptables clean
  7. make[2]: Entering directory '/work/stable/Entware/scripts/config'
  8. make[2]: Leaving directory '/work/stable/Entware/scripts/config'
  9. make[1] package/iptables/compile
  10. make[2] -C package/libs/toolchain compile
  11. make[2] -C package/network/utils/iptables compile
  12. make[2]: Entering directory '/work/stable/Entware/scripts/config'
  13. make[2]: Leaving directory '/work/stable/Entware/scripts/config'
  14. make[1] package/iptables_kn/clean
  15. make[2] -C feeds/keendev3x/iptables_kn clean
  16. make[2]: Entering directory '/work/stable/Entware/scripts/config'
  17. make[2]: Leaving directory '/work/stable/Entware/scripts/config'
  18. make[1] package/iptables_kn/compile
  19. make[2] -C package/libs/toolchain compile
  20. make[2] -C feeds/keendev3x/iptables_kn compile
  21. xxx@zzz:/Entware
  22. ➜ ls -1 bin/targets/mips-3.4/generic-glibc/packages/iptab*
  23. bin/targets/mips-3.4/generic-glibc/packages/iptables_1.4.21-2a_mips-3.4.ipk
  24. bin/targets/mips-3.4/generic-glibc/packages/iptables_1.4.21-2a_mips-3.4_kn.ipk
  25. xxx@zzz:/Entware
  26. ➜ git diff
  27. diff --git a/feeds.conf b/feeds.conf
  28. index 309f1ce..be5d6c2 100644
  29. --- a/feeds.conf
  30. +++ b/feeds.conf
  31. @@ -5,4 +5,5 @@ src-git oldports https://github.com/Entware/entware-oldpackages-ports.git
  32. src-git rtndev https://github.com/Entware/rtndev.git
  33. src-git golang https://github.com/Entware/entware-go.git
  34. #src-git graveyard https://github.com/Entware/graveyard.git
  35. -#src-git dvb https://github.com/Entware/entware-dvb.git
  36. +src-git dvb https://github.com/Entware/entware-dvb.git
  37. +src-git keendev3x git@github.com:The-BB/keendev-3x.git
  38. diff --git a/scripts/ipkg-remove b/scripts/ipkg-remove
  39. index f495700..6a216a6 100755
  40. --- a/scripts/ipkg-remove
  41. +++ b/scripts/ipkg-remove
  42. @@ -5,14 +5,19 @@ sourcename="$1"; shift
  43. for pkg in "$@"; do
  44. tar -Ozxf "$pkg" ./control.tar.gz 2>/dev/null | tar -Ozxf - ./control 2>/dev/null | \
  45. while read field value; do
  46. - if [ "$field" = "SourceName:" ] && [ "$value" = "$sourcename" ]; then
  47. +# if [ "$sourcename" = "iptables" ]; then
  48. +# break
  49. +# elif [ "$field" = "SourceName:" ] && [ "$value" = "$sourcename" ]; then
  50. + if [ "$field" = "SourceName:" ] && [ "$value" = "$sourcename" ] && [ "$sourcename" != "iptables" ]; then
  51. rm -vf "$pkg"
  52. break
  53. fi
  54. done
  55. case "$pkg" in
  56. */"${sourcename}_"*.ipk)
  57. - rm -vf "$pkg"
  58. + if [ "$sourcename" != "iptables" ]; then
  59. + rm -vf "$pkg"
  60. + fi
  61. ;;
  62. esac
  63. done
  64. xxx@zzz:/Entware
  65. ➜ cat feeds/keendev3x/iptables_kn/Makefile
  66. #
  67. # Copyright (C) 2006-2016 OpenWrt.org
  68. #
  69. # This is free software, licensed under the GNU General Public License v2.
  70. # See /LICENSE for more information.
  71. #
  72. # Entware specific: keep 1.4.21 version
  73. # Do not split extensions into separate packages, do not install dev headers
  74.  
  75. include $(TOPDIR)/rules.mk
  76. include $(INCLUDE_DIR)/kernel.mk
  77.  
  78. PKG_NAME:=iptables
  79. PKG_VERSION:=1.4.21
  80. PKG_RELEASE:=2a
  81.  
  82. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  83. PKG_SOURCE_URL:=http://www.netfilter.org/projects/iptables/files \
  84. ftp://ftp.be.netfilter.org/pub/netfilter/iptables/ \
  85. ftp://ftp.de.netfilter.org/pub/netfilter/iptables/ \
  86. ftp://ftp.no.netfilter.org/pub/netfilter/iptables/
  87. PKG_HASH:=52004c68021da9a599feed27f65defcfb22128f7da2c0531c0f75de0f479d3e0
  88. PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(PKG_NAME)_kn-$(PKG_VERSION)
  89.  
  90. PKG_FIXUP:=autoreconf
  91.  
  92. PKG_INSTALL:=1
  93. PKG_BUILD_PARALLEL:=1
  94. PKG_LICENSE:=GPL-2.0
  95. PKG_CPE_ID:=cpe:/a:netfilter_core_team:iptables
  96.  
  97. include $(INCLUDE_DIR)/package.mk
  98.  
  99. PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xjf $(DL_DIR)/$(PKG_SOURCE)
  100.  
  101. define Package/iptables
  102. TITLE:=IP firewall administration tool (Keenetic version)
  103. SECTION:=net
  104. CATEGORY:=Network
  105. SUBMENU:=Firewall
  106. URL:=http://netfilter.org/
  107. PROVIDES:=iptables
  108. ifneq (,$(filter mips mipsel,$(ARCH)))
  109. PKGARCH:=$(BOARD)_kn
  110. endif
  111. endef
  112.  
  113. define Package/iptables/description
  114. IP firewall administration tool.
  115.  
  116. Matches:
  117. - icmp
  118. - tcp
  119. - udp
  120. - comment
  121. - conntrack
  122. - limit
  123. - mac
  124. - mark
  125. - multiport
  126. - set
  127. - state
  128. - time
  129.  
  130. Targets:
  131. - ACCEPT
  132. - CT
  133. - DNAT
  134. - DROP
  135. - REJECT
  136. - LOG
  137. - MARK
  138. - MASQUERADE
  139. - REDIRECT
  140. - SET
  141. - SNAT
  142. - TCPMSS
  143.  
  144. Tables:
  145. - filter
  146. - mangle
  147. - nat
  148. - raw
  149.  
  150. endef
  151.  
  152. TARGET_CPPFLAGS := \
  153. -I$(PKG_BUILD_DIR)/include \
  154. -I$(LINUX_DIR)/user_headers/include \
  155. $(TARGET_CPPFLAGS)
  156.  
  157. TARGET_CFLAGS += \
  158. -I$(PKG_BUILD_DIR)/include \
  159. -I$(LINUX_DIR)/user_headers/include \
  160. -ffunction-sections -fdata-sections \
  161. -DNO_LEGACY
  162.  
  163. TARGET_LDFLAGS += \
  164. -lm -Wl,--gc-sections
  165.  
  166. CONFIGURE_ARGS += \
  167. --enable-shared \
  168. --enable-devel \
  169. --with-kernel="$(LINUX_DIR)/user_headers" \
  170. --with-xtlibdir=/opt/lib/iptables \
  171. --enable-static \
  172. $(if $(CONFIG_IPV6),,--disable-ipv6)
  173.  
  174. MAKE_FLAGS := \
  175. $(TARGET_CONFIGURE_OPTS) \
  176. COPT_FLAGS="$(TARGET_CFLAGS)" \
  177. KERNEL_DIR="$(LINUX_DIR)/user_headers/" PREFIX=/opt \
  178. KBUILD_OUTPUT="$(LINUX_DIR)"
  179.  
  180. #define Build/InstallDev
  181. # $(INSTALL_DIR) $(1)/opt/include
  182. # $(INSTALL_DIR) $(1)/opt/include/iptables
  183. # $(INSTALL_DIR) $(1)/opt/include/net/netfilter
  184.  
  185. # # XXX: iptables header fixup, some headers are not installed by iptables anymore
  186. # $(CP) $(PKG_BUILD_DIR)/include/iptables/*.h $(1)/opt/include/iptables/
  187. # $(CP) $(PKG_BUILD_DIR)/include/iptables.h $(1)/opt/include/
  188. # $(CP) $(PKG_BUILD_DIR)/include/ip6tables.h $(1)/opt/include/
  189. # $(CP) $(PKG_BUILD_DIR)/include/libipulog $(1)/opt/include/
  190. # $(CP) $(PKG_BUILD_DIR)/include/libiptc $(1)/opt/include/
  191.  
  192. # $(CP) $(PKG_INSTALL_DIR)/opt/include/* $(1)/opt/include/
  193. # $(INSTALL_DIR) $(1)/opt/lib
  194. # $(CP) $(PKG_INSTALL_DIR)/opt/lib/libxtables.so* $(1)/opt/lib/
  195. # $(CP) $(PKG_INSTALL_DIR)/opt/lib/libip*tc.so* $(1)/opt/lib/
  196. # $(INSTALL_DIR) $(1)/opt/lib/pkgconfig
  197. # $(CP) $(PKG_INSTALL_DIR)/opt/lib/pkgconfig/xtables.pc $(1)/opt/lib/pkgconfig/
  198. # $(CP) $(PKG_INSTALL_DIR)/opt/lib/pkgconfig/libip*tc.pc $(1)/opt/lib/pkgconfig/
  199.  
  200. # # XXX: needed by firewall3
  201. # $(CP) $(PKG_BUILD_DIR)/extensions/libiptext*.so $(1)/opt/lib/
  202. #endef
  203.  
  204. define Package/iptables/install
  205. $(INSTALL_DIR) $(1)/opt/bin
  206. $(CP) $(PKG_INSTALL_DIR)/opt/bin/iptables-xml $(1)/opt/bin/
  207. $(INSTALL_DIR) $(1)/opt/sbin
  208. $(CP) $(PKG_INSTALL_DIR)/opt/sbin/* $(1)/opt/sbin/
  209. $(INSTALL_DIR) $(1)/opt/lib/iptables
  210. $(CP) $(PKG_INSTALL_DIR)/opt/lib/*.so* $(1)/opt/lib/
  211. $(CP) $(PKG_BUILD_DIR)/extensions/*.so $(1)/opt/lib/
  212. $(CP) $(PKG_INSTALL_DIR)/opt/lib/iptables/*.so* $(1)/opt/lib/iptables/
  213. endef
  214.  
  215. $(eval $(call BuildPackage,iptables))
  216. xxx@zzz:/Entware
  217. ➜ ls -1 feeds/keendev3x/iptables_kn/patches/
  218. 020-iptables-disable-modprobe.patch
  219. 030-no-libnfnetlink.patch
  220. 050-optional-xml.patch
  221. 100-bash-location.patch
  222. 200-configurable_builtin.patch
  223. 500-add-xt_id-match.patch
  224. 600-shared-libext.patch
  225. 700-disable-legacy-revisions.patch
  226. 800-configure.ac-only-check-conntrack-when-libnfnetlink-enabled.patch
  227. 920-xt_ndmmark.patch
  228. 930-xt_conndmmark.patch
  229. xxx@zzz:/Entware
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement