Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/arch/alpha/stand/common Pull up rev 1.4 (approved b...
details: https://anonhg.NetBSD.org/src/rev/0cc44ab61a05
branches: netbsd-1-5
changeset: 489545:0cc44ab61a05
user: simonb <simonb%NetBSD.org@localhost>
date: Tue Sep 26 15:51:05 2000 +0000
description:
Pull up rev 1.4 (approved by thorpej):
Add support for booting off RAIDframe RAID1 mirrors.
Check the first partition type in devopen(), and if it is of type
FS_RAID, add 64 to blkdev_part_offset.
diffstat:
sys/arch/alpha/stand/common/blkdev.c | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diffs (63 lines):
diff -r 5b2e4f0f8fad -r 0cc44ab61a05 sys/arch/alpha/stand/common/blkdev.c
--- a/sys/arch/alpha/stand/common/blkdev.c Tue Sep 26 15:50:40 2000 +0000
+++ b/sys/arch/alpha/stand/common/blkdev.c Tue Sep 26 15:51:05 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: blkdev.c,v 1.3 1999/11/13 21:38:20 thorpej Exp $ */
+/* $NetBSD: blkdev.c,v 1.3.4.1 2000/09/26 15:51:05 simonb Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. All rights reserved.
@@ -79,6 +79,9 @@
#include "stand/common/common.h"
#include "blkdev.h"
+#define RF_PROTECTED_SECTORS 64 /* XXX refer to <.../rf_optnames.h> */
+
+
/*
* If BOOTXX_FS_TYPE is defined, we'll try to find and use the first
* partition with that type mentioned in the disklabel, else default to
@@ -87,8 +90,15 @@
* The old boot blocks used to look for a file system starting at block
* 0. It's not immediately obvious that change here is necessary or good,
* so for now we don't bother looking for the specific type.
+ *
+ * However, for filesystem support on RAID1 sets we use a subset of the
+ * BOOTXX_FS_TYPE support.
*/
+#if defined(BOOTXX_RAID1_SUPPORT)
+#define BOOTXX_FS_TYPE
+#else
#undef BOOTXX_FS_TYPE
+#endif
int blkdev_is_open;
u_int32_t blkdev_part_offset;
@@ -126,13 +136,18 @@
/* Try to read disk label and partition table information. */
blkdev_part_offset = 0;
#if defined(BOOTXX_FS_TYPE)
- i = diskstrategy(NULL, F_READ,
+ i = blkdevstrategy(NULL, F_READ,
(daddr_t)LABELSECTOR, DEV_BSIZE, buf, &cnt);
if (i || cnt != DEV_BSIZE) {
return (ENXIO);
}
msg = getdisklabel(buf, &l);
if (msg == NULL) {
+#if defined(BOOTXX_RAID1_SUPPORT)
+ if (l.d_partitions[0].p_fstype == FS_RAID) {
+ blkdev_part_offset = RF_PROTECTED_SECTORS;
+ }
+#else
/*
* there's a label. find the first partition of the
* type we want and use its offset. if none are
@@ -144,6 +159,7 @@
break;
}
}
+#endif
} else {
/* just use offset 0; it's already set that way */
}
Home |
Main Index |
Thread Index |
Old Index