summaryrefslogtreecommitdiff
path: root/cgpt/cmd_show.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2016-09-07 16:45:48 -0400
committerchrome-bot <chrome-bot@chromium.org>2016-09-08 15:36:23 -0700
commit6c18af501798c9b597839a3628c8374a2f8d7483 (patch)
treee846d7253980759aed453ba8649653cc7a4b60b9 /cgpt/cmd_show.c
parent6764405c93664efcf9742bf4973225099f65b6ec (diff)
downloadvboot-6c18af501798c9b597839a3628c8374a2f8d7483.tar.gz
cgpt: add support for managing the legacy boot gpt bitstabilize-kevin-8785.94.B
Bit 2 in the GPT partition attributes has been allocated as the legacy bios boot (equivalent to the "active" or "boot" flag in MBR). If we try to boot images on newer x86 systems, syslinux dies because it can't find any GPT partition marked bootable. Update the various parts of cgpt add & show to manage this bit. Now we can run: cgpt add -i 12 -B 1 chromiumos_image.bin And the EFI partition will be marked bootable. BUG=chromium:644845 TEST=vboot_reference unittests pass TEST=booted an amd64-generic disk image via USB on a generic laptop BRANCH=None Change-Id: I78e17b8df5b0c61e9e2d8a3c703e6d5ad230fe92 Reviewed-on: https://chromium-review.googlesource.com/382411 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'cgpt/cmd_show.c')
-rw-r--r--cgpt/cmd_show.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cgpt/cmd_show.c b/cgpt/cmd_show.c
index 860d80e7..b9e64818 100644
--- a/cgpt/cmd_show.c
+++ b/cgpt/cmd_show.c
@@ -32,6 +32,7 @@ static void Usage(void)
" -S Successful flag\n"
" -T Tries flag\n"
" -P Priority flag\n"
+ " -B Legacy Boot flag\n"
" -A raw 16-bit attribute value (bits 48-63)\n"
" -d Debug output (including invalid headers)\n"
"\n", progname);
@@ -46,7 +47,7 @@ int cmd_show(int argc, char *argv[]) {
char *e = 0;
opterr = 0; // quiet, you
- while ((c=getopt(argc, argv, ":hnvqi:bstulSTPAdD:")) != -1)
+ while ((c=getopt(argc, argv, ":hnvqi:bstulSTPBAdD:")) != -1)
{
switch (c)
{
@@ -75,6 +76,7 @@ int cmd_show(int argc, char *argv[]) {
case 'S':
case 'T':
case 'P':
+ case 'B':
case 'A':
params.single_item = c;
break;