aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/sbin
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2019-09-06 07:10:52 +0200
committerRafał Miłecki <rafal@milecki.pl>2019-09-11 08:57:24 +0200
commitc5223b26a40ae61fc7750bf865464048af328ab1 (patch)
treedbceb9f27fc7634f77104db36a9d8186cf052224 /package/base-files/files/sbin
parent6d819fae5343dc4666762f359bb57a6fbe60a968 (diff)
downloadupstream-c5223b26a40ae61fc7750bf865464048af328ab1.tar.gz
upstream-c5223b26a40ae61fc7750bf865464048af328ab1.tar.bz2
upstream-c5223b26a40ae61fc7750bf865464048af328ab1.zip
base-files: sysupgrade: pass "backup" ubus attribute
This explicitly tells procd what backup file should be used during sysupgrade (if any). It's much more generic this way compared to the magic /tmp/sysupgrade.tgz file that had to be created before a call. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Diffstat (limited to 'package/base-files/files/sbin')
-rwxr-xr-xpackage/base-files/files/sbin/sysupgrade3
1 files changed, 3 insertions, 0 deletions
diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index f106c3c981..f18143bff4 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -362,10 +362,13 @@ if [ -n "$FAILSAFE" ]; then
else
force_attr=""
[ $FORCE -eq 1 ] && force_attr="\"force\": true,"
+ backup_attr=""
+ [ $SAVE_CONFIG -eq 1 ] && backup_attr="\"backup\": $(json_string $CONF_TAR),"
ubus call system sysupgrade "{
\"prefix\": $(json_string "$RAM_ROOT"),
\"path\": $(json_string "$IMAGE"),
$force_attr
+ $backup_attr
\"command\": $(json_string "$COMMAND"),
\"options\": {
\"save_config\": $SAVE_CONFIG,