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