Added the ability to create and display Linux/Windows GPT partitions to gpt(8).

This commit is contained in:
Arun Sharma 2004-07-01 22:27:12 +00:00
parent c0daeb2592
commit 6fc92a7a9d
3 changed files with 10 additions and 3 deletions

View File

@ -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();
}

View File

@ -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

View File

@ -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);