diff options
Diffstat (limited to 'flash_tools/brillo-flashall.sh')
-rwxr-xr-x | flash_tools/brillo-flashall.sh | 22 |
1 files changed, 20 insertions, 2 deletions
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" |