summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbcollins <tailor@grayson>2006-06-01 13:19:15 -0400
committerBen Collins <bcollins@ubuntu.com>2006-06-01 13:19:15 -0400
commitc59475f689516dfdf66f3ef146b975f907cee73b (patch)
tree89f6f1b40e33215694b94de839ac273a776800cf
parentab81c0d4d0c281aaba2791ff5db60501bdd780c2 (diff)
downloadsilo-c59475f689516dfdf66f3ef146b975f907cee73b.tar.gz
[silo @ 117]
Add "partition-boot" and "secondary=" config options.#
-rw-r--r--man/silo.conf.510
-rw-r--r--second/cfg.c2
-rw-r--r--silo/silo.c17
3 files changed, 27 insertions, 2 deletions
diff --git a/man/silo.conf.5 b/man/silo.conf.5
index 86afca3..677d174 100644
--- a/man/silo.conf.5
+++ b/man/silo.conf.5
@@ -185,6 +185,16 @@ arbitrary file load).
.BI "timeout=" tsecs
Sets a timeout (in tenths of a second) for keyboard input. If no key is
pressed for the specified time, the first image is automatically booted.
+.TP
+.BI "partition-boot"
+This flag causes the same functionality as the \fI-t\fP command line
+option for the silo program. It's useful for not having to manually add
+that option everytime.
+.TP
+.BI "secondary=" filename
+Forces the second stage boot loader to be other than /boot/second.b. Same
+as the \fI-b\fP command line option. This can be overriden by the command
+line option.
.PP
In addition to these global options, per-image options
\fIappend\fP, \fIdevice\fP, \fIfill-reboot-cmd\fP, \fIimage\fP,
diff --git a/second/cfg.c b/second/cfg.c
index 951430b..13dfc64 100644
--- a/second/cfg.c
+++ b/second/cfg.c
@@ -69,6 +69,8 @@ CONFIG cf_options[] =
{cft_strg, "password", NULL},
{cft_flag, "restricted", NULL},
{cft_strg, "proll", NULL},
+ {cft_flag, "partition-boot", NULL},
+ {cft_strg, "secondary", NULL},
{cft_end, NULL, NULL}};
CONFIG cf_image[] =
diff --git a/silo/silo.c b/silo/silo.c
index e4058bb..f52d5fb 100644
--- a/silo/silo.c
+++ b/silo/silo.c
@@ -90,6 +90,7 @@ static int ufs_blocks (struct hwdevice *, ino_t);
#include "../first/ultra.h"
#include "../first/fd.h"
#include "../first/ieee32.h"
+
#define DIGIT_OFFSET (DIGIT_OFFSET_TMP + 0x223)
#define LETTER_OFFSET (LETTER_OFFSET_TMP + 0x223)
#define NUMBER_OFFSET (NUMBER_OFFSET_TMP + 0x223)
@@ -100,6 +101,8 @@ static int ufs_blocks (struct hwdevice *, ino_t);
/* Checks our config file for errors */
int confcheck(char*);
+char *cfg_get_strg (char *, char *);
+int cfg_get_flag (char *, char *);
static int allow_confchk_fail = 0;
/* This is just so that we don't have to fight with incompatible ufs_fs.h headers */
@@ -1061,7 +1064,7 @@ struct hwdevice *get_device(int majno, int minno)
int main(int argc,char **argv)
{
- char *name = NULL, *config_file, *install = NULL, *secondary, *backup, *p;
+ char *name = NULL, *config_file, *install = NULL, *secondary = NULL, *backup, *p;
struct utsname uts;
int version = 0;
struct stat st1, st2, st3;
@@ -1081,7 +1084,6 @@ int main(int argc,char **argv)
ultra = 1;
config_file = DFL_CONFIG;
backup = DFL_BACKUP;
- secondary = DFL_SECONDARY;
new_root = NULL;
name = *argv++;
argc--;
@@ -1225,6 +1227,17 @@ int main(int argc,char **argv)
if (!confcheck(config_file) && !allow_confchk_fail)
return 1;
+ /* Check for some values in the config that override defaults */
+ if (cfg_get_flag(NULL, "partition-boot"))
+ masterboot = 0;
+
+ if (!secondary) {
+ if (cfg_get_strg(NULL, "secondary"))
+ secondary = cfg_get_strg(NULL, "secondary");
+ else
+ secondary = DFL_SECONDARY;
+ }
+
secondary = strdup (secondary);
if (stat (secondary, &st1) < 0)
fatal ("Cannot open second stage loader %s", secondary);