@@ -166,6 +166,9 @@ suricatta :
# auth-domain : string
# path to auth-domain, if any
# default = none
+# run-postupdate : boolean (default true)
+# run the postupdate command automatically after
+# a successful update
webserver :
{
@@ -55,6 +55,7 @@ struct file_upload_state {
int fd;
};
+static bool run_postupdate;
static struct mg_serve_http_opts s_http_server_opts;
static void upload_handler(struct mg_connection *nc, int ev, void *p);
@@ -238,7 +239,7 @@ static void *broadcast_progress_thread(void *data)
broadcast(mgr, str);
}
- if (msg.status == SUCCESS && msg.source == SOURCE_WEBSERVER) {
+ if (msg.status == SUCCESS && msg.source == SOURCE_WEBSERVER && run_postupdate) {
ipc_message ipc = {};
ipc_postupdate(&ipc);
@@ -491,6 +492,12 @@ static int mongoose_settings(void *elem, void __attribute__ ((__unused__)) *dat
if (strlen(tmp)) {
opts->auth_domain = strdup(tmp);
}
+ /*
+ * Default value is active
+ */
+ run_postupdate = true;
+ get_field(LIBCFG_PARSER, elem, "run-postupdate", &run_postupdate);
+
return 0;
}
After a successful update, the Webserver initiates the postupdate command automatically. There are some use case where this is not desired because some manual interventions are required on the device before rebooting. Make this behavior configurable adding a "run-postupdate" flag in the webserver section of the configuration file (default = active). Signed-off-by: Stefano Babic <sbabic@denx.de> --- examples/configuration/swupdate.cfg | 3 +++ mongoose/mongoose_interface.c | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-)