diff options
| author | drochner <drochner@NetBSD.org> | 1998-03-02 16:18:17 +0000 |
|---|---|---|
| committer | drochner <drochner@NetBSD.org> | 1998-03-02 16:18:17 +0000 |
| commit | 3bb9e758633db58da9cf6d64e1b3c169497a56f2 (patch) | |
| tree | e0e8f867c6b14082321a34d1443f7057d6ff04b9 /sys | |
| parent | 6d339338e64cb521400d053f855fc7a52da74f8b (diff) | |
Change MBR partition type for NetBSD to 0xa9, like the i386 port.
Provide compatibility via COMPAT_386BSD_MBRPART.
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/arch/ofppc/conf/GENERIC | 3 | ||||
| -rw-r--r-- | sys/arch/ofppc/include/disklabel.h | 7 | ||||
| -rw-r--r-- | sys/arch/ofppc/ofppc/disksubr.c | 7 | ||||
| -rw-r--r-- | sys/arch/ofppc/stand/ofwboot/ofdev.c | 10 | ||||
| -rw-r--r-- | sys/arch/powerpc/conf/GENERIC | 3 | ||||
| -rw-r--r-- | sys/arch/powerpc/include/disklabel.h | 7 | ||||
| -rw-r--r-- | sys/arch/powerpc/powerpc/disksubr.c | 7 | ||||
| -rw-r--r-- | sys/arch/powerpc/stand/ofwboot/ofdev.c | 10 |
8 files changed, 40 insertions, 14 deletions
diff --git a/sys/arch/ofppc/conf/GENERIC b/sys/arch/ofppc/conf/GENERIC index f310442e6a0..f55e0235d84 100644 --- a/sys/arch/ofppc/conf/GENERIC +++ b/sys/arch/ofppc/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.10 1998/02/24 05:45:51 mycroft Exp $ +# $NetBSD: GENERIC,v 1.11 1998/03/02 16:18:17 drochner Exp $ # # First try for PPC config file # @@ -35,6 +35,7 @@ options COMPAT_09 options COMPAT_10 options COMPAT_12 options COMPAT_13 +options COMPAT_386BSD_MBRPART # recognize old partition ID file-system FFS file-system MFS diff --git a/sys/arch/ofppc/include/disklabel.h b/sys/arch/ofppc/include/disklabel.h index 1706b02603d..2778ceb6563 100644 --- a/sys/arch/ofppc/include/disklabel.h +++ b/sys/arch/ofppc/include/disklabel.h @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.h,v 1.2 1997/04/16 22:55:10 thorpej Exp $ */ +/* $NetBSD: disklabel.h,v 1.3 1998/03/02 16:18:17 drochner Exp $ */ /*- * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -61,7 +61,8 @@ struct mbr_partition { /* Known partition types: */ #define MBR_EXTENDED 0x05 /* Extended partition */ -#define MBR_NETBSD 0xa5 /* NetBSD partition */ +#define MBR_NETBSD 0xa9 /* NetBSD partition */ +#define MBR_386BSD 0xa5 /* 386BSD partition */ /* For compatibility reasons (mainly for fdisk): */ #define dos_partition mbr_partition @@ -79,7 +80,7 @@ struct mbr_partition { #define DOSPARTOFF MBRPARTOFF #define NDOSPART NMBRPART -#define DOSPTYP_386BSD MBR_NETBSD +#define DOSPTYP_NETBSD MBR_NETBSD struct cpu_disklabel { int cd_start; /* Offset to NetBSD partition in blocks */ diff --git a/sys/arch/ofppc/ofppc/disksubr.c b/sys/arch/ofppc/ofppc/disksubr.c index f271c7cda69..7efa81f9cab 100644 --- a/sys/arch/ofppc/ofppc/disksubr.c +++ b/sys/arch/ofppc/ofppc/disksubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: disksubr.c,v 1.2 1997/03/26 22:43:01 gwr Exp $ */ +/* $NetBSD: disksubr.c,v 1.3 1998/03/02 16:18:17 drochner Exp $ */ /* * Copyright (C) 1996 Wolfgang Solfrank. @@ -181,6 +181,11 @@ mbr_to_label(dev, strat, bno, lp, pnpart, osdep, off) lp, pnpart, osdep, off)) goto done; break; +#ifdef COMPAT_386BSD_MBRPART + case MBR_386BSD: + printf("WARNING: old BSD partition ID!\n"); + /* FALLTHROUGH */ +#endif case MBR_NETBSD: /* Found the real NetBSD partition, use it */ osdep->cd_start = off + get_long(&mp->mbr_start); diff --git a/sys/arch/ofppc/stand/ofwboot/ofdev.c b/sys/arch/ofppc/stand/ofwboot/ofdev.c index 2fc6a81e9fa..e4c8979db37 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.2 1998/02/22 07:42:31 mycroft Exp $ */ +/* $NetBSD: ofdev.c,v 1.3 1998/03/02 16:18:17 drochner Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -204,7 +204,13 @@ search_label(devp, off, buf, lp, off0) off0 += off; for (p = (struct mbr_partition *)(buf + MBRPARTOFF), i = 4; --i >= 0; p++) { - if (p->mbr_type == MBR_NETBSD) { + if (p->mbr_type == MBR_NETBSD +#ifdef COMPAT_386BSD_MBRPART + || (p->mbr_type == MBR_386BSD && + (printf("WARNING: old BSD partition ID!\n"), 1) + /* XXX XXX - libsa printf() is void */ ) +#endif + ) { poff = get_long(&p->mbr_start) + off0; if (strategy(devp, F_READ, poff + LABELSECTOR, DEV_BSIZE, buf, &read) == 0 diff --git a/sys/arch/powerpc/conf/GENERIC b/sys/arch/powerpc/conf/GENERIC index f310442e6a0..f55e0235d84 100644 --- a/sys/arch/powerpc/conf/GENERIC +++ b/sys/arch/powerpc/conf/GENERIC @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.10 1998/02/24 05:45:51 mycroft Exp $ +# $NetBSD: GENERIC,v 1.11 1998/03/02 16:18:17 drochner Exp $ # # First try for PPC config file # @@ -35,6 +35,7 @@ options COMPAT_09 options COMPAT_10 options COMPAT_12 options COMPAT_13 +options COMPAT_386BSD_MBRPART # recognize old partition ID file-system FFS file-system MFS diff --git a/sys/arch/powerpc/include/disklabel.h b/sys/arch/powerpc/include/disklabel.h index 1706b02603d..2778ceb6563 100644 --- a/sys/arch/powerpc/include/disklabel.h +++ b/sys/arch/powerpc/include/disklabel.h @@ -1,4 +1,4 @@ -/* $NetBSD: disklabel.h,v 1.2 1997/04/16 22:55:10 thorpej Exp $ */ +/* $NetBSD: disklabel.h,v 1.3 1998/03/02 16:18:17 drochner Exp $ */ /*- * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -61,7 +61,8 @@ struct mbr_partition { /* Known partition types: */ #define MBR_EXTENDED 0x05 /* Extended partition */ -#define MBR_NETBSD 0xa5 /* NetBSD partition */ +#define MBR_NETBSD 0xa9 /* NetBSD partition */ +#define MBR_386BSD 0xa5 /* 386BSD partition */ /* For compatibility reasons (mainly for fdisk): */ #define dos_partition mbr_partition @@ -79,7 +80,7 @@ struct mbr_partition { #define DOSPARTOFF MBRPARTOFF #define NDOSPART NMBRPART -#define DOSPTYP_386BSD MBR_NETBSD +#define DOSPTYP_NETBSD MBR_NETBSD struct cpu_disklabel { int cd_start; /* Offset to NetBSD partition in blocks */ diff --git a/sys/arch/powerpc/powerpc/disksubr.c b/sys/arch/powerpc/powerpc/disksubr.c index f271c7cda69..7efa81f9cab 100644 --- a/sys/arch/powerpc/powerpc/disksubr.c +++ b/sys/arch/powerpc/powerpc/disksubr.c @@ -1,4 +1,4 @@ -/* $NetBSD: disksubr.c,v 1.2 1997/03/26 22:43:01 gwr Exp $ */ +/* $NetBSD: disksubr.c,v 1.3 1998/03/02 16:18:17 drochner Exp $ */ /* * Copyright (C) 1996 Wolfgang Solfrank. @@ -181,6 +181,11 @@ mbr_to_label(dev, strat, bno, lp, pnpart, osdep, off) lp, pnpart, osdep, off)) goto done; break; +#ifdef COMPAT_386BSD_MBRPART + case MBR_386BSD: + printf("WARNING: old BSD partition ID!\n"); + /* FALLTHROUGH */ +#endif case MBR_NETBSD: /* Found the real NetBSD partition, use it */ osdep->cd_start = off + get_long(&mp->mbr_start); diff --git a/sys/arch/powerpc/stand/ofwboot/ofdev.c b/sys/arch/powerpc/stand/ofwboot/ofdev.c index 2fc6a81e9fa..e4c8979db37 100644 --- a/sys/arch/powerpc/stand/ofwboot/ofdev.c +++ b/sys/arch/powerpc/stand/ofwboot/ofdev.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofdev.c,v 1.2 1998/02/22 07:42:31 mycroft Exp $ */ +/* $NetBSD: ofdev.c,v 1.3 1998/03/02 16:18:17 drochner Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -204,7 +204,13 @@ search_label(devp, off, buf, lp, off0) off0 += off; for (p = (struct mbr_partition *)(buf + MBRPARTOFF), i = 4; --i >= 0; p++) { - if (p->mbr_type == MBR_NETBSD) { + if (p->mbr_type == MBR_NETBSD +#ifdef COMPAT_386BSD_MBRPART + || (p->mbr_type == MBR_386BSD && + (printf("WARNING: old BSD partition ID!\n"), 1) + /* XXX XXX - libsa printf() is void */ ) +#endif + ) { poff = get_long(&p->mbr_start) + off0; if (strategy(devp, F_READ, poff + LABELSECTOR, DEV_BSIZE, buf, &read) == 0 |
