diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index 0455f20..bff1633 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -24,7 +24,11 @@ set_perm_recursive() { file_getprop() { grep "^$2" "$1" | cut -d= -f2; } getprop() { test -e /sbin/getprop && /sbin/getprop $1 || file_getprop /default.prop $1; } cleanup() { rm -rf /tmp/anykernel; } -abort() { ui_print "$*"; umount /system; umount /data; exit 1; } +if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.cleanuponabort)" == 1 ]; then + abort() { ui_print "$*"; cleanup; umount /system; umount /data; exit 1; } + else + abort() { ui_print "$*"; umount /system; umount /data; exit 1; } +fi; show_progress 1.34 4; ui_print " "; diff --git a/README.md b/README.md index aab0bf4..5d17003 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ do.devicecheck=1 do.initd=1 do.modules=1 do.cleanup=1 +do.cleanuponabort=0 device.name1=maguro device.name2=toro device.name3=toroplus @@ -32,6 +33,8 @@ __do.modules=1__ will push the contents of the module directory to /system/lib/m __do.cleanup=0__ will keep the zip from removing it's working directory in /tmp/anykernel - this can be useful if trying to debug in adb shell whether the patches worked correctly. +__do.cleanuponabort=0__ will keep the zip from removing it's working directory in /tmp/anykernel in case of installation abort. + `is_slot_device=1` enables detection of the suffix for the active boot partition on slot-based devices and will add this to the end of the supplied `block=` path. ## // Command Methods ## @@ -82,4 +85,3 @@ Not required, but any tweaks you can't hardcode into the source (best practice) Have fun! - diff --git a/anykernel.sh b/anykernel.sh index ac1a3ed..3ae8fa1 100755 --- a/anykernel.sh +++ b/anykernel.sh @@ -8,6 +8,7 @@ do.devicecheck=1 do.initd=1 do.modules=0 do.cleanup=1 +do.cleanuponabort=0 device.name1=maguro device.name2=toro device.name3=toroplus