From 6fc92a7a9df87e318bd907ea4103c32cb8f39c6c Mon Sep 17 00:00:00 2001 From: Arun Sharma Date: Thu, 1 Jul 2004 22:27:12 +0000 Subject: [PATCH] Added the ability to create and display Linux/Windows GPT partitions to gpt(8). --- sbin/gpt/add.c | 4 ++++ sbin/gpt/gpt.8 | 6 +++--- sbin/gpt/show.c | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/sbin/gpt/add.c b/sbin/gpt/add.c index f0ce9a87a61..5f322cfa9ca 100644 --- a/sbin/gpt/add.c +++ b/sbin/gpt/add.c @@ -174,6 +174,10 @@ cmd_add(int argc, char *argv[]) } else if (strcmp(optarg, "ufs") == 0) { uuid_t ufs = GPT_ENT_TYPE_FREEBSD_UFS; type = ufs; + } else if ((strcmp(optarg, "linux") == 0) + || (strcmp(optarg, "windows") == 0)) { + uuid_t ext = GPT_ENT_TYPE_MS_BASIC_DATA; + type = ext ; } else usage_add(); } diff --git a/sbin/gpt/gpt.8 b/sbin/gpt/gpt.8 index 9d08c7e0b8f..af247bf3cab 100644 --- a/sbin/gpt/gpt.8 +++ b/sbin/gpt/gpt.8 @@ -123,10 +123,10 @@ option allows the user to specify the partition type. The type is given as an UUID, but .Nm has created -.Cm efi , swap +.Cm efi , swap, ufs, linux and -.Cm ufs -as aliases for the three most commonly used partition types. +.Cm windows +as aliases for some most commonly used partition types. .\" ==== create ==== .It Xo .Nm diff --git a/sbin/gpt/show.c b/sbin/gpt/show.c index 6acfbe00d11..117cd9bca16 100644 --- a/sbin/gpt/show.c +++ b/sbin/gpt/show.c @@ -57,6 +57,7 @@ friendly(uuid_t *t) uuid_t swap = GPT_ENT_TYPE_FREEBSD_SWAP; uuid_t ufs = GPT_ENT_TYPE_FREEBSD_UFS; uuid_t vinum = GPT_ENT_TYPE_FREEBSD_VINUM; + uuid_t ext = GPT_ENT_TYPE_MS_BASIC_DATA; static char buf[80]; char *s; @@ -70,6 +71,8 @@ friendly(uuid_t *t) return "FreeBSD ufs partition"; else if (memcmp(t, &vinum, sizeof(uuid_t)) == 0) return "FreeBSD vinum partition"; + else if (memcmp(t, &ext, sizeof(uuid_t)) == 0) + return "Linux/Windows"; uuid_to_string(t, &s, NULL); strlcpy(buf, s, sizeof buf); free(s);