View Single Post
Old 07-04-2015, 04:23 PM   #1
tshering
Wizard
tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.tshering ought to be getting tired of karma fortunes by now.
 
Posts: 3,489
Karma: 2914715
Join Date: Jun 2012
Device: kobo touch
initiate factory reset by script

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.

Last edited by tshering; 07-04-2015 at 04:55 PM.
tshering is offline   Reply With Quote