summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-10-18 00:12:55 +0000
committerjkh <jkh@FreeBSD.org>1995-10-18 00:12:55 +0000
commit858000205b94eb93e362e0df9c79b8a8c96e5e9a (patch)
tree588619f5829503b9d60bea3a9c5368aa0356eaae
parent7309d9d4a4fc7b9630ea8fc33558f26d44058316 (diff)
downloadFreeBSD-src-858000205b94eb93e362e0df9c79b8a8c96e5e9a.zip
FreeBSD-src-858000205b94eb93e362e0df9c79b8a8c96e5e9a.tar.gz
Almost snapshot time..
Merge today's work. Now support an attributes file loaded at startup (true front-loaded install). Add fuller debugging support to all device I/O routines. Lots-o-bug fixes.
-rw-r--r--release/sysinstall/options.c36
-rw-r--r--release/sysinstall/package.c18
-rw-r--r--usr.sbin/sysinstall/options.c36
-rw-r--r--usr.sbin/sysinstall/package.c18
4 files changed, 60 insertions, 48 deletions
diff --git a/release/sysinstall/options.c b/release/sysinstall/options.c
index c76c171..78658f2 100644
--- a/release/sysinstall/options.c
+++ b/release/sysinstall/options.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: options.c,v 1.10 1995/10/16 23:02:28 jkh Exp $
+ * $Id: options.c,v 1.11 1995/10/17 02:57:01 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -63,19 +63,11 @@ varCheck(Option opt)
return NULL;
}
-/* Nuke all the flags */
-static int
-resetFlags(char *str)
-{
- OptFlags = OPT_DEFAULT_FLAGS;
- return 0;
-}
-
/* Show our little logo */
static char *
resetLogo(char *str)
{
- return "[whap!]";
+ return "[WHAP!]";
}
static Option Options[] = {
@@ -83,7 +75,7 @@ static Option Options[] = {
OPT_IS_FLAG, &OptFlags, (void *)OPT_NFS_SECURE, NULL },
{ "NFS Slow", "User is using a slow PC or ethernet card",
OPT_IS_FLAG, &OptFlags, (void *)OPT_SLOW_ETHER, NULL },
-{ "Debugging", "Emit extra debugging output on VTY1 (ALT-F2)",
+{ "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)",
OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, NULL },
{ "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs",
OPT_IS_FLAG, &OptFlags, (void *)OPT_NO_CONFIRM, NULL },
@@ -94,17 +86,19 @@ static Option Options[] = {
{ "FTP username", "Username and password to use instead of anonymous",
OPT_IS_FUNC, mediaSetFtpUserPass, FTP_USER, varCheck },
{ "Tape Blocksize", "Tape media block size in 512 byte blocks",
- OPT_IS_FUNC, mediaSetTapeBlocksize, TAPE_BLOCKSIZE, varCheck },
-{ "Detail Level", "How to display filenames on debug screen as CPIO extracts them",
+ OPT_IS_VAR, "Please enter the tape block size in 512 byte blocks", TAPE_BLOCKSIZE, varCheck },
+{ "Extract Detail", "How verbosely to display file name information during extractions",
OPT_IS_FUNC, mediaSetCPIOVerbosity, CPIO_VERBOSITY_LEVEL, varCheck },
{ "Release Name", "Which release to attempt to load from installation media",
- OPT_IS_FUNC, installSelectRelease, RELNAME, varCheck },
+ OPT_IS_VAR, "Please specify the release you wish to load", RELNAME, varCheck },
{ "Browser Pkg", "This is the browser package that will be used for viewing HTML",
- OPT_IS_FUNC, docSelectBrowserPkg, BROWSER_PACKAGE, varCheck },
+ OPT_IS_VAR, "Please specify the name of the HTML browser package:", BROWSER_PACKAGE, varCheck },
{ "Browser Exec", "This is the path to the main binary of the browser package",
- OPT_IS_FUNC, docSelectBrowserBin, BROWSER_BINARY, varCheck },
+ OPT_IS_VAR, "Please specify a full pathname to the HTML browser binary:", BROWSER_BINARY, varCheck },
+{ "Config File", "Name of default configuration file for Load command (top menu)",
+ OPT_IS_VAR, "Please specify the name of a configuration file", CONFIG_FILE, varCheck },
{ "Reset Flags", "Reset all flag values to defaults",
- OPT_IS_FUNC, resetFlags, 0, resetLogo },
+ OPT_IS_FUNC, installVarDefaults, 0, resetLogo },
{ NULL },
};
@@ -137,6 +131,7 @@ value_of(Option opt)
return (*(int *)opt.data) & (int)opt.aux ? "ON" : "OFF";
case OPT_IS_FUNC:
+ case OPT_IS_VAR:
if (opt.check)
return opt.check(opt);
else
@@ -160,6 +155,11 @@ fire(Option opt)
cp(NULL);
}
+ else if (opt.type == OPT_IS_VAR) {
+ dialog_clear();
+ (void)variable_get_value(opt.aux, opt.data);
+ dialog_clear();
+ }
if (opt.check)
opt.check(opt);
}
@@ -193,7 +193,9 @@ optionsEditor(char *str)
/* Names are painted somewhat gratuitously each time, but it's easier this way */
mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name);
if (currOpt == i) standout();
+ attron(A_UNDERLINE);
mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i]));
+ attroff(A_UNDERLINE);
if (currOpt == i) standend();
if (optrow == OPT_END_ROW) {
optrow = OPT_START_ROW;
diff --git a/release/sysinstall/package.c b/release/sysinstall/package.c
index f1cd085..5fe2f20 100644
--- a/release/sysinstall/package.c
+++ b/release/sysinstall/package.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: package.c,v 1.1 1995/10/15 12:41:05 jkh Exp $
+ * $Id: package.c,v 1.2 1995/10/16 15:14:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -62,20 +62,22 @@ package_extract(Device *dev, char *name)
int i, fd, ret;
/* Check to make sure it's not already there */
- if (!vsystem("pkg_info -e %s"))
+ if (!vsystem("pkg_info -e %s", name))
return RET_SUCCESS;
- if (!dev->init(dev))
+ if (!dev->init(dev)) {
+ msgConfirm("Unable to initialize media type for package add.");
return RET_FAIL;
+ }
ret = RET_FAIL;
- sprintf(path, "packages/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
- fd = dev->get(dev, path, NULL);
+ sprintf(path, "packages/All/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
+ msgDebug("pkg_extract: Attempting to fetch %s\n", path);
+ fd = dev->get(dev, path, TRUE);
if (fd >= 0) {
pid_t tpid;
- if (isDebug())
- msgDebug("Got target %s from media type %d\n", path, dev->type);
+ msgNotify("Fetching %s from %s\n", path, dev->name);
pen[0] = '\0';
if ((where = make_playpen(pen, 0)) != NULL) {
if (isDebug())
@@ -114,6 +116,8 @@ package_extract(Device *dev, char *name)
if (dev->type == DEVICE_TYPE_TAPE)
unlink(path);
}
+ else
+ msgDebug("pkg_extract: get operation returned %d\n", fd);
return ret;
}
diff --git a/usr.sbin/sysinstall/options.c b/usr.sbin/sysinstall/options.c
index c76c171..78658f2 100644
--- a/usr.sbin/sysinstall/options.c
+++ b/usr.sbin/sysinstall/options.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: options.c,v 1.10 1995/10/16 23:02:28 jkh Exp $
+ * $Id: options.c,v 1.11 1995/10/17 02:57:01 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -63,19 +63,11 @@ varCheck(Option opt)
return NULL;
}
-/* Nuke all the flags */
-static int
-resetFlags(char *str)
-{
- OptFlags = OPT_DEFAULT_FLAGS;
- return 0;
-}
-
/* Show our little logo */
static char *
resetLogo(char *str)
{
- return "[whap!]";
+ return "[WHAP!]";
}
static Option Options[] = {
@@ -83,7 +75,7 @@ static Option Options[] = {
OPT_IS_FLAG, &OptFlags, (void *)OPT_NFS_SECURE, NULL },
{ "NFS Slow", "User is using a slow PC or ethernet card",
OPT_IS_FLAG, &OptFlags, (void *)OPT_SLOW_ETHER, NULL },
-{ "Debugging", "Emit extra debugging output on VTY1 (ALT-F2)",
+{ "Debugging", "Emit extra debugging output on VTY2 (ALT-F2)",
OPT_IS_FLAG, &OptFlags, (void *)OPT_DEBUG, NULL },
{ "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs",
OPT_IS_FLAG, &OptFlags, (void *)OPT_NO_CONFIRM, NULL },
@@ -94,17 +86,19 @@ static Option Options[] = {
{ "FTP username", "Username and password to use instead of anonymous",
OPT_IS_FUNC, mediaSetFtpUserPass, FTP_USER, varCheck },
{ "Tape Blocksize", "Tape media block size in 512 byte blocks",
- OPT_IS_FUNC, mediaSetTapeBlocksize, TAPE_BLOCKSIZE, varCheck },
-{ "Detail Level", "How to display filenames on debug screen as CPIO extracts them",
+ OPT_IS_VAR, "Please enter the tape block size in 512 byte blocks", TAPE_BLOCKSIZE, varCheck },
+{ "Extract Detail", "How verbosely to display file name information during extractions",
OPT_IS_FUNC, mediaSetCPIOVerbosity, CPIO_VERBOSITY_LEVEL, varCheck },
{ "Release Name", "Which release to attempt to load from installation media",
- OPT_IS_FUNC, installSelectRelease, RELNAME, varCheck },
+ OPT_IS_VAR, "Please specify the release you wish to load", RELNAME, varCheck },
{ "Browser Pkg", "This is the browser package that will be used for viewing HTML",
- OPT_IS_FUNC, docSelectBrowserPkg, BROWSER_PACKAGE, varCheck },
+ OPT_IS_VAR, "Please specify the name of the HTML browser package:", BROWSER_PACKAGE, varCheck },
{ "Browser Exec", "This is the path to the main binary of the browser package",
- OPT_IS_FUNC, docSelectBrowserBin, BROWSER_BINARY, varCheck },
+ OPT_IS_VAR, "Please specify a full pathname to the HTML browser binary:", BROWSER_BINARY, varCheck },
+{ "Config File", "Name of default configuration file for Load command (top menu)",
+ OPT_IS_VAR, "Please specify the name of a configuration file", CONFIG_FILE, varCheck },
{ "Reset Flags", "Reset all flag values to defaults",
- OPT_IS_FUNC, resetFlags, 0, resetLogo },
+ OPT_IS_FUNC, installVarDefaults, 0, resetLogo },
{ NULL },
};
@@ -137,6 +131,7 @@ value_of(Option opt)
return (*(int *)opt.data) & (int)opt.aux ? "ON" : "OFF";
case OPT_IS_FUNC:
+ case OPT_IS_VAR:
if (opt.check)
return opt.check(opt);
else
@@ -160,6 +155,11 @@ fire(Option opt)
cp(NULL);
}
+ else if (opt.type == OPT_IS_VAR) {
+ dialog_clear();
+ (void)variable_get_value(opt.aux, opt.data);
+ dialog_clear();
+ }
if (opt.check)
opt.check(opt);
}
@@ -193,7 +193,9 @@ optionsEditor(char *str)
/* Names are painted somewhat gratuitously each time, but it's easier this way */
mvprintw(optrow, OPT_NAME_COL + optcol, Options[i].name);
if (currOpt == i) standout();
+ attron(A_UNDERLINE);
mvprintw(optrow++, OPT_VALUE_COL + optcol, value_of(Options[i]));
+ attroff(A_UNDERLINE);
if (currOpt == i) standend();
if (optrow == OPT_END_ROW) {
optrow = OPT_START_ROW;
diff --git a/usr.sbin/sysinstall/package.c b/usr.sbin/sysinstall/package.c
index f1cd085..5fe2f20 100644
--- a/usr.sbin/sysinstall/package.c
+++ b/usr.sbin/sysinstall/package.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: package.c,v 1.1 1995/10/15 12:41:05 jkh Exp $
+ * $Id: package.c,v 1.2 1995/10/16 15:14:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -62,20 +62,22 @@ package_extract(Device *dev, char *name)
int i, fd, ret;
/* Check to make sure it's not already there */
- if (!vsystem("pkg_info -e %s"))
+ if (!vsystem("pkg_info -e %s", name))
return RET_SUCCESS;
- if (!dev->init(dev))
+ if (!dev->init(dev)) {
+ msgConfirm("Unable to initialize media type for package add.");
return RET_FAIL;
+ }
ret = RET_FAIL;
- sprintf(path, "packages/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
- fd = dev->get(dev, path, NULL);
+ sprintf(path, "packages/All/%s%s", name, strstr(name, ".tgz") ? "" : ".tgz");
+ msgDebug("pkg_extract: Attempting to fetch %s\n", path);
+ fd = dev->get(dev, path, TRUE);
if (fd >= 0) {
pid_t tpid;
- if (isDebug())
- msgDebug("Got target %s from media type %d\n", path, dev->type);
+ msgNotify("Fetching %s from %s\n", path, dev->name);
pen[0] = '\0';
if ((where = make_playpen(pen, 0)) != NULL) {
if (isDebug())
@@ -114,6 +116,8 @@ package_extract(Device *dev, char *name)
if (dev->type == DEVICE_TYPE_TAPE)
unlink(path);
}
+ else
+ msgDebug("pkg_extract: get operation returned %d\n", fd);
return ret;
}
OpenPOWER on IntegriCloud