blob: dd6c7551bc52577bd597d327aeb74ea28e4a8b08 [file] [log] [blame]
Amit Pundired3f8212019-07-01 18:02:54 +00001#!/bin/bash
2
3INSTALLER_DIR="`dirname ${0}`"
4
5FIRMWARE_DIR="dragonboard-845c-bootloader-ufs-aosp"
6
7# for cases that don't run "lunch db845c-userdebug"
8if [ -z "${ANDROID_BUILD_TOP}" ]; then
9 ANDROID_BUILD_TOP=${INSTALLER_DIR}/../../../../../
10 ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/db845c"
11fi
12
13if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then
14 echo "FLASH-ALL-AOSP: error in locating out/target directory, check if it exist"
15 exit
16fi
17
18echo "android out dir:${ANDROID_PRODUCT_OUT}"
19
20# TODO: Pull one-time recovery/qdl path out of standard install
21# Flash bootloader firmware files
22if [ ! -d "${INSTALLER_DIR}/${FIRMWARE_DIR}/" ]; then
23 echo "FLASH-ALL-AOSP: No firmware directory? Make sure binaries have been provided"
24 exit
25fi
26
27pushd "${INSTALLER_DIR}/${FIRMWARE_DIR}" > /dev/null
28./flashall
29popd > /dev/null
30
31# Set HDMI monitor output
32echo "FLASH-ALL-AOSP: Set HDMI monitor output"
33fastboot oem select-display-panel foobar
34fastboot reboot bootloader
35
36# Slot _a is already marked as active by bootloader but just in case..
37echo "FLASH-ALL-AOSP: Mark _a slot as active"
38fastboot set_active a
John Stultzf36354e2020-01-14 00:10:06 +000039echo "FLASH-ALL-AOSP: Flash boot img"
40fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img
Amit Pundired3f8212019-07-01 18:02:54 +000041echo "FLASH-ALL-AOSP: Flash super/dynamic image"
42fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img
43echo "FLASH-ALL-AOSP: Flash userdata image"
44fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img
Amit Pundirdd5bd1b2020-12-22 13:46:24 +053045echo "FLASH-ALL-AOSP: Flash vendor_boot image"
46fastboot flash vendor_boot "${ANDROID_PRODUCT_OUT}"/vendor_boot.img
John Stultz43de10d2021-02-19 04:32:10 +000047echo "FLASH-ALL-AOSP: Formatting metadata"
48fastboot format:ext4 metadata
Amit Pundired3f8212019-07-01 18:02:54 +000049
John Stultz565dd572020-01-15 17:17:23 +000050fastboot reboot