summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgene <gene@cvs.openbsd.org>1998-02-14 07:01:08 +0000
committergene <gene@cvs.openbsd.org>1998-02-14 07:01:08 +0000
commitdd80b85126e61cd178f24144653b9bc45461de33 (patch)
tree28091dfd04b4abd1d6357b50ebfbcc19ef3ab1b0
parent55b4eda4e8c78d697c3b6867d3f9da7f0d5427eb (diff)
Sync from NetBSD:
Add several new partition types. Process unknown partition types of A/UX type as SCRATCH rather than UNKNOWN. Hack around the long-standing 8-partition problem by searching the entire map and filling out the disklabel struct properly.
-rw-r--r--sys/arch/mac68k/mac68k/disksubr.c18
-rw-r--r--sys/arch/mac68k/mac68k/dpme.h7
2 files changed, 17 insertions, 8 deletions
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c
index d99edd5ef47..d79a5abb3d6 100644
--- a/sys/arch/mac68k/mac68k/disksubr.c
+++ b/sys/arch/mac68k/mac68k/disksubr.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: disksubr.c,v 1.7 1997/09/08 06:14:50 deraadt Exp $ */
-/* $NetBSD: disksubr.c,v 1.14 1996/05/05 06:18:22 briggs Exp $ */
+/* $OpenBSD: disksubr.c,v 1.8 1998/02/14 07:01:06 gene Exp $ */
+/* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -86,7 +86,7 @@
#include <sys/disklabel.h>
#include <sys/syslog.h>
-#include "dpme.h" /* MF the structure of a mac partition entry */
+#include <mac68k/mac68k/dpme.h> /* MF the structure of a mac partition entry */
#define b_cylin b_resid
@@ -144,6 +144,12 @@ whichType(part)
if (strcmp(PART_DRIVER_TYPE, (char *)part->pmPartType) == 0)
return 0;
+ if (strcmp(PART_DRIVER43_TYPE, (char *)part->pmPartType) == 0)
+ return 0;
+ if (strcmp(PART_DRIVERATA_TYPE, (char *)part->pmPartType) == 0)
+ return 0;
+ if (strcmp(PART_FWB_COMPONENT_TYPE, (char *)part->pmPartType) == 0)
+ return 0;
if (strcmp(PART_PARTMAP_TYPE, (char *)part->pmPartType) == 0)
return 0;
if (strcmp(PART_UNIX_TYPE, (char *)part->pmPartType) == 0) {
@@ -161,7 +167,7 @@ whichType(part)
if (bzb->bzbType == BZB_TYPESWAP)
return SWAP_PART;
- return 0;
+ return SCRATCH_PART;
}
if (strcmp(PART_MAC_TYPE, (char *)part->pmPartType) == 0)
return HFS_PART;
@@ -188,7 +194,7 @@ fixPartTable(partTable, size, base, num)
struct partmapentry *pmap;
char *s;
- for (i = 0; i < MAXPARTITIONS; i++) {
+ for (i = 0; i < NUM_PARTS_PROBED; i++) {
pmap = (struct partmapentry *)((i * size) + base);
if (pmap->pmSig != DPME_MAGIC) { /* this is not valid */
@@ -360,7 +366,7 @@ skip:
* MF --
* here's what i'm gonna do:
* read in the entire diskpartition table, it may be bigger or smaller
- * than MAXPARTITIONS but read that many entries. Each entry has a magic
+ * than NUM_PARTS_PROBED but read that many entries. Each entry has a magic
* number so we'll know if an entry is crap.
* next fill in the disklabel with info like this
* next fill in the root, usr, and swap parts.
diff --git a/sys/arch/mac68k/mac68k/dpme.h b/sys/arch/mac68k/mac68k/dpme.h
index b60f7244faf..6eb3aed6042 100644
--- a/sys/arch/mac68k/mac68k/dpme.h
+++ b/sys/arch/mac68k/mac68k/dpme.h
@@ -1,5 +1,5 @@
-/* $OpenBSD: dpme.h,v 1.4 1997/04/23 00:29:14 gene Exp $ */
-/* $NetBSD: dpme.h,v 1.6 1996/06/23 15:30:51 briggs Exp $ */
+/* $OpenBSD: dpme.h,v 1.5 1998/02/14 07:01:07 gene Exp $ */
+/* $NetBSD: dpme.h,v 1.8 1997/11/30 04:46:59 briggs Exp $ */
/*
* Copyright (C) 1993 Allen K. Briggs, Chris P. Caputo,
@@ -96,4 +96,7 @@ struct blockzeroblock {
#define PART_MAC_TYPE "APPLE_HFS"
#define PART_SCRATCH "APPLE_SCRATCH"
#define PART_DRIVER_TYPE "APPLE_DRIVER"
+#define PART_DRIVER43_TYPE "APPLE_DRIVER43"
+#define PART_DRIVERATA_TYPE "APPLE_DRIVER_ATA"
+#define PART_FWB_COMPONENT_TYPE "FWB DRIVER COMPONENTS"
#define PART_PARTMAP_TYPE "APPLE_PARTITION_MAP"