summaryrefslogtreecommitdiff
path: root/firmware/lib/cgptlib/include/cgptlib_internal.h
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2016-09-07 16:45:48 -0400
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-02-02 04:09:53 +0000
commitd6c687b0cd889261dd96a8fe4b53d07e7daaa7d9 (patch)
tree9d0f3ce35ce125f4b5ce7896d95b342930b9a195 /firmware/lib/cgptlib/include/cgptlib_internal.h
parent79dcfc138e0a37e269e907e471892c6fe72fe8eb (diff)
downloadvboot-d6c687b0cd889261dd96a8fe4b53d07e7daaa7d9.tar.gz
cgpt: add support for managing the legacy boot gpt bitfactory-gale-8743.19.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> Reviewed-on: https://chromium-review.googlesource.com/897390 Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org>
Diffstat (limited to 'firmware/lib/cgptlib/include/cgptlib_internal.h')
-rw-r--r--firmware/lib/cgptlib/include/cgptlib_internal.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/firmware/lib/cgptlib/include/cgptlib_internal.h b/firmware/lib/cgptlib/include/cgptlib_internal.h
index b13c4916..cd616e5c 100644
--- a/firmware/lib/cgptlib/include/cgptlib_internal.h
+++ b/firmware/lib/cgptlib/include/cgptlib_internal.h
@@ -26,7 +26,8 @@
* 56 -- success
* 55-52 -- tries
* 51-48 -- priority
- * 47-2 -- UEFI: reserved for future use
+ * 47-3 -- UEFI: reserved for future use
+ * 2 -- UEFI: Legacy BIOS bootable
* 1 -- UEFI: partition is not mapped
* 0 -- UEFI: partition is required
*/
@@ -45,6 +46,9 @@
#define CGPT_ATTRIBUTE_PRIORITY_MASK (CGPT_ATTRIBUTE_MAX_PRIORITY << \
CGPT_ATTRIBUTE_PRIORITY_OFFSET)
+#define CGPT_ATTRIBUTE_LEGACY_BOOT_OFFSET (2)
+#define CGPT_ATTRIBUTE_MAX_LEGACY_BOOT (1ULL)
+
/* Defines ChromeOS-specific limitation on GPT */
#define MIN_SIZE_OF_HEADER 92
#define MAX_SIZE_OF_HEADER 512