Hi Michael,
On 08/02/2021 14:15, Michael Tremer wrote:
Hey Adolf,
This is a rather dangerous upgrade in case any of the command line parameters have changed.
Did you test this and check if loads of scripts that use these tools and potentially parse output of any of the commands do not introduce any recessions?
No I didn't. The only thing I can do is install the built version into my VM testbed and see if all the standard pages work. I don't have any major scripts that use those commands to test that out. Also my testbed (and production system which it is modelled after) are very basic setup's. They use dhcp, hosts, a few firewall rules and that is about it. I will test it on my vm testbed and report back but it is unlikely to be a high coverage test.
So I don't think I can test it very much, unless there are any test scripts that I can use.
Is there anyone else that could test it more deeply?
Regards, Adolf.
Best, -Michael
On 7 Feb 2021, at 18:00, Adolf Belka adolf.belka@ipfire.org wrote:
- Update net-tools from 1.60 to 2.10
- Based on guidance from Michael Tremer
from makefile
- new no-hostname patch created to remove all hostname references
- 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
config/rootfiles/common/net-tools | 10 ++- lfs/net-tools | 22 ++--- src/patches/net-tools-1.60-gcc34-3.patch | 86 ------------------- src/patches/net-tools-1.60-iphdr-redef.patch | 12 --- .../net-tools-1.60-kernel_headers-3.patch | 55 ------------ src/patches/net-tools-1.60-mii_ioctl-1.patch | 27 ------ src/patches/net-tools-1.60-no-hostname.patch | 52 ----------- src/patches/net-tools-2.10-no-hostname.patch | 41 +++++++++ 8 files changed, 61 insertions(+), 244 deletions(-) delete mode 100644 src/patches/net-tools-1.60-gcc34-3.patch delete mode 100644 src/patches/net-tools-1.60-iphdr-redef.patch delete mode 100644 src/patches/net-tools-1.60-kernel_headers-3.patch delete mode 100644 src/patches/net-tools-1.60-mii_ioctl-1.patch delete mode 100644 src/patches/net-tools-1.60-no-hostname.patch create mode 100644 src/patches/net-tools-2.10-no-hostname.patch
diff --git a/config/rootfiles/common/net-tools b/config/rootfiles/common/net-tools index 4860b2f0a..0578c1bc0 100644 --- a/config/rootfiles/common/net-tools +++ b/config/rootfiles/common/net-tools @@ -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
This is no in alphanumerical order any more?!
diff --git a/lfs/net-tools b/lfs/net-tools index 3fde55e2d..7a568a260 100644 --- a/lfs/net-tools +++ b/lfs/net-tools @@ -24,10 +24,10 @@
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 index e6ec25329..000000000 --- a/src/patches/net-tools-1.60-gcc34-3.patch +++ /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 index 23b6dfe01..000000000 --- a/src/patches/net-tools-1.60-iphdr-redef.patch +++ /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 index 89988f0e7..000000000 --- a/src/patches/net-tools-1.60-kernel_headers-3.patch +++ /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 index ca8582d51..000000000 --- a/src/patches/net-tools-1.60-mii_ioctl-1.patch +++ /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 index e2e34a173..000000000 --- a/src/patches/net-tools-1.60-no-hostname.patch +++ /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 index 000000000..c96c798ac --- /dev/null +++ b/src/patches/net-tools-2.10-no-hostname.patch @@ -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}
-- 2.30.0