aboutsummaryrefslogtreecommitdiffstats
path: root/package
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
commit377c7c2c07388413f82ba52119222de3b22754fa (patch)
tree223ef8c95d47b0b44a2cbf7e9a96f27ccf1ef776 /package
parent7d8651cc5c850ae799d9e29396c9378ccda16227 (diff)
downloadmaster-187ad058-377c7c2c07388413f82ba52119222de3b22754fa.tar.gz
master-187ad058-377c7c2c07388413f82ba52119222de3b22754fa.tar.bz2
master-187ad058-377c7c2c07388413f82ba52119222de3b22754fa.zip
add jffs2_mark_erase function for erasing jffs2 partitions on the next mount (typically faster than doing mtd erase manually)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6978 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-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 dac46a3497..86ea82de67 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"
+}