From 4b8d4f97b038a595dd1c6ce16732ef289db3be08 Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Tue, 5 May 2015 09:33:02 +0000 Subject: [PATCH] Add apple-boot, apple-hfs and apple-ufs aliases to MBR scheme. Sort DOSPTYP_* entries in diskmbr.h by value. Document these scheme-specific types in gpart(8). MFC after: 1 week --- sbin/geom/class/part/gpart.8 | 6 +++++- sys/geom/part/g_part_mbr.c | 3 +++ sys/sys/diskmbr.h | 6 ++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/sbin/geom/class/part/gpart.8 b/sbin/geom/class/part/gpart.8 index 520f0491d5c6..8e8f858432b8 100644 --- a/sbin/geom/class/part/gpart.8 +++ b/sbin/geom/class/part/gpart.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2015 +.Dd May 5, 2015 .Dt GPART 8 .Os .Sh NAME @@ -668,6 +668,8 @@ for GPT. .It Cm apple-hfs An Apple Mac OS X partition that contains a HFS or HFS+ filesystem. The scheme-specific types are +.Qq Li "!175" +for MBR, .Qq Li "!Apple_HFS" for APM and .Qq Li "!48465300-0000-11aa-aa11-00306543ecac" @@ -696,6 +698,8 @@ for GPT. .It Cm apple-ufs An Apple Mac OS X partition that contains a UFS filesystem. The scheme-specific types are +.Qq Li "!168" +for MBR, .Qq Li "!Apple_UNIX_SVR2" for APM and .Qq Li "!55465300-0000-11aa-aa11-00306543ecac" diff --git a/sys/geom/part/g_part_mbr.c b/sys/geom/part/g_part_mbr.c index 5073398c954c..c340106ccb40 100644 --- a/sys/geom/part/g_part_mbr.c +++ b/sys/geom/part/g_part_mbr.c @@ -138,6 +138,9 @@ static struct g_part_mbr_alias { { DOSPTYP_PPCBOOT, G_PART_ALIAS_PREP_BOOT }, { DOSPTYP_VMFS, G_PART_ALIAS_VMFS }, { DOSPTYP_VMKDIAG, G_PART_ALIAS_VMKDIAG }, + { DOSPTYP_APPLE_UFS, G_PART_ALIAS_APPLE_UFS }, + { DOSPTYP_APPLE_BOOT, G_PART_ALIAS_APPLE_BOOT }, + { DOSPTYP_HFS, G_PART_ALIAS_APPLE_HFS }, }; static int diff --git a/sys/sys/diskmbr.h b/sys/sys/diskmbr.h index cb05ffa5462c..5f49eb9e8d06 100644 --- a/sys/sys/diskmbr.h +++ b/sys/sys/diskmbr.h @@ -51,11 +51,13 @@ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ #define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ #define DOSPTYP_LDM 0x42 /* Win2k dynamic extended partition */ -#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ -#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ #define DOSPTYP_LINLVM 0x8e /* Linux LVM partition */ +#define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ +#define DOSPTYP_APPLE_UFS 0xa8 /* Apple Mac OS X boot */ +#define DOSPTYP_APPLE_BOOT 0xab /* Apple Mac OS X UFS */ +#define DOSPTYP_HFS 0xaf /* HFS/HFS+ partition type */ #define DOSPTYP_PMBR 0xee /* GPT Protective MBR */ #define DOSPTYP_EFI 0xef /* EFI FAT parition */ #define DOSPTYP_VMFS 0xfb /* VMware VMFS partition */