Amit Pundir | ed3f821 | 2019-07-01 18:02:54 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | INSTALLER_DIR="`dirname ${0}`" |
| 4 | |
| 5 | QDL="`readlink -f ${INSTALLER_DIR}/qdl`" |
| 6 | FIRMWARE_DIR="dragonboard-845c-bootloader-ufs-aosp" |
| 7 | |
| 8 | # for cases that don't run "lunch db845c-userdebug" |
| 9 | if [ -z "${ANDROID_BUILD_TOP}" ]; then |
| 10 | ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../ |
| 11 | ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/db845c" |
| 12 | fi |
| 13 | |
| 14 | if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then |
| 15 | echo "RECOVERY: error in locating out directory, check if it exist" |
| 16 | exit |
| 17 | fi |
| 18 | |
| 19 | echo "android out dir:${ANDROID_PRODUCT_OUT}" |
| 20 | |
| 21 | # TODO: Pull one-time recovery/qdl path out of standard install |
| 22 | # Flash bootloader firmware files |
| 23 | if [ ! -d "${INSTALLER_DIR}/${FIRMWARE_DIR}/" ]; then |
| 24 | echo "RECOVERY: No firmware directory? Make sure binaries have been provided" |
| 25 | exit |
| 26 | fi |
| 27 | |
| 28 | pushd "${INSTALLER_DIR}/${FIRMWARE_DIR}" > /dev/null |
| 29 | sudo "${QDL}" prog_firehose_ddr.elf rawprogram[012345].xml patch[012345].xml |
| 30 | popd > /dev/null |
| 31 | |
| 32 | echo |
| 33 | echo |
| 34 | echo "RECOVERY: Please boot the db845c into fastboot mode, and use the flash-all-aosp.sh script!" |
| 35 | echo |