aboutsummaryrefslogtreecommitdiffstats
path: root/src/modify.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modify.c')
-rw-r--r--src/modify.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/modify.c b/src/modify.c
index 3632ec7..803fb75 100644
--- a/src/modify.c
+++ b/src/modify.c
@@ -4,7 +4,7 @@
int
modify (DISK * d, int n, char *name, char *type_guid, uint64_t start,
- uint64_t end)
+ uint64_t end, char *part_guid)
{
GPT_headers h;
GPT_entry e = { 0 };
@@ -17,7 +17,18 @@ modify (DISK * d, int n, char *name, char *type_guid, uint64_t start,
exit (1);
}
printf ("guid=%s became=%s\n", type_guid, guid_to_a (e.type));
- e.label = guid_random ();
+ if (part_guid)
+ {
+ if (a_to_guid (part_guid, &e.label))
+ {
+ fprintf (stderr, "Partition GUID %s was not parsed\n", part_guid);
+ exit (1);
+ }
+ }
+ else
+ {
+ e.label = guid_random ();
+ }
e.start = start;
e.end = end;