Skip to content

Commit

Permalink
Dual recovery
Browse files Browse the repository at this point in the history
* Add TWRP recovery ramdisk
* Change event to volume keys in bootrec-device
* Add separate cases to check vol up and vol down for both the recoverys(Thanks DooMLoRD)
  • Loading branch information
Abhinav1997 committed May 13, 2014
1 parent f98eda8 commit 6096ed0
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sbin/bootrec-device 100644 → 100755
@@ -1,6 +1,6 @@
#!/sbin/busybox sh

export BOOTREC_EVENT_NODE="/dev/input/event2 c 13 66"
export BOOTREC_EVENT="/dev/input/event2"
export BOOTREC_EVENT_NODE="/dev/input/event1 c 13 65"
export BOOTREC_EVENT="/dev/input/event1"
export BOOTREC_FOTA_NODE="/dev/block/mmcblk0p13 b 179 13"
export BOOTREC_FOTA="/dev/block/mmcblk0p13"
29 changes: 28 additions & 1 deletion sbin/init.sh 100644 → 100755
Expand Up @@ -43,7 +43,34 @@ load_image=/sbin/ramdisk.cpio
if [ -s /dev/keycheck ] || busybox grep -q warmboot=0x5502 /proc/cmdline; then
busybox echo 'RECOVERY BOOT' >>boot.txt
# recovery ramdisk
load_image=/sbin/ramdisk-recovery.cpio

##Handle multiple recovery ramdisks based on keypress
# Thanks a lot to the great DooMLoRD
# default recovery ramdisk is CWM
load_image=/sbin/ramdisk-recovery-cwm.cpio

if [ -s /dev/keycheck ]
then
busybox hexdump < /dev/keycheck > /dev/keycheck1

export VOLUKEYCHECK=`busybox cat /dev/keycheck1 | busybox grep '0001 0073'`
export VOLDKEYCHECK=`busybox cat /dev/keycheck1 | busybox grep '0001 0072'`

busybox rm /dev/keycheck
busybox rm /dev/keycheck1

if [ -n "$VOLUKEYCHECK" ]
then
#load cwm ramdisk
load_image=/sbin/ramdisk-recovery-cwm.cpio
fi

if [ -n "$VOLDKEYCHECK" ]
then
#load twrp ramdisk
load_image=/sbin/ramdisk-recovery-twrp.cpio
fi
fi
else
busybox echo 'ANDROID BOOT' >>boot.txt
fi
Expand Down
File renamed without changes.
Binary file added sbin/ramdisk-recovery-twrp.cpio
Binary file not shown.

0 comments on commit 6096ed0

Please sign in to comment.