diff options
author | phk <phk@FreeBSD.org> | 1994-11-12 05:40:28 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1994-11-12 05:40:28 +0000 |
commit | 72f0a6c2c9f28ecf1ee7eb7b0447b978c79e4f22 (patch) | |
tree | fa827631702e0c8ab3473d29893894c1b2c10945 /sbin | |
parent | 1b2b8288a57b07a3296b0b7d8d5625facf341009 (diff) | |
download | FreeBSD-src-72f0a6c2c9f28ecf1ee7eb7b0447b978c79e4f22.zip FreeBSD-src-72f0a6c2c9f28ecf1ee7eb7b0447b978c79e4f22.tar.gz |
Don't continue if we don't get a /, swap and a /usr or 80Mb in /.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/sysinstall/main.c | 9 | ||||
-rw-r--r-- | sbin/sysinstall/stage1.c | 39 | ||||
-rw-r--r-- | sbin/sysinstall/sysinstall.h | 2 |
3 files changed, 42 insertions, 8 deletions
diff --git a/sbin/sysinstall/main.c b/sbin/sysinstall/main.c index 654bd91..03c537d 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.13 1994/11/08 18:44:14 jkh Exp $ + * $Id: main.c,v 1.14 1994/11/11 23:22:56 jkh Exp $ * */ @@ -89,8 +89,11 @@ main(int argc, char **argv) end_dialog(); dialog_active=0; } else if (!access("/this_is_boot_flp",R_OK)) { - stage0(); - stage1(); + while(1) { + stage0(); + if(!stage1()) + break; + } stage2(); end_dialog(); dialog_active=0; diff --git a/sbin/sysinstall/stage1.c b/sbin/sysinstall/stage1.c index eba98c1..4399f34 100644 --- a/sbin/sysinstall/stage1.c +++ b/sbin/sysinstall/stage1.c @@ -253,13 +253,15 @@ select_partition(int disk) return(choice); } -void +int stage1() { int i,j; + int ret=1; int ok = 0; int ready = 0; int foundroot=0,foundusr=0,foundswap=0; + char *complaint=0; query_disks(); /* @@ -318,15 +320,43 @@ stage1() } mvprintw(21, 0, "Commands available:"); - mvprintw(22, 0, "(H)elp (F)disk (D)isklabel (Q)uit"); + mvprintw(22, 0, "(H)elp (F)disk (D)isklabel (P)roceed (Q)uit"); + if(complaint) { + standout(); + mvprintw(24, 0, complaint); + standend(); + complaint = 0; + } mvprintw(23, 0, "Enter Command> "); i = getch(); switch(i) { case 'h': case 'H': ShowFile(HELPME_FILE,"Help file for disklayout"); break; + case 'p': case 'P': + foundroot=0,foundusr=0,foundswap=0; + for (i = 1; Fmount[i]; i++) { + if(!strcmp(Fmount[i],"/")) foundroot=i; + if(!strcmp(Fmount[i],"swap")) foundswap=i; + if(!strcmp(Fmount[i],"/usr")) foundusr=i; + } + if (!foundroot) { + complaint = "You must assign something to mount on '/'"; + break; + } + if (!foundroot) { + complaint = "You must assign something to mount on 'swap'"; + break; + } + if (!foundusr && Fsize[foundroot] < 80) { + complaint = "You must assign something to mount on '/usr'"; + break; + } + ret = 0; + goto leave; case 'q': case 'Q': - return; + ret = 1; + goto leave; case 'f': case 'F': Fdisk(); query_disks(); @@ -338,10 +368,11 @@ stage1() beep(); } } +leave: clear(); for (i = 0; Dname[i]; i++) close(Dfd[i]); - return; + return ret; } #if 0 while (!ready) { diff --git a/sbin/sysinstall/sysinstall.h b/sbin/sysinstall/sysinstall.h index 831c63a..e7575df 100644 --- a/sbin/sysinstall/sysinstall.h +++ b/sbin/sysinstall/sysinstall.h @@ -113,7 +113,7 @@ int exec __P((int magic, char *cmd, char *args, ...)); void stage0 __P((void)); /* stage1.c */ -void stage1 __P((void)); +int stage1 __P((void)); /* stage2.c */ void stage2 __P((void)); |