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