Don't continue if we don't get a /, swap and a /usr or 80Mb in /.
This commit is contained in:
parent
1b2b8288a5
commit
72f0a6c2c9
@ -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;
|
||||
|
@ -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) {
|
||||
|
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user