diff options
author | Igor Opaniuk <igor.opaniuk@foundries.io> | 2024-05-21 15:52:45 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-28 09:38:23 +0100 |
commit | 024205238e566d7ddd647b7ab2fb6505e8ec770d (patch) | |
tree | f00dcb56688cee71a05a163936d35f7010b0639b | |
parent | 40d1877fafac3712eb76041311b58930568264e6 (diff) | |
download | poky-024205238e566d7ddd647b7ab2fb6505e8ec770d.tar.gz |
initramfs-framework: support force reboot if fatal error occurs
Add support for force reboot in the case of fatal error. In some cases
it's better to force reboot (especially when hw watchdog is not
engaged) instead of waiting for 3600 seconds, for example in order to
trigger some recovery procedure during next boot procedure
(after unsuccessful OTA update etc).
ALso fix indendation issues in the fatal() function implementation.
(From OE-Core rev: 6990855e91f2d5891e95995f3f4a1c3b5891c619)
Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | meta/recipes-core/initrdscripts/initramfs-framework/init | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/meta/recipes-core/initrdscripts/initramfs-framework/init b/meta/recipes-core/initrdscripts/initramfs-framework/init index 567694aff7..e3d8caa0e1 100755 --- a/meta/recipes-core/initrdscripts/initramfs-framework/init +++ b/meta/recipes-core/initrdscripts/initramfs-framework/init | |||
@@ -54,17 +54,20 @@ debug() { | |||
54 | } | 54 | } |
55 | 55 | ||
56 | # Prints a message and start a endless loop | 56 | # Prints a message and start a endless loop |
57 | # Force reboot if init_fatal_reboot bootparam is set | ||
57 | fatal() { | 58 | fatal() { |
58 | echo $1 >/dev/console | 59 | echo $1 >/dev/console |
59 | echo >/dev/console | 60 | echo >/dev/console |
60 | 61 | ||
61 | if [ -n "$bootparam_init_fatal_sh" ]; then | 62 | if [ -n "$bootparam_init_fatal_reboot" ]; then |
62 | sh | 63 | reboot -f |
63 | else | 64 | elif [ -n "$bootparam_init_fatal_sh" ]; then |
64 | while [ "true" ]; do | 65 | sh |
65 | sleep 3600 | 66 | else |
66 | done | 67 | while [ "true" ]; do |
67 | fi | 68 | sleep 3600 |
69 | done | ||
70 | fi | ||
68 | } | 71 | } |
69 | 72 | ||
70 | # Variables shared amoung modules | 73 | # Variables shared amoung modules |