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