sysupgrade: set UPGRADE_BACKUP env variable
authorRafał Miłecki <rafal@milecki.pl>
Thu, 5 Sep 2019 07:20:13 +0000 (09:20 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Thu, 5 Sep 2019 21:12:50 +0000 (23:12 +0200)
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

index ce30798e5478877ae82ea0a4b225e31c2ef40134..19fb05428cb3cc497d6a45063701620f4930aa61 100644 (file)
@@ -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];