Could anybody please confirm whether this script looks okay? It is meant to be run from an external sd.
Code:
#!/bin/sh
PLATFORM=freescale
if [ `dd if=/dev/mmcblk0 bs=512 skip=1024 count=1 | grep -c "HW CONFIG"` == 1 ]; then
CPU=`ntx_hwconfig -s -p /dev/mmcblk0 CPU`
PLATFORM=$CPU-ntx
fi
if [ -f "/etc/u-boot/${PLATFORM}/u-boot.recovery" ]; then
dd if=/etc/u-boot/${PLATFORM}/u-boot.recovery of=/dev/mmcblk0 bs=128k count=1 seek=6
sync
reboot
else
mount -o remount,rw /mnt/sd
sleep 2
echo "Cannot find /etc/u-boot/${PLATFORM}/u-boot.recovery" > /mnt/sd/factory_reset.log
sync
/bin/busybox poweroff
fi
For the older Kobo Touch, if it is running on an older FW (3.0.0 and older), one would have to set the PLATFORM to ntx508.