diff --git a/sbin/sysinstall/main.c b/sbin/sysinstall/main.c index 61fe8245d86d..5ce06ce3dd24 100644 --- a/sbin/sysinstall/main.c +++ b/sbin/sysinstall/main.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: main.c,v 1.3 1994/10/20 06:14:29 phk Exp $ + * $Id: main.c,v 1.4 1994/10/20 06:48:39 phk Exp $ * */ @@ -18,7 +18,6 @@ #include #include -#include #include @@ -61,6 +60,8 @@ jmp_buf jmp_restart; * execl("/sbin/init"); */ +extern int alloc_memory(); + int main(int argc, char **argv) { @@ -86,6 +87,9 @@ main(int argc, char **argv) /* If we haven't crashed I guess dialog is running ! */ dialog_active = 1; + if (alloc_memory() < 0) + Fatal("No memory\n"); + setjmp(jmp_restart); if (getenv("STAGE0") || !access("/this_is_boot_flp",R_OK)) { @@ -112,7 +116,7 @@ main(int argc, char **argv) } else if (getenv("STAGE3")) { stage3(); } else { - fprintf(stderr,"Must setenv STAGE0 or STAGE3"); + fprintf(stderr,"Must setenv STAGE0 or STAGE3\n"); } return 0; } diff --git a/sbin/sysinstall/stage0.c b/sbin/sysinstall/stage0.c index 7ba854704335..c5483e88bc5d 100644 --- a/sbin/sysinstall/stage0.c +++ b/sbin/sysinstall/stage0.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id$ + * $Id: stage0.c,v 1.2 1994/10/20 04:59:56 phk Exp $ * */ @@ -15,7 +15,6 @@ #include #include -#include #include #include "sysinstall.h" @@ -24,11 +23,11 @@ void stage0() { if (!access(README_FILE, R_OK)) { - clear(); - dialog_textbox("READ ME FIRST", README_FILE, 25, 80); + dialog_clear(); + dialog_textbox("READ ME FIRST", README_FILE, 24, 80); } if (!access(COPYRIGHT_FILE, R_OK)) { - clear(); - dialog_textbox("COPYRIGHT", COPYRIGHT_FILE, 25, 80); + dialog_clear(); + dialog_textbox("COPYRIGHT", COPYRIGHT_FILE, 24, 80); } } diff --git a/sbin/sysinstall/stage1.c b/sbin/sysinstall/stage1.c index a946aad718b4..035ed86ece6a 100644 --- a/sbin/sysinstall/stage1.c +++ b/sbin/sysinstall/stage1.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -189,7 +188,7 @@ select_disk() AskAbort(scratch); valid = 0; } - clear(); + dialog_clear(); } while (!valid); return(atoi(selection) - 1); } @@ -220,12 +219,12 @@ select_partition(int disk) AskAbort(scratch); valid = 0; } - clear(); + dialog_clear(); choice = atoi(selection); if (!choice) if (dialog_yesno(TITLE, "Installing to the whole disk will erase all its present data.\n\nAre you sure you want to do this?", 10, 75)) valid = 0; - clear(); + dialog_clear(); } while (!valid); return(atoi(selection) - 1); @@ -238,7 +237,6 @@ stage1() int ok = 0; int ready = 0; - alloc_memory(); while (!ready) { ready = 1; @@ -257,7 +255,7 @@ stage1() AskAbort(scratch); if (!dialog_yesno(TITLE, "Are you sure you wish to proceed?", 10, 75)) { - clear(); + dialog_clear(); clear_mbr(mbr); ok = 1; } @@ -267,7 +265,7 @@ stage1() if (custom_install) if (!dialog_yesno(TITLE, "Do you wish to edit the DOS partition table?", 10, 75)) { - clear(); + dialog_clear(); edit_mbr(mbr, &avail_disklabels[inst_disk]); } @@ -281,7 +279,7 @@ stage1() sprintf(scratch, "The DOS partition table is inconsistent.\n\n%s\n\nDo you wish to edit it by hand?", errmsg); if (!dialog_yesno(TITLE, scratch, 10, 75)) { edit_mbr(mbr, &avail_disklabels[inst_disk]); - clear(); + dialog_clear(); } else { AskAbort(""); ok = 1; @@ -300,7 +298,7 @@ stage1() AskAbort(""); ready = 0; } - clear(); + dialog_clear(); } } diff --git a/sbin/sysinstall/stage2.c b/sbin/sysinstall/stage2.c index 3a7e0e4b49a3..200d3edba603 100644 --- a/sbin/sysinstall/stage2.c +++ b/sbin/sysinstall/stage2.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: stage2.c,v 1.1 1994/10/20 04:59:58 phk Exp $ + * $Id: stage2.c,v 1.2 1994/10/20 06:48:40 phk Exp $ * */ @@ -18,7 +18,6 @@ #include #include -#include #include #include diff --git a/sbin/sysinstall/stage3.c b/sbin/sysinstall/stage3.c index c2996dc66f46..b14c056cd5f2 100644 --- a/sbin/sysinstall/stage3.c +++ b/sbin/sysinstall/stage3.c @@ -6,14 +6,13 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id$ + * $Id: stage3.c,v 1.2 1994/10/20 04:59:58 phk Exp $ * */ #include #include #include -#include #include #include #include @@ -136,9 +135,9 @@ stage3() unlink("/sbin/oinit"); TellEm("link /stand/sysinstall /sbin/init"); link("/stand/sysinstall", "/sbin/init"); - clear(); - refresh(); - endwin(); + dialog_clear(); + dialog_update(); + end_dialog(); close(0); close(1); close(2); diff --git a/sbin/sysinstall/sysinstall.c b/sbin/sysinstall/sysinstall.c index 16b263bad41b..a45f603d07b9 100644 --- a/sbin/sysinstall/sysinstall.c +++ b/sbin/sysinstall/sysinstall.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -76,7 +75,7 @@ abort_installation(char *prompt) strcat(scratch,"\n\n Do you wish to abort the installation ?"); if (!dialog_yesno("Abort installation ?",scratch,10,75)) exit_prompt(); - clear(); + dialog_clear(); } void @@ -85,7 +84,7 @@ exit_prompt() sprintf(scratch,"Are you sure you want to exit sysinstall?"); if (!dialog_yesno("Exit sysinstall",scratch,10,75)) exit_sysinstall(); - clear(); + dialog_clear(); } int @@ -257,7 +256,7 @@ select_disk() abort_installation(scratch); valid = 0; } - clear(); + dialog_clear(); } while (!valid); return(atoi(selection) - 1); } @@ -288,12 +287,12 @@ select_partition(int disk) abort_installation(scratch); valid = 0; } - clear(); + dialog_clear(); choice = atoi(selection); if (!choice) if (dialog_yesno(title, "Installing to the whole disk will erase all its present data.\n\nAre you sure you want to do this?", 10, 75)) valid = 0; - clear(); + dialog_clear(); } while (!valid); return(atoi(selection) - 1); @@ -528,7 +527,7 @@ stage1() abort_installation(scratch); if (!dialog_yesno(title, "Are you sure you wish to proceed?", 10, 75)) { - clear(); + dialog_clear(); clear_mbr(mbr); ok = 1; } @@ -538,7 +537,7 @@ stage1() if (custom_install) if (!dialog_yesno(title, "Do you wish to edit the DOS partition table?", 10, 75)) { - clear(); + dialog_clear(); edit_mbr(mbr, &avail_disklabels[inst_disk]); } @@ -552,7 +551,7 @@ stage1() sprintf(scratch, "The DOS partition table is inconsistent.\n\n%s\n\nDo you wish to edit it by hand?", errmsg); if (!dialog_yesno(title, scratch, 10, 75)) { edit_mbr(mbr, &avail_disklabels[inst_disk]); - clear(); + dialog_clear(); } else { abort_installation(""); ok = 1; @@ -571,7 +570,7 @@ stage1() abort_installation(""); ready = 0; } - clear(); + dialog_clear(); } } diff --git a/sbin/sysinstall/termcap.c b/sbin/sysinstall/termcap.c index a6d7e4998eff..cdb8d5ec7b5c 100644 --- a/sbin/sysinstall/termcap.c +++ b/sbin/sysinstall/termcap.c @@ -17,8 +17,6 @@ #include #include #include -#include -#include #include #include "sysinstall.h" diff --git a/sbin/sysinstall/utils.c b/sbin/sysinstall/utils.c index c5a0382f9201..59f467a60744 100644 --- a/sbin/sysinstall/utils.c +++ b/sbin/sysinstall/utils.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: utils.c,v 1.2 1994/10/20 05:00:00 phk Exp $ + * $Id: utils.c,v 1.3 1994/10/20 06:48:40 phk Exp $ * */ @@ -16,7 +16,6 @@ #include #include #include -#include #include #include @@ -51,6 +50,7 @@ Fatal(char *fmt, ...) va_end(ap); dialog_msgbox("Fatal", p, 12, 75, 1); free(p); + end_dialog(); exit(7); }