init: remove special-case code for machines with less tham 1 MB of RAM.

function                                             old     new   delta
init_main                                            920     781    -139

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2013-05-21 16:36:51 +02:00
parent ae0cf2a9d7
commit f958425451

View File

@ -145,7 +145,7 @@
/* 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
@ -640,7 +640,7 @@ static void new_init_action(uint8_t action_type, const char *command, const char
/* 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.
@ -655,23 +655,22 @@ static void parse_inittab(void)
#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;
}
@ -1058,10 +1057,13 @@ int init_main(int argc UNUSED_PARAM, char **argv)
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
@ -1075,6 +1077,7 @@ int init_main(int argc UNUSED_PARAM, char **argv)
run_actions(SYSINIT); /* wait and removing */
}
}
# endif
#endif
/* Check if we are supposed to be in single user mode */