我在远程位置有ARM板。有一段时间,我在其中遇到了一个内核恐慌错误。同时,没有重新启动硬件的选项。总线在这个地方没有人可以重启它。
我想在内核死机错误后自动重启我的主板。那么在内核中该怎么做呢?
发布于 2014-07-03 14:48:46
如果您的硬件包含watchdog timer,则编译具有watchdog支持的内核并对其进行配置。我建议关注这个博客http://www.jann.cc/2013/02/02/linux_watchdog.html
Caution ::我从未尝试过。如果问题解决了,请在这里更新。
发布于 2014-07-03 15:20:24
您可以修改panic()函数kernel_restart/panic.c,以便在您希望它重新启动时调用内核(*cmd)(例如,可能在打印所需的调试信息之后)。
我假设您正在打开一个板,所以请注意,您需要根据MACH为machine_restart() -(由kernel_restart调用)中的相关函数提供操作。如果您只是按原样使用主板,那么我想用kernel_restart(*cmd)重新构建内核应该可以做到。
发布于 2014-07-05 13:00:56
AFAIK,在内核死机后重启主板的一个简单方法是传递一个内核参数(通常来自引导加载程序)
panic=1然后,主板将在死机后自动重新启动“%1”秒。
请搜索Documentation了解更多信息。
文档中的一些示例:
...
panic= [KNL] Kernel behaviour on panic: delay <timeout>
timeout > 0: seconds before rebooting
timeout = 0: wait forever
timeout < 0: reboot immediately
Format: <timeout>
...
oops=panic Always panic on oopses. Default is to just kill the
process, but there is a small probability of
deadlocking the machine.
This will also cause panics on machine check exceptions.
Useful together with panic=30 to trigger a reboot.
...https://stackoverflow.com/questions/24546608
复制相似问题