Deleted Added
full compact
install.c (8640) install.c (8641)
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
1/*
2 * The new sysinstall program.
3 *
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
6 *
7 * $Id: install.c,v 1.32 1995/05/20 00:13:10 jkh Exp $
7 * $Id: install.c,v 1.33 1995/05/20 08:31:40 jkh Exp $
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 24 unchanged lines hidden (view full) ---

40 * SUCH DAMAGE.
41 *
42 */
43
44#include "sysinstall.h"
45#include <sys/disklabel.h>
46#include <sys/errno.h>
47#include <sys/fcntl.h>
8 *
9 * Copyright (c) 1995
10 * Jordan Hubbard. All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright

--- 24 unchanged lines hidden (view full) ---

40 * SUCH DAMAGE.
41 *
42 */
43
44#include "sysinstall.h"
45#include <sys/disklabel.h>
46#include <sys/errno.h>
47#include <sys/fcntl.h>
48#include <sys/wait.h>
48#include <unistd.h>
49
50Boolean SystemWasInstalled;
51
52static void make_filesystems(void);
53static void copy_self(void);
54static void cpio_extract(void);
55static void install_configuration_files(void);

--- 31 unchanged lines hidden (view full) ---

87 static Boolean alreadyDone = FALSE;
88
89 if (alreadyDone)
90 return;
91
92 /* If things aren't kosher, or we refuse to proceed, bail. */
93 if (!preInstallCheck()
94 || msgYesNo("Last Chance! Are you SURE you want continue the installation?\n\nIf you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before proceeding.\nWe take no responsibility for lost disk contents!"))
49#include <unistd.h>
50
51Boolean SystemWasInstalled;
52
53static void make_filesystems(void);
54static void copy_self(void);
55static void cpio_extract(void);
56static void install_configuration_files(void);

--- 31 unchanged lines hidden (view full) ---

88 static Boolean alreadyDone = FALSE;
89
90 if (alreadyDone)
91 return;
92
93 /* If things aren't kosher, or we refuse to proceed, bail. */
94 if (!preInstallCheck()
95 || msgYesNo("Last Chance! Are you SURE you want continue the installation?\n\nIf you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before proceeding.\nWe take no responsibility for lost disk contents!"))
95 return 0;
96 return;
96
97 mbrContents = NULL;
98 if (!msgYesNo("Would you like to install a boot manager?\n\nThis will allow you to easily select between other operating systems\non the first disk, or boot from a disk other than the first."))
99 mbrContents = bteasy17;
100 else if (!msgYesNo("Would you like to remove an existing boot manager?"))
101 mbrContents = mbr;
102 devs = deviceFind(NULL, DEVICE_TYPE_DISK);
103 for (i = 0; devs[i]; i++) {

--- 163 unchanged lines hidden (view full) ---

267 if (i)
268 msgConfirm("Copy returned error status of %d!", i);
269}
270
271static void
272cpio_extract(void)
273{
274 int i, j, zpid, cpid, pfd[2];
97
98 mbrContents = NULL;
99 if (!msgYesNo("Would you like to install a boot manager?\n\nThis will allow you to easily select between other operating systems\non the first disk, or boot from a disk other than the first."))
100 mbrContents = bteasy17;
101 else if (!msgYesNo("Would you like to remove an existing boot manager?"))
102 mbrContents = mbr;
103 devs = deviceFind(NULL, DEVICE_TYPE_DISK);
104 for (i = 0; devs[i]; i++) {

--- 163 unchanged lines hidden (view full) ---

268 if (i)
269 msgConfirm("Copy returned error status of %d!", i);
270}
271
272static void
273cpio_extract(void)
274{
275 int i, j, zpid, cpid, pfd[2];
275 extern int wait(int *status);
276
277 tryagain:
278 j = fork();
279 if (!j) {
280 while (CpioFD == -1) {
281 msgConfirm("Please Insert CPIO floppy in floppy drive 0");
282 CpioFD = open("/dev/rfd0", O_RDONLY);
283 }

--- 30 unchanged lines hidden (view full) ---

314 close(pfd[1]);
315 close(CpioFD);
316
317 i = waitpid(zpid, &j, 0);
318 if (i < 0 || j) {
319 msgConfirm("gunzip returned status of %d, error was: %s (%d)! Help!", j, strerror(errno), errno);
320 exit(1);
321 }
276
277 tryagain:
278 j = fork();
279 if (!j) {
280 while (CpioFD == -1) {
281 msgConfirm("Please Insert CPIO floppy in floppy drive 0");
282 CpioFD = open("/dev/rfd0", O_RDONLY);
283 }

--- 30 unchanged lines hidden (view full) ---

314 close(pfd[1]);
315 close(CpioFD);
316
317 i = waitpid(zpid, &j, 0);
318 if (i < 0 || j) {
319 msgConfirm("gunzip returned status of %d, error was: %s (%d)! Help!", j, strerror(errno), errno);
320 exit(1);
321 }
322 i = waitpid(cpid, &j);
322 i = waitpid(cpid, &j, 0);
323 if (i < 0 || j) {
324 msgConfirm("cpio returned status of %d, error was: %s (%d)! Help!", j, strerror(errno), errno);
325 exit(2);
326 }
327 exit(0);
328 }
329 else
330 i = wait(&j);

--- 16 unchanged lines hidden ---
323 if (i < 0 || j) {
324 msgConfirm("cpio returned status of %d, error was: %s (%d)! Help!", j, strerror(errno), errno);
325 exit(2);
326 }
327 exit(0);
328 }
329 else
330 i = wait(&j);

--- 16 unchanged lines hidden ---