ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/target/linux/mmp/base-files/sbin/flash_crawler b/target/linux/mmp/base-files/sbin/flash_crawler
new file mode 100755
index 0000000..95ad722
--- /dev/null
+++ b/target/linux/mmp/base-files/sbin/flash_crawler
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+echo "Scan all mtd partitions to handle bit-flip:"
+mtdX=$(cat /proc/mtd | sed '1d;s/: .*//')
+for mtd in $mtdX; do
+ name="$(awk '/^'$mtd':/{print gensub(/"/,"","g",$4)}' /proc/mtd)"
+ if [ "$name" = "OTA" ]; then
+ continue
+ fi
+
+ echo "Read $name" > /dev/console
+ dd if=/dev/$mtd of=/dev/null bs=4096 2>/dev/null
+ sleep 1
+done
+