Selaa lähdekoodia

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 <[email protected]>
Rafał Miłecki 6 vuotta sitten
vanhempi
sitoutus
c5223b26a4
1 muutettua tiedostoa jossa 3 lisäystä ja 0 poistoa
  1. 3 0
      package/base-files/files/sbin/sysupgrade

+ 3 - 0
package/base-files/files/sbin/sysupgrade

@@ -362,10 +362,13 @@ if [ -n "$FAILSAFE" ]; then
 else
 else
 	force_attr=""
 	force_attr=""
 	[ $FORCE -eq 1 ] && force_attr="\"force\": true,"
 	[ $FORCE -eq 1 ] && force_attr="\"force\": true,"
+	backup_attr=""
+	[ $SAVE_CONFIG -eq 1 ] && backup_attr="\"backup\": $(json_string $CONF_TAR),"
 	ubus call system sysupgrade "{
 	ubus call system sysupgrade "{
 		\"prefix\": $(json_string "$RAM_ROOT"),
 		\"prefix\": $(json_string "$RAM_ROOT"),
 		\"path\": $(json_string "$IMAGE"),
 		\"path\": $(json_string "$IMAGE"),
 		$force_attr
 		$force_attr
+		$backup_attr
 		\"command\": $(json_string "$COMMAND"),
 		\"command\": $(json_string "$COMMAND"),
 		\"options\": {
 		\"options\": {
 			\"save_config\": $SAVE_CONFIG,
 			\"save_config\": $SAVE_CONFIG,