base-files: sysupgrade: support additional mtd options
Add support for passing additional parameters to mtd called during sysupgrade. It will be required to toggle the "recovery moe" flag supported by recent tp-link boards. Signed-off-by: David Bauer <mail@david-bauer.net> [split code from board support patch; add commit message] Signed-off-by: Mathias Kresin <dev@kresin.me>
This commit is contained in:
parent
1e06482f7d
commit
28cd2caa35
2 changed files with 3 additions and 2 deletions
|
@ -223,9 +223,9 @@ indicate_upgrade() {
|
||||||
default_do_upgrade() {
|
default_do_upgrade() {
|
||||||
sync
|
sync
|
||||||
if [ "$SAVE_CONFIG" -eq 1 ]; then
|
if [ "$SAVE_CONFIG" -eq 1 ]; then
|
||||||
get_image "$1" "$2" | mtd $MTD_CONFIG_ARGS -j "$CONF_TAR" write - "${PART_NAME:-image}"
|
get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$CONF_TAR" write - "${PART_NAME:-image}"
|
||||||
else
|
else
|
||||||
get_image "$1" "$2" | mtd write - "${PART_NAME:-image}"
|
get_image "$1" "$2" | mtd $MTD_ARGS write - "${PART_NAME:-image}"
|
||||||
fi
|
fi
|
||||||
[ $? -ne 0 ] && exit 1
|
[ $? -ne 0 ] && exit 1
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
. /lib/functions/system.sh
|
. /lib/functions/system.sh
|
||||||
|
|
||||||
# initialize defaults
|
# initialize defaults
|
||||||
|
export MTD_ARGS=""
|
||||||
export MTD_CONFIG_ARGS=""
|
export MTD_CONFIG_ARGS=""
|
||||||
export INTERACTIVE=0
|
export INTERACTIVE=0
|
||||||
export VERBOSE=1
|
export VERBOSE=1
|
||||||
|
|
Loading…
Reference in a new issue