Subject: Re: sysinst with dhcp: host-name option
To: None <tech-install@NetBSD.org>
From: Mikolaj Golub <to.my.trociny@gmail.com>
List: tech-install
Date: 03/27/2007 14:08:14
On Tue, 27 Mar 2007 07:52:37 +0100 David Laight wrote:

 DL> We either need to ask:
 DL>         "Do you want to save the config used during the install ?"
 DL> or:
 DL>         "Do you want to setup the network parameters and save the valu=
es ?"

 DL> So the user never sees both questions.

What to do, when the answer is negative for the first question? Skip network
configuration at all and save nothing or go to network configuration menu?
Below the patch for the second case, but it can be easily modified for the
first one (just return from mnt_net_config() in case of negative answer).
As for me, any solution would be good :-).


diff -urp src/distrib/utils/sysinst.ORIG/msg.mi.de src/distrib/utils/sysins=
t/msg.mi.de
--- src/distrib/utils/sysinst.ORIG/msg.mi.de	2007-03-27 12:44:12.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.de	2007-03-27 12:54:07.000000000 +0300
@@ -757,10 +757,13 @@ abbrechen.
 }
 .endif
=20
-message mntnetconfig
+message mntnetconfigsave
 {M=F6chten Sie die aktuellen Netzwerkeinstellungen f=FCr den allgemeinen
 Gebrauch in /etc speichern?}
=20
+message mntnetconfigsetup
+{XXXDo you want to setup the network parameters and save the values? }
+
 message cur_distsets
 {Die folgenden Distributionspakete werden verwendet:
=20
diff -urp src/distrib/utils/sysinst.ORIG/msg.mi.en src/distrib/utils/sysins=
t/msg.mi.en
--- src/distrib/utils/sysinst.ORIG/msg.mi.en	2007-03-27 12:44:12.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.en	2007-03-27 12:53:14.000000000 +0300
@@ -703,10 +703,13 @@ If the set's has no more disks, select "
 Select "Abort fetch" to return to the install media selection menu.
 }
=20
-message mntnetconfig
+message mntnetconfigsave
 {Is the network information you entered accurate for this machine
 in regular operation and do you want it installed in /etc? }
=20
+message mntnetconfigsetup
+{Do you want to setup the network parameters and save the values? }
+
 message cur_distsets
 {The following is the list of distribution sets that will be used.
=20
diff -urp src/distrib/utils/sysinst.ORIG/msg.mi.es src/distrib/utils/sysins=
t/msg.mi.es
--- src/distrib/utils/sysinst.ORIG/msg.mi.es	2007-03-27 12:44:12.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.es	2007-03-27 12:55:01.000000000 +0300
@@ -724,10 +724,13 @@ para instalarlo. Seleccione "Abortar lec
 de selecci=F3n de medios de instalaci=F3n.
 }
=20
-message mntnetconfig
+message mntnetconfigsave
 {La informaci=F3n de red que ha introducido, =BFes la adecuada para el
 funcionamiento normal de esta m=E1quina y desea instalarla en /etc? }
=20
+message mntnetconfigsetup
+{XXXDo you want to setup the network parameters and save the values? }
+
 message cur_distsets
 {=C9sta es la lista de conjuntos de distribuci=F3n que se usar=E1.
=20
diff -urp src/distrib/utils/sysinst.ORIG/msg.mi.fr src/distrib/utils/sysins=
t/msg.mi.fr
--- src/distrib/utils/sysinst.ORIG/msg.mi.fr	2007-03-27 12:44:12.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.fr	2007-03-27 12:55:51.000000000 +0300
@@ -769,12 +769,15 @@ S=E9lectionnez "Annuler la r=E9cup=E9ration" p
 de s=E9lection du m=E9dia d'installation.
 }
=20
-message mntnetconfig
+message mntnetconfigsave
 {
 Souhaitez-vous conserver les r=E9glages r=E9seaux apr=E8s le red=E9marrage
 du syst=E8me que nous venons d'installer ?
 }
=20
+message mntnetconfigsetup
+{XXXDo you want to setup the network parameters and save the values? }
+
 message cur_distsets
 {
 Veuillez trouver ci-dessous la liste des composants disponibles :
diff -urp src/distrib/utils/sysinst.ORIG/msg.mi.pl src/distrib/utils/sysins=
t/msg.mi.pl
--- src/distrib/utils/sysinst.ORIG/msg.mi.pl	2007-03-27 12:44:12.000000000 =
+0300
+++ src/distrib/utils/sysinst/msg.mi.pl	2007-03-27 13:02:32.000000000 +0300
@@ -697,10 +697,13 @@ aby rozpoczac proces jego instalacji. Wy
 zeby wybrac inne zrodlo oprogramowania.
 }
=20
-message mntnetconfig
+message mntnetconfigsave
 {Czy informacje o sieci, ktore podales sa prawidlowe dla tej maszyny
 w reguralnej pracy i czy chcesz aby je zapisac w /etc? }
=20
+message mntnetconfigsetup
+{Czy chcesz skonfigurowac siec i zapisac podane ustawienia? }
+
 message cur_distsets
 {Ponizej jest lista pakietow dystrybucyjnych, ktore zostana uzyte.
=20
diff -urp src/distrib/utils/sysinst.ORIG/net.c src/distrib/utils/sysinst/ne=
t.c
--- src/distrib/utils/sysinst.ORIG/net.c	2007-03-27 12:47:25.000000000 +0300
+++ src/distrib/utils/sysinst/net.c	2007-03-27 14:47:16.000000000 +0300
@@ -1015,11 +1015,19 @@ mnt_net_config(void)
 	char ifconfig_fn[STRSIZE];
 	FILE *ifconf =3D NULL;
=20
+	if (network_up) {
+		process_menu(MENU_yesno, deconst(MSG_mntnetconfigsave));
+		if (!yesno)
+			network_up =3D 0;
+			config_network();
+	} else {
+		process_menu(MENU_yesno, deconst(MSG_mntnetconfigsetup));
+		if (yesno)
+			config_network();
+	}
+
 	if (!network_up)
 		return;
-	process_menu(MENU_yesno, deconst(MSG_mntnetconfig));
-	if (!yesno)
-		return;
=20
 	/* Write hostname to /etc/rc.conf */
 	if ((net_dhcpconf & DHCPCONF_HOST) =3D=3D 0)


--=20
to my, trociny