cgpt: Change stateful partition type GUID to TYPE_LINUX_FS

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>
diff --git a/cgpt/cgpt_common.c b/cgpt/cgpt_common.c
index e98a453..04eab33 100644
--- a/cgpt/cgpt_common.c
+++ b/cgpt/cgpt_common.c
@@ -670,7 +670,8 @@
 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 @@
   {&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 80e1ea5..ff6ee32 100644
--- a/firmware/include/gpt.h
+++ b/firmware/include/gpt.h
@@ -49,7 +49,7 @@
 	{{{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 81e5d3b..3f18624 100755
--- a/tests/run_cgpt_tests.sh
+++ b/tests/run_cgpt_tests.sh
@@ -41,7 +41,7 @@
 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