From 93cf15e9a1c29962d6f08be6102d2ea7876d969f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 7 Jul 2011 16:00:00 -0700 Subject: [PATCH] Introduce GUID type for Chrome OS read/write firmware. This change teaches cgpt a new GUID type to be used for the Chrome OS read/write firmware. The GUID is CAB6E88E-ABF3-4102-A07A-D4BB9BE3C1D3. BUG=chrome-os-partner:4843 TEST=Built and installed on my host, used a separate change to repurpose partition 11 for the R/W firmware using cgpt and the "firmware" type, inspected the image using cgpt. Built and installed an image and used cgpt on the device to inspect it's GPT. Signed-off-by: Gabe Black Change-Id: I3b2801b2e1f71b3275bbddbc45fb63bde5bce5a7 Reviewed-on: http://gerrit.chromium.org/gerrit/3763 Reviewed-by: Bill Richardson Tested-by: Gabe Black --- cgpt/cgpt.h | 1 + cgpt/cgpt_common.c | 2 ++ firmware/lib/cgptlib/include/gpt.h | 2 ++ 3 files changed, 5 insertions(+) diff --git a/cgpt/cgpt.h b/cgpt/cgpt.h index 3f117bba90..322f1e26fc 100644 --- a/cgpt/cgpt.h +++ b/cgpt/cgpt.h @@ -76,6 +76,7 @@ int GuidEqual(const Guid *guid1, const Guid *guid2); int IsZero(const Guid *guid); /* Constant global type values to compare against */ +extern const Guid guid_chromeos_firmware; extern const Guid guid_chromeos_kernel; extern const Guid guid_chromeos_rootfs; extern const Guid guid_linux_data; diff --git a/cgpt/cgpt_common.c b/cgpt/cgpt_common.c index 90cd8b6025..a5a509b159 100644 --- a/cgpt/cgpt_common.c +++ b/cgpt/cgpt_common.c @@ -558,6 +558,7 @@ int UTF8ToUTF16(const uint8_t *utf8, uint16_t *utf16, unsigned int maxoutput) } /* global types to compare against */ +const Guid guid_chromeos_firmware = GPT_ENT_TYPE_CHROMEOS_FIRMWARE; const Guid guid_chromeos_kernel = GPT_ENT_TYPE_CHROMEOS_KERNEL; const Guid guid_chromeos_rootfs = GPT_ENT_TYPE_CHROMEOS_ROOTFS; const Guid guid_linux_data = GPT_ENT_TYPE_LINUX_DATA; @@ -570,6 +571,7 @@ static struct { char *name; char *description; } supported_types[] = { + {&guid_chromeos_firmware, "firmware", "ChromeOS firmware"}, {&guid_chromeos_kernel, "kernel", "ChromeOS kernel"}, {&guid_chromeos_rootfs, "rootfs", "ChromeOS rootfs"}, {&guid_linux_data, "data", "Linux data"}, diff --git a/firmware/lib/cgptlib/include/gpt.h b/firmware/lib/cgptlib/include/gpt.h index 14a79852ea..69d89d9439 100644 --- a/firmware/lib/cgptlib/include/gpt.h +++ b/firmware/lib/cgptlib/include/gpt.h @@ -30,6 +30,8 @@ __pragma(pack(push,1)) /* Support packing for MSVC. */ {{{0x00000000,0x0000,0x0000,0x00,0x00,{0x00,0x00,0x00,0x00,0x00,0x00}}}} #define GPT_ENT_TYPE_EFI \ {{{0xc12a7328,0xf81f,0x11d2,0xba,0x4b,{0x00,0xa0,0xc9,0x3e,0xc9,0x3b}}}} +#define GPT_ENT_TYPE_CHROMEOS_FIRMWARE \ + {{{0xcab6e88e,0xabf3,0x4102,0xa0,0x7a,{0xd4,0xbb,0x9b,0xe3,0xc1,0xd3}}}} #define GPT_ENT_TYPE_CHROMEOS_KERNEL \ {{{0xfe3a2a5d,0x4f32,0x41a7,0xb7,0x25,{0xac,0xcc,0x32,0x85,0xa3,0x09}}}} #define GPT_ENT_TYPE_CHROMEOS_ROOTFS \