Module Name: src
Committed By: snj
Date: Thu May 14 07:58:50 UTC 2015
Modified Files:
src/usr.sbin/sysinst [netbsd-7]: configmenu.c defs.h disks.c install.c
label.c mbr.c menus.mi net.c partman.c upgrade.c util.c
src/usr.sbin/sysinst/arch/arc [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/atari [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/cobalt [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/emips [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/evbarm [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/evbarm64 [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/hp300 [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/i386 [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/mac68k [netbsd-7]: md.c menus.md.de
menus.md.en menus.md.es menus.md.pl
src/usr.sbin/sysinst/arch/mvme68k [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/ofppc [netbsd-7]: md.c
src/usr.sbin/sysinst/arch/prep [netbsd-7]: md.c menus.md.en
src/usr.sbin/sysinst/arch/x68k [netbsd-7]: md.c
Log Message:
Pull up following revision(s) (requested by martin in ticket #756):
usr.sbin/sysinst/arch/arc/md.c: revision 1.4
usr.sbin/sysinst/arch/atari/md.c: revision 1.3
usr.sbin/sysinst/arch/cobalt/md.c: revision 1.4
usr.sbin/sysinst/arch/emips/md.c: revision 1.3
usr.sbin/sysinst/arch/evbarm/md.c: revision 1.4
usr.sbin/sysinst/arch/evbarm64/md.c: revision 1.2
usr.sbin/sysinst/arch/hp300/md.c: revision 1.4
usr.sbin/sysinst/arch/i386/md.c: revision 1.6
usr.sbin/sysinst/arch/mac68k/md.c: revision 1.3
usr.sbin/sysinst/arch/mac68k/md.c: revision 1.4
usr.sbin/sysinst/arch/mac68k/menus.md.de: revisions 1.3, 1.4
usr.sbin/sysinst/arch/mac68k/menus.md.en: revisions 1.3, 1.4
usr.sbin/sysinst/arch/mac68k/menus.md.es: revisions 1.3, 1.4
usr.sbin/sysinst/arch/mac68k/menus.md.pl: revisions 1.3, 1.4
usr.sbin/sysinst/arch/mvme68k/md.c: revision 1.4
usr.sbin/sysinst/arch/ofppc/md.c: revision 1.3
usr.sbin/sysinst/arch/prep/md.c: revisions 1.3, 1.4
usr.sbin/sysinst/arch/prep/menus.md.en: revision 1.2
usr.sbin/sysinst/arch/x68k/md.c: revision 1.4
usr.sbin/sysinst/configmenu.c: revisions 1.4, 1.5
usr.sbin/sysinst/defs.h: revisions 1.8, 1.9
usr.sbin/sysinst/disks.c: revision 1.9
usr.sbin/sysinst/install.c: revision 1.4
usr.sbin/sysinst/label.c: revision 1.3
usr.sbin/sysinst/mbr.c: revision 1.5
usr.sbin/sysinst/menus.mi: revisions 1.9, 1.10
usr.sbin/sysinst/net.c: revisions 1.18-1.20
usr.sbin/sysinst/partman.c: revision 1.10
usr.sbin/sysinst/upgrade.c: revision 1.4
usr.sbin/sysinst/util.c: revisions 1.6, 1.7
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.
--
Make it compile on architectures that do not support INET6 in sysinst
--
Remove a few more (ab-)usages of "yesno".
--
More (ab-)usages of "yesno"
--
Make "ask_yesno" and "ask_noyes" take a const char * as argument, moving
the deconst() dance into the utility functions and simplifying all callers.
--
Missed a few more "yesno" in previous
To generate a diff of this commit:
cvs rdiff -u -r1.2.4.1 -r1.2.4.2 src/usr.sbin/sysinst/configmenu.c \
src/usr.sbin/sysinst/install.c src/usr.sbin/sysinst/upgrade.c
cvs rdiff -u -r1.3.4.4 -r1.3.4.5 src/usr.sbin/sysinst/defs.h
cvs rdiff -u -r1.4.4.4 -r1.4.4.5 src/usr.sbin/sysinst/disks.c \
src/usr.sbin/sysinst/menus.mi
cvs rdiff -u -r1.2 -r1.2.4.1 src/usr.sbin/sysinst/label.c
cvs rdiff -u -r1.2.4.2 -r1.2.4.3 src/usr.sbin/sysinst/mbr.c
cvs rdiff -u -r1.2.4.4 -r1.2.4.5 src/usr.sbin/sysinst/net.c
cvs rdiff -u -r1.4.4.3 -r1.4.4.4 src/usr.sbin/sysinst/partman.c
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/usr.sbin/sysinst/util.c
cvs rdiff -u -r1.2.4.1 -r1.2.4.2 src/usr.sbin/sysinst/arch/arc/md.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/usr.sbin/sysinst/arch/atari/md.c
cvs rdiff -u -r1.2.4.1 -r1.2.4.2 src/usr.sbin/sysinst/arch/cobalt/md.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/usr.sbin/sysinst/arch/emips/md.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/usr.sbin/sysinst/arch/evbarm/md.c
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/usr.sbin/sysinst/arch/evbarm64/md.c
cvs rdiff -u -r1.2.4.1 -r1.2.4.2 src/usr.sbin/sysinst/arch/hp300/md.c
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/usr.sbin/sysinst/arch/i386/md.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/usr.sbin/sysinst/arch/mac68k/md.c \
src/usr.sbin/sysinst/arch/mac68k/menus.md.de \
src/usr.sbin/sysinst/arch/mac68k/menus.md.en \
src/usr.sbin/sysinst/arch/mac68k/menus.md.es \
src/usr.sbin/sysinst/arch/mac68k/menus.md.pl
cvs rdiff -u -r1.2.4.1 -r1.2.4.2 src/usr.sbin/sysinst/arch/mvme68k/md.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/usr.sbin/sysinst/arch/ofppc/md.c
cvs rdiff -u -r1.2 -r1.2.4.1 src/usr.sbin/sysinst/arch/prep/md.c
cvs rdiff -u -r1.1 -r1.1.4.1 src/usr.sbin/sysinst/arch/prep/menus.md.en
cvs rdiff -u -r1.2.4.1 -r1.2.4.2 src/usr.sbin/sysinst/arch/x68k/md.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/sysinst/configmenu.c
diff -u src/usr.sbin/sysinst/configmenu.c:1.2.4.1 src/usr.sbin/sysinst/configmenu.c:1.2.4.2
--- src/usr.sbin/sysinst/configmenu.c:1.2.4.1 Fri Jan 23 10:06:30 2015
+++ src/usr.sbin/sysinst/configmenu.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: configmenu.c,v 1.2.4.1 2015/01/23 10:06:30 martin Exp $ */
+/* $NetBSD: configmenu.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
/*-
* Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -258,8 +258,7 @@ add_new_user(struct menudesc *menu, void
msg_prompt(MSG_addusername, NULL, username, sizeof username -1);
if (strlen(username) == 0)
return 0;
- process_menu(MENU_yesno, deconst(MSG_addusertowheel));
- inwheel = yesno;
+ inwheel = ask_yesno(MSG_addusertowheel);
ushell = "/bin/csh";
process_menu(MENU_usersh, NULL);
if (inwheel)
@@ -280,8 +279,7 @@ change_root_password(struct menudesc *me
configinfo **confp = arg;
msg_display(MSG_rootpw);
- process_menu(MENU_yesno, NULL);
- if (yesno) {
+ if (ask_yesno(NULL)) {
if (run_program(RUN_DISPLAY | RUN_PROGRESS | RUN_CHROOT,
"passwd -l root") == 0)
confp[menu->cursel]->setting = MSG_password_set;
@@ -298,11 +296,13 @@ set_binpkg(struct menudesc *menu, void *
char additional_pkgs[STRSIZE] = {0};
char pattern[STRSIZE];
int allok = 0;
+ arg_rv parm;
do {
- yesno = -1;
- process_menu(MENU_binpkg, additional_pkgs);
- if (yesno == SET_SKIP) {
+ parm.rv = -1;
+ parm.arg = additional_pkgs;
+ process_menu(MENU_binpkg, &parm);
+ if (parm.rv == SET_SKIP) {
confp[menu->cursel]->setting = MSG_abandoned;
return 0;
}
@@ -354,8 +354,7 @@ set_pkgsrc(struct menudesc *menu, void *
confp[menu->cursel]->setting = MSG_abandoned;
return 0;
}
- process_menu(MENU_yesno, deconst(MSG_retry_pkgsrc_network));
- if (!yesno) {
+ if (!ask_yesno(MSG_retry_pkgsrc_network)) {
confp[menu->cursel]->setting = MSG_abandoned;
return 1;
}
Index: src/usr.sbin/sysinst/install.c
diff -u src/usr.sbin/sysinst/install.c:1.2.4.1 src/usr.sbin/sysinst/install.c:1.2.4.2
--- src/usr.sbin/sysinst/install.c:1.2.4.1 Sun Jan 11 04:32:38 2015
+++ src/usr.sbin/sysinst/install.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: install.c,v 1.2.4.1 2015/01/11 04:32:38 snj Exp $ */
+/* $NetBSD: install.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -51,8 +51,7 @@ do_install(void)
#ifndef DEBUG
msg_display(MSG_installusure);
- process_menu(MENU_noyes, NULL);
- if (!yesno)
+ if (!ask_noyes(NULL))
return;
#endif
@@ -95,8 +94,7 @@ do_install(void)
clear();
refresh();
msg_display(MSG_lastchance, pm->diskdev);
- process_menu(MENU_noyes, NULL);
- if (!yesno)
+ if (!ask_noyes(NULL))
return;
if (md_pre_disklabel() != 0 ||
Index: src/usr.sbin/sysinst/upgrade.c
diff -u src/usr.sbin/sysinst/upgrade.c:1.2.4.1 src/usr.sbin/sysinst/upgrade.c:1.2.4.2
--- src/usr.sbin/sysinst/upgrade.c:1.2.4.1 Sun Jan 11 04:32:38 2015
+++ src/usr.sbin/sysinst/upgrade.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: upgrade.c,v 1.2.4.1 2015/01/11 04:32:38 snj Exp $ */
+/* $NetBSD: upgrade.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -58,8 +58,7 @@ do_upgrade(void)
partman_go = 0;
msg_display(MSG_upgradeusure);
- process_menu(MENU_noyes, NULL);
- if (!yesno)
+ if (!ask_noyes(NULL))
return;
get_ramsize();
@@ -182,8 +181,7 @@ do_reinstall_sets(void)
unwind_mounts();
msg_display(MSG_reinstallusure);
- process_menu(MENU_noyes, NULL);
- if (!yesno)
+ if (!ask_noyes(NULL))
return;
if (find_disks(msg_string(MSG_reinstall)) < 0)
Index: src/usr.sbin/sysinst/defs.h
diff -u src/usr.sbin/sysinst/defs.h:1.3.4.4 src/usr.sbin/sysinst/defs.h:1.3.4.5
--- src/usr.sbin/sysinst/defs.h:1.3.4.4 Thu May 14 00:30:50 2015
+++ src/usr.sbin/sysinst/defs.h Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: defs.h,v 1.3.4.4 2015/05/14 00:30:50 riz Exp $ */
+/* $NetBSD: defs.h,v 1.3.4.5 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -188,6 +188,13 @@ enum {
#define CD_NAMES "cd0a"
/* Types */
+
+/* pass a void* argument into a menu and also provide a int return value */
+typedef struct arg_rv {
+ void *arg;
+ int rv;
+} arg_rv;
+
typedef struct distinfo {
const char *name;
uint set;
@@ -250,7 +257,6 @@ int debug; /* set by -D option */
char rel[SSTRSIZE];
char machine[SSTRSIZE];
-int yesno;
int ignorerror;
int ttysig_ignore;
pid_t ttysig_forward;
@@ -510,6 +516,8 @@ void do_reinstall_sets(void);
void restore_etc(void);
/* from util.c */
+int ask_yesno(const char *);
+int ask_noyes(const char *);
int dir_exists_p(const char *);
int file_exists_p(const char *);
int file_mode_match(const char *, unsigned int);
Index: src/usr.sbin/sysinst/disks.c
diff -u src/usr.sbin/sysinst/disks.c:1.4.4.4 src/usr.sbin/sysinst/disks.c:1.4.4.5
--- src/usr.sbin/sysinst/disks.c:1.4.4.4 Sat May 9 13:50:15 2015
+++ src/usr.sbin/sysinst/disks.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: disks.c,v 1.4.4.4 2015/05/09 13:50:15 msaitoh Exp $ */
+/* $NetBSD: disks.c,v 1.4.4.5 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1010,8 +1010,7 @@ foundffs(struct data *list, size_t num)
error = target_mount("", list[0].u.s_val, ' '-'a', list[1].u.s_val);
if (error != 0) {
msg_display(MSG_mount_failed, list[0].u.s_val);
- process_menu(MENU_noyes, NULL);
- if (!yesno)
+ if (!ask_noyes(NULL))
return error;
}
return 0;
@@ -1061,8 +1060,7 @@ fsck_preen(const char *disk, int ptn, co
free(prog);
if (error != 0) {
msg_display(MSG_badfs, disk, ptn, error);
- process_menu(MENU_noyes, NULL);
- if (yesno)
+ if (ask_noyes(NULL))
error = 0;
/* XXX at this point maybe we should run a full fsck? */
}
Index: src/usr.sbin/sysinst/menus.mi
diff -u src/usr.sbin/sysinst/menus.mi:1.4.4.4 src/usr.sbin/sysinst/menus.mi:1.4.4.5
--- src/usr.sbin/sysinst/menus.mi:1.4.4.4 Thu May 14 00:30:50 2015
+++ src/usr.sbin/sysinst/menus.mi Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.mi,v 1.4.4.4 2015/05/14 00:30:50 riz Exp $ */
+/* $NetBSD: menus.mi,v 1.4.4.5 2015/05/14 07:58:49 snj Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -286,14 +286,16 @@ menu colors, title MSG_Color_scheme, exi
menu yesno, y=-10;
- display action { menu->title = arg ? arg : MSG_yes_or_no; };
- option MSG_Yes, exit, action {yesno = 1;};
- option MSG_No, exit, action {yesno = 0;};
+ display action { arg_rv *p = arg;
+ menu->title = p->arg ? p->arg : MSG_yes_or_no; };
+ option MSG_Yes, exit, action { ((arg_rv*)arg)->rv = 1; };
+ option MSG_No, exit, action { ((arg_rv*)arg)->rv = 0; };
menu noyes, y=-10;
- display action { menu->title = arg ? arg : MSG_yes_or_no; };
- option MSG_No, exit, action {yesno = 0;};
- option MSG_Yes, exit, action {yesno = 1;};
+ display action { arg_rv *p = arg;
+ menu->title = p->arg ? p->arg : MSG_yes_or_no; };
+ option MSG_No, exit, action { ((arg_rv*)arg)->rv = 0; };
+ option MSG_Yes, exit, action { ((arg_rv*)arg)->rv = 1; };
menu ok, no shortcut, y=-10;
display action { menu->title = arg; };
@@ -345,7 +347,7 @@ menu distset, title MSG_Select_your_dist
menu ftpsource, y=-4, x=0, w=70, no box, no clear,
exitstring MSG_Get_Distribution;
- display action { msg_display(MSG_ftpsource, arg); };
+ display action { msg_display(MSG_ftpsource, ((arg_rv*)arg)->arg); };
option {src_legend(menu, MSG_Host, ftp.host);},
action { src_prompt(MSG_Host, ftp.host, sizeof ftp.host); };
option {src_legend(menu, MSG_Base_dir, ftp.dir);},
@@ -382,16 +384,14 @@ menu ftpsource, y=-4, x=0, w=70, no box,
action { src_prompt(MSG_Xfer_dir, xfer_dir, sizeof xfer_dir); };
option {src_legend(menu, MSG_delete_xfer_file,
clean_xfer_dir ? MSG_Yes : MSG_No);},
- action {process_menu(MENU_yesno, deconst(MSG_delete_xfer_file));
- clean_xfer_dir = yesno; };
+ action {clean_xfer_dir = ask_yesno(MSG_delete_xfer_file); };
option MSG_Configure_network,
action {
extern int network_up;
network_up = 0;
config_network();
};
- option MSG_exit_menu_generic, exit, action { yesno = SET_RETRY; };
- exit action { yesno = -1; };
+ option MSG_exit_menu_generic, exit, action { ((arg_rv*)arg)->rv = SET_RETRY; };
menu nfssource, y=-4, x=0, w=70, no box, no clear,
@@ -411,7 +411,7 @@ menu nfssource, y=-4, x=0, w=70, no box,
network_up = 0;
config_network();
};
- option MSG_exit_menu_generic, exit, action { yesno = SET_RETRY; };
+ option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; };
menu fdremount, title MSG_What_do_you_want_to_do;
option MSG_Try_again, exit, action { *(int *)arg = SET_CONTINUE; };
@@ -439,9 +439,8 @@ menu floppysource, y=-4, x=0, w=70, no b
action { src_prompt(MSG_Xfer_dir, xfer_dir, sizeof xfer_dir); };
option {src_legend(menu, MSG_delete_xfer_file,
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; };
+ action {clean_xfer_dir = ask_yesno(MSG_delete_xfer_file); };
+ option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; };
menu cdromsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
display action { msg_display(MSG_cdromsource); };
@@ -451,7 +450,7 @@ menu cdromsource, y=-4, x=0, w=70, no bo
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; };
+ option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; };
menu localfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
display action { msg_display(MSG_localfssource); };
@@ -465,7 +464,7 @@ menu localfssource, y=-4, x=0, w=70, no
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; };
+ option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; };
menu localdirsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue;
display action { msg_display(MSG_localdir); };
@@ -475,7 +474,7 @@ menu localdirsource, y=-4, x=0, w=70, no
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; };
+ option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; };
menu namesrv6, title MSG_Select_DNS_server;
option "google-public-dns-a.google.com (IPv4)", exit, action
@@ -483,9 +482,9 @@ menu namesrv6, title MSG_Select_DNS_serv
#ifdef INET6
strlcpy(net_namesvr, "8.8.8.8",
sizeof(net_namesvr));
- yesno = 1;
+ *((int*)arg) = 1;
#else
- yesno = 0;
+ *((int*)arg) = 0;
#endif
};
option "google-public-dns-b.google.com (IPv4)", exit, action
@@ -493,9 +492,9 @@ menu namesrv6, title MSG_Select_DNS_serv
#ifdef INET6
strlcpy(net_namesvr, "8.8.4.4",
sizeof(net_namesvr));
- yesno = 1;
+ *((int*)arg) = 1;
#else
- yesno = 0;
+ *((int*)arg) = 0;
#endif
};
option "google-public-dns-a.google.com (IPv6)", exit, action
@@ -503,9 +502,9 @@ menu namesrv6, title MSG_Select_DNS_serv
#ifdef INET6
strlcpy(net_namesvr, "2001:4860:4860::8888",
sizeof(net_namesvr));
- yesno = 1;
+ *((int*)arg) = 1;
#else
- yesno = 0;
+ *((int*)arg) = 0;
#endif
};
option "google-public-dns-b.google.com (IPv6)", exit, action
@@ -513,13 +512,13 @@ menu namesrv6, title MSG_Select_DNS_serv
#ifdef INET6
strlcpy(net_namesvr, "2001:4860:4860::8844",
sizeof(net_namesvr));
- yesno = 1;
+ *((int*)arg) = 1;
#else
- yesno = 0;
+ *((int*)arg) = 0;
#endif
};
option MSG_other, exit, action
- { yesno = 0; };
+ { *((int*)arg) = 0; };
menu rootsh, title MSG_Root_shell, no clear;
option "/bin/sh", exit, action {*(const char **)arg = "/bin/sh";};
@@ -564,8 +563,8 @@ menu binpkg, y=-4, x=0, w=70, no box, no
setenv("http_proxy", pkg.proxy, 1);
}
};
- option {src_legend(menu, "Additional packages", (char*)arg); }, /*TODO*/
- action { src_prompt("Additional packages", (char*)arg,
+ option {src_legend(menu, "Additional packages", (char*)(((arg_rv*)arg)->arg)); }, /*TODO*/
+ action { src_prompt("Additional packages", (char*)(((arg_rv*)arg)->arg),
sizeof(char) * STRSIZE); };
option MSG_Configure_network,
action {
@@ -574,7 +573,7 @@ menu binpkg, y=-4, x=0, w=70, no box, no
config_network();
mnt_net_config();
};
- option MSG_quit_pkgs_install, exit, action { yesno = SET_SKIP; };
+ option MSG_quit_pkgs_install, exit, action { ((arg_rv*)arg)->rv = SET_SKIP; };
menu pkgsrc, y=-4, x=0, w=70, no box, no clear,
exit, exitstring MSG_Install_pkgsrc;
@@ -612,9 +611,8 @@ menu pkgsrc, y=-4, x=0, w=70, no box, no
action { src_prompt(MSG_Xfer_dir, xfer_dir, sizeof xfer_dir); };
option {src_legend(menu, MSG_delete_xfer_file,
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 = SET_SKIP;};
+ action {clean_xfer_dir = ask_yesno(MSG_delete_xfer_file); };
+ option MSG_quit_pkgsrc, exit, action { *((int*)arg) = SET_SKIP;};
menu usersh, title MSG_User_shell, no clear;
option "/bin/sh", exit, action { ushell = "/bin/sh";};
Index: src/usr.sbin/sysinst/label.c
diff -u src/usr.sbin/sysinst/label.c:1.2 src/usr.sbin/sysinst/label.c:1.2.4.1
--- src/usr.sbin/sysinst/label.c:1.2 Sun Aug 3 16:09:38 2014
+++ src/usr.sbin/sysinst/label.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: label.c,v 1.2 2014/08/03 16:09:38 martin Exp $ */
+/* $NetBSD: label.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Jonathan Stone
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: label.c,v 1.2 2014/08/03 16:09:38 martin Exp $");
+__RCSID("$NetBSD: label.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $");
#endif
#include <sys/types.h>
@@ -672,8 +672,7 @@ edit_and_check_label(partinfo *lp, int n
/*XXX ???*/
msg_display_add(MSG_edit_partitions_again);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return(0);
}
Index: src/usr.sbin/sysinst/mbr.c
diff -u src/usr.sbin/sysinst/mbr.c:1.2.4.2 src/usr.sbin/sysinst/mbr.c:1.2.4.3
--- src/usr.sbin/sysinst/mbr.c:1.2.4.2 Wed Oct 22 12:28:30 2014
+++ src/usr.sbin/sysinst/mbr.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: mbr.c,v 1.2.4.2 2014/10/22 12:28:30 sborrill Exp $ */
+/* $NetBSD: mbr.c,v 1.2.4.3 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -1294,8 +1294,7 @@ edit_mbr(mbr_info_t *mbri)
/* Ask if we really want to blow away non-NetBSD stuff */
if (numbsd > 1) {
msg_display(MSG_ovrwrite);
- process_menu(MENU_noyes, NULL);
- if (!yesno) {
+ if (!ask_noyes(NULL)) {
if (logfp)
(void)fprintf(logfp, "User answered no to destroy other data, aborting.\n");
return 0;
@@ -1356,16 +1355,14 @@ edit_mbr(mbr_info_t *mbri)
else
msg_display(MSG_multbsdpart, 0);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
continue;
}
if (activepart == 0) {
msg_display(MSG_noactivepart);
- process_menu(MENU_yesno, NULL);
- if (yesno)
+ if (ask_yesno(NULL))
continue;
}
/* the md_check_mbr function has 3 ret codes to deal with
Index: src/usr.sbin/sysinst/net.c
diff -u src/usr.sbin/sysinst/net.c:1.2.4.4 src/usr.sbin/sysinst/net.c:1.2.4.5
--- src/usr.sbin/sysinst/net.c:1.2.4.4 Thu May 14 07:11:53 2015
+++ src/usr.sbin/sysinst/net.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: net.c,v 1.2.4.4 2015/05/14 07:11:53 snj Exp $ */
+/* $NetBSD: net.c,v 1.2.4.5 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -456,8 +456,7 @@ handle_license(const char *dev)
&& val != 0)
return 1;
msg_display(MSG_license, dev, licdev[i].lic);
- process_menu(MENU_yesno, NULL);
- if (yesno) {
+ if (ask_yesno(NULL)) {
val = 1;
if (sysctlbyname(buf, NULL, NULL, &val,
0) == -1)
@@ -491,10 +490,9 @@ config_network(void)
int menu_no;
int num_devs;
int selected_net;
-
int i;
#ifdef INET6
- int v6config = 1;
+ int v6config = 1, rv;
#endif
FILE *f;
@@ -715,8 +713,9 @@ again:
if (!(net_dhcpconf & DHCPCONF_NAMESVR)) {
#ifdef INET6
if (v6config) {
- process_menu(MENU_namesrv6, NULL);
- if (!yesno)
+ rv = 0;
+ process_menu(MENU_namesrv6, &rv);
+ if (!rv)
msg_prompt_add(MSG_net_namesrv, net_namesvr,
net_namesvr, sizeof net_namesvr);
} else
@@ -748,9 +747,7 @@ again:
!is_v6kernel() ? "<not supported>" : net_ip6);
#endif
done:
- process_menu(MENU_yesno, deconst(MSG_netok_ok));
-
- if (!yesno)
+ if (!ask_yesno(MSG_netok_ok))
goto again;
run_program(0, "/sbin/ifconfig lo0 127.0.0.1");
@@ -790,8 +787,6 @@ done:
fclose(f);
}
- run_program(0, "/sbin/ifconfig lo0 127.0.0.1");
-
if (net_ip[0] != '\0') {
if (slip) {
/* XXX: needs 'ifconfig sl0 create' much earlier */
@@ -851,14 +846,9 @@ done:
* ping should be verbose, so users can see the cause
* of a network failure.
*/
-
-#ifdef INET6
- if (v6config && network_up) {
+ if (net_defroute[0] != '\0' && network_up)
network_up = !run_program(RUN_DISPLAY | RUN_PROGRESS,
- "/sbin/ping6 -v -c 3 -n -I %s ff02::2", net_dev);
- }
-#endif
-
+ "/sbin/ping -v -c 5 -w 5 -o -n %s", net_defroute);
if (net_namesvr[0] != '\0' && network_up) {
#ifdef INET6
if (strchr(net_namesvr, ':'))
@@ -869,10 +859,6 @@ done:
network_up = !run_program(RUN_DISPLAY | RUN_PROGRESS,
"/sbin/ping -v -c 5 -w 5 -o -n %s", net_namesvr);
}
-
- if (net_defroute[0] != '\0' && network_up)
- network_up = !run_program(RUN_DISPLAY | RUN_PROGRESS,
- "/sbin/ping -v -c 5 -w 5 -o -n %s", net_defroute);
fflush(NULL);
return network_up;
@@ -973,10 +959,11 @@ do_ftp_fetch(const char *set_name, struc
int
get_pkgsrc(void)
{
- yesno = -1;
- process_menu(MENU_pkgsrc, NULL);
+ int rv = -1;
+
+ process_menu(MENU_pkgsrc, &rv);
- if (yesno == SET_SKIP)
+ if (rv == SET_SKIP)
return SET_SKIP;
fetch_fn = pkgsrc_fetch;
@@ -989,10 +976,13 @@ get_pkgsrc(void)
int
get_via_ftp(const char *xfer_type)
{
- yesno = -1;
- process_menu(MENU_ftpsource, deconst(xfer_type));
+ arg_rv arg;
+
+ arg.rv = -1;
+ arg.arg = deconst(xfer_type);
+ process_menu(MENU_ftpsource, &arg);
- if (yesno == SET_RETRY)
+ if (arg.rv == SET_RETRY)
return SET_RETRY;
/* We'll fetch each file just before installing it */
@@ -1010,6 +1000,7 @@ int
get_via_nfs(void)
{
struct statvfs sb;
+ int rv;
/* If root is on NFS and we have sets, skip this step. */
if (statvfs(set_dir_bin, &sb) == 0 &&
@@ -1020,10 +1011,10 @@ get_via_nfs(void)
}
/* Get server and filepath */
- yesno = -1;
- process_menu(MENU_nfssource, NULL);
+ rv = -1;
+ process_menu(MENU_nfssource, &rv);
- if (yesno == SET_RETRY)
+ if (rv == SET_RETRY)
return SET_RETRY;
/* Mount it */
@@ -1073,8 +1064,7 @@ mnt_net_config(void)
if (!network_up)
return;
- process_menu(MENU_yesno, deconst(MSG_mntnetconfig));
- if (!yesno)
+ if (!ask_yesno(MSG_mntnetconfig))
return;
/* Write hostname to /etc/rc.conf */
@@ -1163,8 +1153,7 @@ config_dhcp(char *inter)
if (!file_mode_match(DHCPCD, S_IFREG))
return 0;
- process_menu(MENU_yesno, deconst(MSG_Perform_autoconfiguration));
- if (yesno) {
+ if (ask_yesno(MSG_Perform_autoconfiguration)) {
/* spawn off dhcpcd and wait for parent to exit */
dhcpautoconf = run_program(RUN_DISPLAY | RUN_PROGRESS,
"%s -d -n %s", DHCPCD, inter);
Index: src/usr.sbin/sysinst/partman.c
diff -u src/usr.sbin/sysinst/partman.c:1.4.4.3 src/usr.sbin/sysinst/partman.c:1.4.4.4
--- src/usr.sbin/sysinst/partman.c:1.4.4.3 Sat May 9 13:50:15 2015
+++ src/usr.sbin/sysinst/partman.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: partman.c,v 1.4.4.3 2015/05/09 13:50:15 msaitoh Exp $ */
+/* $NetBSD: partman.c,v 1.4.4.4 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 2012 Eugene Lozovoy
@@ -1695,8 +1695,7 @@ pm_gpt_convert(pm_devs_t *pm_cur)
int i, error = 0;
msg_display(MSG_removepartswarn);
- process_menu(MENU_noyes, NULL);
- if (! yesno)
+ if (!ask_noyes(NULL))
return -1;
if (! pm_cur->gpt)
@@ -2266,8 +2265,7 @@ pm_needsave(void)
/* Oops, we have unsaved changes */
changed = 1;
msg_display(MSG_saveprompt);
- process_menu(MENU_yesno, NULL);
- return (yesno);
+ return ask_yesno(NULL);
}
return 0;
}
@@ -2402,8 +2400,7 @@ pm_submenu(menudesc *m, void *arg)
return -1;
if (pm_cur->blocked) {
msg_display(MSG_wannaunblock);
- process_menu(MENU_noyes, NULL);
- if (!yesno)
+ if (!ask_noyes(NULL))
return -2;
pm_cur->blocked = 0;
}
@@ -2804,8 +2801,7 @@ partman(void)
pm_lastcheck() != 0 ||
pm_savebootsector() != 0) {
msg_display(MSG_wannatry);
- process_menu(MENU_yesno, NULL);
- args[0].retvalue = (yesno) ? 1:-1;
+ args[0].retvalue = (ask_yesno(NULL)) ? 1:-1;
}
}
} while (args[0].retvalue > 0);
Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.3.2.2 src/usr.sbin/sysinst/util.c:1.3.2.3
--- src/usr.sbin/sysinst/util.c:1.3.2.2 Fri Feb 27 11:29:44 2015
+++ src/usr.sbin/sysinst/util.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: util.c,v 1.3.2.2 2015/02/27 11:29:44 martin Exp $ */
+/* $NetBSD: util.c,v 1.3.2.3 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -363,9 +363,10 @@ floppy_fetch(const char *set_name)
int
get_via_floppy(void)
{
- yesno = -1;
- process_menu(MENU_floppysource, NULL);
- if (yesno == SET_RETRY)
+ int rv = -1;
+
+ process_menu(MENU_floppysource, &rv);
+ if (rv == SET_RETRY)
return SET_RETRY;
fetch_fn = floppy_fetch;
@@ -527,7 +528,7 @@ get_via_cdrom(void)
{
menu_ent cd_menu[MAX_CD_INFOS];
struct stat sb;
- int num_cds, menu_cd, i, selected_cd = 0;
+ int rv, num_cds, menu_cd, i, selected_cd = 0;
bool silent = false;
int mib[2];
char rootdev[SSTRSIZE] = "";
@@ -584,9 +585,9 @@ get_via_cdrom(void)
}
/* ask for paths on the CD */
- yesno = -1;
- process_menu(MENU_cdromsource, NULL);
- if (yesno == SET_RETRY)
+ rv = -1;
+ process_menu(MENU_cdromsource, &rv);
+ if (rv == SET_RETRY)
return SET_RETRY;
if (cd_has_sets())
@@ -603,10 +604,11 @@ get_via_cdrom(void)
int
get_via_localfs(void)
{
+ int rv = -1;
+
/* Get device, filesystem, and filepath */
- yesno = -1;
- process_menu (MENU_localfssource, NULL);
- if (yesno == SET_RETRY)
+ process_menu (MENU_localfssource, &rv);
+ if (rv == SET_RETRY)
return SET_RETRY;
/* Mount it */
@@ -631,10 +633,11 @@ get_via_localfs(void)
int
get_via_localdir(void)
{
+ int rv = -1;
+
/* Get filepath */
- yesno = -1;
- process_menu(MENU_localdirsource, NULL);
- if (yesno == SET_RETRY)
+ process_menu(MENU_localdirsource, &rv);
+ if (rv == SET_RETRY)
return SET_RETRY;
/*
@@ -1084,8 +1087,7 @@ get_and_unpack_sets(int update, msg setu
"/usr/sbin/postinstall -s /.sysinst -d / check mailerconf");
if (oldsendmail == 1) {
msg_display(MSG_oldsendmail);
- process_menu(MENU_yesno, NULL);
- if (yesno) {
+ if (ask_yesno(NULL)) {
run_program(RUN_DISPLAY | RUN_CHROOT,
"/usr/sbin/postinstall -s /.sysinst -d / fix mailerconf");
}
@@ -1560,8 +1562,7 @@ del_rc_conf(const char *value)
if (done) {
if (rename(rcconf, bakname)) {
msg_display(MSG_rcconf_backup_failed);
- process_menu(MENU_noyes, NULL);
- if (!yesno) {
+ if (!ask_noyes(NULL)) {
retval = -1;
goto done;
}
@@ -1717,3 +1718,27 @@ safectime(time_t *t)
/*123456789012345678901234*/
return "preposterous clock time\n";
}
+
+int
+ask_yesno(const char* msgtxt)
+{
+ arg_rv p;
+
+ p.arg = deconst(msgtxt);
+ p.rv = -1;
+
+ process_menu(MENU_yesno, &p);
+ return p.rv;
+}
+
+int
+ask_noyes(const char *msgtxt)
+{
+ arg_rv p;
+
+ p.arg = deconst(msgtxt);
+ p.rv = -1;
+
+ process_menu(MENU_noyes, &p);
+ return p.rv;
+}
Index: src/usr.sbin/sysinst/arch/arc/md.c
diff -u src/usr.sbin/sysinst/arch/arc/md.c:1.2.4.1 src/usr.sbin/sysinst/arch/arc/md.c:1.2.4.2
--- src/usr.sbin/sysinst/arch/arc/md.c:1.2.4.1 Sun Jan 11 04:32:38 2015
+++ src/usr.sbin/sysinst/arch/arc/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2.4.1 2015/01/11 04:32:38 snj Exp $ */
+/* $NetBSD: md.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -299,8 +299,7 @@ md_pre_update(void)
if (part->mbrp_size < (MIN_FAT12_BOOT / 512)) {
msg_display(MSG_boottoosmall);
msg_display_add(MSG_nobootpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
nobootfs = 1;
}
@@ -339,16 +338,14 @@ md_check_mbr(mbr_info_t *mbri)
if (pm->bootsize < (MIN_FAT12_BOOT / 512)) {
msg_display(MSG_boottoosmall);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
if (pm->bootstart == 0 || pm->bootsize == 0) {
msg_display(MSG_nobootpart);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
Index: src/usr.sbin/sysinst/arch/atari/md.c
diff -u src/usr.sbin/sysinst/arch/atari/md.c:1.2 src/usr.sbin/sysinst/arch/atari/md.c:1.2.4.1
--- src/usr.sbin/sysinst/arch/atari/md.c:1.2 Sun Aug 3 16:09:39 2014
+++ src/usr.sbin/sysinst/arch/atari/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2 2014/08/03 16:09:39 martin Exp $ */
+/* $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -69,8 +69,7 @@ int
md_make_bsd_partitions(void)
{
msg_display(MSG_infoahdilabel, pm->diskdev);
- process_menu(MENU_noyes, NULL);
- if (yesno) {
+ if (ask_noyes(NULL)) {
run_program(RUN_DISPLAY, "ahdilabel /dev/r%sc", pm->diskdev);
}
if (!make_bsd_partitions())
Index: src/usr.sbin/sysinst/arch/cobalt/md.c
diff -u src/usr.sbin/sysinst/arch/cobalt/md.c:1.2.4.1 src/usr.sbin/sysinst/arch/cobalt/md.c:1.2.4.2
--- src/usr.sbin/sysinst/arch/cobalt/md.c:1.2.4.1 Sun Jan 11 04:32:38 2015
+++ src/usr.sbin/sysinst/arch/cobalt/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2.4.1 2015/01/11 04:32:38 snj Exp $ */
+/* $NetBSD: md.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -317,8 +317,7 @@ md_pre_update(void)
if (part->mbrp_size < (MIN_EXT2FS_BOOT / 512)) {
msg_display(MSG_boottoosmall);
msg_display_add(MSG_nobootpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
nobootfs = 1;
}
@@ -357,16 +356,14 @@ md_check_mbr(mbr_info_t *mbri)
if (pm->bootsize < (MIN_EXT2FS_BOOT / 512)) {
msg_display(MSG_boottoosmall);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
if (pm->bootstart == 0 || pm->bootsize == 0) {
msg_display(MSG_nobootpart);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
Index: src/usr.sbin/sysinst/arch/emips/md.c
diff -u src/usr.sbin/sysinst/arch/emips/md.c:1.2 src/usr.sbin/sysinst/arch/emips/md.c:1.2.4.1
--- src/usr.sbin/sysinst/arch/emips/md.c:1.2 Sun Aug 3 16:09:39 2014
+++ src/usr.sbin/sysinst/arch/emips/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2 2014/08/03 16:09:39 martin Exp $ */
+/* $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -167,9 +167,8 @@ md_post_extract(void)
strlcpy(ldr_path, target_expand("/boot.emips"), sizeof ldr_path);
msg_display(MSG_dobootblks, "");
- process_menu(MENU_noyes, NULL);
- if (yesno) {
+ if (ask_noyes(NULL)) {
if (run_program(RUN_DISPLAY | RUN_NO_CLEAR,
"/bin/dd if=%s of=/dev/reflash0c bs=512", ldr_path))
process_menu(MENU_ok, deconst("Warning: the system "
Index: src/usr.sbin/sysinst/arch/evbarm/md.c
diff -u src/usr.sbin/sysinst/arch/evbarm/md.c:1.2 src/usr.sbin/sysinst/arch/evbarm/md.c:1.2.4.1
--- src/usr.sbin/sysinst/arch/evbarm/md.c:1.2 Sun Aug 3 16:09:39 2014
+++ src/usr.sbin/sysinst/arch/evbarm/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2 2014/08/03 16:09:39 martin Exp $ */
+/* $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -275,8 +275,7 @@ md_check_mbr(mbr_info_t *mbri)
if (!hasboot) {
msg_display(MSG_nomsdospart);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
Index: src/usr.sbin/sysinst/arch/evbarm64/md.c
diff -u src/usr.sbin/sysinst/arch/evbarm64/md.c:1.1.2.2 src/usr.sbin/sysinst/arch/evbarm64/md.c:1.1.2.3
--- src/usr.sbin/sysinst/arch/evbarm64/md.c:1.1.2.2 Wed Dec 31 06:17:24 2014
+++ src/usr.sbin/sysinst/arch/evbarm64/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.1.2.2 2014/12/31 06:17:24 snj Exp $ */
+/* $NetBSD: md.c,v 1.1.2.3 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -275,8 +275,7 @@ md_check_mbr(mbr_info_t *mbri)
if (!hasboot) {
msg_display(MSG_nomsdospart);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
Index: src/usr.sbin/sysinst/arch/hp300/md.c
diff -u src/usr.sbin/sysinst/arch/hp300/md.c:1.2.4.1 src/usr.sbin/sysinst/arch/hp300/md.c:1.2.4.2
--- src/usr.sbin/sysinst/arch/hp300/md.c:1.2.4.1 Sun Jan 11 04:32:38 2015
+++ src/usr.sbin/sysinst/arch/hp300/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2.4.1 2015/01/11 04:32:38 snj Exp $ */
+/* $NetBSD: md.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -150,8 +150,7 @@ md_check_partitions(void)
} else {
if (start >= pm->bsdlabel[part].pi_offset) {
msg_display(MSG_ordering, part+'a');
- process_menu(MENU_yesno, NULL);
- if (yesno)
+ if (ask_yesno(NULL))
return 0;
}
start = pm->bsdlabel[part].pi_offset;
Index: src/usr.sbin/sysinst/arch/i386/md.c
diff -u src/usr.sbin/sysinst/arch/i386/md.c:1.3.2.2 src/usr.sbin/sysinst/arch/i386/md.c:1.3.2.3
--- src/usr.sbin/sysinst/arch/i386/md.c:1.3.2.2 Mon Feb 16 13:52:43 2015
+++ src/usr.sbin/sysinst/arch/i386/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.3.2.2 2015/02/16 13:52:43 martin Exp $ */
+/* $NetBSD: md.c,v 1.3.2.3 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -110,8 +110,7 @@ edit:
if (biosdisk != NULL && (biosdisk->bi_flags & BIFLAG_EXTINT13) == 0) {
if (mbr_root_above_chs()) {
msg_display(MSG_partabovechs);
- process_menu(MENU_noyes, NULL);
- if (!yesno)
+ if (!ask_noyes(NULL))
goto edit;
/* The user is shooting themselves in the foot here...*/
} else
@@ -169,8 +168,7 @@ edit:
* don't all have bootmenu texts.
*/
msg_display(MSG_missing_bootmenu_text);
- process_menu(MENU_yesno, NULL);
- if (yesno)
+ if (ask_yesno(NULL))
goto edit;
}
@@ -178,8 +176,7 @@ edit:
(biosdisk == NULL || !(biosdisk->bi_flags & BIFLAG_EXTINT13))) {
/* Need unsupported LBA reads to read boot sectors */
msg_display(MSG_no_extended_bootmenu);
- process_menu(MENU_noyes, NULL);
- if (!yesno)
+ if (!ask_noyes(NULL))
goto edit;
}
@@ -215,8 +212,7 @@ edit:
/* Existing code would (probably) be ok */
msg_display(MSG_updatembr);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
/* User doesn't want to update mbr code */
return 1;
@@ -226,7 +222,7 @@ edit:
/* This shouldn't happen since the files are in the floppy fs... */
msg_display("Can't find %s", bootcode);
- process_menu(MENU_yesno, NULL);
+ ask_yesno(NULL);
return 1;
}
Index: src/usr.sbin/sysinst/arch/mac68k/md.c
diff -u src/usr.sbin/sysinst/arch/mac68k/md.c:1.2 src/usr.sbin/sysinst/arch/mac68k/md.c:1.2.4.1
--- src/usr.sbin/sysinst/arch/mac68k/md.c:1.2 Sun Aug 3 16:09:40 2014
+++ src/usr.sbin/sysinst/arch/mac68k/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2 2014/08/03 16:09:40 martin Exp $ */
+/* $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -239,7 +239,7 @@ int
md_make_bsd_partitions(void)
{
FILE *f;
- int i, j, pl;
+ int i, j, pl, rv;
EBZB *bzb;
/*
@@ -250,10 +250,10 @@ md_make_bsd_partitions(void)
*/
while (1) {
if (check_for_errors()) {
- process_menu (MENU_sanity, NULL);
- if (yesno < 0)
+ process_menu (MENU_sanity, &rv);
+ if (rv < 0)
return 0;
- else if (yesno)
+ else if (rv)
break;
edit_diskmap();
} else
@@ -1141,8 +1141,7 @@ edit_diskmap(void)
if (usefull) {
if (map.usable_cnt > (map.root_cnt+map.swap_cnt+map.usr_cnt)) {
msg_display (MSG_ovrwrite);
- process_menu (MENU_noyes, NULL);
- if (!yesno) {
+ if (!ask_noyes(NULL)) {
endwin();
return 0;
}
@@ -1167,7 +1166,7 @@ md_debug_dump(title)
{
char buf[96], type;
char fstyp[16], use[16], name[64];
- int i, j;
+ int i, j, rv;
EBZB *bzb;
msg_clear();
@@ -1188,9 +1187,9 @@ md_debug_dump(title)
map.blk[i].pmPyPartStart, fstyp, use, name);
msg_table_add(MSG_dump_line, buf);
}
- process_menu(MENU_okabort, NULL);
+ process_menu(MENU_okabort, &rv);
msg_clear();
- return(yesno);
+ return rv;
}
#endif /* MD_DEBUG_SORT_MERGE */
Index: src/usr.sbin/sysinst/arch/mac68k/menus.md.de
diff -u src/usr.sbin/sysinst/arch/mac68k/menus.md.de:1.2 src/usr.sbin/sysinst/arch/mac68k/menus.md.de:1.2.4.1
--- src/usr.sbin/sysinst/arch/mac68k/menus.md.de:1.2 Sun Aug 3 16:09:40 2014
+++ src/usr.sbin/sysinst/arch/mac68k/menus.md.de Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.md.de,v 1.2 2014/08/03 16:09:40 martin Exp $ */
+/* $NetBSD: menus.md.de,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -44,12 +44,12 @@ menu nodiskmap, title "Bitte w�hlen Sie"
endwin(); exit(1);
};
option "Initialisiere Festplatten Partition �bersicht", exit, action {
- int i;
+ int i, rv;
msg_clear();
msg_display (MSG_okwritediskmap);
- process_menu (MENU_okabort, NULL);
- if (!yesno) {
+ process_menu (MENU_okabort, &rv);
+ if (!rv) {
endwin();
return 0;
}
@@ -77,7 +77,7 @@ menu editparttable, title "W�hlen Sie e
option "Ausgew�hlte Partition bearbeiten", sub menu chooseid;
option "Mount Point festlegen", sub menu mount_point;
option "Gew�hlte Partition unterteilen", action {
- int i, j, k, size, free_size;
+ int i, j, k, size, free_size, rv;
char buf[40];
EBZB *bzb;
@@ -112,8 +112,8 @@ menu editparttable, title "W�hlen Sie e
sortmerge();
} else {
msg_display (MSG_diskfull);
- process_menu (MENU_okabort, NULL);
- if (!yesno) {
+ process_menu (MENU_okabort, &rv);
+ if (!rv) {
free (map.blk);
map.size = NEW_MAP_SIZE;
map.in_use_cnt = new_map[0].pmMapBlkCnt;
@@ -152,8 +152,8 @@ menu ok2, title "Abbrechen?", y=17;
option "OK", exit, action { };
menu okabort, title "Was m�chten Sie?", y=17;
- option "Fortfahren", exit, action { yesno = 1; };
- option "Installation abbrechen", exit, action { yesno = 0; };
+ option "Fortfahren", exit, action { *((int*)arg) = 1; };
+ option "Installation abbrechen", exit, action { *((int*)arg) = 0; };
menu chooseid, title "Partitionstyp?";
option "NetBSD Root", exit, action {
@@ -321,9 +321,9 @@ menu mount_point, title "Mount Point?";
menu sanity, title "Bitte w�hlen Sie";
display action {msg_display (MSG_sanity_check);
report_errors(); };
- option "Installation abbrechen", exit, action {yesno = -1; };
- option "Warnungen ignorieren und fortfahren", exit, action {yesno = 1;};
- option "Festplatten Partitions �bersicht erneut �ndern", exit, action {yesno = 0; };
+ option "Installation abbrechen", exit, action { *((int*)arg) = -1; };
+ option "Warnungen ignorieren und fortfahren", exit, action { *((int*)arg) = 1;};
+ option "Festplatten Partitions �bersicht erneut �ndern", exit, action { *((int*)arg) = 0; };
/*
* This menu shouldn't be used in the mac68k port, but it needs to be
Index: src/usr.sbin/sysinst/arch/mac68k/menus.md.en
diff -u src/usr.sbin/sysinst/arch/mac68k/menus.md.en:1.2 src/usr.sbin/sysinst/arch/mac68k/menus.md.en:1.2.4.1
--- src/usr.sbin/sysinst/arch/mac68k/menus.md.en:1.2 Sun Aug 3 16:09:40 2014
+++ src/usr.sbin/sysinst/arch/mac68k/menus.md.en Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.md.en,v 1.2 2014/08/03 16:09:40 martin Exp $ */
+/* $NetBSD: menus.md.en,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -44,12 +44,12 @@ menu nodiskmap, title "Choose an option"
endwin(); exit(1);
};
option "Initialize Disk partition Map", exit, action {
- int i;
+ int i, rv;
msg_clear();
msg_display (MSG_okwritediskmap);
- process_menu (MENU_okabort, NULL);
- if (!yesno) {
+ process_menu (MENU_okabort, &rv);
+ if (!rv) {
endwin();
return 0;
}
@@ -77,7 +77,7 @@ menu editparttable, title "Choose your
option "Change selected partition", sub menu chooseid;
option "Set mount point for partition", sub menu mount_point;
option "Split selected partition", action {
- int i, j, k, size, free_size;
+ int i, j, k, size, free_size, rv;
char buf[40];
EBZB *bzb;
@@ -112,8 +112,8 @@ menu editparttable, title "Choose your
sortmerge();
} else {
msg_display (MSG_diskfull);
- process_menu (MENU_okabort, NULL);
- if (!yesno) {
+ process_menu (MENU_okabort, &rv);
+ if (!rv) {
free (map.blk);
map.size = NEW_MAP_SIZE;
map.in_use_cnt = new_map[0].pmMapBlkCnt;
@@ -152,8 +152,8 @@ menu ok2, title "Abort?", y=17;
option "OK", exit, action { };
menu okabort, title "What do you want to do?", y=17;
- option "Continue", exit, action { yesno = 1; };
- option "Abort install", exit, action { yesno = 0; };
+ option "Continue", exit, action { *((int*)arg) = 1; };
+ option "Abort install", exit, action { *((int*)arg) = 0; };
menu chooseid, title "Partition Type?";
option "NetBSD Root", exit, action {
@@ -321,9 +321,9 @@ menu mount_point, title "Mount Point?";
menu sanity, title "Choose an option";
display action {msg_display (MSG_sanity_check);
report_errors(); };
- option "Abort installation", exit, action {yesno = -1; };
- option "Ignore warnings and continue", exit, action {yesno = 1;};
- option "Re-edit Disk Partition Map", exit, action {yesno = 0; };
+ option "Abort installation", exit, action { *((int*)arg) = -1; };
+ option "Ignore warnings and continue", exit, action { *((int*)arg) = 1;};
+ option "Re-edit Disk Partition Map", exit, action { *((int*)arg) = 0; };
/*
* This menu shouldn't be used in the mac68k port, but it needs to be
Index: src/usr.sbin/sysinst/arch/mac68k/menus.md.es
diff -u src/usr.sbin/sysinst/arch/mac68k/menus.md.es:1.2 src/usr.sbin/sysinst/arch/mac68k/menus.md.es:1.2.4.1
--- src/usr.sbin/sysinst/arch/mac68k/menus.md.es:1.2 Sun Aug 3 16:09:40 2014
+++ src/usr.sbin/sysinst/arch/mac68k/menus.md.es Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.md.es,v 1.2 2014/08/03 16:09:40 martin Exp $ */
+/* $NetBSD: menus.md.es,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -44,12 +44,12 @@ menu nodiskmap, title "Escoja una opcion
endwin(); exit(1);
};
option "Inicializar Mapa de particiones de Disco", exit, action {
- int i;
+ int i, rv;
msg_clear();
msg_display (MSG_okwritediskmap);
- process_menu (MENU_okabort, NULL);
- if (!yesno) {
+ process_menu (MENU_okabort, &rv);
+ if (!rv) {
endwin();
return 0;
}
@@ -77,7 +77,7 @@ menu editparttable, title "Escoja su pa
option "Cambiar particion seleccionada", sub menu chooseid;
option "Ajustar punto de montaje para particion", sub menu mount_point;
option "Partir particion seleccionada", action {
- int i, j, k, size, free_size;
+ int i, j, k, size, free_size, rv;
char buf[40];
EBZB *bzb;
@@ -112,8 +112,8 @@ menu editparttable, title "Escoja su pa
sortmerge();
} else {
msg_display (MSG_diskfull);
- process_menu (MENU_okabort, NULL);
- if (!yesno) {
+ process_menu (MENU_okabort, &rv);
+ if (!rv) {
free (map.blk);
map.size = NEW_MAP_SIZE;
map.in_use_cnt = new_map[0].pmMapBlkCnt;
@@ -152,8 +152,8 @@ menu ok2, title "�Abortar?", y=17;
option "OK", exit, action { };
menu okabort, title "�Que quiere hacer?", y=17;
- option "Continuar", exit, action { yesno = 1; };
- option "Abortar instalacion", exit, action { yesno = 0; };
+ option "Continuar", exit, action { *((int*)arg) = 1; };
+ option "Abortar instalacion", exit, { *((int*)arg) = 0; };
menu chooseid, title "�Tipo de particion?";
option "NetBSD Root", exit, action {
@@ -321,9 +321,9 @@ menu mount_point, title "�Punto de mont
menu sanity, title "Escoja una opcion";
display action {msg_display (MSG_sanity_check);
report_errors(); };
- option "Abortar instalacion", exit, action {yesno = -1; };
- option "Ignorar avisos y continuar", exit, action {yesno = 1;};
- option "Re-editar Mapa de Particiones de Disco", exit, action {yesno = 0; };
+ option "Abortar instalacion", exit, action { *((int*)arg) = -1; };
+ option "Ignorar avisos y continuar", exit, action { *((int*)arg) = 1;};
+ option "Re-editar Mapa de Particiones de Disco", exit, action { *((int*)arg) = 0; };
/*
* This menu shouldn't be used in the mac68k port, but it needs to be
Index: src/usr.sbin/sysinst/arch/mac68k/menus.md.pl
diff -u src/usr.sbin/sysinst/arch/mac68k/menus.md.pl:1.2 src/usr.sbin/sysinst/arch/mac68k/menus.md.pl:1.2.4.1
--- src/usr.sbin/sysinst/arch/mac68k/menus.md.pl:1.2 Sun Aug 3 16:09:40 2014
+++ src/usr.sbin/sysinst/arch/mac68k/menus.md.pl Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.md.pl,v 1.2 2014/08/03 16:09:40 martin Exp $ */
+/* $NetBSD: menus.md.pl,v 1.2.4.1 2015/05/14 07:58:49 snj Exp $ */
/* Based on english version: */
/* NetBSD: menus.md.en,v 1.13 2001/11/29 23:20:58 thorpej Exp */
@@ -46,12 +46,12 @@ menu nodiskmap, title "Wybierz opcje", y
endwin(); exit(1);
};
option "Zainicjuj Mape partycji Dysku", exit, action {
- int i;
+ int i, rv;
msg_clear();
msg_display (MSG_okwritediskmap);
- process_menu (MENU_okabort, NULL);
- if (!yesno) {
+ process_menu (MENU_okabort, &rv);
+ if (!rv) {
endwin();
return 0;
}
@@ -79,7 +79,7 @@ menu editparttable, title "Wybierz swoj
option "Zmien wybrana partycje", sub menu chooseid;
option "Ustaw punkt montazu dla partycji", sub menu mount_point;
option "Podziel wybrana partycje", action {
- int i, j, k, size, free_size;
+ int i, j, k, size, free_size, rv;
char buf[40];
EBZB *bzb;
@@ -114,8 +114,8 @@ menu editparttable, title "Wybierz swoj
sortmerge();
} else {
msg_display (MSG_diskfull);
- process_menu (MENU_okabort, NULL);
- if (!yesno) {
+ process_menu (MENU_okabort, &rv);
+ if (!rv) {
free (map.blk);
map.size = NEW_MAP_SIZE;
map.in_use_cnt = new_map[0].pmMapBlkCnt;
@@ -154,8 +154,8 @@ menu ok2, title "Przerwac?", y=17;
option "OK", exit, action { };
menu okabort, title "Co chcesz zrobic?";
- option "OK", exit, action { yesno = 1; };
- option "Przerwac instalacje", exit, action { yesno = 0; };
+ option "OK", exit, action { *((int*)arg) = 1; };
+ option "Przerwac instalacje", exit, action { *((int*)arg) = 0; };
menu chooseid, title "Rodzaj partycji?";
option "NetBSD Root", exit, action {
@@ -323,9 +323,9 @@ menu mount_point, title "Punkt montazu?
menu sanity, title "Wybierz opcje";
display action {msg_display (MSG_sanity_check);
report_errors(); };
- option "Przerwij instalacje", exit, action {yesno = -1; };
- option "Zignoruj ostrzezenia i kontynuuj", exit, action {yesno = 1;};
- option "Ponownie wyedytuj mape partycji dysku", exit, action {yesno = 0; };
+ option "Przerwij instalacje", exit, action { *((int*)arg) = -1; };
+ option "Zignoruj ostrzezenia i kontynuuj", exit, action { *((int*)arg) = 1;};
+ option "Ponownie wyedytuj mape partycji dysku", exit, action { *((int*)arg) = 0; };
/*
* This menu shouldn't be used in the mac68k port, but it needs to be
Index: src/usr.sbin/sysinst/arch/mvme68k/md.c
diff -u src/usr.sbin/sysinst/arch/mvme68k/md.c:1.2.4.1 src/usr.sbin/sysinst/arch/mvme68k/md.c:1.2.4.2
--- src/usr.sbin/sysinst/arch/mvme68k/md.c:1.2.4.1 Sun Jan 11 04:32:38 2015
+++ src/usr.sbin/sysinst/arch/mvme68k/md.c Thu May 14 07:58:49 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2.4.1 2015/01/11 04:32:38 snj Exp $ */
+/* $NetBSD: md.c,v 1.2.4.2 2015/05/14 07:58:49 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -148,8 +148,7 @@ md_check_partitions(void)
} else {
if (start > pm->bsdlabel[part].pi_offset) {
msg_display(MSG_ordering, part+'a');
- process_menu(MENU_yesno, NULL);
- if (yesno)
+ if (ask_yesno(NULL))
return 0;
}
start = pm->bsdlabel[part].pi_offset;
Index: src/usr.sbin/sysinst/arch/ofppc/md.c
diff -u src/usr.sbin/sysinst/arch/ofppc/md.c:1.2 src/usr.sbin/sysinst/arch/ofppc/md.c:1.2.4.1
--- src/usr.sbin/sysinst/arch/ofppc/md.c:1.2 Sun Aug 3 16:09:40 2014
+++ src/usr.sbin/sysinst/arch/ofppc/md.c Thu May 14 07:58:50 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2 2014/08/03 16:09:40 martin Exp $ */
+/* $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:50 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -433,8 +433,7 @@ md_pre_update(void)
part->mbrp_size < (MIN_FAT12_BOOT/512)) {
msg_display(MSG_boottoosmall);
msg_display_add(MSG_nobootpartdisklabel, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
nobootfix = 1;
}
@@ -498,8 +497,7 @@ md_check_mbr(mbr_info_t *mbri)
bprepsize >= (MIN_PREP_BOOT/512)))) {
msg_display(MSG_bootnotright);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
@@ -510,8 +508,7 @@ md_check_mbr(mbr_info_t *mbri)
bprepsize < (MIN_PREP_BOOT/512))) {
msg_display(MSG_preptoosmall);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
@@ -520,8 +517,7 @@ md_check_mbr(mbr_info_t *mbri)
if (pm->bootsize > 0 && pm->bootsize < (MIN_FAT12_BOOT/512)) {
msg_display(MSG_boottoosmall);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
@@ -532,8 +528,7 @@ md_check_mbr(mbr_info_t *mbri)
bprepsize == 0 || bprepstart == 0)) {
msg_display(MSG_nobootpart);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
Index: src/usr.sbin/sysinst/arch/prep/md.c
diff -u src/usr.sbin/sysinst/arch/prep/md.c:1.2 src/usr.sbin/sysinst/arch/prep/md.c:1.2.4.1
--- src/usr.sbin/sysinst/arch/prep/md.c:1.2 Sun Aug 3 16:09:40 2014
+++ src/usr.sbin/sysinst/arch/prep/md.c Thu May 14 07:58:50 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2 2014/08/03 16:09:40 martin Exp $ */
+/* $NetBSD: md.c,v 1.2.4.1 2015/05/14 07:58:50 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -138,13 +138,14 @@ int
md_post_extract(void)
{
char rawdev[100], bootpart[100], bootloader[100];
+ int contype;
/* if we can't make it bootable, just punt */
if (prep_nobootfix)
return 0;
- process_menu(MENU_prepconsole, NULL);
- if (yesno == 1)
+ process_menu(MENU_prepconsole, &contype);
+ if (contype == 1)
snprintf(bootloader, 100, "/usr/mdec/boot_com0");
else
snprintf(bootloader, 100, "/usr/mdec/boot");
@@ -191,8 +192,7 @@ md_pre_update(void)
if (part->mbrp_size < (MIN_PREP_BOOT/512)) {
msg_display(MSG_preptoosmall);
msg_display_add(MSG_prepnobootpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
prep_nobootfix = 1;
}
@@ -233,16 +233,14 @@ md_check_mbr(mbr_info_t *mbri)
if (pm->bootsize < (MIN_PREP_BOOT/512)) {
msg_display(MSG_preptoosmall);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
if (pm->bootstart == 0 || pm->bootsize == 0) {
msg_display(MSG_nopreppart);
msg_display_add(MSG_reeditpart, 0);
- process_menu(MENU_yesno, NULL);
- if (!yesno)
+ if (!ask_yesno(NULL))
return 0;
return 1;
}
Index: src/usr.sbin/sysinst/arch/prep/menus.md.en
diff -u src/usr.sbin/sysinst/arch/prep/menus.md.en:1.1 src/usr.sbin/sysinst/arch/prep/menus.md.en:1.1.4.1
--- src/usr.sbin/sysinst/arch/prep/menus.md.en:1.1 Sat Jul 26 19:30:46 2014
+++ src/usr.sbin/sysinst/arch/prep/menus.md.en Thu May 14 07:58:50 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: menus.md.en,v 1.1 2014/07/26 19:30:46 dholland Exp $ */
+/* $NetBSD: menus.md.en,v 1.1.4.1 2015/05/14 07:58:50 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -35,5 +35,5 @@
/* Menu definitions for sysinst. prep version, machine dependent. */
menu prepconsole, title "Select console device", y=-10;
- option "com0 (S1)", exit, action { yesno = 1; };
- option "VGA", exit, action { yesno = 0; };
+ option "com0 (S1)", exit, action { *((int*)arg) = 1; };
+ option "VGA", exit, action { *((int*)arg) = 0; };
Index: src/usr.sbin/sysinst/arch/x68k/md.c
diff -u src/usr.sbin/sysinst/arch/x68k/md.c:1.2.4.1 src/usr.sbin/sysinst/arch/x68k/md.c:1.2.4.2
--- src/usr.sbin/sysinst/arch/x68k/md.c:1.2.4.1 Sun Jan 11 04:32:39 2015
+++ src/usr.sbin/sysinst/arch/x68k/md.c Thu May 14 07:58:50 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.2.4.1 2015/01/11 04:32:39 snj Exp $ */
+/* $NetBSD: md.c,v 1.2.4.2 2015/05/14 07:58:50 snj Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -176,8 +176,7 @@ md_check_partitions(void)
} else {
if (start >= pm->bsdlabel[part].pi_offset) {
msg_display(MSG_ordering, part+'a');
- process_menu(MENU_yesno, NULL);
- if (yesno)
+ if (ask_yesno(NULL))
return 0;
}
start = pm->bsdlabel[part].pi_offset;
@@ -200,8 +199,7 @@ md_check_partitions(void)
break;
if (memcmp(md_disklabel.dosparts[i].dp_typename, "Human68k", 8)) {
msg_display(MSG_existing);
- process_menu(MENU_noyes);
- preserve = yesno;
+ preserve = ask_noyes(NULL);
break;
}
}