From f2bff8491acc4a097e38e67945db433f9075958e Mon Sep 17 00:00:00 2001 From: vdutta Date: Mon, 25 Jul 2022 19:22:58 +0530 Subject: [PATCH] Wait for the firmware upgrade --- dmdiagnostics.c | 3 ++- dmtree/tr181/deviceinfo.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dmdiagnostics.c b/dmdiagnostics.c index 1aeed9bb..699535ae 100644 --- a/dmdiagnostics.c +++ b/dmdiagnostics.c @@ -660,11 +660,12 @@ int bbf_fw_image_download(const char *url, const char *auto_activate, const char goto end; } + sleep(30); // Wait for the image to become available // Reboot the device if auto activation is true if (activate) { - sleep(30); // Wait for the image to become available if (dmubus_call_set("system", "reboot", UBUS_ARGS{0}, 0) != 0) res = -1; + sleep(10); // Wait for reboot to take action } end: diff --git a/dmtree/tr181/deviceinfo.c b/dmtree/tr181/deviceinfo.c index 5889d5b0..ab323af1 100644 --- a/dmtree/tr181/deviceinfo.c +++ b/dmtree/tr181/deviceinfo.c @@ -1407,6 +1407,7 @@ static int operate_DeviceInfoFirmwareImage_Activate(char *refparam, struct dmctx return CMD_FAIL; res = dmubus_call_set("rpc-sys", "reboot", UBUS_ARGS{0}, 0); + sleep(10); // Wait for reboot to happen } return res ? CMD_FAIL : CMD_SUCCESS;