diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2004-02-23 05:03:51 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2004-02-23 05:03:51 +0000 |
commit | 74d0bc48b2645c03bacf296768bc1481c22e24ea (patch) | |
tree | df889a042d84eb21cd3ac9b4a44b9e894751bcd2 /sys | |
parent | 0abf73690c3eb63b8eddae3f0ba0e9b2b144ddbb (diff) |
Improved boot args parsing. also assume that a bootfile of (hd0)...
is booting from 'wd0'.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/cats/cats/cats_machdep.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/sys/arch/cats/cats/cats_machdep.c b/sys/arch/cats/cats/cats_machdep.c index bb32b0b1480..9e9dc6478a8 100644 --- a/sys/arch/cats/cats/cats_machdep.c +++ b/sys/arch/cats/cats/cats_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cats_machdep.c,v 1.6 2004/02/13 21:32:02 drahn Exp $ */ +/* $OpenBSD: cats_machdep.c,v 1.7 2004/02/23 05:03:50 drahn Exp $ */ /* $NetBSD: cats_machdep.c,v 1.50 2003/10/04 14:28:28 chris Exp $ */ /* @@ -923,26 +923,22 @@ process_kernel_args(args) args = bootargs; boot_file = bootargs; -again: - /* Skip the kernel image filename */ + if (strncmp(args, "(hd0)", 5)== 0) + boot_file = "wd0"; + + /* Skip the kernel image filename, or 'setargs' */ while (*args != ' ' && *args != 0) ++args; - if (*args != 0) *args++ = 0; + + while (*args == ' ') ++args; - if (*args != '-') { - if (0 == strcmp(boot_file, "setargs")) { - boot_file = args; - goto again; - } - } - boot_args = args; - if (*args == '-') { - while (*args) { + while (*args == '-') { + while (*args && *args != ' ') { switch (*args++) { case 'a': boothowto |= RB_ASKNAME; @@ -966,9 +962,10 @@ again: break; } } + while (*args == ' ') + ++args; } - /* XXX too early for console */ printf("bootfile: %s\n", boot_file); printf("bootargs: %s\n", boot_args); |