Module Name: src
Committed By: mlelstv
Date: Sat Nov 22 11:04:57 UTC 2014
Modified Files:
src/sys/kern: kern_subr.c
src/sys/sys: device.h
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.215 -r1.216 src/sys/kern/kern_subr.c
cvs rdiff -u -r1.145 -r1.146 src/sys/sys/device.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_subr.c
diff -u src/sys/kern/kern_subr.c:1.215 src/sys/kern/kern_subr.c:1.216
--- src/sys/kern/kern_subr.c:1.215 Sat Nov 22 10:24:02 2014
+++ src/sys/kern/kern_subr.c Sat Nov 22 11:04:57 2014
@@ -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 @@ device_t booted_device;
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 @@ setroot(device_t bootdv, int bootpartiti
}
/*
+ * 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".
Index: src/sys/sys/device.h
diff -u src/sys/sys/device.h:1.145 src/sys/sys/device.h:1.146
--- src/sys/sys/device.h:1.145 Fri Sep 5 05:47:40 2014
+++ src/sys/sys/device.h Sat Nov 22 11:04:57 2014
@@ -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 device_t booted_device; /* the d
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 *);