diff mbox series

[V2,29/36] Start chunks downloader if delta is enabled

Message ID 20211114172733.71602-30-sbabic@denx.de
State Changes Requested
Headers show
Series DELTA Update | expand

Commit Message

Stefano Babic Nov. 14, 2021, 5:27 p.m. UTC
Start the downloader process if delta is activated. The process is
monitored by SWUpdate.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 core/swupdate.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/core/swupdate.c b/core/swupdate.c
index d651f8e..d3b8ef3 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -41,6 +41,7 @@ 
 #include "network_ipc.h"
 #include "sslapi.h"
 #include "suricatta/suricatta.h"
+#include "delta_process.h"
 #include "progress.h"
 #include "parselib.h"
 #include "swupdate_settings.h"
@@ -853,6 +854,17 @@  int main(int argc, char **argv)
 		freeargs(dwlav);
 	}
 #endif
+#if defined(CONFIG_DELTA)
+	{
+		uid_t uid;
+		gid_t gid;
+		read_settings_user_id(&handle, "download", &uid, &gid);
+		start_subprocess(SOURCE_CHUNKS_DOWNLOADER, "chunks_downloader", uid, gid,
+				cfgfname, ac, av,
+				start_delta_downloader);
+	}
+#endif
+
 
 	/*
 	 * Start all processes added in the config file