diff mbox series

[3/3] suricatta: allow -c 0 to tell swupdate we do not expect any pending update

Message ID 20211122031518.2201903-3-dominique.martinet@atmark-techno.com
State Accepted
Headers show
Series [1/3] server_hawkbit: fix typo in function name s/hakwbit/hawkbit/ | expand

Commit Message

Dominique MARTINET Nov. 22, 2021, 3:15 a.m. UTC
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---
This one probably deserves some justification: we're not using the built
in state mechanism though bootloader env, because we have two uboot
images that each have its own env, so the builtin setenv would not
necessarily update the correct environment (the logic would require
updating both or having a shared env really, but it's not practical for
uboot updates that might change some default value)

In these conditions restarting with -c 1-3 works but prints a warning
if no update is available on server; conversely not passing any -c
will print an error that state could not be read from env.
Having -c 0 basically acts exactly like no -c, except it'll not print
that error.

 suricatta/server_hawkbit.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/suricatta/server_hawkbit.c b/suricatta/server_hawkbit.c
index 70f402645a16..1bf23baf5211 100644
--- a/suricatta/server_hawkbit.c
+++ b/suricatta/server_hawkbit.c
@@ -1753,6 +1753,7 @@  server_op_res_t server_start(char *fname, int argc, char *argv[])
 			 */
 			update_state = (unsigned int)*optarg;
 			switch (update_state) {
+			case STATE_OK:
 			case STATE_INSTALLED:
 			case STATE_TESTING:
 			case STATE_FAILED: