All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] iproute2: backport version 4.9.0
@ 2017-07-19 17:07 Jacob Stiffler
  2017-07-19 17:07 ` [PATCH 2/2] iproute2: add hsr/prp support Jacob Stiffler
  2017-07-19 17:20 ` [PATCH 1/2] iproute2: backport version 4.9.0 Denys Dmytriyenko
  0 siblings, 2 replies; 4+ messages in thread
From: Jacob Stiffler @ 2017-07-19 17:07 UTC (permalink / raw)
  To: meta-arago

* Backport iproute2 4.9.0 from oe-core.
* Recipes were directly copied from commit
  eac08770b1ea3ca6640941dc8fd03fc3fa5ff869

Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
---
 .../recipes-connectivity/iproute2/iproute2.inc     |  48 ++++++++
 .../iproute2/0001-iproute2-de-bash-scripts.patch   |  64 ++++++++++
 .../iproute2/iproute2/configure-cross.patch        |  32 +++++
 .../iproute2/iproute2/iproute2-4.9.0-musl.patch    | 131 +++++++++++++++++++++
 .../iproute2/iproute2_4.9.0.bb                     |  14 +++
 5 files changed, 289 insertions(+)
 create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc
 create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
 create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2/configure-cross.patch
 create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch
 create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb

diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc b/meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc
new file mode 100644
index 0000000..ce64888
--- /dev/null
+++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc
@@ -0,0 +1,48 @@
+SUMMARY = "TCP / IP networking and traffic control utilities"
+DESCRIPTION = "Iproute2 is a collection of utilities for controlling \
+TCP / IP networking and traffic control in Linux.  Of the utilities ip \
+and tc are the most important.  ip controls IPv4 and IPv6 \
+configuration and tc stands for traffic control."
+HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
+SECTION = "base"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
+                    file://ip/ip.c;beginline=3;endline=8;md5=689d691d0410a4b64d3899f8d6e31817"
+
+DEPENDS = "flex-native bison-native iptables elfutils"
+
+inherit update-alternatives bash-completion pkgconfig
+
+EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
+
+do_configure_append () {
+    sh configure ${STAGING_INCDIR}
+    # Explicitly disable ATM support
+    sed -i -e '/TC_CONFIG_ATM/d' Config
+}
+
+do_install () {
+    oe_runmake DESTDIR=${D} install
+    mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2
+    install -d ${D}${datadir}
+    mv ${D}/share/* ${D}${datadir}/ || true
+    rm ${D}/share -rf || true
+}
+
+# The .so files in iproute2-tc are modules, not traditional libraries
+INSANE_SKIP_${PN}-tc = "dev-so"
+
+PACKAGES =+ "${PN}-tc ${PN}-lnstat ${PN}-ifstat ${PN}-genl ${PN}-rtacct ${PN}-nstat ${PN}-ss"
+FILES_${PN}-tc = "${base_sbindir}/tc* \
+                  ${libdir}/tc/*.so"
+FILES_${PN}-lnstat = "${base_sbindir}/lnstat ${base_sbindir}/ctstat ${base_sbindir}/rtstat"
+FILES_${PN}-ifstat = "${base_sbindir}/ifstat"
+FILES_${PN}-genl = "${base_sbindir}/genl"
+FILES_${PN}-rtacct = "${base_sbindir}/rtacct"
+FILES_${PN}-nstat = "${base_sbindir}/nstat"
+FILES_${PN}-ss = "${base_sbindir}/ss"
+
+ALTERNATIVE_${PN} = "ip"
+ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
+ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
new file mode 100644
index 0000000..39c7d40
--- /dev/null
+++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
@@ -0,0 +1,64 @@
+Subject: [PATCH] iproute2: de-bash scripts
+
+de-bash these two scripts to make iproute2 not depend on bash.
+
+Upstream-Status: Pending
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+
+---
+ ip/ifcfg |   15 ++++++++-------
+ ip/rtpr  |    2 +-
+ 2 files changed, 9 insertions(+), 8 deletions(-)
+
+diff --git a/ip/ifcfg b/ip/ifcfg
+index 083d9df..60bcf1f 100644
+--- a/ip/ifcfg
++++ b/ip/ifcfg
+@@ -1,12 +1,13 @@
+-#! /bin/bash
++#! /bin/sh
+ 
+ CheckForwarding () {
+-  local sbase fwd
++  local sbase fwd forwarding
+   sbase=/proc/sys/net/ipv4/conf
+   fwd=0
+   if [ -d $sbase ]; then
+     for dir in $sbase/*/forwarding; do
+-      fwd=$[$fwd + `cat $dir`]
++      forwarding=`cat $dir`
++      fwd=$(($fwd+$forwarding))
+     done
+   else
+     fwd=2
+@@ -127,12 +128,12 @@ fi
+ arping -q -A -c 1 -I $dev $ipaddr
+ noarp=$?
+ ( sleep 2 ;
+-  arping -q -U -c 1 -I $dev $ipaddr ) >& /dev/null </dev/null &
++  arping -q -U -c 1 -I $dev $ipaddr ) > /dev/null 2>&1 </dev/null &
+ 
+-ip route add unreachable 224.0.0.0/24 >& /dev/null
+-ip route add unreachable 255.255.255.255 >& /dev/null
++ip route add unreachable 224.0.0.0/24 > /dev/null 2>&1
++ip route add unreachable 255.255.255.255 > /dev/null 2>&1
+ if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then
+-  ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
++  ip route add 224.0.0.0/4 dev $dev scope global > /dev/null 2>&1
+ fi
+ 
+ if [ $fwd -eq 0 ]; then
+diff --git a/ip/rtpr b/ip/rtpr
+index c3629fd..674198d 100644
+--- a/ip/rtpr
++++ b/ip/rtpr
+@@ -1,4 +1,4 @@
+-#! /bin/bash
++#! /bin/sh
+ 
+ exec tr "[\\\\]" "[
+ ]"
+-- 
+1.7.9.5
+
diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2/configure-cross.patch b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/configure-cross.patch
new file mode 100644
index 0000000..866609c
--- /dev/null
+++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/configure-cross.patch
@@ -0,0 +1,32 @@
+From 85b0589b4843c03e8e6fd9416d71ea449a73c5c0 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Thu, 3 Nov 2011 10:46:16 +0100
+Subject: [PATCH] make configure cross compile safe
+
+According to Kevin Tian:
+Upstream-Status: Pending
+
+Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
+Signed-off-by: Shane Wang <shane.wang@intel.com>
+
+Index: iproute2-3.7.0/configure
+===================================================================
+--- iproute2-3.7.0.orig/configure
++++ iproute2-3.7.0/configure
+@@ -2,6 +2,7 @@
+ # This is not an autconf generated configure
+ #
+ INCLUDE=${1:-"$PWD/include"}
++SYSROOT=$1
+ 
+ # Make a temp directory in build tree.
+ TMPDIR=$(mktemp -d config.XXXXXX)
+@@ -158,7 +159,7 @@ check_ipt_lib_dir()
+ 		return
+ 	fi
+ 
+-	for dir in /lib /usr/lib /usr/local/lib
++	for dir in $SYSROOT/lib $SYSROOT/usr/lib $SYSROOT/usr/local/lib
+ 	do
+ 		for file in $dir/{xtables,iptables}/lib*t_*so ; do
+ 			if [ -f $file ]; then
diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch
new file mode 100644
index 0000000..737a90c
--- /dev/null
+++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch
@@ -0,0 +1,131 @@
+Subject: [PATCH] Avoid in6_addr redefinition
+
+Due to both <netinet/in.h> and <linux/in6.h> being included, the 
+in6_addr is being redefined: once from the C library headers and once
+from the kernel headers. This causes some build failures with for 
+example the musl C library.
+
+In order to fix this, use just the C library header <netinet/in.h>.
+Original patch taken from
+http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-fixes.patch.
+
+(Refreshed the patch for 4.9 release)
+
+Upstream-Status: Pending
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+Signed-off-by: Maxin B. John <maxin.john@intel.com>
+Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
+---
+ include/libiptc/ipt_kernel_headers.h     | 1 -
+ include/linux/if_bridge.h                | 1 -
+ include/linux/if_tunnel.h                | 2 --
+ include/linux/netfilter.h                | 2 --
+ include/linux/netfilter_ipv4/ip_tables.h | 1 -
+ include/linux/xfrm.h                     | 1 -
+ include/utils.h                          | 1 +
+ ip/ip6tunnel.c                           | 1 -
+ 8 files changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
+index a5963e9..42f8610 100644
+--- a/include/libiptc/ipt_kernel_headers.h
++++ b/include/libiptc/ipt_kernel_headers.h
+@@ -6,7 +6,6 @@
+ #include <limits.h>
+ 
+ #include <netinet/ip.h>
+-#include <netinet/in.h>
+ #include <netinet/ip_icmp.h>
+ #include <netinet/tcp.h>
+ #include <netinet/udp.h>
+diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
+index b7393dd..a7028ab 100644
+--- a/include/linux/if_bridge.h
++++ b/include/linux/if_bridge.h
+@@ -15,7 +15,6 @@
+ 
+ #include <linux/types.h>
+ #include <linux/if_ether.h>
+-#include <linux/in6.h>
+ 
+ #define SYSFS_BRIDGE_ATTR	"bridge"
+ #define SYSFS_BRIDGE_FDB	"brforward"
+diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
+index 4f975f5..2680646 100644
+--- a/include/linux/if_tunnel.h
++++ b/include/linux/if_tunnel.h
+@@ -2,9 +2,7 @@
+ #define _IF_TUNNEL_H_
+ 
+ #include <linux/types.h>
+-#include <linux/if.h>
+ #include <linux/ip.h>
+-#include <linux/in6.h>
+ #include <asm/byteorder.h>
+ 
+ 
+diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
+index b71b4c9..3e4e6ae 100644
+--- a/include/linux/netfilter.h
++++ b/include/linux/netfilter.h
+@@ -4,8 +4,6 @@
+ #include <linux/types.h>
+ 
+ #include <linux/sysctl.h>
+-#include <linux/in.h>
+-#include <linux/in6.h>
+ 
+ /* Responses from hook functions. */
+ #define NF_DROP 0
+diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
+index 456fb86..38542b4 100644
+--- a/include/linux/netfilter_ipv4/ip_tables.h
++++ b/include/linux/netfilter_ipv4/ip_tables.h
+@@ -17,7 +17,6 @@
+ 
+ #include <linux/types.h>
+ 
+-#include <linux/if.h>
+ #include <linux/netfilter_ipv4.h>
+ 
+ #include <linux/netfilter/x_tables.h>
+diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
+index d2dd1fd..8c72966 100644
+--- a/include/linux/xfrm.h
++++ b/include/linux/xfrm.h
+@@ -1,7 +1,6 @@
+ #ifndef _LINUX_XFRM_H
+ #define _LINUX_XFRM_H
+ 
+-#include <linux/in6.h>
+ #include <linux/types.h>
+ 
+ /* All of the structures in this file may not change size as they are
+diff --git a/include/utils.h b/include/utils.h
+index 1b4f939..d10840b 100644
+--- a/include/utils.h
++++ b/include/utils.h
+@@ -1,6 +1,7 @@
+ #ifndef __UTILS_H__
+ #define __UTILS_H__ 1
+ 
++#include <sys/param.h>  /* MAXPATHLEN */
+ #include <sys/types.h>
+ #include <asm/types.h>
+ #include <resolv.h>
+diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
+index b1c0ae6..8fa4eb2 100644
+--- a/ip/ip6tunnel.c
++++ b/ip/ip6tunnel.c
+@@ -28,7 +28,6 @@
+ #include <arpa/inet.h>
+ #include <sys/ioctl.h>
+ #include <linux/ip.h>
+-#include <linux/if.h>
+ #include <linux/if_arp.h>
+ #include <linux/if_tunnel.h>
+ #include <linux/ip6_tunnel.h>
+-- 
+2.7.4
+
diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb b/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb
new file mode 100644
index 0000000..808e550
--- /dev/null
+++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb
@@ -0,0 +1,14 @@
+require iproute2.inc
+
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
+           file://configure-cross.patch \
+           file://0001-iproute2-de-bash-scripts.patch \
+           file://iproute2-4.9.0-musl.patch \
+          "
+
+SRC_URI[md5sum] = "44a8371a4b2c40e48e4c9f98cbd41391"
+SRC_URI[sha256sum] = "c0f30f043f7767cc1b2cd2197b08d4e9b2392c95823fabe30bbce308c30116c4"
+
+# CFLAGS are computed in Makefile and reference CCOPTS
+#
+EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] iproute2: add hsr/prp support
  2017-07-19 17:07 [PATCH 1/2] iproute2: backport version 4.9.0 Jacob Stiffler
@ 2017-07-19 17:07 ` Jacob Stiffler
  2017-07-19 17:20 ` [PATCH 1/2] iproute2: backport version 4.9.0 Denys Dmytriyenko
  1 sibling, 0 replies; 4+ messages in thread
From: Jacob Stiffler @ 2017-07-19 17:07 UTC (permalink / raw)
  To: meta-arago

Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
---
 .../0001-ip-HSR-Fix-cut-and-paste-error.patch      |  27 +++
 .../0002-add-support-for-prp-similar-to-hsr.patch  | 221 +++++++++++++++++++++
 .../iproute2/iproute2_4.9.0.bb                     |   2 +
 3 files changed, 250 insertions(+)
 create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-ip-HSR-Fix-cut-and-paste-error.patch
 create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2/0002-add-support-for-prp-similar-to-hsr.patch

diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-ip-HSR-Fix-cut-and-paste-error.patch b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-ip-HSR-Fix-cut-and-paste-error.patch
new file mode 100644
index 0000000..25249ab
--- /dev/null
+++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-ip-HSR-Fix-cut-and-paste-error.patch
@@ -0,0 +1,27 @@
+From 3f586aee3d617b1281d5c535caafd9f09d06f5fb Mon Sep 17 00:00:00 2001
+From: Ralf Baechle <ralf@linux-mips.org>
+Date: Mon, 6 Feb 2017 21:47:35 +0100
+Subject: [PATCH 1/2] ip: HSR: Fix cut and paste error
+
+Fixes: 5c0aec93a516 ("ip: Add HSR support")
+Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
+---
+ ip/iplink_hsr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/ip/iplink_hsr.c b/ip/iplink_hsr.c
+index cb744eb..696b2c9 100644
+--- a/ip/iplink_hsr.c
++++ b/ip/iplink_hsr.c
+@@ -144,7 +144,7 @@ static void hsr_print_help(struct link_util *lu, int argc, char **argv,
+ 
+ struct link_util hsr_link_util = {
+ 	.id		= "hsr",
+-	.maxattr	= IFLA_VLAN_MAX,
++	.maxattr	= IFLA_HSR_MAX,
+ 	.parse_opt	= hsr_parse_opt,
+ 	.print_opt	= hsr_print_opt,
+ 	.print_help	= hsr_print_help,
+-- 
+1.9.1
+
diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0002-add-support-for-prp-similar-to-hsr.patch b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0002-add-support-for-prp-similar-to-hsr.patch
new file mode 100644
index 0000000..d0d74b5
--- /dev/null
+++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0002-add-support-for-prp-similar-to-hsr.patch
@@ -0,0 +1,221 @@
+From c245063217c7c27c3b324c1faba3b69b50c50fd1 Mon Sep 17 00:00:00 2001
+From: Murali Karicheri <m-karicheri2@ti.com>
+Date: Wed, 12 Apr 2017 16:23:37 -0400
+Subject: [PATCH 2/2] add support for prp similar to hsr
+
+prp protocol is similar to hsr in many aspects and this patch add a
+command type prp to create prp interface using two slave interfaces
+similar to hsr
+
+Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
+
+Conflicts:
+	include/linux/if_link.h
+	ip/Makefile
+---
+ include/linux/if_link.h |  14 ++++-
+ ip/Makefile             |   2 +-
+ ip/iplink_prp.c         | 141 ++++++++++++++++++++++++++++++++++++++++++++++++
+ 3 files changed, 154 insertions(+), 3 deletions(-)
+ create mode 100644 ip/iplink_prp.c
+
+diff --git a/include/linux/if_link.h b/include/linux/if_link.h
+index 20965c9..6b9b59b 100644
+--- a/include/linux/if_link.h
++++ b/include/linux/if_link.h
+@@ -810,7 +810,6 @@ enum {
+ 
+ 
+ /* HSR section */
+-
+ enum {
+ 	IFLA_HSR_UNSPEC,
+ 	IFLA_HSR_SLAVE1,
+@@ -821,7 +820,6 @@ enum {
+ 	IFLA_HSR_VERSION,		/* HSR version */
+ 	__IFLA_HSR_MAX,
+ };
+-
+ #define IFLA_HSR_MAX (__IFLA_HSR_MAX - 1)
+ 
+ /* STATS section */
+@@ -881,4 +879,16 @@ enum {
+ 
+ #define IFLA_XDP_MAX (__IFLA_XDP_MAX - 1)
+ 
++/* PRP section */
++enum {
++	IFLA_PRP_UNSPEC,
++	IFLA_PRP_SLAVE1,
++	IFLA_PRP_SLAVE2,
++	IFLA_PRP_MULTICAST_SPEC,	/* Last byte of supervision addr */
++	IFLA_PRP_SUPERVISION_ADDR,	/* Supervision frame multicast addr */
++	IFLA_PRP_SEQ_NR,
++	__IFLA_PRP_MAX,
++};
++#define IFLA_PRP_MAX (__IFLA_PRP_MAX - 1)
++
+ #endif /* _LINUX_IF_LINK_H */
+diff --git a/ip/Makefile b/ip/Makefile
+index 86c8cdc..95f0fa5 100644
+--- a/ip/Makefile
++++ b/ip/Makefile
+@@ -6,7 +6,7 @@ IPOBJ=ip.o ipaddress.o ipaddrlabel.o iproute.o iprule.o ipnetns.o \
+     iplink_macvlan.o ipl2tp.o link_vti.o link_vti6.o \
+     iplink_vxlan.o tcp_metrics.o iplink_ipoib.o ipnetconf.o link_ip6tnl.o \
+     link_iptnl.o link_gre6.o iplink_bond.o iplink_bond_slave.o iplink_hsr.o \
+-    iplink_bridge.o iplink_bridge_slave.o ipfou.o iplink_ipvlan.o \
++    iplink_prp.o iplink_bridge.o iplink_bridge_slave.o ipfou.o iplink_ipvlan.o \
+     iplink_geneve.o iplink_vrf.o iproute_lwtunnel.o ipmacsec.o ipila.o
+ 
+ RTMONOBJ=rtmon.o
+diff --git a/ip/iplink_prp.c b/ip/iplink_prp.c
+new file mode 100644
+index 0000000..c1e5a3b
+--- /dev/null
++++ b/ip/iplink_prp.c
+@@ -0,0 +1,141 @@
++/*
++ * iplink_prp.c	PRP device support
++ *
++ *		This program is free software; you can redistribute it and/or
++ *		modify it under the terms of the GNU General Public License
++ *		as published by the Free Software Foundation; either version
++ *		2 of the License, or (at your option) any later version.
++ *
++ * Authors:	Murali Karicheri <m-karicheri2@ti.com>
++ *
++ *		Based on iplink_hsr.c by Arvid Brodin <arvid.brodin@alten.se>
++ */
++
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/socket.h>  /* Needed by linux/if.h for some reason */
++#include <linux/if.h>
++#include <linux/if_arp.h>
++#include "rt_names.h"
++#include "utils.h"
++#include "ip_common.h"
++
++static void print_usage(FILE *f)
++{
++	fprintf(f,
++"Usage:\tip link add name NAME type prp slave1 SLAVE1-IF slave2 SLAVE2-IF\n"
++"\t[ supervision ADDR-BYTE ]\n"
++"\n"
++"NAME\n"
++"	name of new prp device (e.g. prp0)\n"
++"SLAVE1-IF, SLAVE2-IF\n"
++"	the two slave devices bound to the PRP device\n"
++"ADDR-BYTE\n"
++"	0-255; the last byte of the multicast address used for HSR supervision\n"
++"	frames (default = 0)\n");
++}
++
++static void usage(void)
++{
++	print_usage(stderr);
++}
++
++static int prp_parse_opt(struct link_util *lu, int argc, char **argv,
++			 struct nlmsghdr *n)
++{
++	int ifindex;
++	unsigned char multicast_spec;
++
++	while (argc > 0) {
++		if (matches(*argv, "supervision") == 0) {
++			NEXT_ARG();
++			if (get_u8(&multicast_spec, *argv, 0))
++				invarg("ADDR-BYTE is invalid", *argv);
++			addattr_l(n, 1024, IFLA_HSR_MULTICAST_SPEC,
++				  &multicast_spec, 1);
++		} else if (matches(*argv, "slave1") == 0) {
++			NEXT_ARG();
++			ifindex = ll_name_to_index(*argv);
++			if (ifindex == 0)
++				invarg("No such interface", *argv);
++			addattr_l(n, 1024, IFLA_HSR_SLAVE1, &ifindex, 4);
++		} else if (matches(*argv, "slave2") == 0) {
++			NEXT_ARG();
++			ifindex = ll_name_to_index(*argv);
++			if (ifindex == 0)
++				invarg("No such interface", *argv);
++			addattr_l(n, 1024, IFLA_HSR_SLAVE2, &ifindex, 4);
++		} else if (matches(*argv, "help") == 0) {
++			usage();
++			return -1;
++		} else {
++			fprintf(stderr, "prp: what is \"%s\"?\n", *argv);
++			usage();
++			return -1;
++		}
++		argc--, argv++;
++	}
++
++	return 0;
++}
++
++static void prp_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
++{
++	SPRINT_BUF(b1);
++
++	if (!tb)
++		return;
++
++	if (tb[IFLA_HSR_SLAVE1] &&
++	    RTA_PAYLOAD(tb[IFLA_HSR_SLAVE1]) < sizeof(__u32))
++		return;
++	if (tb[IFLA_HSR_SLAVE2] &&
++	    RTA_PAYLOAD(tb[IFLA_HSR_SLAVE2]) < sizeof(__u32))
++		return;
++	if (tb[IFLA_HSR_SEQ_NR] &&
++	    RTA_PAYLOAD(tb[IFLA_HSR_SEQ_NR]) < sizeof(__u16))
++		return;
++	if (tb[IFLA_HSR_SUPERVISION_ADDR] &&
++	    RTA_PAYLOAD(tb[IFLA_HSR_SUPERVISION_ADDR]) < ETH_ALEN)
++		return;
++
++	fprintf(f, "slave1 ");
++	if (tb[IFLA_HSR_SLAVE1])
++		fprintf(f, "%s ",
++			ll_index_to_name(rta_getattr_u32(tb[IFLA_HSR_SLAVE1])));
++	else
++		fprintf(f, "<none> ");
++
++	fprintf(f, "slave2 ");
++	if (tb[IFLA_HSR_SLAVE2])
++		fprintf(f, "%s ",
++			ll_index_to_name(rta_getattr_u32(tb[IFLA_HSR_SLAVE2])));
++	else
++		fprintf(f, "<none> ");
++
++	if (tb[IFLA_HSR_SEQ_NR])
++		fprintf(f, "sequence %d ",
++			rta_getattr_u16(tb[IFLA_HSR_SEQ_NR]));
++
++	if (tb[IFLA_HSR_SUPERVISION_ADDR])
++		fprintf(f, "supervision %s ",
++			ll_addr_n2a(RTA_DATA(tb[IFLA_HSR_SUPERVISION_ADDR]),
++				    RTA_PAYLOAD(tb[IFLA_HSR_SUPERVISION_ADDR]),
++				    ARPHRD_VOID,
++				    b1, sizeof(b1)));
++}
++
++static void prp_print_help(struct link_util *lu, int argc, char **argv,
++	FILE *f)
++{
++	print_usage(f);
++}
++
++struct link_util prp_link_util = {
++	.id		= "prp",
++	.maxattr	= IFLA_VLAN_MAX,
++	.parse_opt	= prp_parse_opt,
++	.print_opt	= prp_print_opt,
++	.print_help	= prp_print_help,
++};
+-- 
+1.9.1
+
diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb b/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb
index 808e550..f92ea31 100644
--- a/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb
+++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb
@@ -4,6 +4,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
            file://configure-cross.patch \
            file://0001-iproute2-de-bash-scripts.patch \
            file://iproute2-4.9.0-musl.patch \
+           file://0001-ip-HSR-Fix-cut-and-paste-error.patch \
+           file://0002-add-support-for-prp-similar-to-hsr.patch \
           "
 
 SRC_URI[md5sum] = "44a8371a4b2c40e48e4c9f98cbd41391"
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] iproute2: backport version 4.9.0
  2017-07-19 17:07 [PATCH 1/2] iproute2: backport version 4.9.0 Jacob Stiffler
  2017-07-19 17:07 ` [PATCH 2/2] iproute2: add hsr/prp support Jacob Stiffler
@ 2017-07-19 17:20 ` Denys Dmytriyenko
  2017-07-19 17:42   ` Stiffler, Jacob
  1 sibling, 1 reply; 4+ messages in thread
From: Denys Dmytriyenko @ 2017-07-19 17:20 UTC (permalink / raw)
  To: Jacob Stiffler; +Cc: meta-arago

Thanks!
The pristine 4.9 updated recipe should probably go into meta-arago-extras and 
the followup patch as bbappend in meta-arago-distro.

-- 
Denys


On Wed, Jul 19, 2017 at 01:07:47PM -0400, Jacob Stiffler wrote:
> * Backport iproute2 4.9.0 from oe-core.
> * Recipes were directly copied from commit
>   eac08770b1ea3ca6640941dc8fd03fc3fa5ff869
> 
> Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
> ---
>  .../recipes-connectivity/iproute2/iproute2.inc     |  48 ++++++++
>  .../iproute2/0001-iproute2-de-bash-scripts.patch   |  64 ++++++++++
>  .../iproute2/iproute2/configure-cross.patch        |  32 +++++
>  .../iproute2/iproute2/iproute2-4.9.0-musl.patch    | 131 +++++++++++++++++++++
>  .../iproute2/iproute2_4.9.0.bb                     |  14 +++
>  5 files changed, 289 insertions(+)
>  create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc
>  create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
>  create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2/configure-cross.patch
>  create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch
>  create mode 100644 meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb
> 
> diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc b/meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc
> new file mode 100644
> index 0000000..ce64888
> --- /dev/null
> +++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc
> @@ -0,0 +1,48 @@
> +SUMMARY = "TCP / IP networking and traffic control utilities"
> +DESCRIPTION = "Iproute2 is a collection of utilities for controlling \
> +TCP / IP networking and traffic control in Linux.  Of the utilities ip \
> +and tc are the most important.  ip controls IPv4 and IPv6 \
> +configuration and tc stands for traffic control."
> +HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2"
> +SECTION = "base"
> +LICENSE = "GPLv2+"
> +LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
> +                    file://ip/ip.c;beginline=3;endline=8;md5=689d691d0410a4b64d3899f8d6e31817"
> +
> +DEPENDS = "flex-native bison-native iptables elfutils"
> +
> +inherit update-alternatives bash-completion pkgconfig
> +
> +EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
> +
> +do_configure_append () {
> +    sh configure ${STAGING_INCDIR}
> +    # Explicitly disable ATM support
> +    sed -i -e '/TC_CONFIG_ATM/d' Config
> +}
> +
> +do_install () {
> +    oe_runmake DESTDIR=${D} install
> +    mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2
> +    install -d ${D}${datadir}
> +    mv ${D}/share/* ${D}${datadir}/ || true
> +    rm ${D}/share -rf || true
> +}
> +
> +# The .so files in iproute2-tc are modules, not traditional libraries
> +INSANE_SKIP_${PN}-tc = "dev-so"
> +
> +PACKAGES =+ "${PN}-tc ${PN}-lnstat ${PN}-ifstat ${PN}-genl ${PN}-rtacct ${PN}-nstat ${PN}-ss"
> +FILES_${PN}-tc = "${base_sbindir}/tc* \
> +                  ${libdir}/tc/*.so"
> +FILES_${PN}-lnstat = "${base_sbindir}/lnstat ${base_sbindir}/ctstat ${base_sbindir}/rtstat"
> +FILES_${PN}-ifstat = "${base_sbindir}/ifstat"
> +FILES_${PN}-genl = "${base_sbindir}/genl"
> +FILES_${PN}-rtacct = "${base_sbindir}/rtacct"
> +FILES_${PN}-nstat = "${base_sbindir}/nstat"
> +FILES_${PN}-ss = "${base_sbindir}/ss"
> +
> +ALTERNATIVE_${PN} = "ip"
> +ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
> +ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
> +ALTERNATIVE_PRIORITY = "100"
> diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
> new file mode 100644
> index 0000000..39c7d40
> --- /dev/null
> +++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
> @@ -0,0 +1,64 @@
> +Subject: [PATCH] iproute2: de-bash scripts
> +
> +de-bash these two scripts to make iproute2 not depend on bash.
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> +
> +---
> + ip/ifcfg |   15 ++++++++-------
> + ip/rtpr  |    2 +-
> + 2 files changed, 9 insertions(+), 8 deletions(-)
> +
> +diff --git a/ip/ifcfg b/ip/ifcfg
> +index 083d9df..60bcf1f 100644
> +--- a/ip/ifcfg
> ++++ b/ip/ifcfg
> +@@ -1,12 +1,13 @@
> +-#! /bin/bash
> ++#! /bin/sh
> + 
> + CheckForwarding () {
> +-  local sbase fwd
> ++  local sbase fwd forwarding
> +   sbase=/proc/sys/net/ipv4/conf
> +   fwd=0
> +   if [ -d $sbase ]; then
> +     for dir in $sbase/*/forwarding; do
> +-      fwd=$[$fwd + `cat $dir`]
> ++      forwarding=`cat $dir`
> ++      fwd=$(($fwd+$forwarding))
> +     done
> +   else
> +     fwd=2
> +@@ -127,12 +128,12 @@ fi
> + arping -q -A -c 1 -I $dev $ipaddr
> + noarp=$?
> + ( sleep 2 ;
> +-  arping -q -U -c 1 -I $dev $ipaddr ) >& /dev/null </dev/null &
> ++  arping -q -U -c 1 -I $dev $ipaddr ) > /dev/null 2>&1 </dev/null &
> + 
> +-ip route add unreachable 224.0.0.0/24 >& /dev/null
> +-ip route add unreachable 255.255.255.255 >& /dev/null
> ++ip route add unreachable 224.0.0.0/24 > /dev/null 2>&1
> ++ip route add unreachable 255.255.255.255 > /dev/null 2>&1
> + if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then
> +-  ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
> ++  ip route add 224.0.0.0/4 dev $dev scope global > /dev/null 2>&1
> + fi
> + 
> + if [ $fwd -eq 0 ]; then
> +diff --git a/ip/rtpr b/ip/rtpr
> +index c3629fd..674198d 100644
> +--- a/ip/rtpr
> ++++ b/ip/rtpr
> +@@ -1,4 +1,4 @@
> +-#! /bin/bash
> ++#! /bin/sh
> + 
> + exec tr "[\\\\]" "[
> + ]"
> +-- 
> +1.7.9.5
> +
> diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2/configure-cross.patch b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/configure-cross.patch
> new file mode 100644
> index 0000000..866609c
> --- /dev/null
> +++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/configure-cross.patch
> @@ -0,0 +1,32 @@
> +From 85b0589b4843c03e8e6fd9416d71ea449a73c5c0 Mon Sep 17 00:00:00 2001
> +From: Koen Kooi <koen@dominion.thruhere.net>
> +Date: Thu, 3 Nov 2011 10:46:16 +0100
> +Subject: [PATCH] make configure cross compile safe
> +
> +According to Kevin Tian:
> +Upstream-Status: Pending
> +
> +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> +Signed-off-by: Shane Wang <shane.wang@intel.com>
> +
> +Index: iproute2-3.7.0/configure
> +===================================================================
> +--- iproute2-3.7.0.orig/configure
> ++++ iproute2-3.7.0/configure
> +@@ -2,6 +2,7 @@
> + # This is not an autconf generated configure
> + #
> + INCLUDE=${1:-"$PWD/include"}
> ++SYSROOT=$1
> + 
> + # Make a temp directory in build tree.
> + TMPDIR=$(mktemp -d config.XXXXXX)
> +@@ -158,7 +159,7 @@ check_ipt_lib_dir()
> + 		return
> + 	fi
> + 
> +-	for dir in /lib /usr/lib /usr/local/lib
> ++	for dir in $SYSROOT/lib $SYSROOT/usr/lib $SYSROOT/usr/local/lib
> + 	do
> + 		for file in $dir/{xtables,iptables}/lib*t_*so ; do
> + 			if [ -f $file ]; then
> diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch
> new file mode 100644
> index 0000000..737a90c
> --- /dev/null
> +++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch
> @@ -0,0 +1,131 @@
> +Subject: [PATCH] Avoid in6_addr redefinition
> +
> +Due to both <netinet/in.h> and <linux/in6.h> being included, the 
> +in6_addr is being redefined: once from the C library headers and once
> +from the kernel headers. This causes some build failures with for 
> +example the musl C library.
> +
> +In order to fix this, use just the C library header <netinet/in.h>.
> +Original patch taken from
> +http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-fixes.patch.
> +
> +(Refreshed the patch for 4.9 release)
> +
> +Upstream-Status: Pending
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> +Signed-off-by: Maxin B. John <maxin.john@intel.com>
> +Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
> +---
> + include/libiptc/ipt_kernel_headers.h     | 1 -
> + include/linux/if_bridge.h                | 1 -
> + include/linux/if_tunnel.h                | 2 --
> + include/linux/netfilter.h                | 2 --
> + include/linux/netfilter_ipv4/ip_tables.h | 1 -
> + include/linux/xfrm.h                     | 1 -
> + include/utils.h                          | 1 +
> + ip/ip6tunnel.c                           | 1 -
> + 8 files changed, 1 insertion(+), 9 deletions(-)
> +
> +diff --git a/include/libiptc/ipt_kernel_headers.h b/include/libiptc/ipt_kernel_headers.h
> +index a5963e9..42f8610 100644
> +--- a/include/libiptc/ipt_kernel_headers.h
> ++++ b/include/libiptc/ipt_kernel_headers.h
> +@@ -6,7 +6,6 @@
> + #include <limits.h>
> + 
> + #include <netinet/ip.h>
> +-#include <netinet/in.h>
> + #include <netinet/ip_icmp.h>
> + #include <netinet/tcp.h>
> + #include <netinet/udp.h>
> +diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
> +index b7393dd..a7028ab 100644
> +--- a/include/linux/if_bridge.h
> ++++ b/include/linux/if_bridge.h
> +@@ -15,7 +15,6 @@
> + 
> + #include <linux/types.h>
> + #include <linux/if_ether.h>
> +-#include <linux/in6.h>
> + 
> + #define SYSFS_BRIDGE_ATTR	"bridge"
> + #define SYSFS_BRIDGE_FDB	"brforward"
> +diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
> +index 4f975f5..2680646 100644
> +--- a/include/linux/if_tunnel.h
> ++++ b/include/linux/if_tunnel.h
> +@@ -2,9 +2,7 @@
> + #define _IF_TUNNEL_H_
> + 
> + #include <linux/types.h>
> +-#include <linux/if.h>
> + #include <linux/ip.h>
> +-#include <linux/in6.h>
> + #include <asm/byteorder.h>
> + 
> + 
> +diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
> +index b71b4c9..3e4e6ae 100644
> +--- a/include/linux/netfilter.h
> ++++ b/include/linux/netfilter.h
> +@@ -4,8 +4,6 @@
> + #include <linux/types.h>
> + 
> + #include <linux/sysctl.h>
> +-#include <linux/in.h>
> +-#include <linux/in6.h>
> + 
> + /* Responses from hook functions. */
> + #define NF_DROP 0
> +diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
> +index 456fb86..38542b4 100644
> +--- a/include/linux/netfilter_ipv4/ip_tables.h
> ++++ b/include/linux/netfilter_ipv4/ip_tables.h
> +@@ -17,7 +17,6 @@
> + 
> + #include <linux/types.h>
> + 
> +-#include <linux/if.h>
> + #include <linux/netfilter_ipv4.h>
> + 
> + #include <linux/netfilter/x_tables.h>
> +diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
> +index d2dd1fd..8c72966 100644
> +--- a/include/linux/xfrm.h
> ++++ b/include/linux/xfrm.h
> +@@ -1,7 +1,6 @@
> + #ifndef _LINUX_XFRM_H
> + #define _LINUX_XFRM_H
> + 
> +-#include <linux/in6.h>
> + #include <linux/types.h>
> + 
> + /* All of the structures in this file may not change size as they are
> +diff --git a/include/utils.h b/include/utils.h
> +index 1b4f939..d10840b 100644
> +--- a/include/utils.h
> ++++ b/include/utils.h
> +@@ -1,6 +1,7 @@
> + #ifndef __UTILS_H__
> + #define __UTILS_H__ 1
> + 
> ++#include <sys/param.h>  /* MAXPATHLEN */
> + #include <sys/types.h>
> + #include <asm/types.h>
> + #include <resolv.h>
> +diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
> +index b1c0ae6..8fa4eb2 100644
> +--- a/ip/ip6tunnel.c
> ++++ b/ip/ip6tunnel.c
> +@@ -28,7 +28,6 @@
> + #include <arpa/inet.h>
> + #include <sys/ioctl.h>
> + #include <linux/ip.h>
> +-#include <linux/if.h>
> + #include <linux/if_arp.h>
> + #include <linux/if_tunnel.h>
> + #include <linux/ip6_tunnel.h>
> +-- 
> +2.7.4
> +
> diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb b/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb
> new file mode 100644
> index 0000000..808e550
> --- /dev/null
> +++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb
> @@ -0,0 +1,14 @@
> +require iproute2.inc
> +
> +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
> +           file://configure-cross.patch \
> +           file://0001-iproute2-de-bash-scripts.patch \
> +           file://iproute2-4.9.0-musl.patch \
> +          "
> +
> +SRC_URI[md5sum] = "44a8371a4b2c40e48e4c9f98cbd41391"
> +SRC_URI[sha256sum] = "c0f30f043f7767cc1b2cd2197b08d4e9b2392c95823fabe30bbce308c30116c4"
> +
> +# CFLAGS are computed in Makefile and reference CCOPTS
> +#
> +EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'"
> -- 
> 2.7.4
> 
> _______________________________________________
> meta-arago mailing list
> meta-arago@arago-project.org
> http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] iproute2: backport version 4.9.0
  2017-07-19 17:20 ` [PATCH 1/2] iproute2: backport version 4.9.0 Denys Dmytriyenko
@ 2017-07-19 17:42   ` Stiffler, Jacob
  0 siblings, 0 replies; 4+ messages in thread
From: Stiffler, Jacob @ 2017-07-19 17:42 UTC (permalink / raw)
  To: Dmytriyenko, Denys; +Cc: meta-arago@arago-project.org

Alright, I'll make the change now.

> -----Original Message-----
> From: Dmytriyenko, Denys
> Sent: Wednesday, July 19, 2017 1:21 PM
> To: Stiffler, Jacob
> Cc: meta-arago@arago-project.org
> Subject: Re: [meta-arago] [PATCH 1/2] iproute2: backport version 4.9.0
> 
> Thanks!
> The pristine 4.9 updated recipe should probably go into meta-arago-extras
> and the followup patch as bbappend in meta-arago-distro.
> 
> --
> Denys
> 
> 
> On Wed, Jul 19, 2017 at 01:07:47PM -0400, Jacob Stiffler wrote:
> > * Backport iproute2 4.9.0 from oe-core.
> > * Recipes were directly copied from commit
> >   eac08770b1ea3ca6640941dc8fd03fc3fa5ff869
> >
> > Signed-off-by: Jacob Stiffler <j-stiffler@ti.com>
> > ---
> >  .../recipes-connectivity/iproute2/iproute2.inc     |  48 ++++++++
> >  .../iproute2/0001-iproute2-de-bash-scripts.patch   |  64 ++++++++++
> >  .../iproute2/iproute2/configure-cross.patch        |  32 +++++
> >  .../iproute2/iproute2/iproute2-4.9.0-musl.patch    | 131
> +++++++++++++++++++++
> >  .../iproute2/iproute2_4.9.0.bb                     |  14 +++
> >  5 files changed, 289 insertions(+)
> >  create mode 100644 meta-arago-distro/recipes-
> connectivity/iproute2/iproute2.inc
> >  create mode 100644 meta-arago-distro/recipes-
> connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
> >  create mode 100644 meta-arago-distro/recipes-
> connectivity/iproute2/iproute2/configure-cross.patch
> >  create mode 100644 meta-arago-distro/recipes-
> connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch
> >  create mode 100644 meta-arago-distro/recipes-
> connectivity/iproute2/iproute2_4.9.0.bb
> >
> > diff --git a/meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc
> b/meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc
> > new file mode 100644
> > index 0000000..ce64888
> > --- /dev/null
> > +++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2.inc
> > @@ -0,0 +1,48 @@
> > +SUMMARY = "TCP / IP networking and traffic control utilities"
> > +DESCRIPTION = "Iproute2 is a collection of utilities for controlling \
> > +TCP / IP networking and traffic control in Linux.  Of the utilities ip \
> > +and tc are the most important.  ip controls IPv4 and IPv6 \
> > +configuration and tc stands for traffic control."
> > +HOMEPAGE =
> "http://www.linuxfoundation.org/collaborate/workgroups/networking/ipr
> oute2"
> > +SECTION = "base"
> > +LICENSE = "GPLv2+"
> > +LIC_FILES_CHKSUM =
> "file://COPYING;md5=eb723b61539feef013de476e68b5c50a \
> > +
> file://ip/ip.c;beginline=3;endline=8;md5=689d691d0410a4b64d3899f8d6e31
> 817"
> > +
> > +DEPENDS = "flex-native bison-native iptables elfutils"
> > +
> > +inherit update-alternatives bash-completion pkgconfig
> > +
> > +EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR}
> DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip bridge misc genl'
> SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
> > +
> > +do_configure_append () {
> > +    sh configure ${STAGING_INCDIR}
> > +    # Explicitly disable ATM support
> > +    sed -i -e '/TC_CONFIG_ATM/d' Config
> > +}
> > +
> > +do_install () {
> > +    oe_runmake DESTDIR=${D} install
> > +    mv ${D}${base_sbindir}/ip ${D}${base_sbindir}/ip.iproute2
> > +    install -d ${D}${datadir}
> > +    mv ${D}/share/* ${D}${datadir}/ || true
> > +    rm ${D}/share -rf || true
> > +}
> > +
> > +# The .so files in iproute2-tc are modules, not traditional libraries
> > +INSANE_SKIP_${PN}-tc = "dev-so"
> > +
> > +PACKAGES =+ "${PN}-tc ${PN}-lnstat ${PN}-ifstat ${PN}-genl ${PN}-rtacct
> ${PN}-nstat ${PN}-ss"
> > +FILES_${PN}-tc = "${base_sbindir}/tc* \
> > +                  ${libdir}/tc/*.so"
> > +FILES_${PN}-lnstat = "${base_sbindir}/lnstat ${base_sbindir}/ctstat
> ${base_sbindir}/rtstat"
> > +FILES_${PN}-ifstat = "${base_sbindir}/ifstat"
> > +FILES_${PN}-genl = "${base_sbindir}/genl"
> > +FILES_${PN}-rtacct = "${base_sbindir}/rtacct"
> > +FILES_${PN}-nstat = "${base_sbindir}/nstat"
> > +FILES_${PN}-ss = "${base_sbindir}/ss"
> > +
> > +ALTERNATIVE_${PN} = "ip"
> > +ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
> > +ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
> > +ALTERNATIVE_PRIORITY = "100"
> > diff --git a/meta-arago-distro/recipes-
> connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
> b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-
> iproute2-de-bash-scripts.patch
> > new file mode 100644
> > index 0000000..39c7d40
> > --- /dev/null
> > +++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2/0001-
> iproute2-de-bash-scripts.patch
> > @@ -0,0 +1,64 @@
> > +Subject: [PATCH] iproute2: de-bash scripts
> > +
> > +de-bash these two scripts to make iproute2 not depend on bash.
> > +
> > +Upstream-Status: Pending
> > +
> > +Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> > +
> > +---
> > + ip/ifcfg |   15 ++++++++-------
> > + ip/rtpr  |    2 +-
> > + 2 files changed, 9 insertions(+), 8 deletions(-)
> > +
> > +diff --git a/ip/ifcfg b/ip/ifcfg
> > +index 083d9df..60bcf1f 100644
> > +--- a/ip/ifcfg
> > ++++ b/ip/ifcfg
> > +@@ -1,12 +1,13 @@
> > +-#! /bin/bash
> > ++#! /bin/sh
> > +
> > + CheckForwarding () {
> > +-  local sbase fwd
> > ++  local sbase fwd forwarding
> > +   sbase=/proc/sys/net/ipv4/conf
> > +   fwd=0
> > +   if [ -d $sbase ]; then
> > +     for dir in $sbase/*/forwarding; do
> > +-      fwd=$[$fwd + `cat $dir`]
> > ++      forwarding=`cat $dir`
> > ++      fwd=$(($fwd+$forwarding))
> > +     done
> > +   else
> > +     fwd=2
> > +@@ -127,12 +128,12 @@ fi
> > + arping -q -A -c 1 -I $dev $ipaddr
> > + noarp=$?
> > + ( sleep 2 ;
> > +-  arping -q -U -c 1 -I $dev $ipaddr ) >& /dev/null </dev/null &
> > ++  arping -q -U -c 1 -I $dev $ipaddr ) > /dev/null 2>&1 </dev/null &
> > +
> > +-ip route add unreachable 224.0.0.0/24 >& /dev/null
> > +-ip route add unreachable 255.255.255.255 >& /dev/null
> > ++ip route add unreachable 224.0.0.0/24 > /dev/null 2>&1
> > ++ip route add unreachable 255.255.255.255 > /dev/null 2>&1
> > + if [ `ip link ls $dev | grep -c MULTICAST` -ge 1 ]; then
> > +-  ip route add 224.0.0.0/4 dev $dev scope global >& /dev/null
> > ++  ip route add 224.0.0.0/4 dev $dev scope global > /dev/null 2>&1
> > + fi
> > +
> > + if [ $fwd -eq 0 ]; then
> > +diff --git a/ip/rtpr b/ip/rtpr
> > +index c3629fd..674198d 100644
> > +--- a/ip/rtpr
> > ++++ b/ip/rtpr
> > +@@ -1,4 +1,4 @@
> > +-#! /bin/bash
> > ++#! /bin/sh
> > +
> > + exec tr "[\\\\]" "[
> > + ]"
> > +--
> > +1.7.9.5
> > +
> > diff --git a/meta-arago-distro/recipes-
> connectivity/iproute2/iproute2/configure-cross.patch b/meta-arago-
> distro/recipes-connectivity/iproute2/iproute2/configure-cross.patch
> > new file mode 100644
> > index 0000000..866609c
> > --- /dev/null
> > +++ b/meta-arago-distro/recipes-
> connectivity/iproute2/iproute2/configure-cross.patch
> > @@ -0,0 +1,32 @@
> > +From 85b0589b4843c03e8e6fd9416d71ea449a73c5c0 Mon Sep 17 00:00:00
> 2001
> > +From: Koen Kooi <koen@dominion.thruhere.net>
> > +Date: Thu, 3 Nov 2011 10:46:16 +0100
> > +Subject: [PATCH] make configure cross compile safe
> > +
> > +According to Kevin Tian:
> > +Upstream-Status: Pending
> > +
> > +Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
> > +Signed-off-by: Shane Wang <shane.wang@intel.com>
> > +
> > +Index: iproute2-3.7.0/configure
> >
> +==================================================================
> =
> > +--- iproute2-3.7.0.orig/configure
> > ++++ iproute2-3.7.0/configure
> > +@@ -2,6 +2,7 @@
> > + # This is not an autconf generated configure
> > + #
> > + INCLUDE=${1:-"$PWD/include"}
> > ++SYSROOT=$1
> > +
> > + # Make a temp directory in build tree.
> > + TMPDIR=$(mktemp -d config.XXXXXX)
> > +@@ -158,7 +159,7 @@ check_ipt_lib_dir()
> > + 		return
> > + 	fi
> > +
> > +-	for dir in /lib /usr/lib /usr/local/lib
> > ++	for dir in $SYSROOT/lib $SYSROOT/usr/lib $SYSROOT/usr/local/lib
> > + 	do
> > + 		for file in $dir/{xtables,iptables}/lib*t_*so ; do
> > + 			if [ -f $file ]; then
> > diff --git a/meta-arago-distro/recipes-
> connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch b/meta-arago-
> distro/recipes-connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch
> > new file mode 100644
> > index 0000000..737a90c
> > --- /dev/null
> > +++ b/meta-arago-distro/recipes-
> connectivity/iproute2/iproute2/iproute2-4.9.0-musl.patch
> > @@ -0,0 +1,131 @@
> > +Subject: [PATCH] Avoid in6_addr redefinition
> > +
> > +Due to both <netinet/in.h> and <linux/in6.h> being included, the
> > +in6_addr is being redefined: once from the C library headers and once
> > +from the kernel headers. This causes some build failures with for
> > +example the musl C library.
> > +
> > +In order to fix this, use just the C library header <netinet/in.h>.
> > +Original patch taken from
> > +http://git.alpinelinux.org/cgit/aports/tree/main/iproute2/musl-
> fixes.patch.
> > +
> > +(Refreshed the patch for 4.9 release)
> > +
> > +Upstream-Status: Pending
> > +
> > +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-
> electrons.com>
> > +Signed-off-by: Maxin B. John <maxin.john@intel.com>
> > +Signed-off-by: Zheng Ruoqin <zhengrq.fnst@cn.fujitsu.com>
> > +---
> > + include/libiptc/ipt_kernel_headers.h     | 1 -
> > + include/linux/if_bridge.h                | 1 -
> > + include/linux/if_tunnel.h                | 2 --
> > + include/linux/netfilter.h                | 2 --
> > + include/linux/netfilter_ipv4/ip_tables.h | 1 -
> > + include/linux/xfrm.h                     | 1 -
> > + include/utils.h                          | 1 +
> > + ip/ip6tunnel.c                           | 1 -
> > + 8 files changed, 1 insertion(+), 9 deletions(-)
> > +
> > +diff --git a/include/libiptc/ipt_kernel_headers.h
> b/include/libiptc/ipt_kernel_headers.h
> > +index a5963e9..42f8610 100644
> > +--- a/include/libiptc/ipt_kernel_headers.h
> > ++++ b/include/libiptc/ipt_kernel_headers.h
> > +@@ -6,7 +6,6 @@
> > + #include <limits.h>
> > +
> > + #include <netinet/ip.h>
> > +-#include <netinet/in.h>
> > + #include <netinet/ip_icmp.h>
> > + #include <netinet/tcp.h>
> > + #include <netinet/udp.h>
> > +diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
> > +index b7393dd..a7028ab 100644
> > +--- a/include/linux/if_bridge.h
> > ++++ b/include/linux/if_bridge.h
> > +@@ -15,7 +15,6 @@
> > +
> > + #include <linux/types.h>
> > + #include <linux/if_ether.h>
> > +-#include <linux/in6.h>
> > +
> > + #define SYSFS_BRIDGE_ATTR	"bridge"
> > + #define SYSFS_BRIDGE_FDB	"brforward"
> > +diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
> > +index 4f975f5..2680646 100644
> > +--- a/include/linux/if_tunnel.h
> > ++++ b/include/linux/if_tunnel.h
> > +@@ -2,9 +2,7 @@
> > + #define _IF_TUNNEL_H_
> > +
> > + #include <linux/types.h>
> > +-#include <linux/if.h>
> > + #include <linux/ip.h>
> > +-#include <linux/in6.h>
> > + #include <asm/byteorder.h>
> > +
> > +
> > +diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
> > +index b71b4c9..3e4e6ae 100644
> > +--- a/include/linux/netfilter.h
> > ++++ b/include/linux/netfilter.h
> > +@@ -4,8 +4,6 @@
> > + #include <linux/types.h>
> > +
> > + #include <linux/sysctl.h>
> > +-#include <linux/in.h>
> > +-#include <linux/in6.h>
> > +
> > + /* Responses from hook functions. */
> > + #define NF_DROP 0
> > +diff --git a/include/linux/netfilter_ipv4/ip_tables.h
> b/include/linux/netfilter_ipv4/ip_tables.h
> > +index 456fb86..38542b4 100644
> > +--- a/include/linux/netfilter_ipv4/ip_tables.h
> > ++++ b/include/linux/netfilter_ipv4/ip_tables.h
> > +@@ -17,7 +17,6 @@
> > +
> > + #include <linux/types.h>
> > +
> > +-#include <linux/if.h>
> > + #include <linux/netfilter_ipv4.h>
> > +
> > + #include <linux/netfilter/x_tables.h>
> > +diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
> > +index d2dd1fd..8c72966 100644
> > +--- a/include/linux/xfrm.h
> > ++++ b/include/linux/xfrm.h
> > +@@ -1,7 +1,6 @@
> > + #ifndef _LINUX_XFRM_H
> > + #define _LINUX_XFRM_H
> > +
> > +-#include <linux/in6.h>
> > + #include <linux/types.h>
> > +
> > + /* All of the structures in this file may not change size as they are
> > +diff --git a/include/utils.h b/include/utils.h
> > +index 1b4f939..d10840b 100644
> > +--- a/include/utils.h
> > ++++ b/include/utils.h
> > +@@ -1,6 +1,7 @@
> > + #ifndef __UTILS_H__
> > + #define __UTILS_H__ 1
> > +
> > ++#include <sys/param.h>  /* MAXPATHLEN */
> > + #include <sys/types.h>
> > + #include <asm/types.h>
> > + #include <resolv.h>
> > +diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c
> > +index b1c0ae6..8fa4eb2 100644
> > +--- a/ip/ip6tunnel.c
> > ++++ b/ip/ip6tunnel.c
> > +@@ -28,7 +28,6 @@
> > + #include <arpa/inet.h>
> > + #include <sys/ioctl.h>
> > + #include <linux/ip.h>
> > +-#include <linux/if.h>
> > + #include <linux/if_arp.h>
> > + #include <linux/if_tunnel.h>
> > + #include <linux/ip6_tunnel.h>
> > +--
> > +2.7.4
> > +
> > diff --git a/meta-arago-distro/recipes-
> connectivity/iproute2/iproute2_4.9.0.bb b/meta-arago-distro/recipes-
> connectivity/iproute2/iproute2_4.9.0.bb
> > new file mode 100644
> > index 0000000..808e550
> > --- /dev/null
> > +++ b/meta-arago-distro/recipes-connectivity/iproute2/iproute2_4.9.0.bb
> > @@ -0,0 +1,14 @@
> > +require iproute2.inc
> > +
> > +SRC_URI = "${KERNELORG_MIRROR}/linux/utils/net/${BPN}/${BP}.tar.xz \
> > +           file://configure-cross.patch \
> > +           file://0001-iproute2-de-bash-scripts.patch \
> > +           file://iproute2-4.9.0-musl.patch \
> > +          "
> > +
> > +SRC_URI[md5sum] = "44a8371a4b2c40e48e4c9f98cbd41391"
> > +SRC_URI[sha256sum] =
> "c0f30f043f7767cc1b2cd2197b08d4e9b2392c95823fabe30bbce308c30116c4"
> > +
> > +# CFLAGS are computed in Makefile and reference CCOPTS
> > +#
> > +EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'"
> > --
> > 2.7.4
> >
> > _______________________________________________
> > meta-arago mailing list
> > meta-arago@arago-project.org
> > http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-19 17:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-19 17:07 [PATCH 1/2] iproute2: backport version 4.9.0 Jacob Stiffler
2017-07-19 17:07 ` [PATCH 2/2] iproute2: add hsr/prp support Jacob Stiffler
2017-07-19 17:20 ` [PATCH 1/2] iproute2: backport version 4.9.0 Denys Dmytriyenko
2017-07-19 17:42   ` Stiffler, Jacob

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.