diff options
author | Irina Patru <irina.patru@intel.com> | 2016-05-18 16:45:52 +0300 |
---|---|---|
committer | Bruce Beare <bruce.j.beare@intel.com> | 2016-05-23 15:20:49 -0700 |
commit | 5127e85f7a718e8c48691fa9b415fe3c69b08e5b (patch) | |
tree | 4966f5ed5ef95a7440a8760aa731a7c332c21607 | |
parent | dd0652bd73006b48fe582243df07f4aeddb8913c (diff) | |
download | minnowboard-main.tar.gz |
Use the gpt image created by bpttool from device-partitions.bpt file.
The provision script is updated accordingly.
Change-Id: Id4b90ba86a8feae6ade6a6e1d700986eaff031dc
Tracked-On: https://jira01.devtools.intel.com/browse/BP-379
Signed-off-by: Irina Patru <irina.patru@intel.com>
Signed-off-by: Stefan Stanacar <stefan.stanacar@intel.com>
-rw-r--r-- | BoardConfig.mk | 7 | ||||
-rw-r--r-- | build/tasks/flashfiles.mk | 2 | ||||
-rw-r--r-- | device-partitions.bpt | 14 | ||||
-rwxr-xr-x | flash_tools/brillo-flashall.sh | 22 |
4 files changed, 38 insertions, 7 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk index 6fa83a1..a4270cf 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -42,8 +42,7 @@ $(call add_peripheral, intel, bootctrl) BOARD_HAVE_BLUETOOTH_LINUX := true -# NOTE: These values must be kept in sync with BOARD_GPT_INI -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 268435456 +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 536870912 BOARD_BOOTLOADER_PARTITION_SIZE := 20971520 BOARD_USERDATAIMAGE_PARTITION_SIZE := 536870912 TARGET_USERIMAGES_USE_EXT4 := true @@ -77,6 +76,8 @@ BOOTLOADER_USE_PREBUILT := $(shell echo $${BOOTLOADER_USE_PREBUILT:-true}) # on the first pass for make and to thus get around a build system bug. BOARD_SEPOLICY_DIRS := $(BOARD_SEPOLICY_DIRS) device/intel/minnowboard/sepolicy +BOARD_BPT_INPUT_FILES += device/intel/minnowboard/device-partitions.bpt + vendor_partition_directory := vendor/bsp/intel/minnowboard PRODUCT_COPY_FILES += \ @@ -85,7 +86,6 @@ PRODUCT_COPY_FILES += \ ifeq ($(BOOTLOADER_USE_PREBUILT),false) PRODUCT_COPY_FILES += \ - $(vendor_partition_directory)/boot_binaries/gpt.bin:gpt.bin \ $(vendor_partition_directory)/boot_binaries/oemvars.txt:oemvars.txt endif @@ -93,7 +93,6 @@ BRILLO_VENDOR_PARTITIONS := \ $(vendor_partition_directory)/boot_binaries:bootloader \ $(vendor_partition_directory)/boot_binaries:fastboot-usb.img \ $(vendor_partition_directory)/boot_binaries:oemvars.txt \ - $(vendor_partition_directory)/boot_binaries:gpt.bin \ $(vendor_partition_directory)/boot_binaries:README # Must defined at the end of the file diff --git a/build/tasks/flashfiles.mk b/build/tasks/flashfiles.mk index 9527331..ec49379 100644 --- a/build/tasks/flashfiles.mk +++ b/build/tasks/flashfiles.mk @@ -29,11 +29,11 @@ MINNOWBOARD_BINARIES := $(MINNOWBOARD_VENDOR)/boot_binaries MINNOWBOARD_DEVICE := device/intel/minnowboard MINNOWBOARD_TOOLS := $(MINNOWBOARD_DEVICE)/flash_tools -MINNOWBOARD_FLASHFILES += $(MINNOWBOARD_BINARIES)/gpt.bin MINNOWBOARD_FLASHFILES += $(MINNOWBOARD_BINARIES)/bootloader MINNOWBOARD_FLASHFILES += $(MINNOWBOARD_BINARIES)/oemvars.txt MINNOWBOARD_FLASHFILES += $(MINNOWBOARD_TOOLS)/brillo-flashall.sh MINNOWBOARD_FLASHFILES += $(MINNOWBOARD_TOOLS)/README +MINNOWBOARD_FLASHFILES += $(PRODUCT_OUT)/partition-table.img MINNOWBOARD_FLASHFILES += $(PRODUCT_OUT)/boot.img MINNOWBOARD_FLASHFILES += $(PRODUCT_OUT)/system.img MINNOWBOARD_FLASHFILES += $(PRODUCT_OUT)/userdata.img diff --git a/device-partitions.bpt b/device-partitions.bpt new file mode 100644 index 0000000..ceb99b0 --- /dev/null +++ b/device-partitions.bpt @@ -0,0 +1,14 @@ +{ + "partitions": [ + { + "label": "bootloader", + "size": "20 MiB", + "type_guid": "linux_fs" + }, + { + "label": "bootloader2", + "size": "20 MiB", + "type_guid": "linux_fs" + } + ] +} diff --git a/flash_tools/brillo-flashall.sh b/flash_tools/brillo-flashall.sh index 4719e3f..f2d74b7 100755 --- a/flash_tools/brillo-flashall.sh +++ b/flash_tools/brillo-flashall.sh @@ -60,8 +60,25 @@ else FASTBOOT=fastboot fi +# +# Due to possible changes in the u-boot version, we might have some +# issues flashing gpt or recognizing the _a/_b partitions. If we do +# have a failure, we must first re-flash bootloader and reboot to the +# updated version +set +e +fastboot flash gpt "${OS}"/partition-table.img "$@" +bootloader_rc=$? +fastboot flash boot_a "${OS}"/boot.img "$@" +boota_rc=$? +if [ $bootloader_rc -ne 0 -o $boota_rc -ne 0 ]; then + fastboot flash bootloader "${VENDOR}"/bootloader \ + reboot bootloader \ + "$@" +fi + +set -e ${FASTBOOT} \ - flash gpt "${VENDOR}"/gpt.bin \ + flash gpt "${OS}"/partition-table.img \ flash bootloader "${VENDOR}"/bootloader \ flash boot_a "${OS}"/boot.img \ flash boot_b "${OS}"/boot.img \ @@ -69,7 +86,8 @@ ${FASTBOOT} \ flash system_b "${OS}"/system.img \ flash userdata "${OS}"/userdata.img \ flash oemvars "${VENDOR}"/oemvars.txt \ - oem set_active 0 "$@" + set_active _a \ + "$@" echo "Please run the following command to restart your MinnowBoard" echo " ${FASTBOOT} $@ reboot" |