X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/f1bcf559df1efde4455ecbe2bf103f318f173518..6dbdf08f38e76694e0bea1e418ecd37f47c04e8c:/package/base-files/files/etc/functions.sh diff --git a/package/base-files/files/etc/functions.sh b/package/base-files/files/etc/functions.sh index 72e60bb51..86ea82de6 100755 --- a/package/base-files/files/etc/functions.sh +++ b/package/base-files/files/etc/functions.sh @@ -36,7 +36,7 @@ config () { export ${NO_EXPORT:+-n} CONFIG_NUM_SECTIONS=$(($CONFIG_NUM_SECTIONS + 1)) name="${name:-cfg$CONFIG_NUM_SECTIONS}" append CONFIG_SECTIONS "$name" - config_cb "$cfgtype" "$name" + [ -n "$NO_CALLBACK" ] || config_cb "$cfgtype" "$name" export ${NO_EXPORT:+-n} CONFIG_SECTION="$name" export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_TYPE=$cfgtype" } @@ -46,7 +46,7 @@ option () { local value="$*" export ${NO_EXPORT:+-n} "CONFIG_${CONFIG_SECTION}_${varname}=$value" - option_cb "$varname" "$*" + [ -n "$NO_CALLBACK" ] || option_cb "$varname" "$*" } config_rename() { @@ -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" +}