rendered paste bodyfail() {
/bin/echo "Failed"
clear
/bin/echo "$1"
exec /bin/sh
}
/bin/echo "Recovery loaded."
if [ "$CARD_PATH" = "" ];then
CARD_PATH="andboot"
fi;
if [ -d /sdcard/$CARD_PATH ] ; then
card=/sdcard/$CARD_PATH
else
card=/sdcard
fi
[ -d /tmp ] || mkdir /tmp
mount $card/tmp /tmp
[ $? -eq 0 ] || fail "Failed to mount TMP directory. Cannot continue"
mount -t auto -o noatime,nodiratime,rw /dev/block/mmcblk0p2 /system
[ $? -eq 0 ] || fail "Failed to mount SYSTEM partition. Cannot continue"
mount -t auto -o noatime,nodiratime,rw /dev/block/mmcblk0p3 /data
[ $? -eq 0 ] || fail "Failed to mount DATA partition. Cannot continue"
mount -t auto -o noatime,nodiratime,rw /dev/block/mmcblk0p4 /cache
[ $? -eq 0 ] || fail "Failed to mount DATA partition. Cannot continue."
read -s -n3 -p "Press Volume Down SHORTLY to go in CWM Recovery" -t5 keypress
if [ "$keypress" = "[2" ] ; then
if [ ! -d /cache/recovery ] ; then
mkdir /cache/recovery
fi
if cat /proc/cpuinfo | grep -q Kovsky ; then
echo -n "XPERIA detected"
mount --bind /sbin/recoveryx /sbin/recovery
fi
exec /recovery/init.recovery
else
exec /init