/* Default sysinit script. */
#ifndef INIT_SCRIPT
-#define INIT_SCRIPT "/etc/init.d/rcS"
+# define INIT_SCRIPT "/etc/init.d/rcS"
#endif
/* Each type of actions can appear many times. They will be
/* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined,
* then parse_inittab() simply adds in some default
- * actions(i.e., runs INIT_SCRIPT and then starts a pair
+ * actions (i.e., runs INIT_SCRIPT and then starts a pair
* of "askfirst" shells). If CONFIG_FEATURE_USE_INITTAB
* _is_ defined, but /etc/inittab is missing, this
* results in the same set of default behaviors.
#endif
{
/* No inittab file - set up some default behavior */
- /* Reboot on Ctrl-Alt-Del */
- new_init_action(CTRLALTDEL, "reboot", "");
- /* Umount all filesystems on halt/reboot */
- new_init_action(SHUTDOWN, "umount -a -r", "");
- /* Swapoff on halt/reboot */
- if (ENABLE_SWAPONOFF)
- new_init_action(SHUTDOWN, "swapoff -a", "");
- /* Prepare to restart init when a QUIT is received */
- new_init_action(RESTART, "init", "");
+ /* Sysinit */
+ new_init_action(SYSINIT, INIT_SCRIPT, "");
/* Askfirst shell on tty1-4 */
new_init_action(ASKFIRST, bb_default_login_shell, "");
//TODO: VC_1 instead of ""? "" is console -> ctty problems -> angry users
new_init_action(ASKFIRST, bb_default_login_shell, VC_2);
new_init_action(ASKFIRST, bb_default_login_shell, VC_3);
new_init_action(ASKFIRST, bb_default_login_shell, VC_4);
- /* sysinit */
- new_init_action(SYSINIT, INIT_SCRIPT, "");
+ /* Reboot on Ctrl-Alt-Del */
+ new_init_action(CTRLALTDEL, "reboot", "");
+ /* Umount all filesystems on halt/reboot */
+ new_init_action(SHUTDOWN, "umount -a -r", "");
+ /* Swapoff on halt/reboot */
+ new_init_action(SHUTDOWN, "swapoff -a", "");
+ /* Restart init when a QUIT is received */
+ new_init_action(RESTART, "init", "");
return;
}
message(L_CONSOLE | L_LOG, "init started: %s", bb_banner);
#endif
+#if 0
+/* It's 2013, does anyone really still depend on this? */
+/* If you do, consider adding swapon to sysinot actions then! */
/* struct sysinfo is linux-specific */
-#ifdef __linux__
+# ifdef __linux__
/* Make sure there is enough memory to do something useful. */
- if (ENABLE_SWAPONOFF) {
+ /*if (ENABLE_SWAPONOFF) - WRONG: we may have non-bbox swapon*/ {
struct sysinfo info;
if (sysinfo(&info) == 0
run_actions(SYSINIT); /* wait and removing */
}
}
+# endif
#endif
/* Check if we are supposed to be in single user mode */