summaryrefslogtreecommitdiff
path: root/serverboot/bootstrap.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-02-27 23:39:00 +0000
committerRoland McGrath <roland@gnu.org>1999-02-27 23:39:00 +0000
commit300ee2caf49d6afa4ed6228ccf0a8d266080bc5e (patch)
tree363788beec2838eb453ef10361085c75b48fd778 /serverboot/bootstrap.c
parent0e4057bc0e1b9618be4c2fe761d685f4e98b8ddf (diff)
1999-02-27 Roland McGrath <roland@baalperazim.frob.com>
* def_pager_setup.c (add_paging_file): New arg CHECK_LINUX_SIGNATURE, pass down to create_paging_partition. * default_pager.c (create_paging_partition): New arg CHECK_LINUX_SIGNATURE, pass down new_partition. (new_partition): New arg CHECK_LINUX_SIGNATURE: if not < 0, check first page of swap for Linux 2.0 or 2.2 signature page and obey its bad-block map; if > 0, refuse the partition if no signature found. * bootstrap.c (main): Add new boot script functions `add-raw-paging-file', `add-linux-paging-file'. Make those and `add-paging-file' all call add_paging_file with new LINUX_SIGNATURE arg of -1, 1, and 0, respectively. * default_pager.c (create_paging_partition): If new_partition returns null, return and do nothing more.
Diffstat (limited to 'serverboot/bootstrap.c')
-rw-r--r--serverboot/bootstrap.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/serverboot/bootstrap.c b/serverboot/bootstrap.c
index 3fa0f404..5c4a0393 100644
--- a/serverboot/bootstrap.c
+++ b/serverboot/bootstrap.c
@@ -146,12 +146,25 @@ main(argc, argv)
{
int doing_default_pager = 0;
int had_a_partition = 0;
- int script_paging_file (const struct cmd *cmd, int *val)
+ int script_paging_file (const struct cmd *cmd, int linux_signature)
{
if (add_paging_file (bootstrap_master_device_port, cmd->path))
printf ("(serverboot): %s: Cannot add paging file\n", cmd->path);
else
had_a_partition = 1;
+ return 0;
+ }
+ int script_add_paging_file (const struct cmd *cmd, int *val)
+ {
+ return script_paging_file (cmd, 0);
+ }
+ int script_add_raw_paging_file (const struct cmd *cmd, int *val)
+ {
+ return script_paging_file (cmd, -1);
+ }
+ int script_add_linux_paging_file (const struct cmd *cmd, int *val)
+ {
+ return script_paging_file (cmd, 1);
}
int script_default_pager (const struct cmd *cmd, int *val)
{
@@ -178,9 +191,9 @@ main(argc, argv)
*/
if (argv[1][0] != '-')
panic("bootstrap: no flags");
-
+
flag_string = argv[1];
-
+
/*
* Parse the arguments.
*/
@@ -208,13 +221,13 @@ main(argc, argv)
else if (argc == 3)
{
root_name = argv[2];
-
+
get_privileged_ports (&bootstrap_master_host_port,
&bootstrap_master_device_port);
}
-
-
-
+
+
+
printf_init(bootstrap_master_device_port);
#ifdef pleasenoXXX
@@ -275,7 +288,7 @@ main(argc, argv)
}
break;
}
-
+
/*
* If the server boot script name was changed,
* then use the new device name as the root device.
@@ -309,7 +322,12 @@ main(argc, argv)
|| boot_script_set_variable ("boot-args", VAL_STR,
(int) flag_string)
|| boot_script_define_function ("add-paging-file", VAL_NONE,
- &script_paging_file)
+ &script_add_paging_file)
+ || boot_script_define_function ("add-raw-paging-file", VAL_NONE,
+ &script_add_raw_paging_file)
+ || boot_script_define_function ("add-linux-paging-file",
+ VAL_NONE,
+ &script_add_linux_paging_file)
|| boot_script_define_function ("default-pager", VAL_NONE,
&script_default_pager)
)