summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2019-03-22 11:05:30 +0800
committerCommit Bot <commit-bot@chromium.org>2019-10-09 13:31:10 +0000
commita60bf80726cc7255dcb3396c86c4fe9b26d0df32 (patch)
treebc5fc0753875a28d346b0f7e39bd1d81df07ac3f
parentdf4d2000a22db673a788b8e57e8e7c0cc3cee777 (diff)
downloadvboot-stabilize-12593.B.tar.gz
cgpt: Change stateful partition type GUID to TYPE_LINUX_FSstabilize-12593.Bfactory-kukui-12587.B
The TYPE_BASIC_DATA (called TYPE_LINUX_DATA before) is used by both Windows and Linux systems, and has caused problems when dual-booting. Modern Linux systems have been changed to TYPE_LINUX_FS. In Chrome OS, we usually find the stateful partition by number (1) instead of searching by type, so it should be fine simply replacing default mapping in the cgpt tool. BUG=chromium:944389 TEST=sudo emerge vboot_reference; make runtests BRANCH=None Change-Id: If18ff5180cbae5cdea8104f36203cffcf34db934 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1535456 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Matt Delco <delco@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org>
-rw-r--r--cgpt/cgpt_common.c4
-rw-r--r--firmware/include/gpt.h2
-rwxr-xr-xtests/run_cgpt_tests.sh2
3 files changed, 5 insertions, 3 deletions
diff --git a/cgpt/cgpt_common.c b/cgpt/cgpt_common.c
index e98a4533..04eab333 100644
--- a/cgpt/cgpt_common.c
+++ b/cgpt/cgpt_common.c
@@ -670,7 +670,8 @@ int UTF8ToUTF16(const uint8_t *utf8, uint16_t *utf16, unsigned int maxoutput)
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;
+const Guid guid_basic_data = GPT_ENT_TYPE_BASIC_DATA;
+const Guid guid_linux_data = GPT_ENT_TYPE_LINUX_FS;
const Guid guid_chromeos_reserved = GPT_ENT_TYPE_CHROMEOS_RESERVED;
const Guid guid_efi = GPT_ENT_TYPE_EFI;
const Guid guid_unused = GPT_ENT_TYPE_UNUSED;
@@ -684,6 +685,7 @@ const static struct {
{&guid_chromeos_kernel, "kernel", "ChromeOS kernel"},
{&guid_chromeos_rootfs, "rootfs", "ChromeOS rootfs"},
{&guid_linux_data, "data", "Linux data"},
+ {&guid_basic_data, "basicdata", "Basic data"},
{&guid_chromeos_reserved, "reserved", "ChromeOS reserved"},
{&guid_efi, "efi", "EFI System Partition"},
{&guid_unused, "unused", "Unused (nonexistent) partition"},
diff --git a/firmware/include/gpt.h b/firmware/include/gpt.h
index 80e1ea52..ff6ee322 100644
--- a/firmware/include/gpt.h
+++ b/firmware/include/gpt.h
@@ -49,7 +49,7 @@ extern "C" {
{{{0x3cb8e202,0x3b7e,0x47dd,0x8a,0x3c,{0x7f,0xf2,0xa1,0x3c,0xfc,0xec}}}}
#define GPT_ENT_TYPE_CHROMEOS_RESERVED \
{{{0x2e0a753d,0x9e48,0x43b0,0x83,0x37,{0xb1,0x51,0x92,0xcb,0x1b,0x5e}}}}
-#define GPT_ENT_TYPE_LINUX_DATA \
+#define GPT_ENT_TYPE_BASIC_DATA \
{{{0xebd0a0a2,0xb9e5,0x4433,0x87,0xc0,{0x68,0xb6,0xb7,0x26,0x99,0xc7}}}}
#define GPT_ENT_TYPE_LINUX_FS \
{{{0x0fc63daf,0x8483,0x4772,0x8e,0x79,{0x3d,0x69,0xd8,0x47,0x7d,0xe4}}}}
diff --git a/tests/run_cgpt_tests.sh b/tests/run_cgpt_tests.sh
index 81e5d3b6..3f186242 100755
--- a/tests/run_cgpt_tests.sh
+++ b/tests/run_cgpt_tests.sh
@@ -41,7 +41,7 @@ dd if=/dev/zero of=${DEV} conv=notrunc bs=512 count=${NUM_SECTORS} 2>/dev/null
DATA_START=100
DATA_SIZE=20
DATA_LABEL="data stuff"
-DATA_GUID='ebd0a0a2-b9e5-4433-87c0-68b6b72699c7'
+DATA_GUID='0fc63daf-8483-4772-8e79-3d69d8477de4'
DATA_NUM=1
KERN_START=200