Merge "Add support for Brillo Partitioning Tool" am: 11a031c3dd
am: 17ae5f312d

* commit '17ae5f312d49b1f2022566f8a846f7087952f70b':
  Add support for Brillo Partitioning Tool

Change-Id: I85ca85d22adfa0d81b7c0299a9cdbb93410cbf4e
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 829e84e..0688720 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -32,7 +32,7 @@
 # Bootctrl HAL
 $(call add_peripheral, intel, bootctrl)
 
-BOARD_SYSTEMIMAGE_PARTITION_SIZE := 268435456
+BOARD_SYSTEMIMAGE_PARTITION_SIZE := 536870912
 BOARD_USERDATAIMAGE_PARTITION_SIZE := 536870912
 BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456
 BOARD_U_BOOT_ENV_SIZE := 0x10000
@@ -62,10 +62,11 @@
 BOARD_SEPOLICY_DIRS += \
     device/intel/edison/sepolicy
 
+BOARD_BPT_INPUT_FILES += device/intel/edison/device-partitions.bpt
+
 vendor_partition_directory := vendor/bsp/intel/edison
 BRILLO_VENDOR_PARTITIONS := \
-    $(vendor_partition_directory)/uboot_firmware:u-boot-edison.bin \
-    $(vendor_partition_directory)/uboot_firmware:gpt.bin
+    $(vendor_partition_directory)/uboot_firmware:u-boot-edison.bin
 
 DEVICE_PACKAGES += peripheral_io.$(TARGET_DEVICE)
 
diff --git a/build/tasks/flashfiles.mk b/build/tasks/flashfiles.mk
index fb070d3..f4d5785 100644
--- a/build/tasks/flashfiles.mk
+++ b/build/tasks/flashfiles.mk
@@ -18,7 +18,7 @@
 EDISON_FLASHFILES := $(INSTALLED_BOOTIMAGE_TARGET)
 EDISON_FLASHFILES += $(INSTALLED_SYSTEMIMAGE)
 EDISON_FLASHFILES += $(INSTALLED_USERDATAIMAGE_TARGET)
-EDISON_FLASHFILES += $(EDISON_UBOOT)/gpt.bin
+EDISON_FLASHFILES += $(PRODUCT_OUT)/partition-table.img
 EDISON_FLASHFILES += $(EDISON_IFWI)/edison_ifwi-dbg-00.bin \
                      $(EDISON_IFWI)/edison_dnx_fwr.bin \
                      $(EDISON_IFWI)/edison_dnx_osr.bin
diff --git a/device-partitions.bpt b/device-partitions.bpt
new file mode 100644
index 0000000..d4bb07b
--- /dev/null
+++ b/device-partitions.bpt
@@ -0,0 +1,22 @@
+{
+	"settings": {
+		"disk_size": "3.64 GiB"
+	},
+	"partitions": [
+	{
+		"label": "u-boot",
+		"size": "4980 KiB",
+		"type_guid": "linux_fs",
+		"position": 1
+	},
+	{
+		"label": "security",
+		"size": "3 MiB",
+		"position": 2
+	},
+	{
+		"label": "sfitables",
+		"size": "1 MiB"
+	}
+	]
+}
diff --git a/flash_tools/FlashEdison.json b/flash_tools/FlashEdison.json
index 7e77499..8d03f29 100644
--- a/flash_tools/FlashEdison.json
+++ b/flash_tools/FlashEdison.json
@@ -175,7 +175,7 @@
             "gpt_file": {
                 "type": "file",
                 "description": "Partition Table",
-                "value": "gpt.bin",
+                "value": "partition-table.img",
                 "name": "Partition Table"
             }
         },
diff --git a/flash_tools/brillo-flashall-edison.bat b/flash_tools/brillo-flashall-edison.bat
index b6e8b90..4ac8373 100755
--- a/flash_tools/brillo-flashall-edison.bat
+++ b/flash_tools/brillo-flashall-edison.bat
@@ -18,7 +18,7 @@
 :: Only execute this script on a Brillo provisioned Edison.
 :: See your Brillo-Edison online information for initial provisioning and recovery.
 
-fastboot flash gpt      gpt.bin
+fastboot flash gpt      partition-table.img
 fastboot flash u-boot   u-boot-edison.bin
 fastboot flash boot_a   boot.img
 fastboot flash system_a system.img
diff --git a/flash_tools/brillo-flashall-edison.sh b/flash_tools/brillo-flashall-edison.sh
index 17b53b2..f7ecafd 100755
--- a/flash_tools/brillo-flashall-edison.sh
+++ b/flash_tools/brillo-flashall-edison.sh
@@ -33,16 +33,16 @@
     "${ANDROID_BUILD_TOP}/vendor/bsp/intel/edison/uboot_firmware")
 
 #
-# Due to possible changes in the u-boot version, we might have some issues flashing gpt.bin.
+# Due to possible changes in the u-boot version, we might have some issues flashing gpt.
 # If we do have a failure, we must first re-flash u-boot and reboot to the new u-boot.
-fastboot flash gpt "${VENDOR}"/gpt.bin "$@"
+fastboot flash gpt "${OS}"/partition-table.img "$@"
 if [ $? -ne 0 ]; then
     fastboot flash u-boot "${VENDOR}"/u-boot-edison.bin \
              reboot bootloader \
              "$@"
 fi
 
-fastboot flash gpt     "${VENDOR}"/gpt.bin \
+fastboot flash gpt     "${OS}"/partition-table.img \
 	flash u-boot   "${VENDOR}"/u-boot-edison.bin \
 	flash boot_a   "${OS}"/boot.img \
 	flash system_a "${OS}"/system.img \