summaryrefslogtreecommitdiff
path: root/yocto-poky/meta/recipes-connectivity/iproute2
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/meta/recipes-connectivity/iproute2')
-rw-r--r--yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc38
-rw-r--r--yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch64
-rw-r--r--yocto-poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch32
-rw-r--r--yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.1.1.bb12
4 files changed, 146 insertions, 0 deletions
diff --git a/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc b/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc
new file mode 100644
index 000000000..a53a4e6ab
--- /dev/null
+++ b/yocto-poky/meta/recipes-connectivity/iproute2/iproute2.inc
@@ -0,0 +1,38 @@
+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
+
+EXTRA_OEMAKE = "CC='${CC}' KERNEL_INCLUDE=${STAGING_INCDIR} DOCDIR=${docdir}/iproute2 SUBDIRS='lib tc ip' SBINDIR='${base_sbindir}' LIBDIR='${libdir}'"
+
+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"
+FILES_${PN}-tc = "${base_sbindir}/tc* \
+ ${libdir}/tc/*.so"
+
+FILES_${PN}-dbg += "${libdir}/tc/.debug"
+
+ALTERNATIVE_${PN} = "ip"
+ALTERNATIVE_TARGET[ip] = "${base_sbindir}/ip.${BPN}"
+ALTERNATIVE_LINK_NAME[ip] = "${base_sbindir}/ip"
+ALTERNATIVE_PRIORITY = "100"
diff --git a/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch b/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/0001-iproute2-de-bash-scripts.patch
new file mode 100644
index 000000000..39c7d4031
--- /dev/null
+++ b/yocto-poky/meta/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/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch b/yocto-poky/meta/recipes-connectivity/iproute2/iproute2/configure-cross.patch
new file mode 100644
index 000000000..866609ca9
--- /dev/null
+++ b/yocto-poky/meta/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/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.1.1.bb b/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.1.1.bb
new file mode 100644
index 000000000..10db0ba5d
--- /dev/null
+++ b/yocto-poky/meta/recipes-connectivity/iproute2/iproute2_4.1.1.bb
@@ -0,0 +1,12 @@
+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 \
+ "
+SRC_URI[md5sum] = "39290cb3a55d38dd8d10e19a3094109f"
+SRC_URI[sha256sum] = "73077a989efb934450bd655cbd9aaddaa747cb696c64d0c9a3323768a6a8e66f"
+
+# CFLAGS are computed in Makefile and reference CCOPTS
+#
+EXTRA_OEMAKE_append = " CCOPTS='${CFLAGS}'"