Amit Pundir | e4ca84a | 2021-05-26 14:30:57 +0530 | [diff] [blame^] | 1 | #!/bin/bash |
| 2 | |
| 3 | INSTALLER_DIR="`dirname ${0}`" |
| 4 | |
| 5 | QDL="`readlink -f ${INSTALLER_DIR}/qdl`" |
| 6 | FIRMWARE_DIR="rb5-bootloader-ufs-aosp" |
| 7 | |
| 8 | # for cases that don't run "lunch rb5-userdebug" |
| 9 | if [ -z "${ANDROID_BUILD_TOP}" ]; then |
| 10 | ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../ |
| 11 | ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/rb5" |
| 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?.xml patch?.xml |
| 30 | popd > /dev/null |
| 31 | |
| 32 | echo |
| 33 | echo |
| 34 | echo "RECOVERY: Please boot the RB5 into fastboot mode, and use the flash-all-aosp.sh script!" |
| 35 | echo |