summaryrefslogtreecommitdiff
path: root/package/base-files/files/etc
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-04-16 23:29:44 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-04-16 23:29:44 +0000
commit45c01cae72a0b8115d938e419dc679740328296d (patch)
treee4149fdd9ffc3a277b6de70abb6295149f0839ca /package/base-files/files/etc
parent1612bd2f9170c5aa96d96bac7ce71699f5ccdc70 (diff)
downloadmtk-20170518-45c01cae72a0b8115d938e419dc679740328296d.zip
mtk-20170518-45c01cae72a0b8115d938e419dc679740328296d.tar.gz
mtk-20170518-45c01cae72a0b8115d938e419dc679740328296d.tar.bz2
add jffs2_mark_erase function for erasing jffs2 partitions on the next mount (typically faster than doing mtd erase manually)
SVN-Revision: 6978
Diffstat (limited to 'package/base-files/files/etc')
-rwxr-xr-xpackage/base-files/files/etc/functions.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh
index dac46a3..86ea82d 100755
--- a/package/base-files/files/etc/functions.sh
+++ b/package/base-files/files/etc/functions.sh
@@ -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"
+}