summaryrefslogtreecommitdiffstats
path: root/sbin/gpt/create.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2002-10-27 03:23:05 +0000
committermarcel <marcel@FreeBSD.org>2002-10-27 03:23:05 +0000
commit533c9e097154395bf0644b81f7c3f14953d56176 (patch)
treebb533945621b7c18ab431e6fe7b390ef9a32170c /sbin/gpt/create.c
parent9316f3838a06082b0d11dc4de03d67ee1e123738 (diff)
downloadFreeBSD-src-533c9e097154395bf0644b81f7c3f14953d56176.zip
FreeBSD-src-533c9e097154395bf0644b81f7c3f14953d56176.tar.gz
o Add functionality to add a GPT partition,
o Use DCE compliant UUID functions and provide local implementations if they don't exist, o Move dumping of the map to show.c and print the partition type, o Some cleanups and rearrangements. The default GPT partition type is UFS. When no starting block or size are specified, the tool will create a partition in the first free space it find (or that fits, depending on the size).
Diffstat (limited to 'sbin/gpt/create.c')
-rw-r--r--sbin/gpt/create.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/gpt/create.c b/sbin/gpt/create.c
index a82970d..b2904f6 100644
--- a/sbin/gpt/create.c
+++ b/sbin/gpt/create.c
@@ -69,7 +69,7 @@ create(int fd)
}
/* Get the amount of free space after the MBR */
- blocks = map_unused(1LL, 0LL);
+ blocks = map_free(1LL, 0LL);
if (blocks == 0LL) {
warnx("%s: error: no room for the GPT header", device_name);
return;
@@ -125,7 +125,7 @@ create(int fd)
hdr->hdr_lba_alt = last;
hdr->hdr_lba_start = tbl->map_start + blocks;
hdr->hdr_lba_end = last - blocks - 1LL;
- uuidgen(&hdr->hdr_uuid, 1);
+ uuid_create(&hdr->hdr_uuid, NULL);
hdr->hdr_lba_table = tbl->map_start;
hdr->hdr_entries = (blocks * secsz) / sizeof(struct gpt_ent);
if (hdr->hdr_entries > parts)
@@ -134,7 +134,7 @@ create(int fd)
ent = tbl->map_data;
for (i = 0; i < hdr->hdr_entries; i++)
- uuidgen(&ent[i].ent_uuid, 1);
+ uuid_create(&ent[i].ent_uuid, NULL);
hdr->hdr_crc_table = crc32(ent, hdr->hdr_entries * hdr->hdr_entsz);
hdr->hdr_crc_self = crc32(hdr, hdr->hdr_size);
OpenPOWER on IntegriCloud