From 6dbdf08f38e76694e0bea1e418ecd37f47c04e8c Mon Sep 17 00:00:00 2001 From: nbd Date: Mon, 16 Apr 2007 23:29:44 +0000 Subject: 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 --- package/base-files/files/etc/functions.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'package/base-files/files') diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index dac46a349..86ea82de6 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -186,3 +186,13 @@ strtok() { # { [] ... } 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" +} -- cgit v1.2.3