freebsd-src/sbin/sysinstall/stage0.c
Poul-Henning Kamp aa7d974a35 Fixed to make sysinstall work again. Notable changes:
Removed a dialog_clear() which somebody aimlessly had slammed into TellEm()
in absence of any understanding of the structure of this program. :-(

Skip through stage0 for now.

Make write_bootblocks write the disklabel using the kernel-call, and forget
about the boot-blocks for now.  This is wrong, but I havn't found the real
problem yet.  I will continue work on this problem.

Added a Debug-feature.  There is a printf' like Debug() now which sends its
output to ttyv1 (Alt-F2), and all "discarded output" from sub-processes end
up there too.  Made TellEm() put it's messages there also, so that we can
see where what happens.

Set the PATH for the shell we shouldn't start at the end :-)

set "npartitions" after the disklabel-editor returns, so that we actually
can edit all the 8 parts of the label.
1994-10-29 10:01:40 +00:00

81 lines
1.9 KiB
C

/*
* Copyright (c) 1994, Jordan Hubbard, Paul Richards and Poul-Henning Kamp.
*
* All rights reserved.
*
* This software may be used, modified, copied, distributed, and
* sold, in both source and binary form provided that the above
* copyright and these terms are retained, verbatim, as the first
* lines of this file. Under no circumstances is the author
* responsible for the proper functioning of this software, nor does
* the author assume any responsibility for damages incurred with
* its use.
*
* [Note: This file bears almost no resemblance to what was here in an
* earlier incarnation].
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <dialog.h>
#include "sysinstall.h"
static char *welcome[] = {
"View 'READ ME FIRST' File.",
"View FreeBSD Copyright Information.",
"Proceed with installation.",
"Repair existing installation ('fixit' mode).",
"Exit to shell.",
};
void
stage0()
{
int valid = 0;
if (!access(README_FILE, R_OK)) {
dialog_clear();
dialog_textbox("READ ME FIRST", README_FILE, 24, 80);
}
return;
do {
if (!dialog_menu("Welcome to FreeBSD!",
"Please select one of the following options.\n",
10, 75, 5, 5, welcome, selection))
valid = 1;
dialog_clear();
} while (!valid);
switch (atoi(selection)) {
case 1: /* View readme */
if (!access(README_FILE, R_OK)) {
dialog_clear();
dialog_textbox("READ ME FIRST", README_FILE, 24, 80);
}
break;
case 2: /* View copyrights */
if (!access(COPYRIGHT_FILE, R_OK)) {
dialog_clear();
dialog_textbox("COPYRIGHT", COPYRIGHT_FILE, 24, 80);
}
break;
case 3: /* Proceed (do nothing special, really) */
break;
case 4:
dialog_msgbox("Sorry!", "This feature not currently implemented.",
6, 75, 1);
break;
case 5:
exit(0);
break; /* hope not! :) */
}
}