From 6c8d92e33876174fd60b53ddbd05c7a6e98ddf62 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 27 Feb 1999 23:39:00 +0000 Subject: 1999-02-27 Roland McGrath * 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. --- serverboot/bootstrap.c | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'serverboot/bootstrap.c') 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) ) -- cgit v1.2.3