add jffs2_mark_erase function for erasing jffs2 partitions on the next mount (typical...
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 16 Apr 2007 23:29:44 +0000 (23:29 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Mon, 16 Apr 2007 23:29:44 +0000 (23:29 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6978 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/base-files/files/etc/functions.sh

index dac46a3..86ea82d 100755 (executable)
@@ -186,3 +186,13 @@ strtok() { # <string> { <variable> [<separator>] ... }
 
        return $count
 }
+
+
+jffs2_mark_erase() {
+       local part="$(find_mtd_part "$1")"
+       [ -z "$part" ] && {
+               echo Partition not found.
+               return 1
+       }
+       echo -e "\xde\xad\xc0\xde" | mtd -qq write - "$1"
+}