On Thursday, 14th may 2009, Marc Kleine-Budde wrote:
> send to list, please

Here we go:

This patch updates iproute to be used in conjunction with a 2.6.28 kernel
(tested at runtime!). BTW: It seems there is one iproute revision per kernel!

This patch also removes package's dependency to the berkely DB if no
'arpd' is required. iproute's build system will be patched to be able to omit
building the 'arpd'.

Signed-off-by: Juergen Beisert <[email protected]>

Index: patches/iproute2-2.6.28/generic/fix_if_tunnel_build_error.diff
===================================================================
--- patches/iproute2-2.6.28/generic/fix_if_tunnel_build_error.diff      
(Revision 0)
+++ patches/iproute2-2.6.28/generic/fix_if_tunnel_build_error.diff      
(Revision 0)
@@ -0,0 +1,31 @@
+Subject: Fix a build error
+From: Juergen Beisert <[email protected]>
+
+This patch fixes the following build failure:
+
+In file included from link_gre.c:15:
+../include/linux/if_tunnel.h:33: error: field ?iph? has incomplete type
+link_gre.c: In function ?gre_parse_opt?:
+link_gre.c:136: warning: implicit declaration of function ?__constant_htons?
+
+Note: It is also present in the 2.6.29 iproute package!
+
+Provided-by: Stephen Hemminger <[email protected]>
+Tested-by: Juergen Beisert <[email protected]>
+
+---
+ ip/link_gre.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+Index: ip/link_gre.c
+===================================================================
+--- ip/link_gre.c.orig
++++ ip/link_gre.c
+@@ -12,6 +12,7 @@
+ 
+ #include <string.h>
+ #include <net/if.h>
++#include <linux/ip.h>
+ #include <linux/if_tunnel.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
Index: patches/iproute2-2.6.28/generic/remove_arpd.diff
===================================================================
--- patches/iproute2-2.6.28/generic/remove_arpd.diff    (Revision 0)
+++ patches/iproute2-2.6.28/generic/remove_arpd.diff    (Revision 0)
@@ -0,0 +1,42 @@
+Subject: Make the buildsystem be gracious to us.
+
+Signed-off-by: Juergen Beisert [email protected]
+
+---
+ Makefile      |    2 +-
+ misc/Makefile |    6 +++++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+Index: misc/Makefile
+===================================================================
+--- misc/Makefile.orig
++++ misc/Makefile
+@@ -1,10 +1,14 @@
+ SSOBJ=ss.o ssfilter.o
+ LNSTATOBJ=lnstat.o lnstat_util.o
+ 
+-TARGETS=ss nstat ifstat rtacct arpd lnstat
++TARGETS=ss nstat ifstat rtacct lnstat
+ 
+ include ../Config
+ 
++ifdef BUILD_ARPD
++TARGETS += arpd
++endif
++
+ all: $(TARGETS)
+ 
+ ss: $(SSOBJ) $(LIBUTIL)
+Index: Makefile
+===================================================================
+--- Makefile.orig
++++ Makefile
+@@ -23,7 +23,7 @@ ADDLIB+=ipx_ntop.o ipx_pton.o
+ CC = gcc
+ HOSTCC = gcc
+ CCOPTS = -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall
+-CFLAGS = $(CCOPTS) -I../include $(DEFINES)
++CFLAGS = $(CROSS_CPPFLAGS) $(CCOPTS) -I../include $(DEFINES)
+ YACCFLAGS = -d -t -v
+ 
+ LDLIBS += -L../lib -lnetlink -lutil
Index: patches/iproute2-2.6.28/generic/series
===================================================================
--- patches/iproute2-2.6.28/generic/series      (Revision 0)
+++ patches/iproute2-2.6.28/generic/series      (Revision 0)
@@ -0,0 +1,2 @@
+remove_arpd.diff -p0
+fix_if_tunnel_build_error.diff -p0
Index: rules/iproute2.in
===================================================================
--- rules/iproute2.in   (Revision 10518)
+++ rules/iproute2.in   (Arbeitskopie)
@@ -1,17 +1,23 @@
 ## SECTION=networking
-
-config IPROUTE2
+menuconfig IPROUTE2
        tristate
-       prompt "iproute2"
-       select DB
+       prompt "iproute2                      "
+       select DB if IPROUTE2_ARPD
        select LIBC_DL
        select LIBC_M
        select LIBC_RESOLV
+       select KERNEL
        # arpd.c:(.text+0x1428): undefined reference to `__db185_open'
-#      depends on BROKEN
        help
          Iproute2 is a collection of utilities for
          controlling TCP/IP networking and traffic
          control in Linux.
 
+if IPROUTE2
 
+config IPROUTE2_ARPD
+       bool
+       prompt "install arpd"
+       help
+         This will enlarge your system by the berkely DB4.4 library.
+endif
Index: rules/iproute2.make
===================================================================
--- rules/iproute2.make (Revision 10518)
+++ rules/iproute2.make (Arbeitskopie)
@@ -17,7 +17,7 @@
 #
 # Paths and names
 #
-IPROUTE2_VERSION       := 2.6.23
+IPROUTE2_VERSION       := 2.6.28
 IPROUTE2               := iproute2-$(IPROUTE2_VERSION)
 IPROUTE2_SUFFIX                := tar.bz2
 IPROUTE2_URL           := 
http://developer.osdl.org/dev/iproute2/download/$(IPROUTE2).$(IPROUTE2_SUFFIX)
@@ -28,68 +28,35 @@
 # Get
 # ----------------------------------------------------------------------------
 
-iproute2_get: $(STATEDIR)/iproute2.get
-
-$(STATEDIR)/iproute2.get: $(iproute2_get_deps_default)
-       @$(call targetinfo, $@)
-       @$(call touch, $@)
-
 $(IPROUTE2_SOURCE):
        @$(call targetinfo, $@)
        @$(call get, IPROUTE2)
 
 # ----------------------------------------------------------------------------
-# Extract
-# ----------------------------------------------------------------------------
-
-iproute2_extract: $(STATEDIR)/iproute2.extract
-
-$(STATEDIR)/iproute2.extract: $(iproute2_extract_deps_default)
-       @$(call targetinfo, $@)
-       @$(call clean, $(IPROUTE2_DIR))
-       @$(call extract, IPROUTE2)
-       @$(call patchin, IPROUTE2)
-       @$(call touch, $@)
-
-# ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
 
-iproute2_prepare: $(STATEDIR)/iproute2.prepare
-
 IPROUTE2_PATH  :=  PATH=$(CROSS_PATH)
 IPROUTE2_ENV   :=  $(CROSS_ENV)
-IPROUTE2_MAKEVARS = $(call remove_quotes, $(CROSS_ENV_CC) 
CFLAGS='$(CROSS_CPPFLAGS) -D_GNU_SOURCE -O2 -Wstrict-prototypes -Wall 
-I../include -DRESOLVE_HOSTNAMES' 
LDFLAGS='$(CROSS_LDFLAGS) -L../lib -lnetlink -lutil' 
DBM_INCLUDE=$(SYSROOT)/usr/include)
+IPROUTE2_MAKEVARS = \
+       CC=$(PTXCONF_GNU_TARGET)-gcc \
+       CROSS_CPPFLAGS='-I$(KERNEL_DIR)/include $(CROSS_CPPFLAGS) ' \
+       LDFLAGS='$(CROSS_LDFLAGS)' \
+       DBM_INCLUDE=$(SYSROOT)/usr/include
 
-#
-# autoconf
-#
-IPROUTE2_AUTOCONF := $(CROSS_AUTOCONF_USR)
-
-$(STATEDIR)/iproute2.prepare: $(iproute2_prepare_deps_default)
+$(STATEDIR)/iproute2.prepare:
        @$(call targetinfo, $@)
-       @$(call clean, $(IPROUTE2_DIR)/config.cache)
-       touch $(IPROUTE2_DIR)/Config
+       @touch $(IPROUTE2_DIR)/Config
+ifdef PTXCONF_IPROUTE2_ARPD
+       @echo BUILD_ARPD=y >> $(IPROUTE2_DIR)/Config
+endif
        @$(call touch, $@)
 
 # ----------------------------------------------------------------------------
-# Compile
-# ----------------------------------------------------------------------------
-
-iproute2_compile: $(STATEDIR)/iproute2.compile
-
-$(STATEDIR)/iproute2.compile: $(iproute2_compile_deps_default)
-       @$(call targetinfo, $@)
-       cd $(IPROUTE2_DIR) && $(IPROUTE2_PATH) make $(IPROUTE2_MAKEVARS)
-       @$(call touch, $@)
-
-# ----------------------------------------------------------------------------
 # Install
 # ----------------------------------------------------------------------------
 
-iproute2_install: $(STATEDIR)/iproute2.install
-
-$(STATEDIR)/iproute2.install: $(iproute2_install_deps_default)
+$(STATEDIR)/iproute2.install:
        @$(call targetinfo, $@)
        @$(call touch, $@)
 
@@ -97,9 +64,7 @@
 # Target-Install
 # ----------------------------------------------------------------------------
 
-iproute2_targetinstall: $(STATEDIR)/iproute2.targetinstall
-
-$(STATEDIR)/iproute2.targetinstall: $(iproute2_targetinstall_deps_default)
+$(STATEDIR)/iproute2.targetinstall:
        @$(call targetinfo, $@)
 
        @$(call install_init, iproute2)
@@ -107,7 +72,7 @@
        @$(call install_fixup,iproute2,PRIORITY,optional)
        @$(call install_fixup,iproute2,VERSION,$(IPROUTE2_VERSION))
        @$(call install_fixup,iproute2,SECTION,base)
-       @$(call install_fixup,iproute2,AUTHOR,"Robert Schwebel 
<[email protected]>")
+       @$(call install_fixup,iproute2,AUTHOR,"Robert Schwebel 
<[email protected]>")
        @$(call install_fixup,iproute2,DEPENDS,)
        @$(call install_fixup,iproute2,DESCRIPTION,missing)
 
@@ -121,9 +86,11 @@
                $(IPROUTE2_DIR)/tc/tc, \
                /sbin/tc)
 
+ifdef PTXCONF_IPROUTE2_ARPD
        @$(call install_copy, iproute2, 0, 0, 0755, \
                $(IPROUTE2_DIR)/misc/arpd, \
                /usr/sbin/arpd )
+endif
        @$(call install_copy, iproute2, 0, 0, 0755, \
                $(IPROUTE2_DIR)/misc/lnstat, \
                /usr/sbin/lnstat )

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-8766-939 228     |
Vertretung Sued/Muenchen, Germany             | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

--
ptxdist mailing list
[email protected]

Reply via email to