Amit Pundir | e4ca84a | 2021-05-26 14:30:57 +0530 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | INSTALLER_DIR="`dirname ${0}`" |
| 4 | |
Amit Pundir | 2505ddf | 2024-03-29 11:54:48 +0530 | [diff] [blame^] | 5 | # for cases that don't run "lunch db845c-trunk_staging-userdebug" |
Amit Pundir | e4ca84a | 2021-05-26 14:30:57 +0530 | [diff] [blame] | 6 | if [ -z "${ANDROID_BUILD_TOP}" ]; then |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 7 | ANDROID_BUILD_TOP="`readlink -f ${INSTALLER_DIR}/../../../../../`" |
Amit Pundir | e4ca84a | 2021-05-26 14:30:57 +0530 | [diff] [blame] | 8 | fi |
| 9 | |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 10 | . "${ANDROID_BUILD_TOP}/device/linaro/dragonboard/vendor-package-ver.sh" |
Amit Pundir | e4ca84a | 2021-05-26 14:30:57 +0530 | [diff] [blame] | 11 | |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 12 | FIRMWARE_DIR="${ANDROID_BUILD_TOP}/vendor/linaro/rb5/${EXPECTED_LINARO_VENDOR_VERSION}" |
Amit Pundir | e4ca84a | 2021-05-26 14:30:57 +0530 | [diff] [blame] | 13 | |
| 14 | # TODO: Pull one-time recovery/qdl path out of standard install |
| 15 | # Flash bootloader firmware files |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 16 | if [ ! -d "${FIRMWARE_DIR}/" ]; then |
| 17 | echo "RECOVERY: Missing vendor firmware package?" |
| 18 | echo " Make sure the vendor binaries have been downloaded from" |
| 19 | echo " ${VND_PKG_URL}" |
| 20 | echo " and extracted to $ANDROID_BUILD_TOP." |
Amit Pundir | e4ca84a | 2021-05-26 14:30:57 +0530 | [diff] [blame] | 21 | exit |
| 22 | fi |
| 23 | |
Amit Pundir | fbd3fbb | 2021-11-18 14:59:17 +0530 | [diff] [blame] | 24 | QDL="`readlink -f ${FIRMWARE_DIR}/qdl/qdl`" |
| 25 | |
| 26 | pushd "${FIRMWARE_DIR}/rb5-bootloader-ufs-aosp" > /dev/null |
| 27 | echo "RECOVERY: Running QDL board recovery tool" |
| 28 | sudo ${QDL} prog_firehose_ddr.elf rawprogram?.xml patch?.xml |
Amit Pundir | e4ca84a | 2021-05-26 14:30:57 +0530 | [diff] [blame] | 29 | popd > /dev/null |
| 30 | |
| 31 | echo |
| 32 | echo |
| 33 | echo "RECOVERY: Please boot the RB5 into fastboot mode, and use the flash-all-aosp.sh script!" |
| 34 | echo |