]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
net-tools: Update to 2.10
authorAdolf Belka <adolf.belka@ipfire.org>
Sun, 7 Feb 2021 18:00:36 +0000 (19:00 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 8 Feb 2021 13:51:04 +0000 (13:51 +0000)
- Update net-tools from 1.60 to 2.10
- Based on guidance from Michael Tremer
- new no-hostname patch created to remove all hostname references
from makefile
- all other patch files removed from lfs as no longer needed
- version 2.10 places ifconfig and route tools in bin instead of sbin
those tools moved to sbin to keep in line with previous approach
- make update replaced by make install as there is no longer a make
rule for make update
- Updated rootfiles

Signed-off-by: Adolf Belka <adolf.belka@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
config/rootfiles/common/net-tools
lfs/net-tools
src/patches/net-tools-1.60-gcc34-3.patch [deleted file]
src/patches/net-tools-1.60-iphdr-redef.patch [deleted file]
src/patches/net-tools-1.60-kernel_headers-3.patch [deleted file]
src/patches/net-tools-1.60-mii_ioctl-1.patch [deleted file]
src/patches/net-tools-1.60-no-hostname.patch [deleted file]
src/patches/net-tools-2.10-no-hostname.patch [new file with mode: 0644]

index 4860b2f0a8e8e103f05da8787a22979b4fb2b061..0578c1bc0a9259be72b425400ee6572cda4baac4 100644 (file)
@@ -1,17 +1,23 @@
+sbin/ifconfig
 bin/netstat
+sbin/route
 sbin/arp
-sbin/ifconfig
 #sbin/ipmaddr
 #sbin/iptunnel
 sbin/mii-tool
 sbin/nameif
 #sbin/plipconfig
 sbin/rarp
-sbin/route
 sbin/slattach
+#usr/share/man/man1/dnsdomainname.1
+#usr/share/man/man1/domainname.1
+#usr/share/man/man1/nisdomainname.1
+#usr/share/man/man1/ypdomainname.1
 #usr/share/man/man5/ethers.5
 #usr/share/man/man8/arp.8
 #usr/share/man/man8/ifconfig.8
+#usr/share/man/man8/ipmaddr.8
+#usr/share/man/man8/iptunnel.8
 #usr/share/man/man8/mii-tool.8
 #usr/share/man/man8/nameif.8
 #usr/share/man/man8/netstat.8
index 3fde55e2d28c2d9d631116c6d42d918849c202c9..7a568a2605c3b962d7675a41ec0babef28ae9a40 100644 (file)
 
 include Config
 
-VER        = 1.60
+VER        = 2.10
 
 THISAPP    = net-tools-$(VER)
-DL_FILE    = $(THISAPP).tar.bz2
+DL_FILE    = $(THISAPP).tar.xz
 DL_FROM    = $(URL_IPFIRE)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
@@ -39,7 +39,7 @@ objects = $(DL_FILE)
 
 $(DL_FILE)                            = $(DL_FROM)/$(DL_FILE)
 
-$(DL_FILE)_MD5                        = 888774accab40217dde927e21979c165
+$(DL_FILE)_MD5                        = 78aae762c95e2d731faf88d482e4cde5
 
 install : $(TARGET)
 
@@ -68,12 +68,8 @@ $(subst %,%_MD5,$(objects)) :
 
 $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
-       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar jxf $(DIR_DL)/$(DL_FILE)
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/net-tools-1.60-no-hostname.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-gcc34-3.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-kernel_headers-3.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-iphdr-redef.patch
-       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-mii_ioctl-1.patch
+       @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE)
+       cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/net-tools-2.10-no-hostname.patch
        cd $(DIR_APP) && yes "" | make config
        cd $(DIR_APP) && sed -i -e 's|HAVE_IP_TOOLS 0|HAVE_IP_TOOLS 1|g' \
                                -e 's|HAVE_HWSTRIP 1|HAVE_HWSTRIP 0|g' \
@@ -82,6 +78,12 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
                                -e 's|HAVE_HWSTRIP 1|HAVE_HWSTRIP 0|g' \
                                        -e 's|# HAVE_MII=0|HAVE_MII=1|g' config.make
        cd $(DIR_APP) && make
-       cd $(DIR_APP) && make update
+       cd $(DIR_APP) && make install
+
+       # Version 2.10 has moved ifconfig and route from sbin to bin
+       # Move these tools back to sbin to align with previous status in case anyone has
+       # scripts using these tools with the full pathname defined.
+       mv -v /bin/{ifconfig,route} /sbin
+
        @rm -rf $(DIR_APP)
        @$(POSTBUILD)
diff --git a/src/patches/net-tools-1.60-gcc34-3.patch b/src/patches/net-tools-1.60-gcc34-3.patch
deleted file mode 100644 (file)
index e6ec253..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-Originaly By: Zack Winkles <winkie AT linuxfromscratch DOT org>
-Submitted By: Jim Gifford <jim AT linuxfromscratch DOT org>
-Date: 2004-06-23
-Initial Package Version: 1.60
-Origin: N/A
-Upstream Status: N/A
-Description: Fix some occurrences of syntax that GCC 3.4 doesn't like.
-diff -Naur net-tools-1.60.orig/hostname.c net-tools-1.60/hostname.c
---- net-tools-1.60.orig/hostname.c     2001-04-08 17:04:23.000000000 +0000
-+++ net-tools-1.60/hostname.c  2004-06-24 06:22:16.913258663 +0000
-@@ -78,6 +78,7 @@
-             fprintf(stderr, _("%s: name too long\n"), program_name);
-             break;
-         default:
-+          ((void)0);
-         }
-       exit(1);
-     }
-@@ -98,6 +99,7 @@
-           fprintf(stderr, _("%s: name too long\n"), program_name);
-           break;
-       default:
-+          ((void)0);
-       }
-       exit(1);
-     };
-@@ -117,6 +119,7 @@
-           fprintf(stderr, _("%s: name too long\n"), program_name);
-           break;
-       default:
-+          ((void)0);
-       }
-       exit(1);
-     };
-@@ -174,6 +177,7 @@
-       printf("%s\n", hp->h_name);
-       break;
-     default:
-+      ((void)0);
-     }
- }
-diff -Naur net-tools-1.60.orig/lib/inet_sr.c net-tools-1.60/lib/inet_sr.c
---- net-tools-1.60.orig/lib/inet_sr.c  2000-02-20 21:46:45.000000000 +0000
-+++ net-tools-1.60/lib/inet_sr.c       2004-06-24 06:22:01.967840446 +0000
-@@ -105,6 +105,7 @@
-     case 2:
-        isnet = 0; break;
-     default:
-+       ((void)0);
-     }
-     /* Fill in the other fields. */
-diff -Naur net-tools-1.60.orig/mii-tool.c net-tools-1.60/mii-tool.c
---- net-tools-1.60.orig/mii-tool.c     2000-05-21 14:31:17.000000000 +0000
-+++ net-tools-1.60/mii-tool.c  2004-06-24 06:22:01.971839755 +0000
-@@ -379,17 +379,17 @@
- /*--------------------------------------------------------------------*/
- const char *usage =
--"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]
--       -V, --version               display version information
--       -v, --verbose               more verbose output
--       -R, --reset                 reset MII to poweron state
--       -r, --restart               restart autonegotiation
--       -w, --watch                 monitor for link status changes
--       -l, --log                   with -w, write events to syslog
--       -A, --advertise=media,...   advertise only specified media
--       -F, --force=media           force specified media technology
--media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,
--       (to advertise both HD and FD) 100baseTx, 10baseT\n";
-+"usage: %s [-VvRrwl] [-A media,... | -F media] [interface ...]\n"
-+"       -V, --version               display version information\n"
-+"       -v, --verbose               more verbose output\n"
-+"       -R, --reset                 reset MII to poweron state\n"
-+"       -r, --restart               restart autonegotiation\n"
-+"       -w, --watch                 monitor for link status changes\n"
-+"       -l, --log                   with -w, write events to syslog\n"
-+"       -A, --advertise=media,...   advertise only specified media\n"
-+"       -F, --force=media           force specified media technology\n"
-+"media: 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, 10baseT-HD,\n"
-+"       (to advertise both HD and FD) 100baseTx, 10baseT\n";
- int main(int argc, char **argv)
- {
diff --git a/src/patches/net-tools-1.60-iphdr-redef.patch b/src/patches/net-tools-1.60-iphdr-redef.patch
deleted file mode 100644 (file)
index 23b6dfe..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur net-tools-1.60.org/iptunnel.c net-tools-1.60/iptunnel.c
---- net-tools-1.60.org/iptunnel.c      2001-04-08 19:04:23.000000000 +0200
-+++ net-tools-1.60/iptunnel.c  2017-02-07 17:37:17.956405434 +0100
-@@ -26,7 +26,7 @@
- #include <sys/socket.h>
- #include <sys/ioctl.h>
- #include <netinet/in.h>
--#include <netinet/ip.h>
-+#include <linux/ip.h>
- #include <arpa/inet.h>
- #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1))
- #include <net/if.h>
diff --git a/src/patches/net-tools-1.60-kernel_headers-3.patch b/src/patches/net-tools-1.60-kernel_headers-3.patch
deleted file mode 100644 (file)
index 89988f0..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-diff -Naur net-tools-1.60.org/hostname.c net-tools-1.60/hostname.c
---- net-tools-1.60.org/hostname.c      2001-04-08 19:04:23.000000000 +0200
-+++ net-tools-1.60/hostname.c  2013-08-26 11:56:50.131844273 +0200
-@@ -42,10 +42,16 @@
- #include "config.h"
- #include "version.h"
- #include "../intl.h"
-+#include <linux/version.h>
- #if HAVE_AFDECnet
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
- #include <netdnet/dn.h>
- #endif
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
-+#include <linux/dn.h>
-+#endif
-+#endif
- char *Release = RELEASE, *Version = "hostname 1.100 (2001-04-14)";
-diff -Naur net-tools-1.60.org/lib/tr.c net-tools-1.60/lib/tr.c
---- net-tools-1.60.org/lib/tr.c        2000-02-20 22:46:45.000000000 +0100
-+++ net-tools-1.60/lib/tr.c    2013-08-26 11:57:33.675175033 +0200
-@@ -20,7 +20,7 @@
- #include <sys/types.h>
- #include <sys/socket.h>
- #include <net/if_arp.h>
--#include <linux/if_tr.h>
-+#include <netinet/if_tr.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <errno.h>
-diff -Naur net-tools-1.60.org/lib/x25_sr.c net-tools-1.60/lib/x25_sr.c
---- net-tools-1.60.org/lib/x25_sr.c    2000-05-20 15:38:10.000000000 +0200
-+++ net-tools-1.60/lib/x25_sr.c        2013-08-26 11:56:50.131844273 +0200
-@@ -22,6 +22,7 @@
- #include <sys/socket.h>
- #include <sys/ioctl.h>
- #include <linux/x25.h>
-+#include <linux/version.h>
- #include <ctype.h>
- #include <errno.h>
- #include <netdb.h>
-@@ -77,7 +78,11 @@
-   rt.sigdigits=sigdigits;
-   /* x25_route_struct.address isn't type struct sockaddr_x25, Why? */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
-   memcpy(&rt.address, &sx25.sx25_addr, sizeof(x25_address));
-+#else
-+  memcpy(&rt.address, &sx25.sx25_addr, sizeof(struct x25_address));
-+#endif
-   while (*args) {
-       if (!strcmp(*args,"device") || !strcmp(*args,"dev")) {
diff --git a/src/patches/net-tools-1.60-mii_ioctl-1.patch b/src/patches/net-tools-1.60-mii_ioctl-1.patch
deleted file mode 100644 (file)
index ca8582d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-Submitted By:            Randy McMurchy <randy_at_linuxfromscratch_dot_org>
-Date:                    2004-08-27
-Initial Package Version: 1.60
-Upstream Status:         N/A (package is unmaintained)
-Origin:                  From Fedora Core (submitted to LFS-Hackers by Kevin White)
-Description:             Fixes mii-tool when compiled using Linux-2.6.x
-
-$LastChangedBy: randy $
-$Date: 2004-08-27 21:04:05 -0600 (Fri, 27 Aug 2004) $
-
---- net-tools-1.60/include/mii.h.bar   Tue Jul 31 11:49:39 2001
-+++ net-tools-1.60/include/mii.h       Tue Jul 31 11:49:33 2001
-@@ -11,11 +11,9 @@
- /* network interface ioctl's for MII commands */
- #ifndef SIOCGMIIPHY
--#define SIOCGMIIPHY (SIOCDEVPRIVATE)  /* Read from current PHY */
--#define SIOCGMIIREG (SIOCDEVPRIVATE+1)        /* Read any PHY register */
--#define SIOCSMIIREG (SIOCDEVPRIVATE+2)        /* Write any PHY register */
--#define SIOCGPARAMS (SIOCDEVPRIVATE+3)        /* Read operational parameters */
--#define SIOCSPARAMS (SIOCDEVPRIVATE+4)        /* Set operational parameters */
-+#define SIOCGMIIPHY 0x8947    /* Read from current PHY */
-+#define SIOCGMIIREG 0x8948    /* Read any PHY register */
-+#define SIOCSMIIREG 0x8949    /* Write any PHY register */
- #endif
- #include <linux/types.h>
diff --git a/src/patches/net-tools-1.60-no-hostname.patch b/src/patches/net-tools-1.60-no-hostname.patch
deleted file mode 100644 (file)
index e2e34a1..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
---- a/Makefile.bak     2014-06-03 19:01:39.758845492 +0000
-+++ b/Makefile 2014-06-03 19:02:34.119171419 +0000
-@@ -76,7 +76,7 @@
- NET_LIB_PATH = lib
- NET_LIB_NAME = net-tools
--PROGS := ifconfig hostname arp netstat route rarp slattach plipconfig nameif
-+PROGS := ifconfig arp netstat route rarp slattach plipconfig nameif
- -include config.make
- ifeq ($(HAVE_IP_TOOLS),1)
-@@ -190,9 +190,6 @@
- nameif:       nameif.o
-               $(CC) $(LDFLAGS) -o nameif nameif.o 
--hostname:     hostname.o
--              $(CC) $(LDFLAGS) -o hostname hostname.o $(DNLIB)
--
- route:                $(NET_LIB) route.o
-               $(CC) $(LDFLAGS) -o route route.o $(NLIB) $(RESLIB)
-@@ -224,7 +221,6 @@
-       install -m 0755 -d ${BASEDIR}/sbin
-       install -m 0755 -d ${BASEDIR}/bin
-       install -m 0755 arp        ${BASEDIR}/sbin
--      install -m 0755 hostname   ${BASEDIR}/bin
-       install -m 0755 ifconfig   ${BASEDIR}/sbin
-       install -m 0755 nameif     ${BASEDIR}/sbin
-       install -m 0755 netstat    ${BASEDIR}/bin
-@@ -239,21 +235,11 @@
- ifeq ($(HAVE_MII),1)
-       install -m 0755 mii-tool   $(BASEDIR)/sbin
- endif
--      ln -fs hostname $(BASEDIR)/bin/dnsdomainname
--      ln -fs hostname $(BASEDIR)/bin/ypdomainname
--      ln -fs hostname $(BASEDIR)/bin/nisdomainname
--      ln -fs hostname $(BASEDIR)/bin/domainname
--ifeq ($(HAVE_AFDECnet),1)
--      ln -fs hostname $(BASEDIR)/bin/nodename
--endif
- savebin:
-       @for i in ${BASEDIR}/sbin/arp ${BASEDIR}/sbin/ifconfig \
-                  ${BASEDIR}/bin/netstat \
--               ${BASEDIR}/sbin/rarp ${BASEDIR}/sbin/route \
--               ${BASEDIR}/bin/hostname ${BASEDIR}/bin/ypdomainname \
--                 ${BASEDIR}/bin/dnsdomainname ${BASEDIR}/bin/nisdomainname \
--               ${BASEDIR}/bin/domainname ; do \
-+               ${BASEDIR}/sbin/rarp ${BASEDIR}/sbin/route; do \
-                [ -f $$i ] && cp -f $$i $$i.old ; done ; echo Saved.
- installdata:
diff --git a/src/patches/net-tools-2.10-no-hostname.patch b/src/patches/net-tools-2.10-no-hostname.patch
new file mode 100644 (file)
index 0000000..c96c798
--- /dev/null
@@ -0,0 +1,41 @@
+--- net-tools-2.10/Makefile.orig       2021-01-07 00:22:35.000000000 +0100
++++ net-tools-2.10/Makefile    2021-02-06 19:30:07.104393812 +0100
+@@ -39,9 +39,6 @@
+ ifeq ($(HAVE_ARP_TOOLS),1)
+ PROGS += arp rarp
+ endif
+-ifeq ($(HAVE_HOSTNAME_TOOLS),1)
+-PROGS += hostname
+-endif
+ ifeq ($(HAVE_IP_TOOLS),1)
+ PROGS   += iptunnel ipmaddr
+ endif
+@@ -173,9 +170,6 @@
+ nameif:               $(NET_LIB) nameif.o
+               $(CC) $(CFLAGS) $(LDFLAGS) -o $@ nameif.o $(NLIB) $(LDLIBS)
+-hostname:     hostname.o
+-              $(CC) $(CFLAGS) $(LDFLAGS) -o $@ hostname.o $(DNLIB) $(LDLIBS)
+-
+ route:                $(NET_LIB) route.o
+               $(CC) $(CFLAGS) $(LDFLAGS) -o $@ route.o $(NLIB) $(LDLIBS)
+@@ -219,18 +213,6 @@
+       install -m 0755 arp        ${BASEDIR}${SBINDIR}
+       install -m 0755 rarp       ${BASEDIR}${SBINDIR}
+ endif
+-ifeq ($(HAVE_HOSTNAME_TOOLS),1)
+-      install -m 0755 hostname   ${BASEDIR}${BINDIR}
+-      ln -fs hostname $(BASEDIR)${BINDIR}/dnsdomainname
+-ifeq ($(HAVE_HOSTNAME_SYMLINKS),1)
+-      ln -fs hostname $(BASEDIR)${BINDIR}/ypdomainname
+-      ln -fs hostname $(BASEDIR)${BINDIR}/nisdomainname
+-      ln -fs hostname $(BASEDIR)${BINDIR}/domainname
+-endif
+-ifeq ($(HAVE_AFDECnet),1)
+-      ln -fs hostname $(BASEDIR)${BINDIR}/nodename
+-endif
+-endif
+ ifeq ($(HAVE_IP_TOOLS),1)
+       install -m 0755 ipmaddr    $(BASEDIR)${SBINDIR}
+       install -m 0755 iptunnel   $(BASEDIR)${SBINDIR}