I have a small but in my opinion very important proposal of change in your update-binary sh script
At this moment your SuperSU installer writes TWICE entire $BOOTIMAGE block. As you (probably) know - the most popular flash memory in currently available devices is TLC (Triple Level Cell) with about 1000-writes durability of single memory cell. This is not a big problem for /data as "system takes care" about not writing to the same cell until all available space has been physically used already.
This is also not a big problem for normal users which install your update once or twice a month
BUT IMHO this is real problem for Devs/Chefs who use your ZIP as a part of custom rom installer. Sometimes they perform 10 or more iterations before release ready for use custom rom. It usually means 10 times of custom ROM flash processes = 30 times of $BOOTIMAGE writes! (1 - pure stock kernel, 2 - wipe $BOOTIMAGE by SuperSU, 3 - kernel patched by SuperSU)
In case you accept below proposal your installer will write $BOOTIMAGE only ONCE and is still capable of cleaning unused part of $BOOTIMAGE:
if ($CONTINUE); then
if ($SAMSUNG); then
# Prevent "KERNEL IS NOT SEANDROID ENFORCING"
SAMSUNG_CHECK=$(cat /sutmp/boot.img | grep SEANDROIDENFORCE)
if [ $? -ne 0 ]; then
echo -n "SEANDROIDENFORCE" >> /sutmp/boot.img
DEV=$(echo `resolve_link $BOOTIMAGE` | grep /dev/block/)
if [ $? -eq 0 ]; then
ui_print "- Flashing boot image"
cat /sutmp/boot.img /dev/zero | dd of=$BOOTIMAGE bs=4096 2>/dev/null
ui_print "- Saving boot image"
dd if=/sutmp/boot.img of=$BOOTIMAGE bs=4096
The most important change is marked in RED