Quantcast
Channel: MobileRead Forums - Kobo Developer's Corner
Viewing all articles
Browse latest Browse all 1561

initiate factory reset by script

$
0
0
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.

Viewing all articles
Browse latest Browse all 1561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>