Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpcarm Recognize hpcboot's "b=xx" option, which spe...



details:   https://anonhg.NetBSD.org/src/rev/a5eed6939a36
branches:  trunk
changeset: 534020:a5eed6939a36
user:      toshii <toshii%NetBSD.org@localhost>
date:      Sat Jul 13 13:40:28 2002 +0000

description:
Recognize hpcboot's "b=xx" option, which specifies the root device to use.

diffstat:

 sys/arch/hpcarm/hpcarm/autoconf.c    |  11 +++++------
 sys/arch/hpcarm/hpcarm/hpc_machdep.c |  26 ++++++++++++++++++++++++--
 sys/arch/hpcarm/include/bootconfig.h |   4 ++--
 3 files changed, 31 insertions(+), 10 deletions(-)

diffs (113 lines):

diff -r 71b0988c8b5c -r a5eed6939a36 sys/arch/hpcarm/hpcarm/autoconf.c
--- a/sys/arch/hpcarm/hpcarm/autoconf.c Sat Jul 13 12:30:11 2002 +0000
+++ b/sys/arch/hpcarm/hpcarm/autoconf.c Sat Jul 13 13:40:28 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.6 2002/05/31 13:43:28 toshii Exp $      */
+/*     $NetBSD: autoconf.c,v 1.7 2002/07/13 13:40:28 toshii Exp $      */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -114,13 +114,12 @@
 static void
 set_root_device()
 {
-       char *ptr;
             
-       if (boot_file)
+       if (boot_file[0] != '\0')
                get_device(boot_file);
-       if (boot_args &&
-           get_bootconf_option(boot_args, "root", BOOTOPT_TYPE_STRING, &ptr))
-               get_device(ptr);
+       else
+               /* hpcboot doesn't pass a bootdev arg if wd0 */
+               get_device("wd0");
 }
 #endif /* ifndef MEMORY_DISK_IS_ROOT */
 
diff -r 71b0988c8b5c -r a5eed6939a36 sys/arch/hpcarm/hpcarm/hpc_machdep.c
--- a/sys/arch/hpcarm/hpcarm/hpc_machdep.c      Sat Jul 13 12:30:11 2002 +0000
+++ b/sys/arch/hpcarm/hpcarm/hpc_machdep.c      Sat Jul 13 13:40:28 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hpc_machdep.c,v 1.47 2002/05/03 16:45:23 rjs Exp $     */
+/*     $NetBSD: hpc_machdep.c,v 1.48 2002/07/13 13:40:28 toshii Exp $  */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -50,6 +50,7 @@
 
 #include "opt_ddb.h"
 #include "opt_pmap_debug.h"
+#include "fs_nfs.h"
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -95,6 +96,14 @@
 /* XXX for consinit related hacks */
 #include <sys/conf.h>
 
+#ifdef NFS
+#include <sys/mount.h>
+#include <nfs/rpcv2.h>
+#include <nfs/nfsproto.h>
+#include <nfs/nfs.h>
+#include <nfs/nfsmount.h>
+#endif
+
 /*
  * Address to call from cpu_reset() to reset the machine.
  * This is machine architecture dependant as it varies depending
@@ -137,7 +146,7 @@
 pv_addr_t kernelstack;
 
 char *boot_args = NULL;
-char *boot_file = NULL;
+char boot_file[16];
 
 vaddr_t msgbufphys;
 
@@ -331,6 +340,7 @@
        kerneldatasize = ((kerneldatasize - 1) & ~(NBPG * 4 - 1)) + NBPG * 8;
 
        /* parse kernel args */
+       boot_file[0] = '\0';
        strncpy(booted_kernel_storage, *argv, sizeof(booted_kernel_storage));
        for(argc--, argv++; argc; argc--, argv++)
                switch(**argv) {
@@ -340,6 +350,18 @@
                case 's':
                        boothowto |= RB_SINGLE;
                        break;
+               case 'b':
+                       /* boot device: -b=sd0 etc. */
+#ifdef NFS
+                       if (strcmp(*argv + 2, "nfs") == 0)
+                               mountroot = nfs_mountroot;
+                       else
+                               strncpy(boot_file, *argv + 2,
+                                   sizeof(boot_file));
+#else /* NFS */
+                       strncpy(boot_file, *argv + 2, sizeof(boot_file));
+#endif /* NFS */
+                       break;
                default:
                        break;
                }
diff -r 71b0988c8b5c -r a5eed6939a36 sys/arch/hpcarm/include/bootconfig.h
--- a/sys/arch/hpcarm/include/bootconfig.h      Sat Jul 13 12:30:11 2002 +0000
+++ b/sys/arch/hpcarm/include/bootconfig.h      Sat Jul 13 13:40:28 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bootconfig.h,v 1.2 2002/04/10 20:17:24 thorpej Exp $   */
+/*     $NetBSD: bootconfig.h,v 1.3 2002/07/13 13:40:29 toshii Exp $    */
 
 /*
  * Copyright (c) 1994 Mark Brinicombe.
@@ -69,7 +69,7 @@
 int get_bootconf_option __P((char *string, char *option, int type, void *result));
 
 extern char *boot_args;
-extern char *boot_file;
+extern char boot_file[];
 #endif /* _KERNEL */
 
 /* End of bootconfig.h */



Home | Main Index | Thread Index | Old Index