forked from commaai/eon-neos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flash.sh
executable file
·30 lines (22 loc) · 785 Bytes
/
flash.sh
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
#!/bin/bash -e
FASTBOOT=platform-tools/fastboot
VERSION="r28.0.2"
PLATFORM="$(uname -s | tr '[:upper:]' '[:lower:]')"
if [ ! -f $FASTBOOT ]; then
rm -rf platform-tools
rm -f platform-tools-latest-$PLATFORM.zip
curl -L https://dl.google.com/android/repository/platform-tools_$VERSION-$PLATFORM.zip --output platform-tools.zip
unzip platform-tools.zip
rm -f platform-tools.zip
fi
echo "Please enter your computer password if prompted"
sudo $FASTBOOT oem 4F500301 || true
sudo $FASTBOOT flash recovery recovery.img
# from OTA
[ -f files/logo.bin ] && $FASTBOOT flash LOGO files/logo.bin
sudo $FASTBOOT flash boot files/boot.img
sudo $FASTBOOT flash system files/system.img
# clear userdata
sudo $FASTBOOT erase userdata
sudo $FASTBOOT format cache
sudo $FASTBOOT reboot