diff --git a/anykernel.sh b/anykernel.sh index 5e8b781..94a8741 100755 --- a/anykernel.sh +++ b/anykernel.sh @@ -16,6 +16,7 @@ device.name5= # shell variables block=/dev/block/platform/omap/omap_hsmmc.0/by-name/boot; +is_slot_device=0; ## end setup @@ -30,6 +31,15 @@ patch=/tmp/anykernel/patch; chmod -R 755 $bin; mkdir -p $ramdisk $split_img; +if [ "$is_slot_device" == 1 ]; then + slot=$(getprop ro.boot.slot_suffix 2>/dev/null); + test ! "$slot" && slot=$(grep -o 'androidboot.slot_suffix=.*$' /proc/cmdline | cut -d\ -f1 | cut -d= -f2); + test "$slot" && block=$block$slot; + if [ $? != 0 -o ! -e "$block" ]; then + ui_print " "; ui_print "Unable to determine active boot slot. Aborting..."; exit 1; + fi; +fi; + OUTFD=/proc/self/fd/$1; # ui_print