Subject: Re: sysinst with dhcp: host-name option
To: tech-install <tech-install@NetBSD.org>
From: Mikolaj Golub <to.my.trociny@gmail.com>
List: tech-install
Date: 03/26/2007 11:34:37
On Thu, 22 Mar 2007 20:44:19 +0000 David Laight wrote:

> Someone with the odd round-tuit to spare could look at making sysinst
> ask the user for network setup at the end of a non-network install.
> Most of it is just plumbing existing functions into different places.

Below is my attempt to resolve this. After unpacking the sets sysinst will =
ask
if user want to install network configuration in /etc. If network has alrea=
dy
been configured before, sysinst also asks whether user want to store this
configuration.

mntnetconfig0 message is translated to polish only.


diff -burp src/distrib/utils/sysinst.ORIG/msg.mi.de src/distrib/utils/sysin=
st/msg.mi.de
--- src/distrib/utils/sysinst.ORIG/msg.mi.de	2007-03-26 05:04:15.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.de	2007-03-26 05:03:46.000000000 +0300
@@ -757,6 +757,9 @@ abbrechen.
 }
 .endif
=20
+message mntnetconfig0
+{XXXDo you want to install network configuration in /etc? }
+
 message mntnetconfig
 {M=F6chten Sie die aktuellen Netzwerkeinstellungen f=FCr den allgemeinen
 Gebrauch in /etc speichern?}
diff -burp src/distrib/utils/sysinst.ORIG/msg.mi.en src/distrib/utils/sysin=
st/msg.mi.en
--- src/distrib/utils/sysinst.ORIG/msg.mi.en	2007-03-26 05:04:15.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.en	2007-03-26 05:03:46.000000000 +0300
@@ -703,6 +703,9 @@ If the set's has no more disks, select "
 Select "Abort fetch" to return to the install media selection menu.
 }
=20
+message mntnetconfig0
+{Do you want to install network configuration in /etc? }
+
 message mntnetconfig
 {Is the network information you entered accurate for this machine
 in regular operation and do you want it installed in /etc? }
diff -burp src/distrib/utils/sysinst.ORIG/msg.mi.es src/distrib/utils/sysin=
st/msg.mi.es
--- src/distrib/utils/sysinst.ORIG/msg.mi.es	2007-03-26 05:04:15.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.es	2007-03-26 05:03:46.000000000 +0300
@@ -724,6 +724,9 @@ para instalarlo. Seleccione "Abortar lec
 de selecci=F3n de medios de instalaci=F3n.
 }
=20
+message mntnetconfig0
+{XXXDo you want to install network configuration in /etc? }
+
 message mntnetconfig
 {La informaci=F3n de red que ha introducido, =BFes la adecuada para el
 funcionamiento normal de esta m=E1quina y desea instalarla en /etc? }
diff -burp src/distrib/utils/sysinst.ORIG/msg.mi.fr src/distrib/utils/sysin=
st/msg.mi.fr
--- src/distrib/utils/sysinst.ORIG/msg.mi.fr	2007-03-26 05:04:15.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.fr	2007-03-26 05:03:46.000000000 +0300
@@ -769,6 +769,9 @@ S=E9lectionnez "Annuler la r=E9cup=E9ration" p
 de s=E9lection du m=E9dia d'installation.
 }
=20
+message mntnetconfig0
+{XXXDo you want to install network configuration in /etc? }
+
 message mntnetconfig
 {
 Souhaitez-vous conserver les r=E9glages r=E9seaux apr=E8s le red=E9marrage
diff -burp src/distrib/utils/sysinst.ORIG/msg.mi.pl src/distrib/utils/sysin=
st/msg.mi.pl
--- src/distrib/utils/sysinst.ORIG/msg.mi.pl	2007-03-26 05:04:15.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.pl	2007-03-26 05:03:46.000000000 +0300
@@ -697,6 +697,9 @@ aby rozpoczac proces jego instalacji. Wy
 zeby wybrac inne zrodlo oprogramowania.
 }
=20
+message mntnetconfig0
+{Czy chcesz zapisac configuracje sieciowa w /etc? }
+
 message mntnetconfig
 {Czy informacje o sieci, ktore podales sa prawidlowe dla tej maszyny
 w reguralnej pracy i czy chcesz aby je zapisac w /etc? }
diff -burp src/distrib/utils/sysinst.ORIG/net.c src/distrib/utils/sysinst/n=
et.c
--- src/distrib/utils/sysinst.ORIG/net.c	2007-03-26 05:04:15.000000000 +0300
+++ src/distrib/utils/sysinst/net.c	2007-03-26 05:11:40.000000000 +0300
@@ -1015,10 +1015,20 @@ mnt_net_config(void)
 	char ifconfig_fn[STRSIZE];
 	FILE *ifconf =3D NULL;
=20
-	if (!network_up)
+	process_menu(MENU_yesno, deconst(MSG_mntnetconfig0));
+	if (!yesno)
 		return;
+=09
+	if (network_up) {
 	process_menu(MENU_yesno, deconst(MSG_mntnetconfig));
-	if (!yesno)
+		if (!yesno) {
+			network_up =3D 0;
+			config_network();
+		}
+	} else
+		config_network();
+
+	if (!network_up)
 		return;
=20
 	/* Write hostname to /etc/rc.conf */


--=20
Mikolaj Golub