From 4499ab674633d57fb0fdedba278cfe9a156e90c7 Mon Sep 17 00:00:00 2001 From: marcel Date: Thu, 22 Jun 2006 22:22:32 +0000 Subject: Improve support for Intel based Macs: o Accept hfs as partition type. o Print Apple HFS partitions using a friendly name. --- sbin/gpt/gpt.8 | 4 ++-- sbin/gpt/gpt.c | 7 +++++++ sbin/gpt/show.c | 3 +++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sbin/gpt/gpt.8 b/sbin/gpt/gpt.8 index ab2d87c..13f9223 100644 --- a/sbin/gpt/gpt.8 +++ b/sbin/gpt/gpt.8 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 31, 2005 +.Dd June 22, 2006 .Os .Dt GPT 8 .Sh NAME @@ -130,7 +130,7 @@ option allows the user to specify the partition type. The type is given as an UUID, but .Nm accepts -.Cm efi , swap , ufs , linux +.Cm efi , swap , ufs , hfs , linux and .Cm windows as aliases for the most commonly used partition types. diff --git a/sbin/gpt/gpt.c b/sbin/gpt/gpt.c index 569c923..38dc557 100644 --- a/sbin/gpt/gpt.c +++ b/sbin/gpt/gpt.c @@ -275,6 +275,13 @@ parse_uuid(const char *s, uuid_t *uuid) return (0); } break; + case 'h': + if (strcmp(optarg, "hfs") == 0) { + uuid_t hfs = GPT_ENT_TYPE_APPLE_HFS; + *uuid = hfs; + return (0); + } + break; case 'l': if (strcmp(optarg, "linux") == 0) { uuid_t lnx = GPT_ENT_TYPE_MS_BASIC_DATA; diff --git a/sbin/gpt/show.c b/sbin/gpt/show.c index 4df3be1..43fd6ea 100644 --- a/sbin/gpt/show.c +++ b/sbin/gpt/show.c @@ -57,6 +57,7 @@ friendly(uuid_t *t) static uuid_t efi_slice = GPT_ENT_TYPE_EFI; static uuid_t mslinux = GPT_ENT_TYPE_MS_BASIC_DATA; static uuid_t freebsd = GPT_ENT_TYPE_FREEBSD; + static uuid_t hfs = GPT_ENT_TYPE_APPLE_HFS; static uuid_t linuxswap = GPT_ENT_TYPE_LINUX_SWAP; static uuid_t msr = GPT_ENT_TYPE_MS_RESERVED; static uuid_t swap = GPT_ENT_TYPE_FREEBSD_SWAP; @@ -85,6 +86,8 @@ friendly(uuid_t *t) return ("Linux swap"); if (uuid_equal(t, &msr, NULL)) return ("Windows reserved"); + if (uuid_equal(t, &hfs, NULL)) + return ("Apple HFS"); unfriendly: uuid_to_string(t, &s, NULL); -- cgit v1.1