From 9fc03d557e56d4e3bc46252b2b89e03f583fe2c8 Mon Sep 17 00:00:00 2001 From: Vivek Dutta Date: Wed, 3 Dec 2025 15:51:38 +0530 Subject: [PATCH] Updated logs in reboot method --- src/fw_images.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/fw_images.c b/src/fw_images.c index e4f5f24..d2d1bb2 100644 --- a/src/fw_images.c +++ b/src/fw_images.c @@ -212,12 +212,18 @@ static void _exec_reboot(const void *arg1, void *arg2) dmuci_commit_package(config_name); sleep(3); - dmubus_call_set("rpc-sys", "reboot", UBUS_ARGS{0}, 0); - sleep(5); // Wait for reboot to happen - BBFDM_ERR("Reboot call failed with rpc-sys, trying again with system"); - dmubus_call_set("system", "reboot", UBUS_ARGS{0}, 0); - sleep(5); // Wait for reboot - BBFDM_ERR("Reboot call failed!!!"); + dmubus_call_blocking("system", "reboot", UBUS_ARGS{0}, 0, NULL); + sleep(15); // Wait for reboot + BBFDM_INFO("Reboot call failed with system, trying again with reboot rpc-sys..."); + dmubus_call_blocking("rpc-sys", "reboot", UBUS_ARGS{0}, 0, NULL); + sleep(15); // Wait for reboot to happen + BBFDM_WARNING("Reboot call failed with rpc-sys, trying again with reboot cmd ..."); + run_cmd("reboot", NULL, 0); + sleep(15); // Wait for reboot + BBFDM_ERR("Reboot calls failed, trying hard reboot!!!"); + run_cmd("reboot -f", NULL, 0); + sleep(15); // Wait for reboot + BBFDM_ERR("### Tried all reboot methods, nothing worked ....."); // Set last_reboot_cause to empty because there is a problem in the system reboot dmuci_set_value(config_name, "reboots", "last_reboot_cause", "");