mirror of
https://github.com/troglobit/finit.git
synced 2026-10-24 11:54:36 +00:00
Fix #38: Add --enable-emergency-shell fallback debug mode
This patch adds a very special debug mode to Finit. With this feature enabled the actual duties of PID 1 is forked off early to a child. If that child ever dies, usually due to a SIGSEGV, this wakes up the real PID 1 which lauches a debug shell on the console. Remember to disable 'quiet' and enable '--debug' on the kernel command line to get all the debug logs -- which these days goes into the kernel log in /dev/kmsg -- simply `cat /dev/kmsg` and use Ctrl-C to get the shell prompt back. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
79207dcb22
commit
3ca28e765d
2 files changed
+40
No files matched your search
@@ -37,6 +37,10 @@ PKG_CHECK_MODULES([uev], [libuev >= 1.4.0])
|
||||
PKG_CHECK_MODULES([lite], [libite >= 1.5.0])
|
||||
|
||||
# Check for configured Finit features
|
||||
AC_ARG_ENABLE(emergency_shell,
|
||||
AS_HELP_STRING([--enable-emergency-shell], [Experimental emergency fallback at boot.
|
||||
Only use this for debugging very early boot problems with Finit.]))
|
||||
|
||||
AC_ARG_ENABLE(rw-rootfs,
|
||||
AS_HELP_STRING([--enable-rw-rootfs], [Remount / R/W at boot, usually not for embedded]))
|
||||
|
||||
@@ -117,6 +121,9 @@ AC_ARG_WITH(random-seed,
|
||||
### Enable features ###########################################################################
|
||||
|
||||
# Create config.h from selected features and fallback defautls
|
||||
AS_IF([test "x$enable_emergency_shell" = "xyes"], [
|
||||
AC_DEFINE(EMERGENCY_SHELL, 1, [Fork off init and let PID 1 wait and start /bin/sh if init crashes.])])
|
||||
|
||||
AS_IF([test "x$enable_rw_rootfs" = "xyes"], [
|
||||
AC_DEFINE(REMOUNT_ROOTFS, 1, [Remount / as rw at boot])])
|
||||
|
||||
|
||||
Reference in new issue
Block a user