diff options
Diffstat (limited to 'cgpt/cmd_add.c')
-rw-r--r-- | cgpt/cmd_add.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cgpt/cmd_add.c b/cgpt/cmd_add.c index ca379a22..3c7741b8 100644 --- a/cgpt/cmd_add.c +++ b/cgpt/cmd_add.c @@ -27,6 +27,7 @@ static void Usage(void) " -S NUM set Successful flag (0|1)\n" " -T NUM set Tries flag (0-15)\n" " -P NUM set Priority flag (0-15)\n" + " -B NUM set Legacy Boot flag (0|1)\n" " -A NUM set raw 16-bit attribute value (bits 48-63)\n" "\n" "Use the -i option to modify an existing partition.\n" @@ -45,7 +46,7 @@ int cmd_add(int argc, char *argv[]) { char *e = 0; opterr = 0; // quiet, you - while ((c=getopt(argc, argv, ":hi:b:s:t:u:l:S:T:P:A:D:")) != -1) + while ((c=getopt(argc, argv, ":hi:b:s:t:u:l:S:T:P:B:A:D:")) != -1) { switch (c) { @@ -103,6 +104,12 @@ int cmd_add(int argc, char *argv[]) { errorcnt += check_int_parse(c, e); errorcnt += check_int_limit(c, params.priority, 0, 15); break; + case 'B': + params.set_legacy_boot = 1; + params.legacy_boot = (uint32_t)strtoul(optarg, &e, 0); + errorcnt += check_int_parse(c, e); + errorcnt += check_int_limit(c, params.legacy_boot, 0, 1); + break; case 'A': params.set_raw = 1; params.raw_value = strtoull(optarg, &e, 0); |