aboutsummaryrefslogtreecommitdiff
path: root/sbin/sysinstall/sysinstall.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1994-11-02 06:19:53 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1994-11-02 06:19:53 +0000
commit07823336820b821b98b860f969e1ddf17b3e2252 (patch)
tree601b7f45d13a319df0e9447468c61f687ef5ab39 /sbin/sysinstall/sysinstall.c
parentc4b01b57f620d1d89a86c29a7f61325f08fbd890 (diff)
Get stage0 and stage5 working.
Try to reformat this code to be a little more human. Weird europeans have been writing this, and can't even seem to agree a single coding style for more than 4 consecutive lines! :-)
Notes
Notes: svn path=/head/; revision=4077
Diffstat (limited to 'sbin/sysinstall/sysinstall.c')
-rw-r--r--sbin/sysinstall/sysinstall.c127
1 files changed, 65 insertions, 62 deletions
diff --git a/sbin/sysinstall/sysinstall.c b/sbin/sysinstall/sysinstall.c
index a45f603d07b9..a94581bfc342 100644
--- a/sbin/sysinstall/sysinstall.c
+++ b/sbin/sysinstall/sysinstall.c
@@ -762,66 +762,69 @@ stage2()
void
main(int argc, char **argv)
{
- int i;
-
- /* phk's main */
- if (argc > 1 && !strcmp(argv[1],"phk")) {
- return Xmain(argc,argv);
- }
-
- /* paul's main */
- /* Are we running as init? */
- if (getpid() == 1) {
- close(0); open("/dev/console",O_RDWR);
- close(1); dup(0);
- close(2); dup(0);
- i = 1;
- ioctl(0,TIOCSPGRP,&i);
- setlogin("root");
- }
-
- if (set_termcap() == -1)
- fatal("Can't find terminal entry\n");
-
- if (alloc_memory() == -1)
- fatal("Couldn't allocate memory\n");
-
- if (uname(&utsname) == -1) {
- /* Fake uname entry */
- bcopy("FreeBSD", utsname.sysname, strlen("FreeBSD"));
- }
-
- /* XXX - libdialog has particularly bad return value checking */
- init_dialog();
- /* If we haven't crashed I guess dialog is running ! */
- dialog_active = 1;
-
- strcpy(scratch, "/etc/");
- strcat(scratch, STATUSFILE);
- if (read_status(scratch, sysinstall) == -1) {
- fatal(errmsg);
- }
-
- switch(sysinstall->status) {
- case NOT_INSTALLED:
- stage1();
- dialog_msgbox("Stage 1 complete",
- "Remove all floppy disks from the drives and hit return to reboot from the hard disk",
- 10, 75, 1);
- if (reboot(RB_AUTOBOOT) == -1)
- fatal("Reboot failed");
- break;
- case DISK_READY:
- dialog_msgbox("Stage 2 install", "Hi!", 10, 75, 1);
- stage2();
- dialog_msgbox("Stage 2 complete",
- "Well, this is as far as it goes so far :-)\n",
- 10, 75, 1);
- break;
- case INSTALLED_BASE:
- break;
- default:
- fatal("Unknown installation status");
- }
- exit_sysinstall();
+ int i;
+
+ /* phk's main */
+ if (argc > 1 && !strcmp(argv[1],"phk")) {
+ return Xmain(argc,argv);
+ }
+
+ /* paul's main */
+ /* Are we running as init? */
+ if (getpid() == 1) {
+ close(0); open("/dev/console", O_RDWR);
+ close(1); dup(0);
+ close(2); dup(0);
+ i = 1;
+ ioctl(0,TIOCSPGRP,&i);
+ setlogin("root");
+ }
+
+ if (set_termcap() == -1)
+ fatal("Can't find terminal entry\n");
+
+ if (alloc_memory() == -1)
+ fatal("Couldn't allocate memory\n");
+
+ if (uname(&utsname) == -1) {
+ /* Fake uname entry */
+ bcopy("FreeBSD", utsname.sysname, strlen("FreeBSD"));
+ }
+
+ /* XXX - libdialog has particularly bad return value checking */
+ init_dialog();
+ /* If we haven't crashed I guess dialog is running ! */
+ dialog_active = 1;
+
+ strcpy(scratch, "/etc/");
+ strcat(scratch, STATUSFILE);
+ if (read_status(scratch, sysinstall) == -1) {
+ fatal(errmsg);
+ }
+
+ switch(sysinstall->status) {
+ case NOT_INSTALLED:
+ stage1();
+ dialog_msgbox("Stage 1 complete",
+ "Remove all floppy disks from the drives and hit return to reboot from the hard disk",
+ 10, 75, 1);
+ if (reboot(RB_AUTOBOOT) == -1)
+ fatal("Reboot failed");
+ break;
+
+ case DISK_READY:
+ dialog_msgbox("Stage 2 install", "Hi!", 10, 75, 1);
+ stage2();
+ dialog_msgbox("Stage 2 complete",
+ "Well, this is as far as it goes so far :-)\n",
+ 10, 75, 1);
+ break;
+
+ case INSTALLED_BASE:
+ break;
+
+ default:
+ fatal("Unknown installation status");
+ }
+ exit_sysinstall();
}