[OpenWrt-Devel] [PATCH 1/3] base-files: sysupgrade: pass "backup" ubus attribute

Rafał Miłecki zajec5 at gmail.com
Fri Sep 6 01:10:52 EDT 2019


From: Rafał Miłecki <rafal at milecki.pl>

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 at milecki.pl>
---
 package/base-files/files/sbin/sysupgrade | 3 +++
 1 file changed, 3 insertions(+)

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,
-- 
2.21.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list