blob: ae54514b2f0eb13e4553fb766cd9061b0efa5a34 [file] [log] [blame]
Vishal Bhojca1fbcd2015-12-16 00:25:24 +05301#!/bin/bash
2if [ $# -eq 0 ]
3 then
4 echo "Provide the right /dev/ttyUSBX specific to recovery device"
5 exit
6fi
7
8if [ ! -e $1 ]
9 then
10 echo "device: $1 does not exist"
11 exit
12fi
13
Dmitry Shmidt06cb4cd2016-01-27 11:00:33 -080014PTABLE=ptable-aosp-8g.img
15if [ $# -gt 1 ]
16 then
17 if [ $2 == '4g' ]
18 then
19 PTABLE=ptable-aosp-4g.img
20 fi
21fi
22
Vishal Bhojca1fbcd2015-12-16 00:25:24 +053023INSTALLER_DIR="`dirname $0`"
24ANDROID_TOP=${INSTALLER_DIR}/../../../../
25python ${INSTALLER_DIR}/hisi-idt.py --img1=${INSTALLER_DIR}/l-loader.bin -d ${1}
Dmitry Shmidt06cb4cd2016-01-27 11:00:33 -080026fastboot flash ptable ${INSTALLER_DIR}/${PTABLE}
Vishal Bhojca1fbcd2015-12-16 00:25:24 +053027fastboot flash fastboot ${INSTALLER_DIR}/fip.bin
28fastboot flash nvme ${INSTALLER_DIR}/nvme.img
29fastboot flash boot ${ANDROID_TOP}/out/target/product/hikey/boot_fat.uefi.img
30fastboot flash system ${ANDROID_TOP}/out/target/product/hikey/system.img
31fastboot flash cache ${ANDROID_TOP}/out/target/product/hikey/cache.img
32fastboot flash userdata ${ANDROID_TOP}/out/target/product/hikey/userdata.img