From 9c1261344fadcffa36a8b281b5cdbbebc838cb9c Mon Sep 17 00:00:00 2001 From: mrg Date: Thu, 3 Jan 2008 06:40:02 +0000 Subject: [PATCH] support FS_RAID partitions, and increase the offset by RF_PROTECTED_SECTORS (64) if so. --- sys/arch/ofppc/stand/ofwboot/ofdev.c | 9 ++++++++- sys/arch/ofppc/stand/ofwboot/version | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/arch/ofppc/stand/ofwboot/ofdev.c b/sys/arch/ofppc/stand/ofwboot/ofdev.c index c9b9088a8169..b2b3b2ed05bb 100644 --- a/sys/arch/ofppc/stand/ofwboot/ofdev.c +++ b/sys/arch/ofppc/stand/ofwboot/ofdev.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofdev.c,v 1.14 2006/06/28 22:22:50 he Exp $ */ +/* $NetBSD: ofdev.c,v 1.15 2008/01/03 06:40:02 mrg Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -317,6 +317,7 @@ devopen(struct open_file *of, const char *name, char **file) strcat(fname, ":0"); } + DPRINTF("calling OF_open(fname=%s)\n", fname); if ((handle = OF_open(fname)) == -1) return ENXIO; memset(&ofdev, 0, sizeof ofdev); @@ -353,6 +354,12 @@ devopen(struct open_file *of, const char *name, char **file) } else { part = partition ? partition - 'a' : 0; ofdev.partoff = label.d_partitions[part].p_offset; + if (label.d_partitions[part].p_fstype == FS_RAID) { +#define RF_PROTECTED_SECTORS 64 + ofdev.partoff += RF_PROTECTED_SECTORS; + DPRINTF("devopen: found RAID partition, " + "adjusting offset to %x\n", ofdev.partoff); + } } of->f_dev = devsw; diff --git a/sys/arch/ofppc/stand/ofwboot/version b/sys/arch/ofppc/stand/ofwboot/version index eff25f70bc32..041d8cfda344 100644 --- a/sys/arch/ofppc/stand/ofwboot/version +++ b/sys/arch/ofppc/stand/ofwboot/version @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.6 2007/10/18 19:59:32 garbled Exp $ +$NetBSD: version,v 1.7 2008/01/03 06:40:02 mrg Exp $ 1.1: Boot program for OpenFirmware; initial revision 1.2: Boot program rearrangement @@ -6,3 +6,4 @@ $NetBSD: version,v 1.6 2007/10/18 19:59:32 garbled Exp $ 1.4: Support verbose/quiet boot. 1.5: Support for proper DDB symbol loading and MS-DOS file systems 1.6: Change how symbol table is conveyed to kernel +1.7: Support RAID partitions