blob: 626b9a6618b67ca7f8289b7db9e66e2ae3344173 [file] [log] [blame]
Amit Pundire4ca84a2021-05-26 14:30:57 +05301#!/bin/bash
2
3INSTALLER_DIR="`dirname ${0}`"
4
Amit Pundir2505ddf2024-03-29 11:54:48 +05305# for cases that don't run "lunch db845c-trunk_staging-userdebug"
Amit Pundire4ca84a2021-05-26 14:30:57 +05306if [ -z "${ANDROID_BUILD_TOP}" ]; then
Amit Pundirfbd3fbb2021-11-18 14:59:17 +05307 ANDROID_BUILD_TOP="`readlink -f ${INSTALLER_DIR}/../../../../../`"
Amit Pundire4ca84a2021-05-26 14:30:57 +05308fi
9
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053010. "${ANDROID_BUILD_TOP}/device/linaro/dragonboard/vendor-package-ver.sh"
Amit Pundire4ca84a2021-05-26 14:30:57 +053011
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053012FIRMWARE_DIR="${ANDROID_BUILD_TOP}/vendor/linaro/rb5/${EXPECTED_LINARO_VENDOR_VERSION}"
Amit Pundire4ca84a2021-05-26 14:30:57 +053013
14# TODO: Pull one-time recovery/qdl path out of standard install
15# Flash bootloader firmware files
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053016if [ ! -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 Pundire4ca84a2021-05-26 14:30:57 +053021 exit
22fi
23
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053024QDL="`readlink -f ${FIRMWARE_DIR}/qdl/qdl`"
25
26pushd "${FIRMWARE_DIR}/rb5-bootloader-ufs-aosp" > /dev/null
27echo "RECOVERY: Running QDL board recovery tool"
28sudo ${QDL} prog_firehose_ddr.elf rawprogram?.xml patch?.xml
Amit Pundire4ca84a2021-05-26 14:30:57 +053029popd > /dev/null
30
31echo
32echo
33echo "RECOVERY: Please boot the RB5 into fastboot mode, and use the flash-all-aosp.sh script!"
34echo