MC3302_SDK_V1.1.9_202507281.../bsp/busybox/patches/busybox-1.36.1/0001-init-reboot-debug.patch
2025-11-11 12:08:31 +08:00

50 lines
1.7 KiB
Diff
Executable File

--- init/init.c 2023-01-03 22:14:43.000000000 +0800
+++ ../init.c 2023-12-05 15:40:00.000000000 +0800
@@ -761,18 +761,23 @@
* to killing everything, in case people wish to use scripts to
* shut things down gracefully... */
run_actions(SHUTDOWN);
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
message(L_CONSOLE | L_LOG, "The system is going down NOW!");
/* Send signals to every process _except_ pid 1 */
kill(-1, SIGTERM);
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
message(L_CONSOLE, "Sent SIG%s to all processes", "TERM");
sync();
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
sleep1();
kill(-1, SIGKILL);
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
message(L_CONSOLE, "Sent SIG%s to all processes", "KILL");
sync();
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
/*sleep1(); - callers take care about making a pause */
}
@@ -819,9 +824,12 @@
* while true; do reboot; done
* Preventing it:
*/
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
reset_sighandlers_and_unblock_sigs();
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
run_shutdown_and_kill_processes();
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
m = "halt";
rb = RB_HALT_SYSTEM;
@@ -999,7 +1007,9 @@
| (1 << SIGUSR2)
| (1 << SIGTERM)
)) {
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
halt_reboot_pwoff(sig);
+ message(L_CONSOLE, "busybox: %s %s %d\r\n", __FILE__, __func__, __LINE__);
}
/* if (sig == SIGCHLD) do nothing */
}