-
Notifications
You must be signed in to change notification settings - Fork 0
/
flash.sh
61 lines (50 loc) · 1.44 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
echo
echo "--------------------------------------"
echo " Flash GSI Script "
echo " by "
echo " Imbroglius "
echo "--------------------------------------"
echo
echo
echo
echo
echo "--------------------------------------"
echo " !!!ATTENTION!!! "
echo " use only when your "
echo " bootloader is already unlocked "
echo " and you have already "
echo " a GSI ROM installed! "
echo "--------------------------------------"
echo
echo
echo
read -p "Press any key to continue. Or exit the script with Strg+C"
set -e
FIMAGE=$1
rebootFastbootD () {
read -p "Press any key to continue. The Image you want to flash is: $FIMAGE"
echo "we now boot the phone into FastbootD"
fastboot reboot fastboot
}
deletePartitions () {
echo "Now we delete the partitions"
fastboot delete-logical-partition product
fastboot delete-logical-partition product_a
fastboot delete-logical-partition product_b
}
flashSystem () {
echo "Now the Image will be flashed to System partition."
fastboot flash system "$FIMAGE"
}
rebootRecovery () {
echo "Now the phone is rebooted into recovery"
fastboot reboot recovery
}
rebootFastbootD
deletePartitions
flashSystem
rebootRecovery
echo "Your phone will now be rebooted into recovery mode"
echo "if it is no dirty flash please wipe data there"
echo "and reboot your phone."