diff --git a/distrib/utils/sysinst/Makefile.inc b/distrib/utils/sysinst/Makefile.inc
index 434d924..ec9252e 100644
--- a/distrib/utils/sysinst/Makefile.inc
+++ b/distrib/utils/sysinst/Makefile.inc
@@ -44,6 +44,10 @@ CPPFLAGS+=	-I. -I${.CURDIR}/../.. -I${.CURDIR} \
 		-DREL=\"${DISTRIBVER}\" -DMACH=\"${MACHINE}\" \
 		-DMACH_${MACHINE} -DARCH_${MACHINE_ARCH}
 
+.if (defined(DEBUG))
+CPPFLAGS+=-DDEBUG
+.endif
+
 .if (!defined(SMALLPROG) || defined(SMALLPROG_INET6)) && (${USE_INET6} != "no")
 CPPFLAGS+=-DINET6
 .endif
diff --git a/distrib/utils/sysinst/configmenu.c b/distrib/utils/sysinst/configmenu.c
index 32f1ff5..d8eedde 100644
--- a/distrib/utils/sysinst/configmenu.c
+++ b/distrib/utils/sysinst/configmenu.c
@@ -34,6 +34,7 @@
 #include <stdio.h>
 #include <curses.h>
 #include <unistd.h>
+#include <errno.h>
 #include "defs.h"
 #include "msg_defs.h"
 #include "menu_defs.h"
@@ -67,6 +68,7 @@ enum {
 	CONFIGOPT_NTPD,
 	CONFIGOPT_NTPDATE,
 	CONFIGOPT_MDNSD,
+	CONFIGOPT_XDM,
 	CONFIGOPT_LAST
 };
 
@@ -84,14 +86,15 @@ configinfo config_list[] = {
 	{MSG_timezone, CONFIGOPT_TZ, NULL, set_timezone_menu, NULL},
 	{MSG_Root_shell, CONFIGOPT_ROOTSH, NULL, set_root_shell, NULL},
 	{MSG_change_rootpw, CONFIGOPT_ROOTPW, NULL, change_root_password, MSG_change},
-	{MSG_enable_binpkg, CONFIGOPT_BINPKG, NULL, set_binpkg, MSG_configure},
+	{MSG_enable_binpkg, CONFIGOPT_BINPKG, NULL, set_binpkg, MSG_install},
 	{MSG_get_pkgsrc, CONFIGOPT_PKGSRC, NULL, set_pkgsrc, MSG_install},
 	{MSG_enable_sshd, CONFIGOPT_SSHD, "sshd", toggle_rcvar, NULL},
 	{MSG_enable_ntpd, CONFIGOPT_NTPD, "ntpd", toggle_rcvar, NULL},
 	{MSG_run_ntpdate, CONFIGOPT_NTPDATE, "ntpdate", toggle_rcvar, NULL},
 	{MSG_enable_mdnsd, CONFIGOPT_MDNSD, "mdnsd", toggle_rcvar, NULL},
+	{"Enable XDM", CONFIGOPT_XDM, "xdm", toggle_rcvar, NULL},
 	{NULL,		CONFIGOPT_LAST,	NULL, NULL, NULL}
-};
+}; //TODO XDM
 
 static void
 config_list_init(void)
@@ -198,8 +201,9 @@ set_root_shell(struct menudesc *menu, void *arg)
 	configinfo **confp = arg;
 	
 	process_menu(MENU_rootsh, &confp[menu->cursel]->setting);
-	run_program(RUN_PROGRESS | RUN_CHROOT,
-		"chpass -s %s root", confp[menu->cursel]->setting);
+	if (run_program(RUN_PROGRESS | RUN_CHROOT,
+		"chpass -s %s root", confp[menu->cursel]->setting) != 0)
+		confp[menu->cursel]->setting = MSG_failed;
 	return 0;
 }
 
@@ -243,10 +247,13 @@ change_root_password(struct menudesc *menu, void *arg)
 
 	msg_display(MSG_rootpw);
 	process_menu(MENU_yesno, NULL);
-	if (yesno)
-		run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
-			"passwd -l root");
-	confp[menu->cursel]->setting = MSG_password_set;
+	if (yesno) {
+		if (run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
+			"passwd -l root") == 0)
+			confp[menu->cursel]->setting = MSG_password_set;
+		else
+			confp[menu->cursel]->setting = MSG_failed;
+	}
 	return 0;
 }
 
@@ -254,25 +261,24 @@ static int
 set_binpkg(struct menudesc *menu, void *arg)
 {
 	configinfo **confp = arg;
-
+	char additional_pkgs[STRSIZE] = {0};
 	char pattern[STRSIZE];
+	int allok = 0;
 
-	/* binary pkg config requires network at this point, so if
-	   it's not already configured, do it. */
-	if (network_up == 0) {
-		if (config_network())
-			mnt_net_config();
-	}
-
-	process_menu(MENU_binpkg, NULL);
-	make_url(pkgpath, &pkg, pkg_dir);
-	if ( run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
-		"pkg_add %s/pkgin", pkgpath) != 0) {
-		msg_display(MSG_pkgin_failed);
-		process_menu(MENU_ok, NULL);
-		confp[menu->cursel]->setting = MSG_failed;
-		return 0;
-	}
+	do {
+		yesno = -1;
+		process_menu(MENU_binpkg, additional_pkgs);
+		if (yesno == SET_SKIP) {
+			confp[menu->cursel]->setting = MSG_abandoned;
+			return 0;
+		}
+		
+		make_url(pkgpath, &pkg, pkg_dir);
+		if (run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
+			"pkg_add %s/pkgin", pkgpath) == 0) {
+			allok = 1;
+		}
+	} while (allok == 0);
 
 	/* configure pkgin to use $pkgpath as a repository */
 	snprintf(pattern, STRSIZE, "s,^[^#].*$,%s,", pkgpath);
@@ -281,9 +287,13 @@ set_binpkg(struct menudesc *menu, void *arg)
 	run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
 		"/usr/pkg/bin/pkgin -y update");
 
+	if (strlen(additional_pkgs) > 0)
+		run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
+		"/usr/pkg/bin/pkgin -y install %s", additional_pkgs);
+	
 	msg_display(MSG_binpkg_installed);
 	process_menu(MENU_ok, NULL);
-	
+
 	confp[menu->cursel]->setting = MSG_DONE;
 	return 0;
 }
@@ -317,8 +327,7 @@ set_pkgsrc(struct menudesc *menu, void *arg)
 		}
 	}
 	while (status == SET_RETRY);
-	
-	
+
 	confp[menu->cursel]->setting = MSG_DONE;
 	return 0;
 }
@@ -349,9 +358,9 @@ toggle_rcvar(struct menudesc *menu, void *arg)
 	}
 
 	if (!(fp = fopen(target_expand("/etc/rc.conf"), "r"))) {
-		msg_display(MSG_rcconf_delete_failed, varname);
+		msg_display(MSG_openfail, target_expand("/etc/rc.conf"), strerror(errno));
 		process_menu(MENU_ok, NULL);
-		return -1;
+		return 0;
 	}
 
 	while (fgets(buf, sizeof buf, fp) != NULL) {
@@ -402,11 +411,6 @@ do_configmenu()
 	menu_ent	me[CONFIGOPT_LAST];
 	configinfo	*ce[CONFIGOPT_LAST];
 
-        wrefresh(curscr);
-        wmove(stdscr, 0, 0);
-        wclear(stdscr);
-        wrefresh(stdscr);
-	
 	/* if the target isn't mounted already, figure it out. */
 	if (target_mounted() == 0) {
 		if (find_disks(msg_string(MSG_configure_prior)) < 0)
@@ -420,6 +424,11 @@ do_configmenu()
 	make_url(pkgpath, &pkg, pkg_dir);
 	opts = init_config_menu(config_list, me, ce);
 
+	wrefresh(curscr);
+	wmove(stdscr, 0, 0);
+	wclear(stdscr);
+	wrefresh(stdscr);
+
 	menu_no = new_menu(NULL, me, opts, 0, -4, 0, 70,
 		MC_SCROLL | MC_NOBOX | MC_DFLTEXIT,
 		configmenu_hdr, set_config, NULL, "XXX Help String",
@@ -427,7 +436,4 @@ do_configmenu()
 
 	process_menu(menu_no, ce);
 	free_menu(menu_no);
-
-	sanity_check();
-
 }
diff --git a/distrib/utils/sysinst/defs.h b/distrib/utils/sysinst/defs.h
index 1ffdb9a..14630fb 100644
--- a/distrib/utils/sysinst/defs.h
+++ b/distrib/utils/sysinst/defs.h
@@ -390,6 +390,7 @@ int	mount_disks(void);
 int	set_swap(const char *, partinfo *);
 int	check_swap(const char *, int);
 char	*bootxx_name(void);
+int	partitioning(void);
 
 /* from disks_lfs.c */
 int	fs_is_lfs(void *);
@@ -476,6 +477,7 @@ const char *ext_dir_for_set(const char *);
 void	replace(const char *, const char *, ...);
 void	get_tz_default(void);
 int	extract_file(distinfo *, int);
+void	do_coloring (unsigned int, unsigned int);
 
 /* from target.c */
 #if defined(DEBUG)  ||	defined(DEBUG_ROOT)
@@ -533,4 +535,6 @@ void	do_configmenu(void);
 /* from checkrc.c */
 int	check_rcvar(const char *);
 int	check_rcdefault(const char *);
+	WINDOW *mainwin;
+
 #endif	/* _DEFS_H_ */
diff --git a/distrib/utils/sysinst/disks.c b/distrib/utils/sysinst/disks.c
index d4a04b5..f7c41e9 100644
--- a/distrib/utils/sysinst/disks.c
+++ b/distrib/utils/sysinst/disks.c
@@ -364,7 +364,7 @@ find_disks(const char *doingwhat)
 	struct disk_desc *disk;
 	int i;
 	int numdisks;
-	int selected_disk = 0;
+	int selected_disk = -1;
 	int menu_no;
 
 	/* Find disks. */
@@ -382,14 +382,8 @@ find_disks(const char *doingwhat)
 		process_menu(MENU_ok, NULL);
 		/*endwin();*/
 		return -1;
-	}
-
-	if (numdisks == 1) {
-		/* One disk found! */
-		msg_display(MSG_onedisk, disks[0].dd_descr, doingwhat);
-		process_menu(MENU_ok, NULL);
 	} else {
-		/* Multiple disks found! */
+		/* One or more disks found! */
 		for (i = 0; i < numdisks; i++) {
 			dsk_menu[i].opt_name = disks[i].dd_descr;
 			dsk_menu[i].opt_menu = OPT_NOMENU;
@@ -398,7 +392,7 @@ find_disks(const char *doingwhat)
 		}
 		menu_no = new_menu(MSG_Available_disks,
 			dsk_menu, numdisks, -1, 4, 0, 0,
-			MC_SCROLL | MC_NOEXITOPT,
+			MC_SCROLL,
 			NULL, NULL, NULL, NULL, NULL);
 		if (menu_no == -1)
 			return -1;
@@ -407,6 +401,9 @@ find_disks(const char *doingwhat)
 		free_menu(menu_no);
 	}
 
+	if (selected_disk == -1)
+	    return -1;
+
 	disk = disks + selected_disk;
 	strlcpy(diskdev, disk->dd_name, sizeof diskdev);
 
@@ -1112,3 +1109,56 @@ bootxx_name(void)
 	return bootxx;
 }
 #endif
+
+// TODO: write new partition tool there
+int
+partitioning(void)
+{
+	if (find_disks(msg_string(MSG_install)) < 0)
+		return -1;
+	clear();
+	refresh();
+
+	if (check_swap(diskdev, 0) > 0) {
+		msg_display(MSG_swapactive);
+		process_menu(MENU_ok, NULL);
+		if (check_swap(diskdev, 1) < 0) {
+			msg_display(MSG_swapdelfailed);
+			process_menu(MENU_ok, NULL);
+			if (!debug)
+				return -1;
+		}
+	}
+
+	if (md_get_info() == 0)
+		return -1;
+	if (md_make_bsd_partitions() == 0)
+		return -1;
+
+	/* Last chance ... do you really want to do this? */
+	clear();
+	refresh();
+	msg_display(MSG_lastchance, diskdev);
+	process_menu(MENU_noyes, NULL);
+	if (!yesno)
+		return -1;
+
+	if (md_pre_disklabel() != 0)
+		return -1;
+
+	if (write_disklabel() != 0)
+		return -1;
+
+	if (md_post_disklabel() != 0)
+		return -1;
+
+	if (make_filesystems())
+		return -1;
+
+	if (make_fstab() != 0)
+		return -1;
+
+	if (md_post_newfs() != 0)
+		return -1;
+    return 0;
+}
diff --git a/distrib/utils/sysinst/install.c b/distrib/utils/sysinst/install.c
index d00a8e9..077c75a 100644
--- a/distrib/utils/sysinst/install.c
+++ b/distrib/utils/sysinst/install.c
@@ -53,63 +53,15 @@ do_install(void)
 
 	get_ramsize();
 
-	if (find_disks(msg_string(MSG_install)) < 0)
-		return;
-	clear();
-	refresh();
-
-	if (check_swap(diskdev, 0) > 0) {
-		msg_display(MSG_swapactive);
-		process_menu(MENU_ok, NULL);
-		if (check_swap(diskdev, 1) < 0) {
-			msg_display(MSG_swapdelfailed);
-			process_menu(MENU_ok, NULL);
-			if (!debug)
-				return;
-		}
-	}
-
-	process_menu(MENU_distset, NULL);
-
-	if (!md_get_info()) {
+	/* Create and mount partitions */
+	if (!partitioning() < 0) {
 		msg_display(MSG_abort);
 		process_menu(MENU_ok, NULL);
 		return;
 	}
 
-	if (md_make_bsd_partitions() == 0) {
-		msg_display(MSG_abort);
-		process_menu(MENU_ok, NULL);
-		return;
-	}
-
-	/* Last chance ... do you really want to do this? */
-	clear();
-	refresh();
-	msg_display(MSG_lastchance, diskdev);
-	process_menu(MENU_noyes, NULL);
-	if (!yesno)
-		return;
-
-	if (md_pre_disklabel() != 0)
-		return;
-
-	if (write_disklabel() != 0)
-		return;
-
-	if (md_post_disklabel() != 0)
-		return;
-
-	if (make_filesystems())
-		return;
-
-	if (make_fstab() != 0)
-		return;
-
-	if (md_post_newfs() != 0)
-		return;
-
 	/* Unpack the distribution. */
+	process_menu(MENU_distset, NULL);
 	if (get_and_unpack_sets(0, MSG_disksetupdone,
 	    MSG_extractcomplete, MSG_abortinst) != 0)
 		return;
diff --git a/distrib/utils/sysinst/main.c b/distrib/utils/sysinst/main.c
index 65b50d0..b4ca0df 100644
--- a/distrib/utils/sysinst/main.c
+++ b/distrib/utils/sysinst/main.c
@@ -62,11 +62,19 @@ static void process_f_flag(char *);
 static int exit_cleanly = 0;	/* Did we finish nicely? */
 FILE *logfp;			/* log file */
 FILE *script;			/* script file */
+int part_mode;			/* run partition editor */
 
 #ifdef DEBUG
 extern int log_flip(void);
 #endif
 
+/* Definion for colors */
+
+struct {
+	unsigned int bg;
+	unsigned int fg;
+} clr_arg;
+
 /* String defaults and stuff for processing the -f file argument. */
 
 struct f_arg {
@@ -119,7 +127,7 @@ static void
 init(void)
 {
 	const struct f_arg *arg;
-
+	
 	sizemult = 1;
 	disktype = "unknown";
 	tmp_ramdisk_size = 0;
@@ -131,12 +139,17 @@ init(void)
 	for (arg = fflagopts; arg->name != NULL; arg++)
 		strlcpy(arg->var, arg->dflt, arg->size);
 	pkg.xfer_type = pkgsrc.xfer_type = "http";
+	
+	clr_arg.bg=COLOR_BLUE;
+	clr_arg.fg=COLOR_WHITE;
+#ifdef DEBUG
+	clr_arg.bg=COLOR_RED;
+#endif
 }
 
 int
 main(int argc, char **argv)
 {
-	WINDOW *win;
 	int ch;
 
 	init();
@@ -151,7 +164,7 @@ main(int argc, char **argv)
 	}
 
 	/* argv processing */
-	while ((ch = getopt(argc, argv, "Dr:f:")) != -1)
+	while ((ch = getopt(argc, argv, "Dr:f:C:p")) != -1)
 		switch(ch) {
 		case 'D':	/* set to get past certain errors in testing */
 			debug = 1;
@@ -164,6 +177,14 @@ main(int argc, char **argv)
 			/* Definition file to read. */
 			process_f_flag(optarg);
 			break;
+		case 'C':
+			/* Define colors */
+			sscanf(optarg, "%u:%u", &clr_arg.bg, &clr_arg.fg);
+			break;
+		case 'p':
+			/* Partition tool */
+			part_mode = 1;
+			break;
 		case '?':
 		default:
 			usage();
@@ -181,21 +202,17 @@ main(int argc, char **argv)
 	 * Put 'messages' in a window that has a one-character border
 	 * on the real screen.
 	 */
-	win = newwin(getmaxy(stdscr) - 2, getmaxx(stdscr) - 2, 1, 1);
-	if (win == NULL) {
+	mainwin = newwin(getmaxy(stdscr) - 2, getmaxx(stdscr) - 2, 1, 1);
+	if (mainwin == NULL) {
 		(void)fprintf(stderr,
 			 "sysinst: screen too small\n");
 		exit(1);
 	}
 	if (has_colors()) {
-		/*
-		 * XXX This color trick should be done so much better,
-		 * but is it worth it?
-		 */
-		wbkgd(win, COLOR_PAIR(1));
-		wattrset(win, COLOR_PAIR(1));
+		start_color();
+		do_coloring (clr_arg.fg,clr_arg.bg);
 	}
-	msg_window(win);
+	msg_window(mainwin);
 
 	/* Watch for signals and clean up */
 	(void)atexit(cleanup);
@@ -214,7 +231,10 @@ main(int argc, char **argv)
 	get_kb_encoding();
 
 	/* Menu processing */
-	process_menu(MENU_netbsd, NULL);
+	if (part_mode)
+		partitioning();
+	else
+		process_menu(MENU_netbsd, NULL);
 
 	exit_cleanly = 1;
 	return 0;
@@ -331,6 +351,12 @@ select_language(void)
 void
 toplevel(void)
 {
+	/*
+	 * Undo any stateful side-effects of previous menu choices.
+	 * XXX must be idempotent, since we get run each time the main
+	 *     menu is displayed.
+	 */
+	unwind_mounts();
 
 	/* Display banner message in (english, francais, deutsch..) */
 	msg_display(MSG_hello);
@@ -338,14 +364,6 @@ toplevel(void)
 	if (md_may_remove_boot_medium())
 		msg_display_add(MSG_md_may_remove_boot_medium);
 	msg_display_add(MSG_thanks);
-
-	/*
-	 * Undo any stateful side-effects of previous menu choices.
-	 * XXX must be idempotent, since we get run each time the main
-	 *     menu is displayed.
-	 */
-	unwind_mounts();
-	/* ... */
 }
 
 
diff --git a/distrib/utils/sysinst/menus.mi b/distrib/utils/sysinst/menus.mi
index 3aadc30..36e88e5 100644
--- a/distrib/utils/sysinst/menus.mi
+++ b/distrib/utils/sysinst/menus.mi
@@ -162,10 +162,10 @@ menu netbsd, title MSG_NetBSD_VERSION_Install_System, y=-1,
 	option MSG_Reboot_the_computer, exit,
 		action (endwin) { system("/sbin/reboot -q"); };
 	option MSG_Utility_menu, sub menu utility;
-	option "Config menu", action { do_configmenu(); };
+	option MSG_Config_menu, action { do_configmenu(); };
 
 menu utility, title MSG_NetBSD_VERSION_Utilities, exit,
-		exitstring MSG_exit_utility_menu;
+		exitstring MSG_exit_menu_generic;
 	display action  { toplevel(); };
 	option MSG_Run_bin_sh,
 		action (endwin) { system("/bin/sh"); };
@@ -174,15 +174,23 @@ menu utility, title MSG_NetBSD_VERSION_Utilities, exit,
 	option MSG_Configure_network,
 		action {
 			extern int network_up;
-
 			network_up = 0;
 			config_network();
 		};
-/*	option MSG_Partition a disk; XXX add later.  */
+	option MSG_Partition_a_disk, action { partitioning(); };
 	option MSG_Logging_functions, action { do_logging(); };
+	option MSG_Color_scheme, sub menu colors;
 	option MSG_Halt_the_system, exit,
 		action (endwin) { system("/sbin/halt -q"); };
 
+menu colors, title MSG_Color_scheme, exit,
+		exitstring MSG_exit_menu_generic;
+	option MSG_White_on_black, action { do_coloring(COLOR_WHITE,COLOR_BLACK); };
+	option MSG_Black_on_white, action { do_coloring(COLOR_BLACK,COLOR_WHITE); };
+	option MSG_White_on_blue,  action { do_coloring(COLOR_WHITE,COLOR_BLUE); };
+	option MSG_Green_on_black, action { do_coloring(COLOR_GREEN,COLOR_BLACK); };
+
+
 menu yesno, y=-10;
 	display action { menu->title = arg ? arg : MSG_yes_or_no; };
 	option MSG_Yes, exit, action  {yesno = 1;};
@@ -281,10 +289,17 @@ menu ftpsource, y=-4, x=0, w=70, no box, no clear,
 			clean_xfer_dir ? MSG_Yes : MSG_No);},
 		action {process_menu(MENU_yesno, deconst(MSG_delete_xfer_file));
 			clean_xfer_dir = yesno; };
+	option MSG_Configure_network,
+		action {
+			extern int network_up;
+			network_up = 0;
+			config_network();
+		};
+	option MSG_exit_menu_generic, exit, action { yesno = SET_RETRY; };
 
 
 menu nfssource, y=-4, x=0, w=70, no box, no clear,
-	    exitstring MSG_Continue;
+	    exitstring MSG_Get_Distribution;
 	display action { msg_display(MSG_nfssource); };
 	option {src_legend(menu, MSG_Host, nfs_host);},
 		action { src_prompt(MSG_Host, nfs_host, sizeof nfs_host); };
@@ -294,6 +309,13 @@ menu nfssource, y=-4, x=0, w=70, no box, no clear,
 		action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
 	option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
 		action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); };
+	option MSG_Configure_network,
+		action {
+			extern int network_up;
+			network_up = 0;
+			config_network();
+		};
+	option MSG_exit_menu_generic, exit, action { yesno = SET_RETRY; };
 
 menu fdremount, title MSG_What_do_you_want_to_do;
 	option MSG_Try_again, exit, action { *(int *)arg = SET_CONTINUE; };
@@ -323,6 +345,7 @@ menu floppysource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
 			clean_xfer_dir ? MSG_Yes : MSG_No);},
 		action {process_menu(MENU_yesno, deconst(MSG_delete_xfer_file));
 			clean_xfer_dir = yesno; };
+	option MSG_exit_menu_generic, exit, action { yesno = SET_RETRY; };
 
 menu cdromsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
 	display action { msg_display(MSG_cdromsource); };
@@ -332,6 +355,7 @@ menu cdromsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
 		action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
 	option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
 		action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); };
+	option MSG_exit_menu_generic, exit, action { yesno = SET_RETRY; };
 
 menu localfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
 	display action { msg_display(MSG_localfssource); };
@@ -345,6 +369,7 @@ menu localfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
 		action { src_prompt(MSG_Set_dir_bin, set_dir_bin, sizeof set_dir_bin); };
 	option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
 		action { src_prompt(MSG_Set_dir_src, set_dir_src, sizeof set_dir_src); };
+	option MSG_exit_menu_generic, exit, action { yesno = SET_RETRY; };
 
 menu localdirsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
 	display action { msg_display(MSG_localdir); };
@@ -354,6 +379,7 @@ menu localdirsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
 		action { src_prompt(MSG_Set_dir_bin, set_dir_bin, 60); };
 	option {src_legend(menu, MSG_Set_dir_src, set_dir_src);},
 		action { src_prompt(MSG_Set_dir_src, set_dir_src, 60); };
+	option MSG_exit_menu_generic, exit, action { yesno = SET_RETRY; };
 
 menu namesrv6, title MSG_Select_IPv6_DNS_server;
 	option "google-public-dns-a.google.com", exit, action
@@ -422,6 +448,17 @@ menu binpkg, y=-4, x=0, w=70, no box, no clear,
 			setenv("http_proxy", pkg.proxy, 1);
 		  }
 		};
+	option {src_legend(menu, "Additional packages", (char*)arg); }, /*TODO*/
+		action { src_prompt("Additional packages", (char*)arg,
+			 sizeof(char) * STRSIZE); };
+	option MSG_Configure_network,
+		action {
+			extern int network_up;
+			network_up = 0;
+			config_network();
+			mnt_net_config();
+		};
+	option MSG_quit_install, exit, action { yesno = SET_SKIP; };
 
 menu pkgsrc, y=-4, x=0, w=70, no box, no clear,
 	    exit, exitstring MSG_Install_pkgsrc;
@@ -461,4 +498,10 @@ menu pkgsrc, y=-4, x=0, w=70, no box, no clear,
 			clean_xfer_dir ? MSG_Yes : MSG_No);},
 		action {process_menu(MENU_yesno, deconst(MSG_delete_xfer_file));
 			clean_xfer_dir = yesno; };
-	option MSG_quit_pkgsrc, exit, action { yesno = 0;};
+	option MSG_Configure_network,
+		action {
+			extern int network_up;
+			network_up = 0;
+			config_network();
+		};
+	option MSG_quit_install, exit, action { yesno = SET_SKIP; };
diff --git a/distrib/utils/sysinst/msg.mi.de b/distrib/utils/sysinst/msg.mi.de
index 25be022..cd0c6b4 100644
--- a/distrib/utils/sysinst/msg.mi.de
+++ b/distrib/utils/sysinst/msg.mi.de
@@ -35,7 +35,7 @@
 /* MI Message catalog -- German, machine independent */
 
 message usage
-{Aufruf: sysinst [-r Release] [-f Definitionsdatei]
+{Aufruf: sysinst [-r Release] [-f Definitionsdatei]  [-C bg:fg]
 }
 
 /*
@@ -514,19 +514,11 @@ message nonet
 Zurück zum vorigen Menü.
 }
 
-message netup
-{Die folgenden Netzwerkadapter sind verfügbar: %s 
-Hat einer davon Zugriff auf die benötigten Server?}
-
 message asknetdev
-{NetBSD hat folgende Netzwerkadapter gefunden: %s
-\nWelchen möchten Sie benutzen?}
+{NetBSD hat einige Netzwerkadapter gefunden. Welchen möchten Sie benutzen?}
 
-message badnet
-{Sie haben keinen der angezeigten Netzwerkadapter ausgewählt. Bitte versuchen
-Sie es erneut. 
-NetBSD hat folgende Netzwerkadapter gefunden: %s
-\nWelchen möchten Sie benutzen?}
+message netdevs
+{Verfügbare schnittstellen}
 
 message netinfo
 {Um das Netzwerk nutzen zu können, benötigen wir folgende Angaben:
@@ -600,11 +592,6 @@ message slattach {
 Flags für slattach
 }
 
-message netagain
-{Bitte geben Sie die Informationen über Ihr Netzwerk erneut an. Diese werden
-auch als Vorgabe beibehalten.
-
-}
 
 message wait_network
 {
@@ -951,8 +938,9 @@ message Install_NetBSD_to_hard_disk {NetBSD auf die Festplatte installieren}
 message Upgrade_NetBSD_on_a_hard_disk {Aktualisierung einer bestehenden NetBSD-Installation}
 message Re_install_sets_or_install_additional_sets {Erneute Installation oder zusätzliche Pakete installieren}
 message Reboot_the_computer {Computer neu starten}
+message Config_menu {Konfiguration Menü}
 message Utility_menu {Extras}
-message exit_utility_menu {Zurück zum Hauptmenü}
+message exit_menu_generic {Zurück}
 message NetBSD_VERSION_Utilities {NetBSD-@@VERSION@@ Extras}
 message Run_bin_sh {Ausführen von /bin/sh}
 message Set_timezone {Setzen der Zeitzone}
@@ -1006,6 +994,11 @@ message other {andere }
 message Perform_IPv6_autoconfiguration {IPv6 automatisch konfigurieren?}
 message Perform_DHCP_autoconfiguration {Konfiguration per DHCP ermitteln?}
 message Root_shell {Root-Shell}
+message Color_scheme {Farbschema}
+message White_on_black {Weiß auf schwarz}
+message Black_on_white {Schwarz auf weiß}
+message White_on_blue {Weiß auf Blau}
+message Green_on_black {Grün auf schwarz}
 
 .if AOUT2ELF
 message aoutfail
@@ -1095,7 +1088,7 @@ message get_pkgsrc {pkgsrc zur Installation von Quellpaketen herunterladen und
 installieren}
 message retry_pkgsrc_network {Netzwerkkonfiguration fehlgeschlagen. Noch einmal 
 versuchen?}
-message quit_pkgsrc {Ohne Installation von pkgsrc beenden.}
+message quit_install {Ohne Installation von pkgsrc beenden.} /*TODO*/
 message pkgin_failed 
 {Die Installation von pkgin ist fehlgeschlagen, evtl. weil keine Binärpakete 
 vorhanden sind. Bitte den Pfad der Pakete überprüfen und noch einmal versuchen.}
diff --git a/distrib/utils/sysinst/msg.mi.en b/distrib/utils/sysinst/msg.mi.en
index f43ee38..abbd3ae 100644
--- a/distrib/utils/sysinst/msg.mi.en
+++ b/distrib/utils/sysinst/msg.mi.en
@@ -35,7 +35,7 @@
 /* MI Message catalog -- english, machine independent */
 
 message usage
-{usage: sysinst [-r release] [-f definition-file]
+{usage: sysinst [-r release] [-f definition-file] [-C bg:fg]
 }
 
 message sysinst_message_language
@@ -496,18 +496,11 @@ message nonet
 returned to the previous menu.
 }
 
-message netup
-{The following network interfaces are active: %s
-Does one of them connect to the required server?}
-
 message asknetdev
-{I have found the following network interfaces: %s
-\nWhich device shall I use?}
+{I have found some network interfaces. Which device shall I use?}
 
-message badnet
-{You did not choose one of the listed network devices.  Please try again.
-The following network devices are available: %s
-\nWhich device shall I use?}
+message netdevs
+{Available interfaces}
 
 message netinfo
 {To be able to use the network, we need answers to the following:
@@ -576,12 +569,6 @@ IPv6 Nameserver:	%s
 message netok_ok
 {Are they OK?}
 
-message netagain
-{Please reenter the information about your network.  Your last answers
-will be your default.
-
-}
-
 message wait_network
 {
 Waiting while network interface comes up.
@@ -891,8 +878,9 @@ message Install_NetBSD_to_hard_disk {Install NetBSD to hard disk}
 message Upgrade_NetBSD_on_a_hard_disk {Upgrade NetBSD on a hard disk}
 message Re_install_sets_or_install_additional_sets {Re-install sets or install additional sets}
 message Reboot_the_computer {Reboot the computer}
+message Config_menu {Config menu}
 message Utility_menu {Utility menu}
-message exit_utility_menu {Back to main menu}
+message exit_menu_generic {Exit}
 message NetBSD_VERSION_Utilities {NetBSD-@@VERSION@@ Utilities}
 message Run_bin_sh {Run /bin/sh}
 message Set_timezone {Set timezone}
@@ -946,6 +934,11 @@ message other {other }
 message Perform_IPv6_autoconfiguration {Perform IPv6 autoconfiguration?}
 message Perform_DHCP_autoconfiguration {Perform DHCP autoconfiguration?}
 message Root_shell {Root shell}
+message Color_scheme {Color scheme}
+message White_on_black {White on black}
+message Black_on_white {Black on white}
+message White_on_blue {White on blue}
+message Green_on_black {Green on black}
 
 .if AOUT2ELF
 message aoutfail
@@ -1000,7 +993,7 @@ message abandoned {Abandoned}
 message empty {***EMPTY***}
 message timezone {Timezone}
 message change_rootpw {Change root password}
-message enable_binpkg {Enable installation of binary packages}
+message enable_binpkg {Fetch and install pkgin packages management tool}
 message enable_sshd {Enable sshd}
 message enable_ntpd {Enable ntpd}
 message run_ntpdate {Run ntpdate at boot}
@@ -1022,10 +1015,10 @@ The following are the host, directory, user, and password that
 will be used.  If "user" is "ftp", then the password is not needed.
 
 }
+message quit_install {Quit without installing this component}
 message Pkgsrc_dir {pkgsrc directory}
 message get_pkgsrc {Fetch and unpack pkgsrc for building from source}
 message retry_pkgsrc_network {Network configuration failed.  Retry?}
-message quit_pkgsrc {Quit without installing pkgsrc}
 message pkgin_failed
 {Installation of pkgin failed, possibly because no binary packages
 exist.  Please check the package path and try again.}
diff --git a/distrib/utils/sysinst/msg.mi.es b/distrib/utils/sysinst/msg.mi.es
index 4b7b51b..147a461 100644
--- a/distrib/utils/sysinst/msg.mi.es
+++ b/distrib/utils/sysinst/msg.mi.es
@@ -35,7 +35,7 @@
 /* MI Message catalog -- spanish, machine independent */
 
 message usage
-{uso: sysinst [-r versión] [-f fichero-definición]
+{uso: sysinst [-r versión] [-f fichero-definición] [-C bg:fg]
 }
 
 /*
@@ -509,19 +509,11 @@ message nonet
 Se le devolverá al menú anterior.
 }
 
-message netup
-{Las siguientes interfaces están activas: %s
-¿Conecta alguna de ellas al servidor requerido?}
-
 message asknetdev
-{Se han encontrado las siguientes interfaces de red: %s
-\n¿Cuál se debería usar?}
+{Se han encontrado las siguientes interfaces de red. ¿Cuál se debería usar?}
 
-message badnet
-{No ha seleccionado ninguna interfaz de las listadas.  Por favor, vuelva a
-intentarlo.
-Están disponibles las siguientes interfaces de red: %s
-\n¿Cuál debería usar?}
+message netdevs
+{Interfaces disponibles}
 
 message netinfo
 {Para poder usar la red, necesita responder lo siguiente:
@@ -590,12 +582,6 @@ Serv de nombres IPv6:	%s
 message netok_ok
 {¿Son correctos?}
 
-message netagain
-{Por favor, vuelva a introducir la información sobre su red.  Sus últimas
-respuestas serán las predeterminadas.
-
-}
-
 message wait_network
 {
 Espere mientras las interfaces de red se levantan.
@@ -916,8 +902,9 @@ message Install_NetBSD_to_hard_disk {Instalar NetBSD en el disco duro}
 message Upgrade_NetBSD_on_a_hard_disk {Actualizar NetBSD en un disco duro}
 message Re_install_sets_or_install_additional_sets {Reinstalar conjuntos o instalar conjuntos adicionales}
 message Reboot_the_computer {Reiniciar la computadora}
+message Config_menu {Menú de configuración}
 message Utility_menu {Menú de utilidades}
-message exit_utility_menu {Exit}
+message exit_menu_generic {atrás}
 message NetBSD_VERSION_Utilities {Utilidades de NetBSD-@@VERSION@@}
 message Run_bin_sh {Ejecutar /bin/sh}
 message Set_timezone {Establecer la zona horaria}
@@ -971,6 +958,11 @@ message other {otro }
 message Perform_IPv6_autoconfiguration {¿Realizar autoconfiguración IPv6?}
 message Perform_DHCP_autoconfiguration {¿Realizar autoconfiguración DHCP ?}
 message Root_shell {Shell de root}
+message Color_scheme {Combinación de colores}
+message White_on_black {Blanco sobre negro}
+message Black_on_white {Negro sobre blanco}
+message White_on_blue {Blanco sobre azul}
+message Green_on_black {Verde sobre negro}
 
 .if AOUT2ELF
 message aoutfail
@@ -1064,7 +1056,7 @@ will be used.  If "user" is "ftp", then the password is not needed.
 message Pkgsrc_dir {pkgsrc directory}
 message get_pkgsrc {Fetch and unpack pkgsrc for building from source}
 message retry_pkgsrc_network {Network configuration failed.  Retry?}
-message quit_pkgsrc {Quit without installing pkgsrc}
+message quit_install {Quit without installing pkgsrc} /*TODO*/
 message pkgin_failed 
 {Installation of pkgin failed, possibly because no binary packages  exist.  Please check the package path and try again.}
 message failed {Failed}
diff --git a/distrib/utils/sysinst/msg.mi.fr b/distrib/utils/sysinst/msg.mi.fr
index 2e00429..c23f09c 100644
--- a/distrib/utils/sysinst/msg.mi.fr
+++ b/distrib/utils/sysinst/msg.mi.fr
@@ -35,7 +35,7 @@
 /* MI Message catalog -- french, machine independent */
 
 message usage
-{utilisation : sysinst [-r version] [-f fichier de définition]
+{utilisation : sysinst [-r version] [-f fichier de définition] [-C bg:fg]
 }
 
 /*
@@ -517,21 +517,13 @@ message nonet
 Retour au menu précédent.
 }
 
-message netup
-{Les interfaces réseau suivantes sont utilisables : %s
-Quelle interface souhaitez-vous utiliser ?
-}
-
 message asknetdev
-{Les interfaces suivantes sont utilisables : %s
+{Les interfaces suivantes sont utilisables.
 Quelle interface doit être utilisée ?
 }
 
-message badnet
-{Vous n'avez pas choisi une interface réseau dans la liste.
-Veuillez essayer à nouveau.
-Les interfaces réseau suivantes sont utilisables : %s
-\nQuel est votre choix ?}
+message netdevs
+{Interfaces disponibles}
 
 message netinfo
 {Veuillez répondre aux points suivants afin de pouvoir utiliser
@@ -605,11 +597,6 @@ message slattach {
 Entrez les "flags" slattach
 }
 
-message netagain
-{
-Veuillez spécifier de nouveau les paramètres réseau.
-}
-
 message wait_network
 {
 Veuillez patienter pendant la configuration de l'interface...
@@ -988,8 +975,9 @@ message Install_NetBSD_to_hard_disk {Installation de NetBSD sur disque dur}
 message Upgrade_NetBSD_on_a_hard_disk {Mise à jour de NetBSD sur disque dur}
 message Re_install_sets_or_install_additional_sets {Réinstaller ou installer de nouveaux composants}
 message Reboot_the_computer {Redémarrer l'ordinateur}
+message Config_menu {Menu config}
 message Utility_menu {Utilitaires}
-message exit_utility_menu {Quitter}
+message exit_menu_generic {Quitter}
 message NetBSD_VERSION_Utilities {Utilitaires NetBSD-@@VERSION@@}
 message Run_bin_sh {Exécuter /bin/sh}
 message Set_timezone {Configurer le fuseau horaire}
@@ -1043,6 +1031,11 @@ message other {autre }
 message Perform_IPv6_autoconfiguration {Configurer automatiquement l'IPv6 ?}
 message Perform_DHCP_autoconfiguration {Configurer automatiquement par DHCP ?}
 message Root_shell {Shell du compte "root"}
+message Color_scheme {Jeu de couleurs}
+message White_on_black {Blanc sur noir}
+message Black_on_white {Noir sur blanc}
+message White_on_blue {Blanc sur bleu}
+message Green_on_black {Vert sur noir}
 
 .if AOUT2ELF
 message aoutfail
@@ -1134,7 +1127,7 @@ message Pkgsrc_dir {R
 message get_pkgsrc
 {Obtenir et extraire pkgsrc afin de compiler des paquetages à partir des sources}
 message retry_pkgsrc_network {La configuration du réseau a échoué. Réessayer ?}
-message quit_pkgsrc {Quitter sans installer pkgsrc}
+message quit_install {Quitter sans installer pkgsrc} /*TODO*/
 message pkgin_failed 
 {L'installation de pkgin a échoué, peut-être parce que son paquetage binaire
 n'existe pas.  Vérifiez le chemin et essayez à nouveau.}
diff --git a/distrib/utils/sysinst/msg.mi.pl b/distrib/utils/sysinst/msg.mi.pl
index 55b54af..9e58a3a 100644
--- a/distrib/utils/sysinst/msg.mi.pl
+++ b/distrib/utils/sysinst/msg.mi.pl
@@ -37,7 +37,7 @@
 /* MI Message catalog -- polish, machine independent */
 
 message usage
-{uzycie: sysinst [-r wersja] [-f plik-definicji]
+{uzycie: sysinst [-r wersja] [-f plik-definicji] [-C bg:fg]
 }
 
 /*
@@ -491,18 +491,11 @@ message nonet
 Zostaniesz przeniesiony do glownego menu.
 }
 
-message netup
-{Nastepujace interfejsy sieciowe sa aktywne: %s
-Czy ktorys z nich jest podlaczony do serwera?}
-
 message asknetdev
-{Znalazlem nastepujace interfejsy sieciowe : %s
-\nKtorego urzadzenia mam uzyc?}
+{Znalazlem kilka interfejsy sieciowe. Ktorego urzadzenia mam uzyc?}
 
-message badnet
-{Nie wybrales zadnego z podanych urzadzen sieciowych. Sprobuj jeszcze raz.
-Nastepujace urzadzenie sieciowe sa dostepne: %s
-\nKtorego urzadzenia mam uzyc?}
+message netdevs
+{Dost?pne interfejsy}
 
 message netinfo
 {Aby mozna bylo uzywac sieci, potrzebujemy odpowiedzi na ponizsze pytania:
@@ -575,12 +568,6 @@ message slattach {
 Podaja parametry dla polecenia 'slattach'
 }
 
-message netagain
-{Wprowadz jeszcze raz informacje o twojej sieci. Twoje ostatnie odpowiedzi
-beda domyslnymi wartosciami.
-
-}
-
 message wait_network
 {
 Poczekaj, az interfejs sieciowy zostanie uaktywniony.
@@ -885,8 +872,9 @@ message Install_NetBSD_to_hard_disk {Zainstaluj NetBSD na twardym dysku}
 message Upgrade_NetBSD_on_a_hard_disk {Zaktualizuj NetBSD na twardym dysku}
 message Re_install_sets_or_install_additional_sets {Przeinstaluj albo zainstaluj dodatkowe pakiety}
 message Reboot_the_computer {Zrestartuj komputer}
+message Config_menu {Menu konfiguracji}
 message Utility_menu {Menu Narzedziowe}
-message exit_utility_menu {Exit}
+message exit_menu_generic {Nazad}
 message NetBSD_VERSION_Utilities {Narzedzia NetBSD-@@VERSION@@}
 message Run_bin_sh {Uruchom /bin/sh}
 message Set_timezone {Ustaw strefe czasowa}
@@ -940,6 +928,11 @@ message other {inny  }
 message Perform_IPv6_autoconfiguration {Wykonac autokonfiguracje IPv6?}
 message Perform_DHCP_autoconfiguration {Wykonac autkonfiguracje DHCP?}
 message Root_shell {Powloka root'a}
+message Color_scheme {Schemat kolorów}
+message White_on_black {Bia³y na czarnym}
+message Black_on_white {Czarno na bia³ym}
+message White_on_blue {Bia³y na niebieskim}
+message Green_on_black {Zielony na czarnym}
 
 .if AOUT2ELF
 message aoutfail
@@ -1019,7 +1012,7 @@ will be used.  If "user" is "ftp", then the password is not needed.
 message Pkgsrc_dir {pkgsrc directory}
 message get_pkgsrc {Fetch and unpack pkgsrc for building from source}
 message retry_pkgsrc_network {Network configuration failed.  Retry?}
-message quit_pkgsrc {Quit without installing pkgsrc}
+message quit_install {Quit without installing pkgsrc} /*TODO*/
 message pkgin_failed 
 {Installation of pkgin failed, possibly because no binary packages  exist.  Please check the package path and try again.}
 message failed {Failed}
diff --git a/distrib/utils/sysinst/net.c b/distrib/utils/sysinst/net.c
index 160c904..100331a 100644
--- a/distrib/utils/sysinst/net.c
+++ b/distrib/utils/sysinst/net.c
@@ -64,8 +64,12 @@
 
 int network_up = 0;
 /* Access to network information */
-static char *net_devices;
-static char *net_up;
+#define MAX_NETS 15
+struct net_desc {
+	char if_dev[STRSIZE];
+	char name[STRSIZE]; // TODO
+};
+
 static char net_dev[STRSIZE];
 static char net_domain[STRSIZE];
 static char net_host[STRSIZE];
@@ -200,7 +204,6 @@ url_encode(char *dst, const char *src, const char *ep,
 	return dst;
 }
 
-
 static const char *ignored_if_names[] = {
 	"eon",			/* netiso */
 	"gre",			/* net */
@@ -208,6 +211,7 @@ static const char *ignored_if_names[] = {
 	"gif",			/* netinet6 */
 	"faith",		/* netinet6 */
 	"lo",			/* net */
+	"lo0",			/* net */
 #if 0
 	"mdecap",		/* netinet -- never in IF list (?) XXX */
 #endif
@@ -222,24 +226,19 @@ static const char *ignored_if_names[] = {
 	NULL,
 };
 
-static void
-get_ifconfig_info(void)
+static int
+get_ifconfig_info(struct net_desc *devs)
 {
-	char *textbuf;
-	char *t, *nt;
+	char *buf_in;
+	char *buf_tmp;
 	const char **ignore;
+	char *buf;
+	char *tmp;
 	int textsize;
-	ulong fl;
-	char *cp;
-
-	free(net_devices);
-	net_devices = NULL;
-	free(net_up);
-	net_up = NULL;
+	int i;
 
 	/* Get ifconfig information */
-
-	textsize = collect(T_OUTPUT, &textbuf, "/sbin/ifconfig -a 2>/dev/null");
+	textsize = collect(T_OUTPUT, &buf_in, "/sbin/ifconfig -l 2>/dev/null");
 	if (textsize < 0) {
 		if (logfp)
 			(void)fprintf(logfp,
@@ -248,52 +247,31 @@ get_ifconfig_info(void)
 		exit(1);
 	}
 
-	for (t = textbuf; t != NULL && *t != 0; t = nt) {
-		/* find entry for next interface */
-		for (nt = t; (nt = strchr(nt, '\n')); ) {
-			if (*++nt != '\t')
-				break;
-		}
-		if (memcmp(t, "lo0:", 4) == 0)
-			/* completely ignore loopback interface */
-			continue;
-		cp = strchr(t, '=');
-		if (cp == NULL)
-			break;
-		/* get interface flags */
-		fl = strtoul(cp + 1, &cp, 16);
-		if (*cp != '<')
-			break;
+	buf = malloc (STRSIZE * sizeof(char));
+	for (i = 0, buf_tmp = buf_in; strlen(buf_tmp) > 0 && buf_tmp < buf_in +
+	     strlen(buf_in);) {
+		tmp = stpncpy(buf, buf_tmp, strcspn(buf_tmp," \n"));
+		*tmp='\0';
+		buf_tmp += (strcspn(buf_tmp, " \n") + 1) * sizeof(char);
 
+		/* Skip ignored interfaces */
 		for (ignore = ignored_if_names; *ignore != NULL; ignore++) {
 			size_t len = strlen(*ignore);
-			if (strncmp(t, *ignore, len) == 0 &&
-			    isdigit((unsigned char)t[len]))
+			if (strncmp(buf, *ignore, len) == 0 &&
+			    isdigit((unsigned char)buf[len]))
 				break;
 		}
 		if (*ignore != NULL)
 			continue;
 
-		if (fl & IFF_UP) {
-			/* This interface might be connected to the server */
-			cp = strchr(t, ':');
-			if (cp == NULL)
-				break;
-			asprintf(&cp, "%s%.*s ",
-			    net_up ? net_up : "", (int)(cp - t), t);
-			free(net_up);
-			net_up = cp;
-		}
-
-		cp = strchr(t, ':');
-		if (cp == NULL)
-			break;
-		asprintf(&cp, "%s%.*s ",
-		    net_devices ? net_devices : "", (int)(cp - t), t);
-		free(net_devices);
-		net_devices = cp;
+		strncpy (devs[i].if_dev, buf, STRSIZE);
+		i++;
 	}
-	free(textbuf);
+	strcpy(devs[i].if_dev, "\0");
+
+	free(buf);
+	free(buf_in);
+	return i;
 }
 
 static int
@@ -532,6 +510,13 @@ handle_license(const char *dev)
 	return 1;
 }
 
+static int
+set_net_select(menudesc *m, void *arg)
+{
+	*(int *)arg = m->cursel;
+	return 1;
+}
+
 /*
  * Get the information to configure the network, configure it and
  * make sure both the gateway and the name server are up.
@@ -539,9 +524,6 @@ handle_license(const char *dev)
 int
 config_network(void)
 {
-	char *tp;
-	char *defname;
-	const char *prompt;
 	char *textbuf;
 	int  octet0;
 	int  dhcp_config;
@@ -551,8 +533,13 @@ config_network(void)
  	char **ap, *slcmd[10], *in_buf;
  	char buffer[STRSIZE];
  	struct statvfs sb;
+	struct net_desc net_devs[MAX_NETS];
+	menu_ent net_menu[5];
+	int menu_no;
+	int num_devs;
+	int selected_net;
 
-	int l;
+	int i;
 	char dhcp_host[STRSIZE];
 #ifdef INET6
 	int v6config = 1;
@@ -564,43 +551,38 @@ config_network(void)
 	if (network_up)
 		return (1);
 
-	get_ifconfig_info();
-
-	if (net_up != NULL) {
-		/* XXX: some retry loops come here... */
-		/* active interfaces found */
-		msg_display(MSG_netup, net_up);
-		process_menu(MENU_yesno, NULL);
-		if (!yesno)
-			return 0;
-	}
+	num_devs = get_ifconfig_info(net_devs);
 
-	if (net_devices == NULL) {
+	if (num_devs < 1) {
 		/* No network interfaces found! */
 		msg_display(MSG_nonet);
 		process_menu(MENU_ok, NULL);
 		return (-1);
 	}
-	network_up = 1;
 
-again:
-	tp = strchr(net_devices, ' ');
-	asprintf(&defname, "%.*s", (int)(tp - net_devices), net_devices);
-	for (prompt = MSG_asknetdev;; prompt = MSG_badnet) {
-		msg_prompt(prompt, defname, net_dev, sizeof net_dev - 1,
-		    net_devices);
-		l = strlen(net_dev);
-		net_dev[l] = ' ';
-		net_dev[l + 1] = 0;
-		tp = strstr(net_devices, net_dev);
-		if (tp == NULL)
-			continue;
-		if (tp != net_devices && tp[-1] != ' ')
-			continue;
-		net_dev[l] = 0;
-		break;
+	for (i = 0; i < num_devs; i++) {
+		net_menu[i].opt_name = net_devs[i].if_dev;
+		net_menu[i].opt_menu = OPT_NOMENU;
+		net_menu[i].opt_flags = OPT_EXIT;
+		net_menu[i].opt_action = set_net_select;
 	}
-	free(defname);
+again:
+	selected_net = -1;
+	menu_no = new_menu(MSG_netdevs,
+		net_menu, num_devs, -1, 4, 0, 0,
+		MC_SCROLL,
+		NULL, NULL, NULL, NULL, NULL);
+	msg_display(MSG_asknetdev, "");
+	process_menu(menu_no, &selected_net);
+	free_menu(menu_no);
+	
+	if (selected_net == -1)
+	    return 0;
+
+	network_up = 1;
+
+	strncpy(net_dev, net_devs[selected_net].if_dev, STRSIZE);
+
 	if (!handle_license(net_dev))
 		goto done;
 
@@ -802,8 +784,7 @@ again:
 #endif
 done:
 	process_menu(MENU_yesno, deconst(MSG_netok_ok));
-	if (!yesno)
-		msg_display(MSG_netagain);
+
 	if (!yesno)
 		goto again;
 
@@ -1028,40 +1009,18 @@ do_ftp_fetch(const char *set_name, struct ftpinfo *f)
 	return rval ? SET_RETRY : SET_OK;
 }
 
-static int
-do_config_network(void)
-{
-	int ret;
-
-	while ((ret = config_network()) <= 0) {
-		if (ret < 0)
-			return (-1);
-		msg_display(MSG_netnotup);
-		process_menu(MENU_yesno, NULL);
-		if (!yesno) {
-			msg_display(MSG_netnotup_continueanyway);
-			process_menu(MENU_yesno, NULL);
-			if (!yesno)
-				return -1;
-			network_up = 1;
-			break;
-		}
-	}
-	return 0;
-}
+
+// TODO: check MSG_netnotup_continueanyway and MSG_netnotup
 
 int
 get_pkgsrc(void)
 {
-	if (!network_up)
-		if (do_config_network() != 0)
-			return SET_RETRY;
-
-	yesno = 1;
+	yesno = -1;
 	process_menu(MENU_pkgsrc, NULL);
 	
-	if (yesno == 0)
+	if (yesno == SET_SKIP)
 		return SET_SKIP;
+
 	fetch_fn = pkgsrc_fetch;
 	snprintf(ext_dir_pkgsrc, sizeof ext_dir_pkgsrc, "%s/%s",
 	    target_prefix(), xfer_dir + (*xfer_dir == '/'));
@@ -1072,11 +1031,11 @@ get_pkgsrc(void)
 int
 get_via_ftp(const char *xfer_type)
 {
-
-	if (do_config_network() != 0)
-		return SET_RETRY;
-
+	yesno = -1;
 	process_menu(MENU_ftpsource, deconst(xfer_type));
+	
+	if (yesno == SET_RETRY)
+		return SET_RETRY;
 
 	/* We'll fetch each file just before installing it */
 	fetch_fn = ftp_fetch;
@@ -1094,9 +1053,6 @@ get_via_nfs(void)
 {
 	struct statvfs sb;
 
-	if (do_config_network() != 0)
-		return SET_RETRY;
-
 	/* If root is on NFS and we have sets, skip this step. */
 	if (statvfs(set_dir_bin, &sb) == 0 &&
 	    strcmp(sb.f_fstypename, "nfs") == 0) {
@@ -1106,7 +1062,11 @@ get_via_nfs(void)
 	}
 
 	/* Get server and filepath */
+	yesno = -1;
 	process_menu(MENU_nfssource, NULL);
+	
+	if (yesno == SET_RETRY)
+		return SET_RETRY;
 
 	/* Mount it */
 	if (run_program(0, "/sbin/mount -r -o -2,-i,-r=1024 -t nfs %s:%s /mnt2",
diff --git a/distrib/utils/sysinst/target.c b/distrib/utils/sysinst/target.c
index dee3266..36f108a 100644
--- a/distrib/utils/sysinst/target.c
+++ b/distrib/utils/sysinst/target.c
@@ -280,7 +280,10 @@ do_target_chdir(const char *dir, int must_succeed)
 	error = 0;
 	tgt_dir = target_expand(dir);
 
-#ifndef DEBUG
+#ifdef DEBUG
+	printf("target_chdir (%s)\n", tgt_dir);
+	//return (0);
+#endif
 	/* chdir returns -1 on error and sets errno. */
 	if (chdir(tgt_dir) < 0)
 		error = errno;
@@ -303,10 +306,6 @@ do_target_chdir(const char *dir, int must_succeed)
 	}
 	errno = error;
 	return (error);
-#else
-	printf("target_chdir (%s)\n", tgt_dir);
-	return (0);
-#endif
 }
 
 void
diff --git a/distrib/utils/sysinst/upgrade.c b/distrib/utils/sysinst/upgrade.c
index af7d088..4969412 100644
--- a/distrib/utils/sysinst/upgrade.c
+++ b/distrib/utils/sysinst/upgrade.c
@@ -68,8 +68,6 @@ do_upgrade(void)
 	if (md_pre_update() < 0)
 		return;
 
-	process_menu(MENU_distset, NULL);
-
 	if (mount_disks() != 0)
 		return;
 
@@ -96,6 +94,7 @@ do_upgrade(void)
 	wrefresh(stdscr);
 
 	/* Done with disks. Ready to get and unpack tarballs. */
+	process_menu(MENU_distset, NULL);
 	if (get_and_unpack_sets(1, MSG_disksetupdoneupdate,
 	    MSG_upgrcomplete, MSG_abortupgr) != 0)
 		return;
@@ -182,12 +181,11 @@ do_reinstall_sets(void)
 	if (find_disks(msg_string(MSG_reinstall)) < 0)
 		return;
 
-	process_menu(MENU_distset, NULL);
-
 	if (mount_disks() != 0)
 		return;
 
 	/* Unpack the distribution. */
+	process_menu(MENU_distset, NULL);
 	if (get_and_unpack_sets(0, NULL, MSG_unpackcomplete, MSG_abortunpack) != 0)
 		return;
 
diff --git a/distrib/utils/sysinst/util.c b/distrib/utils/sysinst/util.c
index f290979..acfdfe9 100644
--- a/distrib/utils/sysinst/util.c
+++ b/distrib/utils/sysinst/util.c
@@ -358,8 +358,10 @@ floppy_fetch(const char *set_name)
 int
 get_via_floppy(void)
 {
-
+	yesno = -1;
 	process_menu(MENU_floppysource, NULL);
+	if (yesno == SET_RETRY)
+		return SET_RETRY;
 
 	fetch_fn = floppy_fetch;
 
@@ -577,7 +579,10 @@ get_via_cdrom(void)
 	}
 
 	/* ask for paths on the CD */
+	yesno = -1;
 	process_menu(MENU_cdromsource, NULL);
+	if (yesno == SET_RETRY)
+		return SET_RETRY;
 
 	if (cd_has_sets())
 		return SET_OK;
@@ -593,9 +598,11 @@ get_via_cdrom(void)
 int
 get_via_localfs(void)
 {
-
 	/* Get device, filesystem, and filepath */
+	yesno = -1;
 	process_menu (MENU_localfssource, NULL);
+	if (yesno == SET_RETRY)
+		return SET_RETRY;
 
 	/* Mount it */
 	if (run_program(0, "/sbin/mount -rt %s /dev/%s /mnt2",
@@ -619,9 +626,11 @@ get_via_localfs(void)
 int
 get_via_localdir(void)
 {
-
 	/* Get filepath */
+	yesno = -1;
 	process_menu(MENU_localdirsource, NULL);
+	if (yesno == SET_RETRY)
+		return SET_RETRY;
 
 	/*
 	 * We have to have an absolute path ('cos pax runs in a
@@ -1604,3 +1613,23 @@ ext_dir_for_set(const char *set_name) {
 	return set_is_source(set_name) ? ext_dir_src : ext_dir_bin;
 }
 
+void
+do_coloring (unsigned int fg, unsigned int bg) {
+	if (bg > COLOR_WHITE)
+		bg = COLOR_BLUE;
+	if (fg > COLOR_WHITE)
+		fg = COLOR_WHITE;
+	if (fg != bg && has_colors()) {
+		init_pair(1, fg, bg);
+		wbkgd(stdscr, COLOR_PAIR(1));
+		wbkgd(mainwin, COLOR_PAIR(1));
+		wattrset(stdscr, COLOR_PAIR(1));
+		wattrset(mainwin, COLOR_PAIR(1));
+	}
+	/* redraw screen */
+	touchwin(stdscr);
+	touchwin(mainwin);
+	wrefresh(stdscr);
+	wrefresh(mainwin);
+	return;
+}
\ No newline at end of file
