Просмотр исходного кода

iproute2: add libcap support, enabled in ip-full

Preserve optionality of libcap by having configuration script follow the
HAVE_CAP environment variable, used similarly to the HAVE_ELF variable.

Signed-off-by: Alin Nastac <[email protected]>
Signed-off-by: Hans Dedecker <[email protected]> [PKG_RELEASE increase/refresh patches]
Alin Nastac 6 лет назад
Родитель
Сommit
a6da3f9ef7

+ 11 - 9
package/network/utils/iproute2/Makefile

@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 
 PKG_NAME:=iproute2
 PKG_NAME:=iproute2
 PKG_VERSION:=5.1.0
 PKG_VERSION:=5.1.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
 PKG_SOURCE_URL:=@KERNEL/linux/utils/net/iproute2
@@ -47,7 +47,7 @@ $(call Package/iproute2/Default)
  VARIANT:=full
  VARIANT:=full
  PROVIDES:=ip
  PROVIDES:=ip
  ALTERNATIVES:=300:/sbin/ip:/usr/libexec/ip-full
  ALTERNATIVES:=300:/sbin/ip:/usr/libexec/ip-full
- DEPENDS:=+libnl-tiny +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
+ DEPENDS:=+libnl-tiny +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl +libcap
 endef
 endef
 
 
 define Package/tc
 define Package/tc
@@ -55,43 +55,43 @@ $(call Package/iproute2/Default)
   TITLE:=Traffic control utility
   TITLE:=Traffic control utility
   VARIANT:=tc
   VARIANT:=tc
   PROVIDES:=tc
   PROVIDES:=tc
-  DEPENDS:=+kmod-sched-core +libxtables +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl
+  DEPENDS:=+kmod-sched-core +libxtables +libelf +(PACKAGE_devlink||PACKAGE_rdma):libmnl +PACKAGE_ip-full:libcap
 endef
 endef
 
 
 define Package/genl
 define Package/genl
 $(call Package/iproute2/Default)
 $(call Package/iproute2/Default)
   TITLE:=General netlink utility frontend
   TITLE:=General netlink utility frontend
-  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf +PACKAGE_ip-full:libcap
 endef
 endef
 
 
 define Package/ip-bridge
 define Package/ip-bridge
 $(call Package/iproute2/Default)
 $(call Package/iproute2/Default)
   TITLE:=Bridge configuration utility from iproute2
   TITLE:=Bridge configuration utility from iproute2
-  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf +PACKAGE_ip-full:libcap
 endef
 endef
 
 
 define Package/ss
 define Package/ss
 $(call Package/iproute2/Default)
 $(call Package/iproute2/Default)
   TITLE:=Socket statistics utility
   TITLE:=Socket statistics utility
-  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf +PACKAGE_ip-full:libcap
 endef
 endef
 
 
 define Package/nstat
 define Package/nstat
 $(call Package/iproute2/Default)
 $(call Package/iproute2/Default)
   TITLE:=Network statistics utility
   TITLE:=Network statistics utility
-  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+  DEPENDS:=+libnl-tiny +(PACKAGE_devlink||PACKAGE_rdma):libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf +PACKAGE_ip-full:libcap
 endef
 endef
 
 
 define Package/devlink
 define Package/devlink
 $(call Package/iproute2/Default)
 $(call Package/iproute2/Default)
   TITLE:=Network devlink utility
   TITLE:=Network devlink utility
-  DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+  DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf +PACKAGE_ip-full:libcap
 endef
 endef
 
 
 define Package/rdma
 define Package/rdma
 $(call Package/iproute2/Default)
 $(call Package/iproute2/Default)
   TITLE:=Network rdma utility
   TITLE:=Network rdma utility
-  DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf
+  DEPENDS:=+libmnl +(PACKAGE_tc||PACKAGE_ip-full):libelf +PACKAGE_ip-full:libcap
 endef
 endef
 
 
 ifeq ($(BUILD_VARIANT),tiny)
 ifeq ($(BUILD_VARIANT),tiny)
@@ -100,6 +100,7 @@ endif
 
 
 ifeq ($(BUILD_VARIANT),full)
 ifeq ($(BUILD_VARIANT),full)
   HAVE_ELF:=y
   HAVE_ELF:=y
+  HAVE_CAP:=y
 endif
 endif
 
 
 ifeq ($(BUILD_VARIANT),tc)
 ifeq ($(BUILD_VARIANT),tc)
@@ -130,6 +131,7 @@ MAKE_FLAGS += \
 	IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
 	IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
 	HAVE_ELF=$(HAVE_ELF) \
 	HAVE_ELF=$(HAVE_ELF) \
 	HAVE_MNL=$(HAVE_MNL) \
 	HAVE_MNL=$(HAVE_MNL) \
+	HAVE_CAP=$(HAVE_CAP) \
 	IPT_LIB_DIR=/usr/lib/iptables \
 	IPT_LIB_DIR=/usr/lib/iptables \
 	XT_LIB_DIR=/usr/lib/iptables \
 	XT_LIB_DIR=/usr/lib/iptables \
 	FPIC="$(FPIC)"
 	FPIC="$(FPIC)"

+ 0 - 2
package/network/utils/iproute2/patches/001-devlink-fix-libc-and-kernel-headers-collision.patch

@@ -32,8 +32,6 @@ Signed-off-by: Stephen Hemminger <[email protected]>
  devlink/devlink.c | 3 ++-
  devlink/devlink.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 
-diff --git a/devlink/devlink.c b/devlink/devlink.c
-index 97b9373..5618ba2 100644
 --- a/devlink/devlink.c
 --- a/devlink/devlink.c
 +++ b/devlink/devlink.c
 +++ b/devlink/devlink.c
 @@ -18,11 +18,12 @@
 @@ -18,11 +18,12 @@

+ 0 - 16
package/network/utils/iproute2/patches/090-tc-add-support-for-action-act_ctinfo.patch

@@ -73,8 +73,6 @@ Reviewed-by: Toke Høiland-Jørgensen <[email protected]>
  create mode 100644 man/man8/tc-ctinfo.8
  create mode 100644 man/man8/tc-ctinfo.8
  create mode 100644 tc/m_ctinfo.c
  create mode 100644 tc/m_ctinfo.c
 
 
-diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h
-index 95d0db2a..a6e7e176 100644
 --- a/include/uapi/linux/pkt_cls.h
 --- a/include/uapi/linux/pkt_cls.h
 +++ b/include/uapi/linux/pkt_cls.h
 +++ b/include/uapi/linux/pkt_cls.h
 @@ -105,6 +105,7 @@ enum tca_id {
 @@ -105,6 +105,7 @@ enum tca_id {
@@ -85,9 +83,6 @@ index 95d0db2a..a6e7e176 100644
  	__TCA_ID_MAX = 255
  	__TCA_ID_MAX = 255
  };
  };
  
  
-diff --git a/include/uapi/linux/tc_act/tc_ctinfo.h b/include/uapi/linux/tc_act/tc_ctinfo.h
-new file mode 100644
-index 00000000..f5f26d95
 --- /dev/null
 --- /dev/null
 +++ b/include/uapi/linux/tc_act/tc_ctinfo.h
 +++ b/include/uapi/linux/tc_act/tc_ctinfo.h
 @@ -0,0 +1,29 @@
 @@ -0,0 +1,29 @@
@@ -120,9 +115,6 @@ index 00000000..f5f26d95
 +#define TCA_CTINFO_MAX (__TCA_CTINFO_MAX - 1)
 +#define TCA_CTINFO_MAX (__TCA_CTINFO_MAX - 1)
 +
 +
 +#endif
 +#endif
-diff --git a/man/man8/tc-ctinfo.8 b/man/man8/tc-ctinfo.8
-new file mode 100644
-index 00000000..096590d1
 --- /dev/null
 --- /dev/null
 +++ b/man/man8/tc-ctinfo.8
 +++ b/man/man8/tc-ctinfo.8
 @@ -0,0 +1,170 @@
 @@ -0,0 +1,170 @@
@@ -296,8 +288,6 @@ index 00000000..096590d1
 +.BR tc-mirred (8)
 +.BR tc-mirred (8)
 +.SH AUTHORS
 +.SH AUTHORS
 +ctinfo was written by Kevin Darbyshire-Bryant.
 +ctinfo was written by Kevin Darbyshire-Bryant.
-diff --git a/tc/Makefile b/tc/Makefile
-index 2edaf2c8..ec93a9a1 100644
 --- a/tc/Makefile
 --- a/tc/Makefile
 +++ b/tc/Makefile
 +++ b/tc/Makefile
 @@ -48,6 +48,7 @@ TCMODULES += m_csum.o
 @@ -48,6 +48,7 @@ TCMODULES += m_csum.o
@@ -308,9 +298,6 @@ index 2edaf2c8..ec93a9a1 100644
  TCMODULES += m_bpf.o
  TCMODULES += m_bpf.o
  TCMODULES += m_tunnel_key.o
  TCMODULES += m_tunnel_key.o
  TCMODULES += m_sample.o
  TCMODULES += m_sample.o
-diff --git a/tc/m_ctinfo.c b/tc/m_ctinfo.c
-new file mode 100644
-index 00000000..5e451f87
 --- /dev/null
 --- /dev/null
 +++ b/tc/m_ctinfo.c
 +++ b/tc/m_ctinfo.c
 @@ -0,0 +1,268 @@
 @@ -0,0 +1,268 @@
@@ -582,6 +569,3 @@ index 00000000..5e451f87
 +	.parse_aopt = parse_ctinfo,
 +	.parse_aopt = parse_ctinfo,
 +	.print_aopt = print_ctinfo,
 +	.print_aopt = print_ctinfo,
 +};
 +};
--- 
-2.20.1 (Apple Git-117)
-

+ 11 - 0
package/network/utils/iproute2/patches/150-keep_libcap_optional.patch

@@ -0,0 +1,11 @@
+--- a/configure
++++ b/configure
+@@ -313,7 +313,7 @@ EOF
+ 
+ check_cap()
+ {
+-	if ${PKG_CONFIG} libcap --exists; then
++	if [ "${HAVE_CAP}" = "y" ] && ${PKG_CONFIG} libcap --exists; then
+ 		echo "HAVE_CAP:=y" >>$CONFIG
+ 		echo "yes"
+