blob: 000047806d2808feec06b1e6d09385dc0c6f8e44 [file] [log] [blame]
Amit Pundired3f8212019-07-01 18:02:54 +00001#!/bin/bash
Amit Pundired3f8212019-07-01 18:02:54 +00002INSTALLER_DIR="`dirname ${0}`"
3
Amit Pundired3f8212019-07-01 18:02:54 +00004# for cases that don't run "lunch db845c-userdebug"
5if [ -z "${ANDROID_BUILD_TOP}" ]; then
Amit Pundirfbd3fbb2021-11-18 14:59:17 +05306 ANDROID_BUILD_TOP="`readlink -f ${INSTALLER_DIR}/../../../../../`"
Amit Pundired3f8212019-07-01 18:02:54 +00007 ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/db845c"
8fi
9
10if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053011 echo "FLASH-ALL-AOSP: error in locating ${ANDROID_PRODUCT_OUT}/ directory, check if it exist"
Amit Pundired3f8212019-07-01 18:02:54 +000012 exit
13fi
14
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053015. "${ANDROID_BUILD_TOP}/device/linaro/dragonboard/vendor-package-ver.sh"
16
17FIRMWARE_DIR="${ANDROID_BUILD_TOP}/vendor/linaro/db845c/${EXPECTED_LINARO_VENDOR_VERSION}"
Amit Pundired3f8212019-07-01 18:02:54 +000018
19# TODO: Pull one-time recovery/qdl path out of standard install
20# Flash bootloader firmware files
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053021if [ ! -d "${FIRMWARE_DIR}/" ]; then
22 echo "FLASH-ALL-AOSP: Missing vendor firmware package?"
23 echo " Make sure the vendor binaries have been downloaded from"
24 echo " ${VND_PKG_URL}"
25 echo " and extracted to $ANDROID_BUILD_TOP."
Amit Pundired3f8212019-07-01 18:02:54 +000026 exit
27fi
28
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053029pushd "${FIRMWARE_DIR}/dragonboard-845c-bootloader-ufs-aosp" > /dev/null
30echo "FLASH-ALL-AOSP: Flash bootloader images"
Amit Pundired3f8212019-07-01 18:02:54 +000031./flashall
32popd > /dev/null
33
34# Set HDMI monitor output
35echo "FLASH-ALL-AOSP: Set HDMI monitor output"
36fastboot oem select-display-panel foobar
37fastboot reboot bootloader
38
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053039echo "android out dir:${ANDROID_PRODUCT_OUT}"
40
Amit Pundired3f8212019-07-01 18:02:54 +000041# Slot _a is already marked as active by bootloader but just in case..
42echo "FLASH-ALL-AOSP: Mark _a slot as active"
43fastboot set_active a
John Stultzf36354e2020-01-14 00:10:06 +000044echo "FLASH-ALL-AOSP: Flash boot img"
45fastboot flash boot "${ANDROID_PRODUCT_OUT}"/boot.img
Amit Pundired3f8212019-07-01 18:02:54 +000046echo "FLASH-ALL-AOSP: Flash super/dynamic image"
47fastboot flash super "${ANDROID_PRODUCT_OUT}"/super.img
48echo "FLASH-ALL-AOSP: Flash userdata image"
49fastboot flash userdata "${ANDROID_PRODUCT_OUT}"/userdata.img
Amit Pundirdd5bd1b2020-12-22 13:46:24 +053050echo "FLASH-ALL-AOSP: Flash vendor_boot image"
51fastboot flash vendor_boot "${ANDROID_PRODUCT_OUT}"/vendor_boot.img
John Stultz43de10d2021-02-19 04:32:10 +000052echo "FLASH-ALL-AOSP: Formatting metadata"
53fastboot format:ext4 metadata
Amit Pundired3f8212019-07-01 18:02:54 +000054
Amit Pundirfbd3fbb2021-11-18 14:59:17 +053055echo "FLASH-ALL-AOSP: Rebooting"
John Stultz565dd572020-01-15 17:17:23 +000056fastboot reboot