Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sgimips/sgimips Use boot arguments to try to determ...
details: https://anonhg.NetBSD.org/src/rev/702f824844f9
branches: trunk
changeset: 516170:702f824844f9
user: mhitch <mhitch%NetBSD.org@localhost>
date: Thu Oct 18 02:36:33 2001 +0000
description:
Use boot arguments to try to determine the boot device. The OSLoadPartition
string, if present, will override the second argument (which may be the
path/kernel being loaded). This will provide a way to netboot the kernel
and allow the root device be set to a disk partition.
diffstat:
sys/arch/sgimips/sgimips/machdep.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diffs (42 lines):
diff -r 6ab8483b05cc -r 702f824844f9 sys/arch/sgimips/sgimips/machdep.c
--- a/sys/arch/sgimips/sgimips/machdep.c Thu Oct 18 02:25:33 2001 +0000
+++ b/sys/arch/sgimips/sgimips/machdep.c Thu Oct 18 02:36:33 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.27 2001/09/24 03:56:03 mhitch Exp $ */
+/* $NetBSD: machdep.c,v 1.28 2001/10/18 02:36:33 mhitch Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang
@@ -237,12 +237,32 @@
uvm_setpagesize();
+ /*
+ * argv[0] can be either the bootloader loaded by the PROM, or a
+ * kernel loaded directly by the PROM.
+ *
+ * If argv[0] is the bootloader, then argv[1] might be the kernel
+ * that was loaded. How to tell which one to use?
+ *
+ * If argv[1] isn't an environment string, try to use it to set the
+ * boot device.
+ */
+ if (strchr(argv[1], '=') != 0)
+ makebootdev(argv[1]);
+
boothowto = RB_SINGLE;
for (i = 0; i < argc; i++) {
if (strcmp(argv[i], "OSLoadOptions=auto") == 0) {
boothowto &= ~RB_SINGLE;
}
+ /*
+ * If this is OSLoadPartition, use it to set the boot device.
+ * XXX This probably should not be done if we used a path
+ * XXX from argv[1], but how to tell?
+ */
+ if (strncmp(argv[i], "OSLoadPartition=", 16) == 0)
+ makebootdev(argv[i] + 16);
#if 0
printf("argv[%d]: %s\n", i, argv[i]);
/* delay(20000); */ /* give the user a little time.. */
Home |
Main Index |
Thread Index |
Old Index