From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: Re: [PATCH] net-tools: Update to 2.10 Date: Mon, 08 Feb 2021 13:15:29 +0000 Message-ID: <62B40A97-FB05-45CB-8CB6-ABFF9AB3E84D@ipfire.org> In-Reply-To: <20210207180036.1915371-1-adolf.belka@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1815724808154735333==" List-Id: --===============1815724808154735333== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 pote= ntially parse output of any of the commands do not introduce any recessions? Best, -Michael > On 7 Feb 2021, at 18:00, Adolf Belka wrote: >=20 > - 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 >=20 > Signed-off-by: Adolf Belka > --- > 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 >=20 > diff --git a/config/rootfiles/common/net-tools b/config/rootfiles/common/ne= t-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 @@ >=20 > include Config >=20 > -VER =3D 1.60 > +VER =3D 2.10 >=20 > THISAPP =3D net-tools-$(VER) > -DL_FILE =3D $(THISAPP).tar.bz2 > +DL_FILE =3D $(THISAPP).tar.xz > DL_FROM =3D $(URL_IPFIRE) > DIR_APP =3D $(DIR_SRC)/$(THISAPP) > TARGET =3D $(DIR_INFO)/$(THISAPP) > @@ -39,7 +39,7 @@ objects =3D $(DL_FILE) >=20 > $(DL_FILE) =3D $(DL_FROM)/$(DL_FILE) >=20 > -$(DL_FILE)_MD5 =3D 888774accab40217dde927e21979c165 > +$(DL_FILE)_MD5 =3D 78aae762c95e2d731faf88d482e4cde5 >=20 > install : $(TARGET) >=20 > @@ -68,12 +68,8 @@ $(subst %,%_MD5,$(objects)) : >=20 > $(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-h= ostname.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_h= eaders-3.patch > - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-iphdr-re= def.patch > - cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/$(THISAPP)-mii_ioct= l-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-h= ostname.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=3D0|HAVE_MII=3D1|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 any= one 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-too= ls-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 > -Submitted By: Jim Gifford > -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. > -=20 > -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); > - } > - } > -=20 > -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 =3D 0; break; > - default: > -+ ((void)0); > - } > -=20 > - /* 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 @@ > - /*--------------------------------------------------------------------*/ > -=20 > - const char *usage =3D > --"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=3Dmedia,... advertise only specified media > -- -F, --force=3Dmedia 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=3Dmedia,... advertise only specified media\n" > -+" -F, --force=3Dmedia 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"; > -=20 > - 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 > - #include > - #include > --#include > -+#include > - #include > - #if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ =3D=3D 2 && __GLIB= C_MINOR__ >=3D 1)) > - #include > diff --git a/src/patches/net-tools-1.60-kernel_headers-3.patch b/src/patche= s/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 > -=20 > - #if HAVE_AFDECnet > -+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) > - #include > - #endif > -+#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2, 6, 0) > -+#include > -+#endif > -+#endif > -=20 > - char *Release =3D RELEASE, *Version =3D "hostname 1.100 (2001-04-14)"; > -=20 > -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 > - #include > - #include > --#include > -+#include > - #include > - #include > - #include > -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 > - #include > - #include > -+#include > - #include > - #include > - #include > -@@ -77,7 +78,11 @@ > - rt.sigdigits=3Dsigdigits; > -=20 > - /* 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 > -=20 > - 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 > -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 Kev= in 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 @@ > -=20 > - /* 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 > -=20 > - #include > 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 =3D lib > - NET_LIB_NAME =3D net-tools > -=20 > --PROGS :=3D ifconfig hostname arp netstat route rarp slattach plipconfig n= ameif > -+PROGS :=3D ifconfig arp netstat route rarp slattach plipconfig nameif > -=20 > - -include config.make > - ifeq ($(HAVE_IP_TOOLS),1) > -@@ -190,9 +190,6 @@ > - nameif: nameif.o > - $(CC) $(LDFLAGS) -o nameif nameif.o=20 > -=20 > --hostname: hostname.o > -- $(CC) $(LDFLAGS) -o hostname hostname.o $(DNLIB) > -- > - route: $(NET_LIB) route.o > - $(CC) $(LDFLAGS) -o route route.o $(NLIB) $(RESLIB) > -=20 > -@@ -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 > -=20 > - 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/nisdomainnam= e \ > -- ${BASEDIR}/bin/domainname ; do \ > -+ ${BASEDIR}/sbin/rarp ${BASEDIR}/sbin/route; do \ > - [ -f $$i ] && cp -f $$i $$i.old ; done ; echo Saved. > -=20 > - 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 +=3D arp rarp > + endif > +-ifeq ($(HAVE_HOSTNAME_TOOLS),1) > +-PROGS +=3D hostname > +-endif > + ifeq ($(HAVE_IP_TOOLS),1) > + PROGS +=3D iptunnel ipmaddr > + endif > +@@ -173,9 +170,6 @@ > + nameif: $(NET_LIB) nameif.o > + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ nameif.o $(NLIB) $(LDLIBS) > +=20 > +-hostname: hostname.o > +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ hostname.o $(DNLIB) $(LDLIBS) > +- > + route: $(NET_LIB) route.o > + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ route.o $(NLIB) $(LDLIBS) > +=20 > +@@ -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} > --=20 > 2.30.0 >=20 --===============1815724808154735333==--