Module Name:    src
Committed By:   snj
Date:           Thu May 14 07:11:53 UTC 2015

Modified Files:
        src/distrib/amd64/cdroms [netbsd-7]: Makefile.cdrom
        src/distrib/amd64/installimage [netbsd-7]: Makefile spec.inst
        src/distrib/common [netbsd-7]: Makefile.dhcpcd list.dhcpcd
        src/distrib/i386/cdroms [netbsd-7]: Makefile.cdrom
        src/distrib/i386/installimage [netbsd-7]: Makefile spec.inst
        src/distrib/sparc64/cdroms/installcd [netbsd-7]: Makefile
        src/distrib/vax/cdroms/installcd [netbsd-7]: Makefile
        src/usr.sbin/sysinst [netbsd-7]: msg.mi.de msg.mi.en msg.mi.es
            msg.mi.fr msg.mi.pl net.c
Removed Files:
        src/distrib/common [netbsd-7]: 10-resolv.conf 99-print-sysinst

Log Message:
Pull up following revision(s) (requested by martin in ticket #759):
        distrib/amd64/cdroms/Makefile.cdrom: revision 1.12
        distrib/amd64/installimage/Makefile: revision 1.5
        distrib/amd64/installimage/spec.inst: revision 1.2
        distrib/common/10-resolv.conf: file removal
        distrib/common/99-print-sysinst: file removal
        distrib/common/Makefile.dhcpcd: revision 1.2
        distrib/common/list.dhcpcd: revision 1.3
        distrib/i386/cdroms/Makefile.cdrom: revision 1.32
        distrib/i386/installimage/Makefile: revision 1.5
        distrib/i386/installimage/spec.inst: revision 1.2
        distrib/sparc64/cdroms/installcd/Makefile: revision 1.20
        distrib/vax/cdroms/installcd/Makefile: revision 1.10
        usr.sbin/sysinst/msg.mi.de: revision 1.4
        usr.sbin/sysinst/msg.mi.en: revision 1.4
        usr.sbin/sysinst/msg.mi.es: revision 1.4
        usr.sbin/sysinst/msg.mi.fr: revision 1.4
        usr.sbin/sysinst/msg.mi.pl: revision 1.4
        usr.sbin/sysinst/net.c: revisions 1.5-1.8, 1.11-1.15
The dhcpcd utilties in pkgsrc require dhcpcd to be running in master mode.
So set dhcpcd to start like so, but restrict it to the configured interface
still instead of ifconfig_foo=dhcp.
--
Use the 20-resolv.conf hook from dhcpcd rather than the minimal one.
Extract configured information from resolv.conf and hostname instead
of scraping the last dhcpcd script run.
This will allow the use of DHCPv6 and IPv6RA DNS details in the future.
--
dhcpcd will already have configured the system at this point, so
don't bother writing it manually.
--
Don't prompt for hostname or domain if obtained from DHCP.
--
Change the display order so it's protocol agnostic at the top,
then IPv4 then IPv6.
--
Strip newline from the gateway correctly.
--
Show the IP6 address instead of yes
--
Fix a bogus gcc warning: dhcp_config may be used uninitialized
--
Punt custom dhcpcd hooks in favour up upstream hooks
--
For the benefit of gcc 4.5, rename a local "nl" variable to "nline",
so it doesn't collide with the global curses nl() function.


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.1 -r1.10.2.2 src/distrib/amd64/cdroms/Makefile.cdrom
cvs rdiff -u -r1.4 -r1.4.2.1 src/distrib/amd64/installimage/Makefile
cvs rdiff -u -r1.1 -r1.1.22.1 src/distrib/amd64/installimage/spec.inst
cvs rdiff -u -r1.1 -r0 src/distrib/common/10-resolv.conf \
    src/distrib/common/99-print-sysinst
cvs rdiff -u -r1.1 -r1.1.28.1 src/distrib/common/Makefile.dhcpcd
cvs rdiff -u -r1.2 -r1.2.24.1 src/distrib/common/list.dhcpcd
cvs rdiff -u -r1.30.2.1 -r1.30.2.2 src/distrib/i386/cdroms/Makefile.cdrom
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/distrib/i386/installimage/Makefile
cvs rdiff -u -r1.1 -r1.1.22.1 src/distrib/i386/installimage/spec.inst
cvs rdiff -u -r1.18.2.1 -r1.18.2.2 \
    src/distrib/sparc64/cdroms/installcd/Makefile
cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/distrib/vax/cdroms/installcd/Makefile
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/usr.sbin/sysinst/msg.mi.de \
    src/usr.sbin/sysinst/msg.mi.es src/usr.sbin/sysinst/msg.mi.fr
cvs rdiff -u -r1.2.4.5 -r1.2.4.6 src/usr.sbin/sysinst/msg.mi.en
cvs rdiff -u -r1.2.4.4 -r1.2.4.5 src/usr.sbin/sysinst/msg.mi.pl
cvs rdiff -u -r1.2.4.3 -r1.2.4.4 src/usr.sbin/sysinst/net.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/amd64/cdroms/Makefile.cdrom
diff -u src/distrib/amd64/cdroms/Makefile.cdrom:1.10.2.1 src/distrib/amd64/cdroms/Makefile.cdrom:1.10.2.2
--- src/distrib/amd64/cdroms/Makefile.cdrom:1.10.2.1	Fri Aug 15 10:23:22 2014
+++ src/distrib/amd64/cdroms/Makefile.cdrom	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.10.2.1 2014/08/15 10:23:22 martin Exp $
+# $NetBSD: Makefile.cdrom,v 1.10.2.2 2015/05/14 07:11:53 snj Exp $
 
 .include <bsd.own.mk>
 
@@ -65,9 +65,6 @@ CDRUNTIME+=	./usr/share/misc/terminfo.cd
 CDRUNTIME+=	./usr/share/locale
 
 image_md_pre:
-	${MKDIR} cdrom/libexec/dhcpcd-hooks
-	${INSTALL} ${COPY} ${.CURDIR}/../../../common/10-resolv.conf cdrom/libexec/dhcpcd-hooks
-	${INSTALL} ${COPY} ${.CURDIR}/../../../common/99-print-sysinst cdrom/libexec/dhcpcd-hooks
 	${MKDIR} cdrom/etc
 	${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
 	${INSTALL} ${COPY} ${.CURDIR}/../etc.ttys cdrom/etc/ttys

Index: src/distrib/amd64/installimage/Makefile
diff -u src/distrib/amd64/installimage/Makefile:1.4 src/distrib/amd64/installimage/Makefile:1.4.2.1
--- src/distrib/amd64/installimage/Makefile:1.4	Sat Jul 26 19:34:08 2014
+++ src/distrib/amd64/installimage/Makefile	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2014/07/26 19:34:08 dholland Exp $
+#	$NetBSD: Makefile,v 1.4.2.1 2015/05/14 07:11:53 snj Exp $
 
 .include <bsd.own.mk>
 
@@ -26,8 +26,6 @@ SYSINSTDIR!= cd ${.CURDIR}/../../../usr.
 
 SPEC_EXTRA=		${.CURDIR}/spec.inst
 IMGFILE_EXTRA=								\
-	${DISTRIBDIR}/common/10-resolv.conf	libexec/dhcpcd-hooks	\
-	${DISTRIBDIR}/common/99-print-sysinst	libexec/dhcpcd-hooks	\
 	${.CURDIR}/etc.ttys		etc/ttys			\
 	${.CURDIR}/etc.rc		etc/rc				\
 	${.CURDIR}/install.sh		.				\

Index: src/distrib/amd64/installimage/spec.inst
diff -u src/distrib/amd64/installimage/spec.inst:1.1 src/distrib/amd64/installimage/spec.inst:1.1.22.1
--- src/distrib/amd64/installimage/spec.inst:1.1	Sun Jan 22 03:53:29 2012
+++ src/distrib/amd64/installimage/spec.inst	Thu May 14 07:11:53 2015
@@ -1,10 +1,7 @@
-# $NetBSD: spec.inst,v 1.1 2012/01/22 03:53:29 tsutsui Exp $
+# $NetBSD: spec.inst,v 1.1.22.1 2015/05/14 07:11:53 snj Exp $
 ./mnt2			type=dir mode=0755 uname=root gname=wheel
 ./targetroot		type=dir mode=0755 uname=root gname=wheel
 
-./libexec/dhcpcd-hooks/10-resolv.conf	type=file mode=0444 uname=root gname=wheel
-./libexec/dhcpcd-hooks/99-print-sysinst	type=file mode=0444 uname=root gname=wheel
-
 ./install.sh		type=file mode=0755 uname=root gname=wheel
 ./sysinst		type=file mode=0755 uname=root gname=wheel
 ./sysinstmsgs.de	type=file mode=0444 uname=root gname=wheel

Index: src/distrib/common/Makefile.dhcpcd
diff -u src/distrib/common/Makefile.dhcpcd:1.1 src/distrib/common/Makefile.dhcpcd:1.1.28.1
--- src/distrib/common/Makefile.dhcpcd:1.1	Tue Apr  7 11:49:17 2009
+++ src/distrib/common/Makefile.dhcpcd	Thu May 14 07:11:53 2015
@@ -1,8 +1,9 @@
-# $NetBSD: Makefile.dhcpcd,v 1.1 2009/04/07 11:49:17 joerg Exp $
+# $NetBSD: Makefile.dhcpcd,v 1.1.28.1 2015/05/14 07:11:53 snj Exp $
 
 IMAGEDEPENDS+= 	\
 	${DESTDIR}/etc/dhcpcd.conf \
 	${DESTDIR}/libexec/dhcpcd-run-hooks \
+	${DESTDIR}/libexec/dhcpcd-hooks/20-resolv.conf \
 	${DESTDIR}/libexec/dhcpcd-hooks/30-hostname
 
 LISTS+=		${DISTRIBDIR}/common/list.dhcpcd

Index: src/distrib/common/list.dhcpcd
diff -u src/distrib/common/list.dhcpcd:1.2 src/distrib/common/list.dhcpcd:1.2.24.1
--- src/distrib/common/list.dhcpcd:1.2	Tue May 31 06:19:11 2011
+++ src/distrib/common/list.dhcpcd	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: list.dhcpcd,v 1.2 2011/05/31 06:19:11 christos Exp $
+#	$NetBSD: list.dhcpcd,v 1.2.24.1 2015/05/14 07:11:53 snj Exp $
 #
 # list file (c.f. parselist.awk) for DHCP-enabled install media.
 #
@@ -8,7 +8,5 @@ SPECIAL	dhcpcd srcdir external/bsd/dhcpc
 
 COPY	${DESTDIR}/etc/dhcpcd.conf etc/dhcpcd.conf
 COPY	${DESTDIR}/libexec/dhcpcd-run-hooks libexec/dhcpcd-run-hooks 555
-
-COPY	${NETBSDSRCDIR}/distrib/common/10-resolv.conf libexec/dhcpcd-hooks/10-resolv.conf
+COPY	${DESTDIR}/libexec/dhcpcd-hooks/20-resolv.conf libexec/dhcpcd-hooks/20-resolv.conf
 COPY	${DESTDIR}/libexec/dhcpcd-hooks/30-hostname libexec/dhcpcd-hooks/30-hostname
-COPY	${NETBSDSRCDIR}/distrib/common/99-print-sysinst libexec/dhcpcd-hooks/99-print-sysinst

Index: src/distrib/i386/cdroms/Makefile.cdrom
diff -u src/distrib/i386/cdroms/Makefile.cdrom:1.30.2.1 src/distrib/i386/cdroms/Makefile.cdrom:1.30.2.2
--- src/distrib/i386/cdroms/Makefile.cdrom:1.30.2.1	Fri Aug 15 10:23:22 2014
+++ src/distrib/i386/cdroms/Makefile.cdrom	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.cdrom,v 1.30.2.1 2014/08/15 10:23:22 martin Exp $
+# $NetBSD: Makefile.cdrom,v 1.30.2.2 2015/05/14 07:11:53 snj Exp $
 
 .include <bsd.own.mk>
 
@@ -65,9 +65,6 @@ CDRUNTIME+=	./usr/share/misc/terminfo.cd
 CDRUNTIME+=	./usr/share/locale
 
 image_md_pre:
-	${MKDIR} cdrom/libexec/dhcpcd-hooks
-	${INSTALL} ${COPY} ${.CURDIR}/../../../common/10-resolv.conf cdrom/libexec/dhcpcd-hooks
-	${INSTALL} ${COPY} ${.CURDIR}/../../../common/99-print-sysinst cdrom/libexec/dhcpcd-hooks
 	${MKDIR} cdrom/etc
 	${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
 	${INSTALL} ${COPY} ${.CURDIR}/../etc.ttys cdrom/etc/ttys

Index: src/distrib/i386/installimage/Makefile
diff -u src/distrib/i386/installimage/Makefile:1.4.2.2 src/distrib/i386/installimage/Makefile:1.4.2.3
--- src/distrib/i386/installimage/Makefile:1.4.2.2	Thu Mar 12 19:06:22 2015
+++ src/distrib/i386/installimage/Makefile	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4.2.2 2015/03/12 19:06:22 snj Exp $
+#	$NetBSD: Makefile,v 1.4.2.3 2015/05/14 07:11:53 snj Exp $
 
 .include <bsd.own.mk>
 
@@ -26,8 +26,6 @@ SYSINSTDIR!= cd ${.CURDIR}/../../../usr.
 
 SPEC_EXTRA=		${.CURDIR}/spec.inst
 IMGFILE_EXTRA=								\
-	${DISTRIBDIR}/common/10-resolv.conf	libexec/dhcpcd-hooks	\
-	${DISTRIBDIR}/common/99-print-sysinst	libexec/dhcpcd-hooks	\
 	${.CURDIR}/etc.ttys		etc/ttys			\
 	${.CURDIR}/etc.rc		etc/rc				\
 	${.CURDIR}/install.sh		.				\

Index: src/distrib/i386/installimage/spec.inst
diff -u src/distrib/i386/installimage/spec.inst:1.1 src/distrib/i386/installimage/spec.inst:1.1.22.1
--- src/distrib/i386/installimage/spec.inst:1.1	Sun Jan 22 03:53:30 2012
+++ src/distrib/i386/installimage/spec.inst	Thu May 14 07:11:53 2015
@@ -1,10 +1,7 @@
-# $NetBSD: spec.inst,v 1.1 2012/01/22 03:53:30 tsutsui Exp $
+# $NetBSD: spec.inst,v 1.1.22.1 2015/05/14 07:11:53 snj Exp $
 ./mnt2			type=dir mode=0755 uname=root gname=wheel
 ./targetroot		type=dir mode=0755 uname=root gname=wheel
 
-./libexec/dhcpcd-hooks/10-resolv.conf	type=file mode=0444 uname=root gname=wheel
-./libexec/dhcpcd-hooks/99-print-sysinst	type=file mode=0444 uname=root gname=wheel
-
 ./install.sh		type=file mode=0755 uname=root gname=wheel
 ./sysinst		type=file mode=0755 uname=root gname=wheel
 ./sysinstmsgs.de	type=file mode=0444 uname=root gname=wheel

Index: src/distrib/sparc64/cdroms/installcd/Makefile
diff -u src/distrib/sparc64/cdroms/installcd/Makefile:1.18.2.1 src/distrib/sparc64/cdroms/installcd/Makefile:1.18.2.2
--- src/distrib/sparc64/cdroms/installcd/Makefile:1.18.2.1	Fri Aug 15 10:23:22 2014
+++ src/distrib/sparc64/cdroms/installcd/Makefile	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18.2.1 2014/08/15 10:23:22 martin Exp $
+#	$NetBSD: Makefile,v 1.18.2.2 2015/05/14 07:11:53 snj Exp $
 CDBASE=		sparc64cd		# gives ${CDBASE}.iso
 CDRELEASE=	true			# include $RELEASEDIR/$MACHINE
 
@@ -68,9 +68,6 @@ CDRUNTIME+=	./usr/share/misc/terminfo.cd
 CDRUNTIME+=	./usr/share/locale
 
 image_md_pre:
-	${RM} -rf cdrom/libexec/dhcpcd-hooks/*
-	${CP} ${.CURDIR}/../../../common/10-resolv.conf cdrom/libexec/dhcpcd-hooks
-	${CP} ${.CURDIR}/../../../common/99-print-sysinst cdrom/libexec/dhcpcd-hooks
 	${MKDIR} cdrom/etc
 	${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
 	${INSTALL} ${COPY} ${.CURDIR}/etc.ttys cdrom/etc/ttys

Index: src/distrib/vax/cdroms/installcd/Makefile
diff -u src/distrib/vax/cdroms/installcd/Makefile:1.8.2.1 src/distrib/vax/cdroms/installcd/Makefile:1.8.2.2
--- src/distrib/vax/cdroms/installcd/Makefile:1.8.2.1	Fri Aug 15 10:23:21 2014
+++ src/distrib/vax/cdroms/installcd/Makefile	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.8.2.1 2014/08/15 10:23:21 martin Exp $
+#	$NetBSD: Makefile,v 1.8.2.2 2015/05/14 07:11:53 snj Exp $
 CDBASE=		vaxcd			# gives ${CDBASE}.iso
 CDRELEASE=	true			# include $RELEASEDIR/$MACHINE
 CDKERNELS=	${RELEASEDIR}/${MACHINE}/binary/kernel/netbsd-GENERIC.gz	netbsd.gz
@@ -17,10 +17,6 @@ image_md_pre:
 	${CP} ${DESTDIR}/usr/mdec/boot cdrom/boot
 	${RM} -f bootxx.${MACHINE}
 	${CP} ${DESTDIR}/usr/mdec/xxboot bootxx.${MACHINE}
-	${RM} -rf cdrom/libexec/dhcpcd-hooks/*
-	${MKDIR} -p cdrom/libexec/dhcpcd-hooks
-	${CP} ${.CURDIR}/../../../common/10-resolv.conf cdrom/libexec/dhcpcd-hooks
-	${CP} ${.CURDIR}/../../../common/99-print-sysinst cdrom/libexec/dhcpcd-hooks
 	${MKDIR} cdrom/etc
 	${HOST_LN} -fs /tmp/gettytab cdrom/etc/gettytab
 	${INSTALL} ${COPY} ${.CURDIR}/etc.ttys cdrom/etc/ttys

Index: src/usr.sbin/sysinst/msg.mi.de
diff -u src/usr.sbin/sysinst/msg.mi.de:1.2.4.2 src/usr.sbin/sysinst/msg.mi.de:1.2.4.3
--- src/usr.sbin/sysinst/msg.mi.de:1.2.4.2	Wed May 13 17:04:27 2015
+++ src/usr.sbin/sysinst/msg.mi.de	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.de,v 1.2.4.2 2015/05/13 17:04:27 snj Exp $	*/
+/*	$NetBSD: msg.mi.de,v 1.2.4.3 2015/05/14 07:11:53 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -547,9 +547,6 @@ message net_srv_ip
 message net_mask
 {IPv4-Netzmaske}
 
-message net_namesrv6
-{IPv6-Nameserver}
-
 message net_namesrv
 {IPv4-Nameserver}
 
@@ -564,12 +561,12 @@ message netok
 
 DNS-Domain:		%s 
 Hostname:		%s 
+Nameserver:		%s 
 Netzwerkadapter:	%s 
+Verbindungstyp:		%s 
 IP-Adresse:		%s 
 Netzmaske:		%s 
-IPv4-Nameserver:	%s 
 IPv4-Gateway:		%s 
-Verbindungstyp:		%s 
 }
 
 message netok_slip
@@ -577,19 +574,18 @@ message netok_slip
 
 DNS-Domain:		%s 
 Hostname:		%s 
+Nameserver:		%s 
 Netzwerkadapter:	%s 
+Verbindungstyp:		%s 
 IP-Adresse:		%s 
 IP-Adresse des Servers:	%s 
 Netzmaske:		%s 
-IPv4-Nameserver:	%s 
 IPv4-Gateway:		%s 
-Verbindungstyp:		%s 
 }
 
 message netokv6
 {
 IPv6-Autokonfiguration:	%s 
-IPv6-Nameserver:	%s 
 }
 
 message netok_ok
@@ -1008,8 +1004,7 @@ message Device {Ger�t}
 message File_system {Dateisystem}
 message Select_DNS_server {  Ausw�hlen eines DNS Servers}
 message other {andere }
-message Perform_IPv6_autoconfiguration {IPv6 automatisch konfigurieren?}
-message Perform_DHCP_autoconfiguration {Konfiguration per DHCP ermitteln?}
+message Perform_autoconfiguration {F�hren Sie die automatische Konfiguration?}
 message Root_shell {Root-Shell}
 message User_shell {User-Shell}
 message Color_scheme {Farbschema}
Index: src/usr.sbin/sysinst/msg.mi.es
diff -u src/usr.sbin/sysinst/msg.mi.es:1.2.4.2 src/usr.sbin/sysinst/msg.mi.es:1.2.4.3
--- src/usr.sbin/sysinst/msg.mi.es:1.2.4.2	Wed May 13 17:04:27 2015
+++ src/usr.sbin/sysinst/msg.mi.es	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.es,v 1.2.4.2 2015/05/13 17:04:27 snj Exp $	*/
+/*	$NetBSD: msg.mi.es,v 1.2.4.3 2015/05/14 07:11:53 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -542,9 +542,6 @@ message net_srv_ip
 message net_mask
 {M�scara de red IPv4}
 
-message net_namesrv6
-{Servidor de nombres IPv6}
-
 message net_namesrv
 {Servidor de nombres IPv4}
 
@@ -559,12 +556,12 @@ message netok
 
 Dominio DNS: 		%s 
 Nombre de m�quina:	%s 
+Serv de nombres:	%s 
 Interfaz primaria:	%s 
+Tipo de medio:		%s 
 IP de la m�quina:	%s 
 M�scara de red:		%s 
-Serv de nombres IPv4:	%s 
 Pasarela IPv4:		%s 
-Tipo de medio:		%s 
 }
 
 message netok_slip
@@ -572,18 +569,17 @@ message netok_slip
 
 Dominio DNS: 		%s 
 Nombre de la m�quina:	%s 
+Serv de nombres:	%s 
 Interfaz primaria:	%s 
+Tipo de medio:		%s 
 IP de la m�quina:	%s 
 IP del servidor:	%s 
 M�scara de red:		%s 
-Serv de nombres IPv4:	%s 
 Pasarela IPv4:		%s 
-Tipo de medio:		%s 
 }
 
 message netokv6
 {IPv6 autoconf:		%s 
-Serv de nombres IPv6:	%s 
 }
 
 message netok_ok
@@ -974,8 +970,7 @@ message Device {Dispositivo}
 message File_system {Sistema de archivos}
 message Select_DNS_server {  Seleccione servidor DNS}
 message other {otro }
-message Perform_IPv6_autoconfiguration {�Realizar autoconfiguraci�n IPv6?}
-message Perform_DHCP_autoconfiguration {�Realizar autoconfiguraci�n DHCP ?}
+message Perform_autoconfiguration {�Realizar autoconfiguraci�n ?}
 message Root_shell {Shell de root}
 message Color_scheme {Combinaci�n de colores}
 message White_on_black {Blanco sobre negro}
Index: src/usr.sbin/sysinst/msg.mi.fr
diff -u src/usr.sbin/sysinst/msg.mi.fr:1.2.4.2 src/usr.sbin/sysinst/msg.mi.fr:1.2.4.3
--- src/usr.sbin/sysinst/msg.mi.fr:1.2.4.2	Wed May 13 17:04:27 2015
+++ src/usr.sbin/sysinst/msg.mi.fr	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.fr,v 1.2.4.2 2015/05/13 17:04:27 snj Exp $	*/
+/*	$NetBSD: msg.mi.fr,v 1.2.4.3 2015/05/14 07:11:53 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -553,9 +553,6 @@ message net_srv_ip
 message net_mask
 {Votre masque de r�seau (IPv4)}
 
-message net_namesrv6
-{Adresse IPv6 de votre serveur de noms (DNS)}
-
 message net_namesrv
 {Adresse IPv4 de votre serveur de noms (DNS)}
 
@@ -568,33 +565,32 @@ message net_media
 message netok
 {Vous avez sp�cifi� les valeurs suivantes :
 
-Nom de domaine (DNS) :		 %s 
-Nom d'ordinateur :		 %s 
-Interface r�seau :		 %s
-Adresse IPv4 :			 %s
-Masque de sous-r�seau :	 %s
-Adresse IPv4 du serveur de noms : %s
-Adresse IPv4 de la passerelle :  %s
-Type de r�seau (m�dia)	 %s 
+Nom de domaine (DNS) :		%s 
+Nom d'ordinateur :		%s 
+Adresse du serveur de noms :	%s
+Interface r�seau :		%s
+Type de r�seau (m�dia)		%s 
+Adresse IPv4 :			%s
+Masque de sous-r�seau :		%s
+Adresse IPv4 de la passerelle : %s
 }
 
 message netok_slip
 {Vous avez sp�cifi� les valeurs suivantes. �tes-vous d'accord ?
 
-Nom de domaine (DNS) :		 %s
-Nom d'ordinateur :		 %s
-Interface r�seau :		 %s
-Adresse IPv4 :			 %s
-Adresse IPv4 du serveur :	 %s
-Masque de sous-r�seau :	 %s
-Adresse IPv4 du serveur de noms : %s
-Adresse IPv4 de la passerelle :	 %s
-Type de r�seau (m�dia) :	 %s
+Nom de domaine (DNS) :		%s
+Nom d'ordinateur :		%s
+Adresse du serveur de noms :	%s
+Interface r�seau :		%s
+Type de r�seau (m�dia) :	%s
+Adresse IPv4 :			%s
+Adresse IPv4 du serveur :	%s
+Masque de sous-r�seau :		%s
+Adresse IPv4 de la passerelle :	%s
 }
 
 message netokv6
-{Auto-configuration IPv6 :	 %s 
-Adresse du serveur de noms IPv6 : %s 
+{Auto-configuration IPv6 :	%s 
 }
 
 message netok_ok
@@ -1046,8 +1042,7 @@ message Device {P�riph�rique}
 message File_system {Syst�me de fichiers}
 message Select_DNS_server {  Choisissez un serveur de noms :}
 message other {autre }
-message Perform_IPv6_autoconfiguration {Configurer automatiquement l'IPv6 ?}
-message Perform_DHCP_autoconfiguration {Configurer automatiquement par DHCP ?}
+message Perform_autoconfiguration {Configurer automatiquement ?}
 message Root_shell {Shell du compte "root"}
 message Color_scheme {Jeu de couleurs}
 message White_on_black {Blanc sur noir}

Index: src/usr.sbin/sysinst/msg.mi.en
diff -u src/usr.sbin/sysinst/msg.mi.en:1.2.4.5 src/usr.sbin/sysinst/msg.mi.en:1.2.4.6
--- src/usr.sbin/sysinst/msg.mi.en:1.2.4.5	Wed May 13 17:04:27 2015
+++ src/usr.sbin/sysinst/msg.mi.en	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.en,v 1.2.4.5 2015/05/13 17:04:27 snj Exp $	*/
+/*	$NetBSD: msg.mi.en,v 1.2.4.6 2015/05/14 07:11:53 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -523,11 +523,8 @@ message net_srv_ip
 message net_mask
 {IPv4 Netmask}
 
-message net_namesrv6
-{IPv6 name server}
-
 message net_namesrv
-{IPv4 name server}
+{Your name server}
 
 message net_defroute
 {IPv4 gateway}
@@ -540,12 +537,12 @@ message netok
 
 DNS Domain:		%s 
 Host Name:		%s 
+Nameserver:		%s 
 Primary Interface:	%s 
+Media type:		%s 
 Host IP:		%s 
 Netmask:		%s 
-IPv4 Nameserver:	%s 
 IPv4 Gateway:		%s 
-Media type:		%s 
 }
 
 message netok_slip
@@ -553,18 +550,17 @@ message netok_slip
 
 DNS Domain:		%s 
 Host Name:		%s 
+Nameserver:		%s 
 Primary Interface:	%s 
+Media type:		%s 
 Host IP:		%s 
 Server IP:		%s 
 Netmask:		%s 
-IPv4 Nameserver:	%s 
 IPv4 Gateway:		%s 
-Media type:		%s 
 }
 
 message netokv6
 {IPv6 autoconf:		%s 
-IPv6 Nameserver:	%s 
 }
 
 message netok_ok
@@ -943,8 +939,7 @@ message Device {Device}
 message File_system {File system}
 message Select_DNS_server {  Select DNS server}
 message other {other }
-message Perform_IPv6_autoconfiguration {Perform IPv6 autoconfiguration?}
-message Perform_DHCP_autoconfiguration {Perform DHCP autoconfiguration?}
+message Perform_autoconfiguration {Perform autoconfiguration?}
 message Root_shell {Root shell}
 message User_shell {User shell}
 message Color_scheme {Color scheme}

Index: src/usr.sbin/sysinst/msg.mi.pl
diff -u src/usr.sbin/sysinst/msg.mi.pl:1.2.4.4 src/usr.sbin/sysinst/msg.mi.pl:1.2.4.5
--- src/usr.sbin/sysinst/msg.mi.pl:1.2.4.4	Wed May 13 17:04:27 2015
+++ src/usr.sbin/sysinst/msg.mi.pl	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: msg.mi.pl,v 1.2.4.4 2015/05/13 17:04:27 snj Exp $	*/
+/*	$NetBSD: msg.mi.pl,v 1.2.4.5 2015/05/14 07:11:53 snj Exp $	*/
 /*	Based on english version: */
 /*	NetBSD: msg.mi.pl,v 1.36 2004/04/17 18:55:35 atatat Exp       */
 
@@ -523,9 +523,6 @@ message net_srv_ip
 message net_mask
 {Maska podsieci IPv4}
 
-message net_namesrv6
-{Serwer nazw IPv6}
-
 message net_namesrv
 {Serwer nazw IPv4}
 
@@ -540,12 +537,12 @@ message netok
 
 Domena DNS:		%s 
 Nazwa hosta:		%s 
+Serwer nazw:		%s 
 Podstawowy interfejs:	%s 
+Medium sieciowe:	%s
 Twoj adres IP:		%s 
 Maska podsieci:		%s 
-Serwer nazw IPv4:	%s 
 Bramka IPv4:		%s 
-Medium sieciowe:	%s
 }
 
 message netok_slip
@@ -553,18 +550,17 @@ message netok_slip
 
 Domena DNS:		%s 
 Nazwa hosta:		%s 
+Serwer nazw:		%s 
 Podstawowy interfejs:	%s 
+Medium sieciowe:	%s
 Twoj adres IP:		%s 
 Adres IP serwera:	%s
 Maska podsieci:		%s 
-Serwer nazw IPv4:	%s 
 Bramka IPv4:		%s 
-Medium sieciowe:	%s
 }
 
 message netokv6
 {Autkonfiguracja IPv6:	%s 
-Serwer nazw IPv6:	%s 
 }
 
 message netok_ok
@@ -946,8 +942,7 @@ message Device {Urzadzenie}
 message File_system {SystemPlikow}
 message Select_DNS_server {  Wybierz serwer nazw}
 message other {inny  }
-message Perform_IPv6_autoconfiguration {Wykonac autokonfiguracje IPv6?}
-message Perform_DHCP_autoconfiguration {Wykonac autkonfiguracje DHCP?}
+message Perform_autoconfiguration {Wykonac autkonfiguracje?}
 message Root_shell {Powloka root'a}
 message Color_scheme {Kolorystyka}
 message White_on_black {Bia�y na czarnym}

Index: src/usr.sbin/sysinst/net.c
diff -u src/usr.sbin/sysinst/net.c:1.2.4.3 src/usr.sbin/sysinst/net.c:1.2.4.4
--- src/usr.sbin/sysinst/net.c:1.2.4.3	Thu May 14 00:30:50 2015
+++ src/usr.sbin/sysinst/net.c	Thu May 14 07:11:53 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.2.4.3 2015/05/14 00:30:50 riz Exp $	*/
+/*	$NetBSD: net.c,v 1.2.4.4 2015/05/14 07:11:53 snj Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -102,7 +102,6 @@ static void write_etc_hosts(FILE *f);
 #define DHCPCD "/sbin/dhcpcd"
 #include <signal.h>
 static int config_dhcp(char *);
-static void get_dhcp_value(char *, size_t, const char *);
 
 #ifdef INET6
 static int is_v6kernel (void);
@@ -494,7 +493,6 @@ config_network(void)
 	int selected_net;
 
 	int i;
-	char dhcp_host[STRSIZE];
 #ifdef INET6
 	int v6config = 1;
 #endif
@@ -534,6 +532,7 @@ again:
 	    return 0;
 
 	network_up = 1;
+	dhcp_config = 0;
 
 	strncpy(net_dev, net_devs[selected_net].if_dev, STRSIZE);
 
@@ -546,13 +545,10 @@ again:
 	/* If root is on NFS do not reconfigure the interface. */
 	if (statvfs("/", &sb) == 0 && strcmp(sb.f_fstypename, "nfs") == 0) {
 		nfs_root = 1;
-		dhcp_config = 0;
 		get_ifinterface_info();
 		get_if6interface_info();
 		get_host_info();
-	} else if (slip) {
-		dhcp_config = 0;
-	} else {
+	} else if (!slip) {
 		/* Preload any defaults we can find */
 		get_ifinterface_info();
 		get_if6interface_info();
@@ -606,6 +602,8 @@ again:
 		/* try a dhcp configuration */
 		dhcp_config = config_dhcp(net_dev);
 		if (dhcp_config) {
+			char *nline;
+
 			/* Get newly configured data off interface. */
 			get_ifinterface_info();
 			get_if6interface_info();
@@ -618,50 +616,72 @@ again:
 			 * 'route -n show'
 			 */
 			if (collect(T_OUTPUT, &textbuf,
-				    "/sbin/route -n show | "
-				    "while read dest gateway flags;"
-				    " do [ \"$dest\" = default ] && {"
-					" echo $gateway; break; };"
-				    " done" ) > 0)
+			    "/sbin/route -n show | "
+			    "while read dest gateway flags;"
+			    " do [ \"$dest\" = default ] && {"
+			    " echo \"$gateway\"; break; };"
+			    " done" ) > 0)
 				strlcpy(net_defroute, textbuf,
 				    sizeof net_defroute);
 			free(textbuf);
+			if ((nline = strchr(net_defroute, '\n')))
+				*nline = '\0';
 
 			/* pull nameserver info out of /etc/resolv.conf */
 			if (collect(T_OUTPUT, &textbuf,
-				    "cat /etc/resolv.conf 2>/dev/null |"
-				    " while read keyword address rest;"
-				    " do [ \"$keyword\" = nameserver "
-					" -a \"${address#*:}\" = "
-					"\"${address}\" ] && {"
-					    " echo $address; break; };"
-				    " done" ) > 0)
+			    "cat /etc/resolv.conf 2>/dev/null |"
+			    " while read keyword address rest;"
+			    " do [ \"$keyword\" = nameserver ] &&"
+			    " { echo \"$address\"; break; };"
+			    " done" ) > 0)
 				strlcpy(net_namesvr, textbuf,
 				    sizeof net_namesvr);
 			free(textbuf);
+			if ((nline = strchr(net_namesvr, '\n')))
+				*nline = '\0';
 			if (net_namesvr[0] != '\0')
 				net_dhcpconf |= DHCPCONF_NAMESVR;
 
-			/* pull domainname out of leases file */
-			get_dhcp_value(net_domain, sizeof(net_domain),
-			    "domain-name");
+			/* pull domain info out of /etc/resolv.conf */
+			if (collect(T_OUTPUT, &textbuf,
+			    "cat /etc/resolv.conf 2>/dev/null |"
+			    " while read keyword domain rest;"
+			    " do [ \"$keyword\" = domain ] &&"
+			    " { echo \"$domain\"; break; };"
+			    " done" ) > 0)
+				strlcpy(net_domain, textbuf,
+				    sizeof net_domain);
+			free(textbuf);
+			if (net_domain[0] == '\0') {
+				/* pull domain info out of /etc/resolv.conf */
+				if (collect(T_OUTPUT, &textbuf,
+				    "cat /etc/resolv.conf 2>/dev/null |"
+				    " while read keyword search rest;"
+				    " do [ \"$keyword\" = search ] &&"
+				    " { echo \"$search\"; break; };"
+				    " done" ) > 0)
+					strlcpy(net_domain, textbuf,
+					    sizeof net_domain);
+				free(textbuf);
+			}
+			if ((nline = strchr(net_domain, '\n')))
+				*nline = '\0';
 			if (net_domain[0] != '\0')
 				net_dhcpconf |= DHCPCONF_DOMAIN;
 
-			/* pull hostname out of leases file */
-			dhcp_host[0] = 0;
-			get_dhcp_value(dhcp_host, sizeof(dhcp_host),
-			    "host-name");
-			if (dhcp_host[0] != '\0') {
+			if (gethostname(net_host, sizeof(net_host)) == 0 &&
+			    net_host[0] != 0)
 				net_dhcpconf |= DHCPCONF_HOST;
-				strlcpy(net_host, dhcp_host, sizeof net_host);
-			}
 		}
 	}
 
-	msg_prompt_add(MSG_net_domain, net_domain, net_domain,
-	    sizeof net_domain);
-	msg_prompt_add(MSG_net_host, net_host, net_host, sizeof net_host);
+	if (!(net_dhcpconf & DHCPCONF_HOST))
+		msg_prompt_add(MSG_net_host, net_host, net_host,
+		    sizeof net_host);
+
+	if (!(net_dhcpconf & DHCPCONF_DOMAIN))
+		msg_prompt_add(MSG_net_domain, net_domain, net_domain,
+		    sizeof net_domain);
 
 	if (!dhcp_config) {
 		/* Manually configure IPv4 */
@@ -707,24 +727,25 @@ again:
 
 	/* confirm the setting */
 	if (slip)
-		msg_display(MSG_netok_slip, net_domain, net_host, net_dev,
-			*net_ip == '\0' ? "<none>" : net_ip,
-			*net_srv_ip == '\0' ? "<none>" : net_srv_ip,
-			*net_mask == '\0' ? "<none>" : net_mask,
-			*net_namesvr == '\0' ? "<none>" : net_namesvr,
-			*net_defroute == '\0' ? "<none>" : net_defroute,
-			*net_media == '\0' ? "<default>" : net_media);
+		msg_display(MSG_netok_slip, net_domain, net_host,
+		    *net_namesvr == '\0' ? "<none>" : net_namesvr,
+		    net_dev,
+		    *net_media == '\0' ? "<default>" : net_media,
+		    *net_ip == '\0' ? "<none>" : net_ip,
+		    *net_srv_ip == '\0' ? "<none>" : net_srv_ip,
+		    *net_mask == '\0' ? "<none>" : net_mask,
+		    *net_defroute == '\0' ? "<none>" : net_defroute);
 	else
-		msg_display(MSG_netok, net_domain, net_host, net_dev,
-			*net_ip == '\0' ? "<none>" : net_ip,
-			*net_mask == '\0' ? "<none>" : net_mask,
-			*net_namesvr == '\0' ? "<none>" : net_namesvr,
-			*net_defroute == '\0' ? "<none>" : net_defroute,
-			*net_media == '\0' ? "<default>" : net_media);
+		msg_display(MSG_netok, net_domain, net_host,
+		    *net_namesvr == '\0' ? "<none>" : net_namesvr,
+		    net_dev,
+		    *net_media == '\0' ? "<default>" : net_media,
+		    *net_ip == '\0' ? "<none>" : net_ip,
+		    *net_mask == '\0' ? "<none>" : net_mask,
+		    *net_defroute == '\0' ? "<none>" : net_defroute);
 #ifdef INET6
 	msg_display_add(MSG_netokv6,
-		     !is_v6kernel() ? "<not supported>" :
-			(v6config ? "yes" : "no"));
+		     !is_v6kernel() ? "<not supported>" : net_ip6);
 #endif
 done:
 	process_menu(MENU_yesno, deconst(MSG_netok_ok));
@@ -732,6 +753,15 @@ done:
 	if (!yesno)
 		goto again;
 
+	run_program(0, "/sbin/ifconfig lo0 127.0.0.1");
+
+	/* dhcpcd will have configured it all for us */
+	if (dhcp_config) {
+		fflush(NULL);
+		network_up = 1;
+		return network_up;
+	}
+
 	/*
 	 * we may want to perform checks against inconsistent configuration,
 	 * like IPv4 DNS server without IPv4 configuration.
@@ -1039,7 +1069,6 @@ void
 mnt_net_config(void)
 {
 	char ifconfig_fn[STRSIZE];
-	char ifconfig_str[STRSIZE];
 	FILE *ifconf = NULL;
 
 	if (!network_up)
@@ -1107,11 +1136,12 @@ mnt_net_config(void)
 		if (del_rc_conf("defaultroute") == 0)
 			add_rc_conf("defaultroute=\"%s\"\n", net_defroute);
 	} else {
-		if (snprintf(ifconfig_str, sizeof ifconfig_str,
-		    "ifconfig_%s", net_dev) > 0 &&
-		    del_rc_conf(ifconfig_str) == 0) {
-			add_rc_conf("ifconfig_%s=dhcp\n", net_dev);
-		}
+		/*
+		 * Start dhcpcd quietly and in master mode, but restrict
+		 * it to our interface
+		 */
+		add_rc_conf("dhcpcd=YES\n");
+		add_rc_conf("dhcpcd_flags=\"-qM %s\"\n", net_dev);
         }
 
 	if (ifconf)
@@ -1133,7 +1163,7 @@ config_dhcp(char *inter)
 
 	if (!file_mode_match(DHCPCD, S_IFREG))
 		return 0;
-	process_menu(MENU_yesno, deconst(MSG_Perform_DHCP_autoconfiguration));
+	process_menu(MENU_yesno, deconst(MSG_Perform_autoconfiguration));
 	if (yesno) {
 		/* spawn off dhcpcd and wait for parent to exit */
 		dhcpautoconf = run_program(RUN_DISPLAY | RUN_PROGRESS,
@@ -1142,37 +1172,3 @@ config_dhcp(char *inter)
 	}
 	return 0;
 }
-
-static void
-get_dhcp_value(char *targ, size_t l, const char *var)
-{
-	static const char *lease_data = "/tmp/dhcpcd-lease";
-	FILE *fp;
-	char *line;
-	size_t len, var_len;
-
-	if ((fp = fopen(lease_data, "r")) == NULL) {
-		warn("Could not open %s", lease_data);
-		*targ = '\0';
-		return;
-	}
-
-	var_len = strlen(var);
-
-	while ((line = fgetln(fp, &len)) != NULL) {
-		if (line[len - 1] == '\n')
-			--len;
-		if (len <= var_len)
-			continue;
-		if (memcmp(line, var, var_len))
-			continue;
-		if (line[var_len] != '=')
-			continue;
-		line += var_len + 1;
-		len -= var_len + 1;
-		strlcpy(targ, line, l > len ? len + 1: l);
-		break;
-	}
-
-	fclose(fp);
-}

Reply via email to