summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-05-30 03:01:22 +0000
committerRoland McGrath <roland@gnu.org>1999-05-30 03:01:22 +0000
commitf49930e98d8013c4835d1f1300db516a69cec4cc (patch)
tree0141c424ab7638bda97c25b9d924a887a5b0ba68
parentb09374d04a6576e3746f4efc4a34735294f8270c (diff)
1999-05-29 Roland McGrath <roland@baalperazim.frob.com>
* bootstrap.c (main): Define $(serverboot) function for "serverboot controls", control command replacing the pathname. For command "die", terminate ourselves after running the boot script, no default pager.
-rw-r--r--serverboot/bootstrap.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/serverboot/bootstrap.c b/serverboot/bootstrap.c
index d103e60f..58096f21 100644
--- a/serverboot/bootstrap.c
+++ b/serverboot/bootstrap.c
@@ -144,6 +144,7 @@ main(argc, argv)
int argc;
char **argv;
{
+ int die = 0;
int script_paging_file (const struct cmd *cmd, int linux_signature)
{
if (add_paging_file (bootstrap_master_device_port, cmd->path,
@@ -163,6 +164,15 @@ main(argc, argv)
{
return script_paging_file (cmd, 1);
}
+ int script_serverboot_ctl (const struct cmd *cmd, int *val)
+ {
+ const char *const ctl = cmd->path;
+ if (!strcmp (ctl, "die"))
+ die = 1;
+ else
+ printf ("(serverboot): Unknown control word `%s' ignored\n", ctl);
+ return 0;
+ }
register kern_return_t result;
struct file scriptf;
@@ -320,6 +330,9 @@ main(argc, argv)
|| boot_script_define_function ("add-linux-paging-file",
VAL_NONE,
&script_add_linux_paging_file)
+ || boot_script_define_function ("serverboot",
+ VAL_NONE,
+ &script_serverboot_ctl)
)
panic ("bootstrap: error setting boot script variables");
@@ -392,6 +405,13 @@ main(argc, argv)
}
#endif
+ if (die)
+ {
+ printf ("(serverboot): terminating, not becoming default pager\n");
+ while (1)
+ task_terminate (mach_task_self ());
+ }
+
default_pager_initialize (bootstrap_master_host_port);
/*