treewide: sysupgrade: use $UPGRADE_BACKUP to check for backup

Now that $UPGRADE_BACKUP is set conditionally there is no need to check
the $UPGRADE_OPT_SAVE_CONFIG anymore. All conditions can be simplified.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit a858db3136)
This commit is contained in:
Rafał Miłecki
2019-09-06 07:10:54 +02:00
parent f69b855a75
commit c53a0ed5e3
11 changed files with 12 additions and 13 deletions

View File

@@ -220,7 +220,7 @@ indicate_upgrade() {
# $(2): (optional) pipe command to extract firmware, e.g. dd bs=n skip=m
default_do_upgrade() {
sync
if [ "$UPGRADE_OPT_SAVE_CONFIG" -eq 1 ]; then
if [ -n "$UPGRADE_BACKUP" ]; then
get_image "$1" "$2" | mtd $MTD_ARGS $MTD_CONFIG_ARGS -j "$UPGRADE_BACKUP" write - "${PART_NAME:-image}"
else
get_image "$1" "$2" | mtd $MTD_ARGS write - "${PART_NAME:-image}"