label.c Make sure we always show 8 disk-partitions.

main.c	sanitize the logic of what we do when:

if(getpid()!=1) do stage0 & stage1  (very useful actually)
else if (floppy-marker-file is there) stage0-2, reboot
else stage3-5
This commit is contained in:
Poul-Henning Kamp 1994-11-06 04:05:45 +00:00
parent 8a364f2218
commit 6b25616b3b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4197
2 changed files with 13 additions and 6 deletions

View File

@ -430,6 +430,12 @@ DiskLabel()
hd = lbl->d_ntracks;
sec = lbl->d_nsectors;
tsec = lbl->d_secperunit;
for (i = lbl->d_npartitions; i < MAXPARTITIONS; i++) {
lbl->d_partitions[i].p_offset = 0;
lbl->d_partitions[i].p_size = 0;
lbl->d_partitions[i].p_fstype = 0;
}
lbl->d_npartitions = MAXPARTITIONS;
while(!done) {
clear(); standend();
if (yip) {
@ -447,8 +453,6 @@ DiskLabel()
mvprintw(j++, 0, "Part Start End Blocks MB Type Mountpoint");
for (i = 0; i < MAXPARTITIONS; i++) {
mvprintw(j++, 0, "%c ", 'a'+i);
if (i >= lbl->d_npartitions)
continue;
printw(" %8u %8u %8u %5u ",
lbl->d_partitions[i].p_offset,
lbl->d_partitions[i].p_offset+

View File

@ -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.9 1994/10/29 10:01:34 phk Exp $
* $Id: main.c,v 1.10 1994/11/01 10:10:24 phk Exp $
*
*/
@ -69,12 +69,15 @@ main(int argc, char **argv)
if (alloc_memory() < 0)
Fatal("No memory\n");
setjmp(jmp_restart); /* XXX Allow people to "restart" */
if (getenv("STAGE0") || !access("/this_is_boot_flp",R_OK)) {
if (getpid() != 1) {
stage0();
stage1();
} else if (!access("/this_is_boot_flp",R_OK)) {
stage0();
stage1();
stage2();
end_dialog();
dialog_active=0;
reboot(RB_AUTOBOOT);
} else {
stage3();