From: Felix Fietkau Date: Mon, 16 Apr 2007 23:29:44 +0000 (+0000) Subject: add jffs2_mark_erase function for erasing jffs2 partitions on the next mount (typical... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=45c01cae72a0b8115d938e419dc679740328296d;p=openwrt%2Fstaging%2Fblocktrron.git add jffs2_mark_erase function for erasing jffs2 partitions on the next mount (typically faster than doing mtd erase manually) SVN-Revision: 6978 --- 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() { # { [] ... } 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" +}