diff options
| author | Paul Traina <pst@FreeBSD.org> | 1996-09-26 21:03:35 +0000 |
|---|---|---|
| committer | Paul Traina <pst@FreeBSD.org> | 1996-09-26 21:03:35 +0000 |
| commit | 5319e113ebda1cb478fbbbf9a76fcb97d54a394a (patch) | |
| tree | dcbd3b12c273bdbd04210e616408dcccb05795e8 | |
| parent | b3f3fea5fd64b36ae3b7e09152d493688aceb605 (diff) | |
Notes
| -rw-r--r-- | release/sysinstall/main.c | 69 | ||||
| -rw-r--r-- | usr.sbin/sade/main.c | 69 | ||||
| -rw-r--r-- | usr.sbin/sysinstall/main.c | 69 |
3 files changed, 138 insertions, 69 deletions
diff --git a/release/sysinstall/main.c b/release/sysinstall/main.c index 5f42e4ba4a0a..2328c706a152 100644 --- a/release/sysinstall/main.c +++ b/release/sysinstall/main.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: main.c,v 1.26 1996/09/08 01:39:24 jkh Exp $ + * $Id: main.c,v 1.27 1996/09/15 23:55:23 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -37,6 +37,7 @@ #include "sysinstall.h" #include <stdio.h> #include <sys/signal.h> +#include <sys/fcntl.h> static void screech(int sig) @@ -110,33 +111,55 @@ main(int argc, char **argv) systemShutdown(0); } -/* If we have a compiled-in startup config file name, look for it and try to load it on startup */ + { + int fd; + Attribs attrs[512]; + + bzero(attrs, sizeof(attrs)); + + fd = open("install.cfg", O_RDONLY); + if (fd >= 0) { + msgNotify("Loading pre-configuration file"); + if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { + int i; + + for (i = 0; *attrs[i].name; i++) + variable_set2(attrs[i].name, attrs[i].value); + } + close(fd); + } + #if defined(LOAD_CONFIG_FILE) - else { - extern char *distWanted; - - distWanted = (char *)1; /* Tell mediaSetFloppy() to try floppy now */ - /* Try to open the floppy drive if we can do that first */ - if (DITEM_STATUS(mediaSetFloppy(NULL)) != DITEM_FAILURE && mediaDevice->init(mediaDevice)) { - int fd; - - fd = mediaDevice->get(mediaDevice, LOAD_CONFIG_FILE, TRUE); - if (fd > 0) { - Attribs attrs[512]; /* Don't have more than this many attrs in one file, ok? :-) */ - - msgNotify("Loading %s pre-configuration file", LOAD_CONFIG_FILE); - if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { - int i; - - for (i = 0; attrs[i].name; i++) - variable_set2(attrs[i].name, attrs[i].value); + else { + /* If we have a compiled-in startup config file name on + the floppy, look for it and try to load it on startup */ + extern char *distWanted; + + /* Tell mediaSetFloppy() to try floppy now */ + distWanted = (char *)1; + + /* Try to open the floppy drive if we can do that first */ + if (DITEM_STATUS(mediaSetFloppy(NULL)) != DITEM_FAILURE && + mediaDevice->init(mediaDevice)) { + int fd; + + fd = mediaDevice->get(mediaDevice, LOAD_CONFIG_FILE, TRUE); + if (fd > 0) { + msgNotify("Loading %s pre-configuration file", + LOAD_CONFIG_FILE); + if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { + int i; + + for (i = 0; *attrs[i].name; i++) + variable_set2(attrs[i].name, attrs[i].value); + } + mediaDevice->close(mediaDevice, fd); } - mediaDevice->close(mediaDevice, fd); + mediaDevice->shutdown(mediaDevice); } - mediaDevice->shutdown(mediaDevice); } - } #endif + } /* Begin user dialog at outer menu */ dialog_clear(); diff --git a/usr.sbin/sade/main.c b/usr.sbin/sade/main.c index 5f42e4ba4a0a..2328c706a152 100644 --- a/usr.sbin/sade/main.c +++ b/usr.sbin/sade/main.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: main.c,v 1.26 1996/09/08 01:39:24 jkh Exp $ + * $Id: main.c,v 1.27 1996/09/15 23:55:23 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -37,6 +37,7 @@ #include "sysinstall.h" #include <stdio.h> #include <sys/signal.h> +#include <sys/fcntl.h> static void screech(int sig) @@ -110,33 +111,55 @@ main(int argc, char **argv) systemShutdown(0); } -/* If we have a compiled-in startup config file name, look for it and try to load it on startup */ + { + int fd; + Attribs attrs[512]; + + bzero(attrs, sizeof(attrs)); + + fd = open("install.cfg", O_RDONLY); + if (fd >= 0) { + msgNotify("Loading pre-configuration file"); + if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { + int i; + + for (i = 0; *attrs[i].name; i++) + variable_set2(attrs[i].name, attrs[i].value); + } + close(fd); + } + #if defined(LOAD_CONFIG_FILE) - else { - extern char *distWanted; - - distWanted = (char *)1; /* Tell mediaSetFloppy() to try floppy now */ - /* Try to open the floppy drive if we can do that first */ - if (DITEM_STATUS(mediaSetFloppy(NULL)) != DITEM_FAILURE && mediaDevice->init(mediaDevice)) { - int fd; - - fd = mediaDevice->get(mediaDevice, LOAD_CONFIG_FILE, TRUE); - if (fd > 0) { - Attribs attrs[512]; /* Don't have more than this many attrs in one file, ok? :-) */ - - msgNotify("Loading %s pre-configuration file", LOAD_CONFIG_FILE); - if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { - int i; - - for (i = 0; attrs[i].name; i++) - variable_set2(attrs[i].name, attrs[i].value); + else { + /* If we have a compiled-in startup config file name on + the floppy, look for it and try to load it on startup */ + extern char *distWanted; + + /* Tell mediaSetFloppy() to try floppy now */ + distWanted = (char *)1; + + /* Try to open the floppy drive if we can do that first */ + if (DITEM_STATUS(mediaSetFloppy(NULL)) != DITEM_FAILURE && + mediaDevice->init(mediaDevice)) { + int fd; + + fd = mediaDevice->get(mediaDevice, LOAD_CONFIG_FILE, TRUE); + if (fd > 0) { + msgNotify("Loading %s pre-configuration file", + LOAD_CONFIG_FILE); + if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { + int i; + + for (i = 0; *attrs[i].name; i++) + variable_set2(attrs[i].name, attrs[i].value); + } + mediaDevice->close(mediaDevice, fd); } - mediaDevice->close(mediaDevice, fd); + mediaDevice->shutdown(mediaDevice); } - mediaDevice->shutdown(mediaDevice); } - } #endif + } /* Begin user dialog at outer menu */ dialog_clear(); diff --git a/usr.sbin/sysinstall/main.c b/usr.sbin/sysinstall/main.c index 5f42e4ba4a0a..2328c706a152 100644 --- a/usr.sbin/sysinstall/main.c +++ b/usr.sbin/sysinstall/main.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: main.c,v 1.26 1996/09/08 01:39:24 jkh Exp $ + * $Id: main.c,v 1.27 1996/09/15 23:55:23 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -37,6 +37,7 @@ #include "sysinstall.h" #include <stdio.h> #include <sys/signal.h> +#include <sys/fcntl.h> static void screech(int sig) @@ -110,33 +111,55 @@ main(int argc, char **argv) systemShutdown(0); } -/* If we have a compiled-in startup config file name, look for it and try to load it on startup */ + { + int fd; + Attribs attrs[512]; + + bzero(attrs, sizeof(attrs)); + + fd = open("install.cfg", O_RDONLY); + if (fd >= 0) { + msgNotify("Loading pre-configuration file"); + if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { + int i; + + for (i = 0; *attrs[i].name; i++) + variable_set2(attrs[i].name, attrs[i].value); + } + close(fd); + } + #if defined(LOAD_CONFIG_FILE) - else { - extern char *distWanted; - - distWanted = (char *)1; /* Tell mediaSetFloppy() to try floppy now */ - /* Try to open the floppy drive if we can do that first */ - if (DITEM_STATUS(mediaSetFloppy(NULL)) != DITEM_FAILURE && mediaDevice->init(mediaDevice)) { - int fd; - - fd = mediaDevice->get(mediaDevice, LOAD_CONFIG_FILE, TRUE); - if (fd > 0) { - Attribs attrs[512]; /* Don't have more than this many attrs in one file, ok? :-) */ - - msgNotify("Loading %s pre-configuration file", LOAD_CONFIG_FILE); - if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { - int i; - - for (i = 0; attrs[i].name; i++) - variable_set2(attrs[i].name, attrs[i].value); + else { + /* If we have a compiled-in startup config file name on + the floppy, look for it and try to load it on startup */ + extern char *distWanted; + + /* Tell mediaSetFloppy() to try floppy now */ + distWanted = (char *)1; + + /* Try to open the floppy drive if we can do that first */ + if (DITEM_STATUS(mediaSetFloppy(NULL)) != DITEM_FAILURE && + mediaDevice->init(mediaDevice)) { + int fd; + + fd = mediaDevice->get(mediaDevice, LOAD_CONFIG_FILE, TRUE); + if (fd > 0) { + msgNotify("Loading %s pre-configuration file", + LOAD_CONFIG_FILE); + if (DITEM_STATUS(attr_parse(attrs, fd)) == DITEM_SUCCESS) { + int i; + + for (i = 0; *attrs[i].name; i++) + variable_set2(attrs[i].name, attrs[i].value); + } + mediaDevice->close(mediaDevice, fd); } - mediaDevice->close(mediaDevice, fd); + mediaDevice->shutdown(mediaDevice); } - mediaDevice->shutdown(mediaDevice); } - } #endif + } /* Begin user dialog at outer menu */ dialog_clear(); |
