summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-06-26 09:09:30 +0000
committerjkh <jkh@FreeBSD.org>1996-06-26 09:09:30 +0000
commit4578af9ab6a15e9cee87701b666984ef832db16c (patch)
tree5fd81129732a0ec0a9434a8636b28d6e094fdffa /usr.sbin/sysinstall
parente5839083912249c09dcf97c128cd4c1d4671910f (diff)
downloadFreeBSD-src-4578af9ab6a15e9cee87701b666984ef832db16c.zip
FreeBSD-src-4578af9ab6a15e9cee87701b666984ef832db16c.tar.gz
Allow argv[0] to be a command also.
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/dispatch.c8
-rw-r--r--usr.sbin/sysinstall/main.c24
-rw-r--r--usr.sbin/sysinstall/menus.c4
3 files changed, 25 insertions, 11 deletions
diff --git a/usr.sbin/sysinstall/dispatch.c b/usr.sbin/sysinstall/dispatch.c
index 8a51ade..ebf0d4e 100644
--- a/usr.sbin/sysinstall/dispatch.c
+++ b/usr.sbin/sysinstall/dispatch.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dispatch.c,v 1.1 1996/05/16 11:47:27 jkh Exp $
+ * $Id: dispatch.c,v 1.2 1996/06/08 09:08:38 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -107,12 +107,16 @@ int
dispatchCommand(char *str)
{
int i;
+ char *cp;
if (!str || !*str) {
msgConfirm("Null or zero-length string passed to dispatchCommand");
return DITEM_FAILURE;
}
- else if (index(str, '=')) {
+ /* A command might be a pathname if it's encoded in argv[0], as we also support */
+ if ((cp = index(str, '/')) != NULL)
+ str = cp + 1;
+ if (index(str, '=')) {
variable_set(str);
return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/main.c b/usr.sbin/sysinstall/main.c
index c7cdffe..c74a867 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.20 1996/05/28 18:30:30 jkh Exp $
+ * $Id: main.c,v 1.21 1996/06/08 07:02:20 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -42,7 +42,10 @@ static void
screech(int sig)
{
fprintf(stderr, "\007Fatal signal %d caught! I'm dead..\n", sig);
- pause();
+ if (RunningAsInit)
+ pause();
+ else
+ exit(1);
}
int
@@ -89,14 +92,21 @@ main(int argc, char **argv)
if (!mediaDevice->init(mediaDevice))
mediaDevice = NULL;
}
- if (argc > 1 && !RunningAsInit) {
- int i;
- for (i = 1; i < argc; i++) {
+ /* First, see if we have any arguments to process (and argv[0] counts if it's not "sysinstall") */
+ if (!RunningAsInit) {
+ int i, start_arg;
+
+ if (!strstr(argv[0], "sysinstall"))
+ start_arg = 0;
+ else
+ start_arg = 1;
+ for (i = start_arg; i < argc; i++) {
if (DITEM_STATUS(dispatchCommand(argv[i])) != DITEM_SUCCESS)
systemShutdown(1);
- }
- systemShutdown(0);
+ }
+ if (argc > start_arg)
+ systemShutdown(0);
}
/* Begin user dialog at outer menu */
diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c
index 2377af4..3d5a0ff 100644
--- a/usr.sbin/sysinstall/menus.c
+++ b/usr.sbin/sysinstall/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.70 1996/06/17 19:31:34 jkh Exp $
+ * $Id: menus.c,v 1.71 1996/06/17 19:33:27 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -240,7 +240,7 @@ DMenu MenuIndex = {
{ "Install, Express", "An express system installation.", NULL, installExpress },
{ "Install, Custom", "The custom installation menu", NULL, dmenuSubmenu, NULL, &MenuInstallCustom },
{ "Label", "The disk Label editor", NULL, diskLabelEditor },
- { "Media, All", "Top level media selection menu.", NULL, dmenuSubmenu, NULL, &MenuMedia },
+ { "Media", "Top level media selection menu.", NULL, dmenuSubmenu, NULL, &MenuMedia },
{ "Media, Tape", "Select tape installation media.", NULL, mediaSetTape },
{ "Media, NFS", "Select NFS installation media.", NULL, mediaSetNFS },
{ "Media, Floppy", "Select floppy installation media.", NULL, mediaSetFloppy },
OpenPOWER on IntegriCloud