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/29/2007 09:55:02
--=-=-=


On Tue, 27 Mar 2007 18:20:37 +0100 David Laight wrote:

 DL> On Tue, Mar 27, 2007 at 09:52:43AM +0200, Alan Barrett wrote:
 >> Actually, I'd like the opportunity to edit the settings before saving,
 >> so I'd make both the above questions go to a network config editor
 >> (initialised differently in the two cases, but otherwise offering the
 >> same capabilities).

 DL> Which rather seems as though a normal menu, rather than a yes/no
 DL> question is needed.

 DL> Possibly based on the one that shows the final configuration that the
 DL> user confirms during network setup.

Then what about this patch. If network is not configured yet, sysinst will ask
if user want to setup the network parameters and save them. But if network has
been configured previously, sysinst will display current configuration and ask
if user want to discard network setup, save current setup or change
configuration before saving.

Also, I have note that during network configuration sysinst asks:

 The following network interfaces are active: xennet0
 Does one of them connect to the required server?

And the next question:

 I have found the following network interfaces: xennet0
 
 Which device shall I use? [xennet0]: 

Dose it have a sense to ask almost the same thing twice?

-- 
Mikolaj Golub


--=-=-=
Content-Type: text/plain; charset=koi8-r
Content-Disposition: inline; filename=9904-4.diff
Content-Transfer-Encoding: 8bit

diff -urp src/distrib/utils/sysinst.ORIG/menus.mi src/distrib/utils/sysinst/menus.mi
--- src/distrib/utils/sysinst.ORIG/menus.mi	2007-03-27 12:44:12.000000000 +0300
+++ src/distrib/utils/sysinst/menus.mi	2007-03-28 19:17:53.000000000 +0300
@@ -392,3 +392,10 @@ menu extract, title MSG_Select_set_extra
 	option MSG_Progress_bar, exit, action { *(int *)arg = 0; };
 	option MSG_Silent,       exit, action { *(int *)arg = 1; };
 	option MSG_Verbose,      exit, action { *(int *)arg = 2; };
+
+menu mntnetconfig, title MSG_mntnetconfig_save, y = -10;
+	display action { menu->cursel = *(int *)arg; };
+	option MSG_Yes,    exit, action { *(int *)arg = 0; };
+	option MSG_No,     exit, action { *(int *)arg = 1; };
+	option MSG_Change, exit, action { *(int *)arg = 2; };
+
diff -urp src/distrib/utils/sysinst.ORIG/msg.mi.de src/distrib/utils/sysinst/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-28 16:15:32.000000000 +0300
@@ -757,10 +757,15 @@ abbrechen.
 }
 .endif
 
-message mntnetconfig
+message mntnetconfig_save
 {Möchten Sie die aktuellen Netzwerkeinstellungen für den allgemeinen
 Gebrauch in /etc speichern?}
 
+message mntnetconfig_setup
+{XXXDo you want to setup the network parameters and save the values? }
+
+message Change {XXXChange }
+
 message cur_distsets
 {Die folgenden Distributionspakete werden verwendet:
 
diff -urp src/distrib/utils/sysinst.ORIG/msg.mi.en src/distrib/utils/sysinst/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-28 16:14:42.000000000 +0300
@@ -703,10 +703,15 @@ If the set's has no more disks, select "
 Select "Abort fetch" to return to the install media selection menu.
 }
 
-message mntnetconfig
+message mntnetconfig_save
 {Is the network information you entered accurate for this machine
 in regular operation and do you want it installed in /etc? }
 
+message mntnetconfig_setup
+{Do you want to setup the network parameters and save the values? }
+
+message Change {Change }
+
 message cur_distsets
 {The following is the list of distribution sets that will be used.
 
diff -urp src/distrib/utils/sysinst.ORIG/msg.mi.es src/distrib/utils/sysinst/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-28 16:16:10.000000000 +0300
@@ -724,10 +724,15 @@ para instalarlo. Seleccione "Abortar lec
 de selección de medios de instalación.
 }
 
-message mntnetconfig
+message mntnetconfig_save
 {La información de red que ha introducido, ¿es la adecuada para el
 funcionamiento normal de esta máquina y desea instalarla en /etc? }
 
+message mntnetconfig_setup
+{XXXDo you want to setup the network parameters and save the values? }
+
+message Change {XXXChange }
+
 message cur_distsets
 {Ésta es la lista de conjuntos de distribución que se usará.
 
diff -urp src/distrib/utils/sysinst.ORIG/msg.mi.fr src/distrib/utils/sysinst/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-28 16:16:31.000000000 +0300
@@ -769,12 +769,17 @@ Sélectionnez "Annuler la récupération" p
 de sélection du média d'installation.
 }
 
-message mntnetconfig
+message mntnetconfig_save
 {
 Souhaitez-vous conserver les réglages réseaux après le redémarrage
 du système que nous venons d'installer ?
 }
 
+message mntnetconfig_setup
+{XXXDo you want to setup the network parameters and save the values? }
+
+message Change {XXXChange }
+
 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/sysinst/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-28 16:17:28.000000000 +0300
@@ -697,10 +697,15 @@ aby rozpoczac proces jego instalacji. Wy
 zeby wybrac inne zrodlo oprogramowania.
 }
 
-message mntnetconfig
+message mntnetconfig_save
 {Czy informacje o sieci, ktore podales sa prawidlowe dla tej maszyny
 w reguralnej pracy i czy chcesz aby je zapisac w /etc? }
 
+message mntnetconfig_setup
+{Czy chcesz skonfigurowac siec i zapisac podane ustawienia? }
+
+message Change {Zmien }
+
 message cur_distsets
 {Ponizej jest lista pakietow dystrybucyjnych, ktore zostana uzyte.
 
diff -urp src/distrib/utils/sysinst.ORIG/net.c src/distrib/utils/sysinst/net.c
--- src/distrib/utils/sysinst.ORIG/net.c	2007-03-27 12:47:25.000000000 +0300
+++ src/distrib/utils/sysinst/net.c	2007-03-29 10:22:24.000000000 +0300
@@ -1014,12 +1014,46 @@ mnt_net_config(void)
 {
 	char ifconfig_fn[STRSIZE];
 	FILE *ifconf = NULL;
+	int config = 0;
+
+	if (network_up) {
+	        if (net_dev[0] == 's' && net_dev[1] == 'l' &&
+			isdigit((unsigned char)net_dev[2])) /* 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);
+	        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);
+#ifdef INET6
+		msg_display_add(MSG_netokv6,
+			!is_v6kernel() ? "<not supported>" :
+			(net_ip6conf & IP6CONF_AUTOHOST ? "yes" : "no"),
+			*net_namesvr6 == '\0' ? "<none>" : net_namesvr6);
+#endif
+        	process_menu(MENU_mntnetconfig, &config);
+		if (config == 1) 
+			network_up = 0;
+		else if (config == 2) {
+			network_up = 0;
+			config_network();
+		}
+	} else {
+		process_menu(MENU_yesno, deconst(MSG_mntnetconfig_setup));
+		if (yesno)
+			config_network();
+	}
 
 	if (!network_up)
 		return;
-	process_menu(MENU_yesno, deconst(MSG_mntnetconfig));
-	if (!yesno)
-		return;
 
 	/* Write hostname to /etc/rc.conf */
 	if ((net_dhcpconf & DHCPCONF_HOST) == 0)

--=-=-=--