summaryrefslogtreecommitdiff
path: root/cgpt/cmd_legacy.c
diff options
context:
space:
mode:
Diffstat (limited to 'cgpt/cmd_legacy.c')
-rw-r--r--cgpt/cmd_legacy.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/cgpt/cmd_legacy.c b/cgpt/cmd_legacy.c
index 955ce3f4..5fd742cc 100644
--- a/cgpt/cmd_legacy.c
+++ b/cgpt/cmd_legacy.c
@@ -15,6 +15,9 @@ static void Usage(void)
printf("\nUsage: %s legacy [OPTIONS] DRIVE\n\n"
"Switch GPT header signature to \"CHROMEOS\".\n\n"
"Options:\n"
+ " -D NUM Size (in bytes) of the disk where partitions reside\n"
+ " default 0, meaning partitions and GPT structs are\n"
+ " both on DRIVE\n"
" -e Switch GPT header signature back to \"EFI PART\"\n"
"\n", progname);
}
@@ -24,13 +27,22 @@ int cmd_legacy(int argc, char *argv[]) {
memset(&params, 0, sizeof(params));
int c;
+ char* e = 0;
int errorcnt = 0;
opterr = 0; // quiet, you
- while ((c=getopt(argc, argv, ":he")) != -1)
+ while ((c=getopt(argc, argv, ":heD:")) != -1)
{
switch (c)
{
+ case 'D':
+ params.drive_size = strtoull(optarg, &e, 0);
+ if (!*optarg || (e && *e))
+ {
+ Error("invalid argument to -%c: \"%s\"\n", c, optarg);
+ errorcnt++;
+ }
+ break;
case 'e':
params.efipart = 1;
break;