diff mbox series

[OpenWrt-Devel,procd] sysupgrade: set UPGRADE_BACKUP env variable

Message ID 20190905072013.2703-1-zajec5@gmail.com
State Accepted
Delegated to: Rafał Miłecki
Headers show
Series [OpenWrt-Devel,procd] sysupgrade: set UPGRADE_BACKUP env variable | expand

Commit Message

Rafał Miłecki Sept. 5, 2019, 7:20 a.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

It points to the backup file to use duing sysupgrace process. Right now
it's hardcoded to the /tmp/sysupgrade.tgz. Once all cleanups are in
place "sysupgrade" ubus method should be extended to allow passing any
custom path.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 sysupgrade.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/sysupgrade.c b/sysupgrade.c
index ce30798..19fb054 100644
--- a/sysupgrade.c
+++ b/sysupgrade.c
@@ -48,6 +48,8 @@  void sysupgrade_exec_upgraded(const char *prefix, char *path, char *command,
 		setenv("WDTFD", wdt_fd, 1);
 	}
 
+	setenv("UPGRADE_BACKUP", "/tmp/sysupgrade.tgz", 1);
+
 	blobmsg_for_each_attr(option, options, rem) {
 		const char *prefix = "UPGRADE_OPT_";
 		char value[11];