Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/raidframe restore defaulting to the 'a' partition fo...
details: https://anonhg.NetBSD.org/src/rev/a42912ac3e89
branches: trunk
changeset: 329165:a42912ac3e89
user: christos <christos%NetBSD.org@localhost>
date: Mon May 12 15:53:01 2014 +0000
description:
restore defaulting to the 'a' partition for booting with root on raid as
it was before, and explain why we do things this way.
diffstat:
sys/dev/raidframe/rf_netbsdkintf.c | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diffs (62 lines):
diff -r 5c739eaf5bc5 -r a42912ac3e89 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c Mon May 12 15:34:23 2014 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c Mon May 12 15:53:01 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.309 2014/05/08 20:36:15 jakllsch Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.310 2014/05/12 15:53:01 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
***********************************************************/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.309 2014/05/08 20:36:15 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.310 2014/05/12 15:53:01 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -527,11 +527,22 @@
/* we found something bootable... */
+ /*
+ * XXX: The following code assumes that the root raid
+ * is the first ('a') partition. This is about the best
+ * we can do with a BSD disklabel, but we might be able
+ * to do better with a GPT label, by setting a specified
+ * attribute to indicate the root partition. We can then
+ * stash the partition number in the r->root_partition
+ * high bits (the bottom 2 bits are already used). For
+ * now we just set booted_partition to 0 when we override
+ * root.
+ */
if (num_root == 1) {
device_t candidate_root;
if (rsc->sc_dkdev.dk_nwedges != 0) {
- /* XXX: How do we find the real root partition? */
char cname[sizeof(cset->ac->devname)];
+ /* XXX: assume 'a' */
snprintf(cname, sizeof(cname), "%s%c",
device_xname(rsc->sc_dev), 'a');
candidate_root = dkwedge_find_by_wname(cname);
@@ -539,8 +550,10 @@
candidate_root = rsc->sc_dev;
if (booted_device == NULL ||
rsc->sc_r.root_partition == 1 ||
- rf_containsboot(&rsc->sc_r, booted_device))
+ rf_containsboot(&rsc->sc_r, booted_device)) {
booted_device = candidate_root;
+ booted_partition = 0; /* XXX assume 'a' */
+ }
} else if (num_root > 1) {
/*
@@ -571,6 +584,7 @@
if (num_root == 1) {
booted_device = rsc->sc_dev;
+ booted_partition = 0; /* XXX assume 'a' */
} else {
/* we can't guess.. require the user to answer... */
boothowto |= RB_ASKNAME;
Home |
Main Index |
Thread Index |
Old Index