install.c (8620) | install.c (8628) |
---|---|
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.28 1995/05/18 22:00:01 phk Exp $ | 7 * $Id: install.c,v 1.29 1995/05/19 01:49:57 gpalmer 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 --- 29 unchanged lines hidden (view full) --- 45#include <sys/disklabel.h> 46#include <sys/errno.h> 47#include <sys/fcntl.h> 48#include <unistd.h> 49 50Boolean SystemWasInstalled; 51 52static void make_filesystems(void); | 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 --- 29 unchanged lines hidden (view full) --- 45#include <sys/disklabel.h> 46#include <sys/errno.h> 47#include <sys/fcntl.h> 48#include <unistd.h> 49 50Boolean SystemWasInstalled; 51 52static void make_filesystems(void); |
53static void copy_self(void); |
|
53static void cpio_extract(void); 54static void install_configuration_files(void); 55static void do_final_setup(void); 56 57static Boolean 58preInstallCheck(void) 59{ 60 if (!getenv(DISK_PARTITIONED)) { --- 60 unchanged lines hidden (view full) --- 121 msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret); 122 ret = vsystem("bad144 -v -s /dev/r%s", c1->name); 123 if (ret) 124 msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret); 125 } 126 } 127 } 128 make_filesystems(); | 54static void cpio_extract(void); 55static void install_configuration_files(void); 56static void do_final_setup(void); 57 58static Boolean 59preInstallCheck(void) 60{ 61 if (!getenv(DISK_PARTITIONED)) { --- 60 unchanged lines hidden (view full) --- 122 msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret); 123 ret = vsystem("bad144 -v -s /dev/r%s", c1->name); 124 if (ret) 125 msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret); 126 } 127 } 128 } 129 make_filesystems(); |
130 copy_self(); |
|
129 cpio_extract(); 130 distExtractAll(); 131 install_configuration_files(); 132 do_final_setup(); 133 return 1; 134} 135 136/* Go newfs and/or mount all the filesystems we've been asked to */ --- 46 unchanged lines hidden (view full) --- 183 } 184 else { 185 extern int makedevs(void); 186 187 if (Mkdir("/mnt/dev", NULL) 188 || chdir("/mnt/dev") 189 || makedevs()) 190 msgConfirm("Failed to make some of the devices in /mnt!"); | 131 cpio_extract(); 132 distExtractAll(); 133 install_configuration_files(); 134 do_final_setup(); 135 return 1; 136} 137 138/* Go newfs and/or mount all the filesystems we've been asked to */ --- 46 unchanged lines hidden (view full) --- 185 } 186 else { 187 extern int makedevs(void); 188 189 if (Mkdir("/mnt/dev", NULL) 190 || chdir("/mnt/dev") 191 || makedevs()) 192 msgConfirm("Failed to make some of the devices in /mnt!"); |
193 if (Mkdir("/mnt/stand", NULL)) 194 msgConfirm("Unable to make /mnt/stand directory!"); |
|
191 chdir("/"); 192 break; 193 } 194 } 195 } 196 } 197 } 198 } --- 24 unchanged lines hidden (view full) --- 223 } 224 } 225 } 226 } 227 command_sort(); 228 command_execute(); 229} 230 | 195 chdir("/"); 196 break; 197 } 198 } 199 } 200 } 201 } 202 } --- 24 unchanged lines hidden (view full) --- 227 } 228 } 229 } 230 } 231 command_sort(); 232 command_execute(); 233} 234 |
235/* Copy the boot floppy contents into /stand */ |
|
231static void | 236static void |
237copy_self(void) 238{ 239 int i; 240 241 msgNotify("Copying the boot floppy to /stand on root filesystem"); 242 chdir("/"); 243 i = vsystem("find -x . | cpio -pdmv /mnt/stand"); 244 if (i) 245 msgConfirm("Copy returned error status of %d!", i); 246} 247 248static void |
|
232cpio_extract(void) 233{ 234 int i, j, zpid, cpid, pfd[2]; 235 extern int wait(int *status); 236 237 while (CpioFD == -1) { 238 msgConfirm("Please Insert CPIO floppy in floppy drive 0"); 239 CpioFD = open("/dev/rfd0", O_RDONLY); --- 9 unchanged lines hidden (view full) --- 249 msgDebug("/stand/gunzip command returns %d status\n", i); 250 exit(i); 251 } 252 cpid = fork(); 253 if (!cpid) { 254 close(0); dup(pfd[0]); close(pfd[0]); 255 close(CpioFD); 256 close(pfd[1]); | 249cpio_extract(void) 250{ 251 int i, j, zpid, cpid, pfd[2]; 252 extern int wait(int *status); 253 254 while (CpioFD == -1) { 255 msgConfirm("Please Insert CPIO floppy in floppy drive 0"); 256 CpioFD = open("/dev/rfd0", O_RDONLY); --- 9 unchanged lines hidden (view full) --- 266 msgDebug("/stand/gunzip command returns %d status\n", i); 267 exit(i); 268 } 269 cpid = fork(); 270 if (!cpid) { 271 close(0); dup(pfd[0]); close(pfd[0]); 272 close(CpioFD); 273 close(pfd[1]); |
257 close(1); open("/dev/null", O_WRONLY); | 274 if (DebugFD != -1) { 275 dup2(DebugFD, 1); 276 dup2(DebugFD, 2); 277 } 278 else { 279 close(1); open("/dev/null", O_WRONLY); 280 dup2(1, 2); 281 } |
258 chdir("/mnt"); 259 i = execl("/stand/cpio", "/stand/cpio", "-iduvm", 0); 260 msgDebug("/stand/cpio command returns %d status\n", i); 261 exit(i); 262 } 263 close(pfd[0]); 264 close(pfd[1]); 265 close(CpioFD); --- 19 unchanged lines hidden --- | 282 chdir("/mnt"); 283 i = execl("/stand/cpio", "/stand/cpio", "-iduvm", 0); 284 msgDebug("/stand/cpio command returns %d status\n", i); 285 exit(i); 286 } 287 close(pfd[0]); 288 close(pfd[1]); 289 close(CpioFD); --- 19 unchanged lines hidden --- |