#!/system/bin/sh
sysid=`cat /proc/cmdline | busybox grep system1`
if [ -n "$sysid" ]; then
sysid=1
fi
if ! applypatch -c EMMC:/dev/block/platform/msm_sdcc.1/by-name/recovery:16250880:1d5c46212ab722f9977bbdc344f3f0445b9ff007; then
  applypatch -b /system/etc/recovery-resource.dat EMMC:/dev/block/platform/msm_sdcc.1/by-name/boot$sysid:14743552:f6d6c293ffadfb80128e186bbb3f4dac85b9f79c EMMC:/dev/block/platform/msm_sdcc.1/by-name/recovery 1d5c46212ab722f9977bbdc344f3f0445b9ff007 16250880 f6d6c293ffadfb80128e186bbb3f4dac85b9f79c:/system/recovery-from-boot.p && log -t recovery "Installing new recovery image: succeeded" || log -t recovery "Installing new recovery image: failed"
else
  log -t recovery "Recovery image already installed"
fi
