Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Let MD code provide boot disk information as spec string...
details: https://anonhg.NetBSD.org/src/rev/eb70d648a729
branches: trunk
changeset: 333920:eb70d648a729
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Sat Nov 22 11:04:57 2014 +0000
description:
Let MD code provide boot disk information as spec string that can be
parsed by MI code. The format is the same as provided by an embedded
'root on <rootspec>' string in the config file. An embedded string
(other than a wildcard) still takes precedence.
diffstat:
sys/kern/kern_subr.c | 11 +++++++++--
sys/sys/device.h | 3 ++-
2 files changed, 11 insertions(+), 3 deletions(-)
diffs (56 lines):
diff -r e050e1ca11a4 -r eb70d648a729 sys/kern/kern_subr.c
--- a/sys/kern/kern_subr.c Sat Nov 22 10:24:02 2014 +0000
+++ b/sys/kern/kern_subr.c Sat Nov 22 11:04:57 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_subr.c,v 1.215 2014/11/22 10:24:02 mlelstv Exp $ */
+/* $NetBSD: kern_subr.c,v 1.216 2014/11/22 11:04:57 mlelstv Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.215 2014/11/22 10:24:02 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.216 2014/11/22 11:04:57 mlelstv Exp $");
#include "opt_ddb.h"
#include "opt_md.h"
@@ -159,6 +159,7 @@
int booted_partition;
daddr_t booted_startblk;
uint64_t booted_nblks;
+char *bootspec;
/*
* Use partition letters if it's a disk class but not a wedge.
@@ -209,6 +210,12 @@
}
/*
+ * Let bootcode augment "rootspec".
+ */
+ if (rootspec == NULL)
+ rootspec = bootspec;
+
+ /*
* If NFS is specified as the file system, and we found
* a DV_DISK boot device (or no boot device at all), then
* find a reasonable network interface for "rootspec".
diff -r e050e1ca11a4 -r eb70d648a729 sys/sys/device.h
--- a/sys/sys/device.h Sat Nov 22 10:24:02 2014 +0000
+++ b/sys/sys/device.h Sat Nov 22 11:04:57 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device.h,v 1.145 2014/09/05 05:47:40 matt Exp $ */
+/* $NetBSD: device.h,v 1.146 2014/11/22 11:04:57 mlelstv Exp $ */
/*
* Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -415,6 +415,7 @@
extern int booted_partition; /* the partition on that device */
extern daddr_t booted_startblk; /* or the start of a wedge */
extern uint64_t booted_nblks; /* and the size of that wedge */
+extern char *bootspec; /* and the device/wedge name */
struct vnode *opendisk(device_t);
int getdisksize(struct vnode *, uint64_t *, unsigned int *);
Home |
Main Index |
Thread Index |
Old Index