Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 1 | #!/bin/bash |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 2 | INSTALLER_DIR="`dirname ${0}`" |
| 3 | |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 4 | # for cases that don't run "lunch db845c-userdebug" |
| 5 | if [ -z "${ANDROID_BUILD_TOP}" ]; then |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 6 | ANDROID_BUILD_TOP="`readlink -f ${INSTALLER_DIR}/../../../../../`" |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 7 | ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/db845c" |
| 8 | fi |
| 9 | |
| 10 | if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 11 | echo "FLASH-ALL-AOSP: error in locating ${ANDROID_PRODUCT_OUT}/ directory, check if it exist" |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 12 | exit |
| 13 | fi |
| 14 | |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 15 | . "${ANDROID_BUILD_TOP}/device/linaro/dragonboard/vendor-package-ver.sh" |
| 16 | |
| 17 | FIRMWARE_DIR="${ANDROID_BUILD_TOP}/vendor/linaro/db845c/${EXPECTED_LINARO_VENDOR_VERSION}" |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 18 | |
| 19 | # TODO: Pull one-time recovery/qdl path out of standard install |
| 20 | # Flash bootloader firmware files |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 21 | if [ ! -d "${FIRMWARE_DIR}/" ]; then |
| 22 | echo "FLASH-ALL-AOSP: Missing vendor firmware package?" |
| 23 | echo " Make sure the vendor binaries have been downloaded from" |
| 24 | echo " ${VND_PKG_URL}" |
| 25 | echo " and extracted to $ANDROID_BUILD_TOP." |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 26 | exit |
| 27 | fi |
| 28 | |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 29 | pushd "${FIRMWARE_DIR}/dragonboard-845c-bootloader-ufs-aosp" > /dev/null |
| 30 | echo "FLASH-ALL-AOSP: Flash bootloader images" |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 31 | ./flashall |
| 32 | popd > /dev/null |
| 33 | |
| 34 | # Set HDMI monitor output |
| 35 | echo "FLASH-ALL-AOSP: Set HDMI monitor output" |
| 36 | fastboot oem select-display-panel foobar |
| 37 | fastboot reboot bootloader |
| 38 | |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 39 | echo "android out dir:${ANDROID_PRODUCT_OUT}" |
| 40 | |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 41 | # Slot _a is already marked as active by bootloader but just in case.. |
| 42 | echo "FLASH-ALL-AOSP: Mark _a slot as active" |
| 43 | fastboot set_active a |
John Stultz | f36354e | 2020-01-14 00:10:06 +0000 | [diff] [blame] | 44 | echo "FLASH-ALL-AOSP: Flash boot img" |
| 45 | fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 46 | echo "FLASH-ALL-AOSP: Flash super/dynamic image" |
| 47 | fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img |
| 48 | echo "FLASH-ALL-AOSP: Flash userdata image" |
| 49 | fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img |
Amit Pundir | dd5bd1b | 2020-12-22 13:46:24 +0530 | [diff] [blame] | 50 | echo "FLASH-ALL-AOSP: Flash vendor_boot image" |
| 51 | fastboot flash vendor_boot "${ANDROID_PRODUCT_OUT}"/vendor_boot.img |
John Stultz | 43de10d | 2021-02-19 04:32:10 +0000 | [diff] [blame] | 52 | echo "FLASH-ALL-AOSP: Formatting metadata" |
| 53 | fastboot format:ext4 metadata |
Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 54 | |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 55 | echo "FLASH-ALL-AOSP: Rebooting" |
John Stultz | 565dd57 | 2020-01-15 17:17:23 +0000 | [diff] [blame] | 56 | fastboot reboot |