Added validator for reset_reason file
Compare changes
+ 34
− 8
@@ -20,9 +20,9 @@
@@ -20,9 +20,9 @@
#define REBOOT_LOCK_FILE "/tmp/bbf_reboot_handler.lock" // Lock file indicating that the boot action has already been executed
#define RESET_REASON_PATH "/tmp/reset_reason" // Path to the file containing the reason for the most recent boot/reset
#define REBOOT_MAX_RETRIES 10 // Maximum number of retries for checking if RESET_REASON_PATH has been generated
#define REBOOT_RETRY_DELAY 2 // Delay in seconds between retries when checking for the existence of RESET_REASON_PATH
#define REBOOT_MAX_ENTRIES 32 // Maximum number of reboot entries to display in Device.DeviceInfo.Reboots.Reboot.{i}
@@ -59,6 +59,7 @@ static void get_boot_option_value(const char *option_name, char *buffer, size_t
@@ -59,6 +59,7 @@ static void get_boot_option_value(const char *option_name, char *buffer, size_t
@@ -195,7 +196,7 @@ static void create_reboot_section(const char *trigger, const char *reason)
@@ -195,7 +196,7 @@ static void create_reboot_section(const char *trigger, const char *reason)
@@ -206,6 +207,7 @@ static void sysmngr_register_boot_action(void)
@@ -206,6 +207,7 @@ static void sysmngr_register_boot_action(void)
@@ -236,6 +238,25 @@ static void sysmngr_register_boot_action(void)
@@ -236,6 +238,25 @@ static void sysmngr_register_boot_action(void)
@@ -248,8 +269,13 @@ static struct uloop_timeout reboot_timer = { .cb = reboot_check_timer };
@@ -248,8 +269,13 @@ static struct uloop_timeout reboot_timer = { .cb = reboot_check_timer };
@@ -258,10 +284,10 @@ void sysmngr_reboots_init(void)
@@ -258,10 +284,10 @@ void sysmngr_reboots_init(void)
BBF_ERR("Max retries reached (%d). Reset reason file '%s' not found. Proceeding with boot action registration",