support FS_RAID partitions, and increase the offset by

RF_PROTECTED_SECTORS (64) if so.
This commit is contained in:
mrg 2008-01-03 06:40:02 +00:00
parent 8d9f58ea97
commit 9c1261344f
2 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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