summaryrefslogtreecommitdiff
path: root/installer/rb5/recovery.sh
blob: 156a16d0cc9c62afe7f39ef4de296bc5b0e722e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

INSTALLER_DIR="`dirname ${0}`"

# for cases that don't run "lunch rb5-userdebug"
if [ -z "${ANDROID_BUILD_TOP}" ]; then
    ANDROID_BUILD_TOP="`readlink -f ${INSTALLER_DIR}/../../../../../`"
fi

. "${ANDROID_BUILD_TOP}/device/linaro/dragonboard/vendor-package-ver.sh"

FIRMWARE_DIR="${ANDROID_BUILD_TOP}/vendor/linaro/rb5/${EXPECTED_LINARO_VENDOR_VERSION}"

# TODO: Pull one-time recovery/qdl path out of standard install
# Flash bootloader firmware files
if [ ! -d "${FIRMWARE_DIR}/" ]; then
    echo "RECOVERY: Missing vendor firmware package?"
    echo "          Make sure the vendor binaries have been downloaded from"
    echo "          ${VND_PKG_URL}"
    echo "          and extracted to $ANDROID_BUILD_TOP."
    exit
fi

QDL="`readlink -f ${FIRMWARE_DIR}/qdl/qdl`"

pushd "${FIRMWARE_DIR}/rb5-bootloader-ufs-aosp" > /dev/null
echo "RECOVERY: Running QDL board recovery tool"
sudo ${QDL} prog_firehose_ddr.elf rawprogram?.xml patch?.xml
popd > /dev/null

echo
echo
echo "RECOVERY: Please boot the RB5 into fastboot mode, and use the flash-all-aosp.sh script!"
echo