Wait for the firmware upgrade

This commit is contained in:
vdutta 2022-07-25 19:22:58 +05:30
parent 38399ab501
commit f2bff8491a
2 changed files with 3 additions and 1 deletions

View file

@ -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:

View file

@ -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;