mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-05 09:14:03 +00:00
Adjust my installation script to more closely match reality.
Add a system command to script mechanism (so you can call things like tzsetup from scripts). Add noError variable for causing script errors to be ignored.
This commit is contained in:
parent
172d6524df
commit
b4cfcc4383
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26795
@ -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.17 1997/06/13 17:55:32 jkh Exp $
|
||||
* $Id: dispatch.c,v 1.18 1997/06/21 15:45:08 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -38,6 +38,7 @@
|
||||
#include <ctype.h>
|
||||
|
||||
static int _shutdown(dialogMenuItem *unused);
|
||||
static int _systemExecute(dialogMenuItem *unused);
|
||||
|
||||
static struct _word {
|
||||
char *name;
|
||||
@ -102,6 +103,7 @@ static struct _word {
|
||||
{ "addGroup", userAddGroup },
|
||||
{ "addUser", userAddUser },
|
||||
{ "shutdown", _shutdown },
|
||||
{ "system", _systemExecute },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
@ -122,12 +124,25 @@ call_possible_resword(char *name, dialogMenuItem *value, int *status)
|
||||
}
|
||||
|
||||
/* Just convenience */
|
||||
static int _shutdown(dialogMenuItem *unused)
|
||||
static int
|
||||
_shutdown(dialogMenuItem *unused)
|
||||
{
|
||||
systemShutdown(0);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
static int
|
||||
_systemExecute(dialogMenuItem *unused)
|
||||
{
|
||||
char *cmd = variable_get("command");
|
||||
|
||||
if (cmd)
|
||||
return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS;
|
||||
else
|
||||
msgDebug("_systemExecute: No command passed in `command' variable.\n");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
/* For a given string, call it or spit out an undefined command diagnostic */
|
||||
int
|
||||
dispatchCommand(char *str)
|
||||
|
@ -30,17 +30,20 @@ distSetCustom
|
||||
################################
|
||||
|
||||
################################
|
||||
# Now set the parameters for the partition editor on wd0. Set to use all
|
||||
# remaining free space (could also be "all" or "existing" to use all the
|
||||
# disk or an existing FreeBSD slice).
|
||||
# Now set the parameters for the partition editor on wd0. Set to use the
|
||||
# disk exclusively (could also be "all" to use the whole disk but
|
||||
# respecting the MBR or "free" to use only unallocated space for FreeBSD).
|
||||
disk=wd0
|
||||
# Use the whole disk.
|
||||
partition=exclusive
|
||||
# Use only the free space.
|
||||
#partition=free
|
||||
#bootManager=booteasy
|
||||
diskPartitionEditor
|
||||
|
||||
# Uncomment this instead to use only the free space and install boot manager.
|
||||
#partition=free
|
||||
#bootManager=booteasy
|
||||
#diskPartitionEditor
|
||||
################################
|
||||
|
||||
################################
|
||||
# It's bogus that we have to re-enter the label editor for each partition
|
||||
# we want to create, but it was easier to do it this way (from a programming
|
||||
# standpoint, not a user standpoint!). This assumes that slice 1 is a DOS
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: sysinstall.h,v 1.135 1997/06/18 05:11:37 jkh Exp $
|
||||
* $Id: sysinstall.h,v 1.136 1997/06/21 15:45:15 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -135,6 +135,7 @@
|
||||
#define VAR_NFS_SECURE "nfsSecure"
|
||||
#define VAR_NFS_SERVER "nfs_server_enable"
|
||||
#define VAR_NO_CONFIRM "noConfirm"
|
||||
#define VAR_NO_ERROR "noError"
|
||||
#define VAR_NO_WARN "noWarn"
|
||||
#define VAR_NONINTERACTIVE "nonInteractive"
|
||||
#define VAR_NOVELL "novell"
|
||||
|
@ -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: variable_load.c,v 1.7 1997/06/13 07:11:57 jkh Exp $
|
||||
* $Id: variable_load.c,v 1.8 1997/06/13 09:37:25 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1997
|
||||
* Paul Traina. All rights reserved.
|
||||
@ -122,9 +122,13 @@ variableLoad(dialogMenuItem *self)
|
||||
|
||||
for (i = 0; i < curr; i++) {
|
||||
if (DITEM_STATUS(dispatchCommand(list[i])) != DITEM_SUCCESS) {
|
||||
msgConfirm("Command `%s' failed - rest of script aborted.\n", buf);
|
||||
what |= DITEM_FAILURE;
|
||||
break;
|
||||
if (variable_get(VAR_NO_ERROR))
|
||||
variable_unset(VAR_NO_ERROR);
|
||||
else {
|
||||
msgConfirm("Command `%s' failed - rest of script aborted.\n", buf);
|
||||
what |= DITEM_FAILURE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
strings_free(list, &curr, &max);
|
||||
|
@ -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.17 1997/06/13 17:55:32 jkh Exp $
|
||||
* $Id: dispatch.c,v 1.18 1997/06/21 15:45:08 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -38,6 +38,7 @@
|
||||
#include <ctype.h>
|
||||
|
||||
static int _shutdown(dialogMenuItem *unused);
|
||||
static int _systemExecute(dialogMenuItem *unused);
|
||||
|
||||
static struct _word {
|
||||
char *name;
|
||||
@ -102,6 +103,7 @@ static struct _word {
|
||||
{ "addGroup", userAddGroup },
|
||||
{ "addUser", userAddUser },
|
||||
{ "shutdown", _shutdown },
|
||||
{ "system", _systemExecute },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
@ -122,12 +124,25 @@ call_possible_resword(char *name, dialogMenuItem *value, int *status)
|
||||
}
|
||||
|
||||
/* Just convenience */
|
||||
static int _shutdown(dialogMenuItem *unused)
|
||||
static int
|
||||
_shutdown(dialogMenuItem *unused)
|
||||
{
|
||||
systemShutdown(0);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
static int
|
||||
_systemExecute(dialogMenuItem *unused)
|
||||
{
|
||||
char *cmd = variable_get("command");
|
||||
|
||||
if (cmd)
|
||||
return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS;
|
||||
else
|
||||
msgDebug("_systemExecute: No command passed in `command' variable.\n");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
/* For a given string, call it or spit out an undefined command diagnostic */
|
||||
int
|
||||
dispatchCommand(char *str)
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: sysinstall.h,v 1.135 1997/06/18 05:11:37 jkh Exp $
|
||||
* $Id: sysinstall.h,v 1.136 1997/06/21 15:45:15 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -135,6 +135,7 @@
|
||||
#define VAR_NFS_SECURE "nfsSecure"
|
||||
#define VAR_NFS_SERVER "nfs_server_enable"
|
||||
#define VAR_NO_CONFIRM "noConfirm"
|
||||
#define VAR_NO_ERROR "noError"
|
||||
#define VAR_NO_WARN "noWarn"
|
||||
#define VAR_NONINTERACTIVE "nonInteractive"
|
||||
#define VAR_NOVELL "novell"
|
||||
|
@ -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.17 1997/06/13 17:55:32 jkh Exp $
|
||||
* $Id: dispatch.c,v 1.18 1997/06/21 15:45:08 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -38,6 +38,7 @@
|
||||
#include <ctype.h>
|
||||
|
||||
static int _shutdown(dialogMenuItem *unused);
|
||||
static int _systemExecute(dialogMenuItem *unused);
|
||||
|
||||
static struct _word {
|
||||
char *name;
|
||||
@ -102,6 +103,7 @@ static struct _word {
|
||||
{ "addGroup", userAddGroup },
|
||||
{ "addUser", userAddUser },
|
||||
{ "shutdown", _shutdown },
|
||||
{ "system", _systemExecute },
|
||||
{ NULL, NULL },
|
||||
};
|
||||
|
||||
@ -122,12 +124,25 @@ call_possible_resword(char *name, dialogMenuItem *value, int *status)
|
||||
}
|
||||
|
||||
/* Just convenience */
|
||||
static int _shutdown(dialogMenuItem *unused)
|
||||
static int
|
||||
_shutdown(dialogMenuItem *unused)
|
||||
{
|
||||
systemShutdown(0);
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
static int
|
||||
_systemExecute(dialogMenuItem *unused)
|
||||
{
|
||||
char *cmd = variable_get("command");
|
||||
|
||||
if (cmd)
|
||||
return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS;
|
||||
else
|
||||
msgDebug("_systemExecute: No command passed in `command' variable.\n");
|
||||
return DITEM_FAILURE;
|
||||
}
|
||||
|
||||
/* For a given string, call it or spit out an undefined command diagnostic */
|
||||
int
|
||||
dispatchCommand(char *str)
|
||||
|
@ -30,17 +30,20 @@ distSetCustom
|
||||
################################
|
||||
|
||||
################################
|
||||
# Now set the parameters for the partition editor on wd0. Set to use all
|
||||
# remaining free space (could also be "all" or "existing" to use all the
|
||||
# disk or an existing FreeBSD slice).
|
||||
# Now set the parameters for the partition editor on wd0. Set to use the
|
||||
# disk exclusively (could also be "all" to use the whole disk but
|
||||
# respecting the MBR or "free" to use only unallocated space for FreeBSD).
|
||||
disk=wd0
|
||||
# Use the whole disk.
|
||||
partition=exclusive
|
||||
# Use only the free space.
|
||||
#partition=free
|
||||
#bootManager=booteasy
|
||||
diskPartitionEditor
|
||||
|
||||
# Uncomment this instead to use only the free space and install boot manager.
|
||||
#partition=free
|
||||
#bootManager=booteasy
|
||||
#diskPartitionEditor
|
||||
################################
|
||||
|
||||
################################
|
||||
# It's bogus that we have to re-enter the label editor for each partition
|
||||
# we want to create, but it was easier to do it this way (from a programming
|
||||
# standpoint, not a user standpoint!). This assumes that slice 1 is a DOS
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: sysinstall.h,v 1.135 1997/06/18 05:11:37 jkh Exp $
|
||||
* $Id: sysinstall.h,v 1.136 1997/06/21 15:45:15 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -135,6 +135,7 @@
|
||||
#define VAR_NFS_SECURE "nfsSecure"
|
||||
#define VAR_NFS_SERVER "nfs_server_enable"
|
||||
#define VAR_NO_CONFIRM "noConfirm"
|
||||
#define VAR_NO_ERROR "noError"
|
||||
#define VAR_NO_WARN "noWarn"
|
||||
#define VAR_NONINTERACTIVE "nonInteractive"
|
||||
#define VAR_NOVELL "novell"
|
||||
|
Loading…
Reference in New Issue
Block a user