diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-05-21 16:36:51 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-05-21 16:36:51 +0200 |
commit | f9584254511ff497b46bc7ec6ee76d7355ef133e (patch) | |
tree | 66f6f08ed4db0be2c271b619b4718765ecd0205b /init | |
parent | ae0cf2a9d73d6e290e3b2850de2bf22f9b3df622 (diff) | |
download | busybox-w32-f9584254511ff497b46bc7ec6ee76d7355ef133e.tar.gz busybox-w32-f9584254511ff497b46bc7ec6ee76d7355ef133e.tar.bz2 busybox-w32-f9584254511ff497b46bc7ec6ee76d7355ef133e.zip |
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>
Diffstat (limited to 'init')
-rw-r--r-- | init/init.c | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/init/init.c b/init/init.c index 15aad474f..f3a35d532 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -145,7 +145,7 @@ | |||
145 | 145 | ||
146 | /* Default sysinit script. */ | 146 | /* Default sysinit script. */ |
147 | #ifndef INIT_SCRIPT | 147 | #ifndef INIT_SCRIPT |
148 | #define INIT_SCRIPT "/etc/init.d/rcS" | 148 | # define INIT_SCRIPT "/etc/init.d/rcS" |
149 | #endif | 149 | #endif |
150 | 150 | ||
151 | /* Each type of actions can appear many times. They will be | 151 | /* 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 | |||
640 | 640 | ||
641 | /* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined, | 641 | /* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined, |
642 | * then parse_inittab() simply adds in some default | 642 | * then parse_inittab() simply adds in some default |
643 | * actions(i.e., runs INIT_SCRIPT and then starts a pair | 643 | * actions (i.e., runs INIT_SCRIPT and then starts a pair |
644 | * of "askfirst" shells). If CONFIG_FEATURE_USE_INITTAB | 644 | * of "askfirst" shells). If CONFIG_FEATURE_USE_INITTAB |
645 | * _is_ defined, but /etc/inittab is missing, this | 645 | * _is_ defined, but /etc/inittab is missing, this |
646 | * results in the same set of default behaviors. | 646 | * results in the same set of default behaviors. |
@@ -655,23 +655,22 @@ static void parse_inittab(void) | |||
655 | #endif | 655 | #endif |
656 | { | 656 | { |
657 | /* No inittab file - set up some default behavior */ | 657 | /* No inittab file - set up some default behavior */ |
658 | /* Reboot on Ctrl-Alt-Del */ | 658 | /* Sysinit */ |
659 | new_init_action(CTRLALTDEL, "reboot", ""); | 659 | new_init_action(SYSINIT, INIT_SCRIPT, ""); |
660 | /* Umount all filesystems on halt/reboot */ | ||
661 | new_init_action(SHUTDOWN, "umount -a -r", ""); | ||
662 | /* Swapoff on halt/reboot */ | ||
663 | if (ENABLE_SWAPONOFF) | ||
664 | new_init_action(SHUTDOWN, "swapoff -a", ""); | ||
665 | /* Prepare to restart init when a QUIT is received */ | ||
666 | new_init_action(RESTART, "init", ""); | ||
667 | /* Askfirst shell on tty1-4 */ | 660 | /* Askfirst shell on tty1-4 */ |
668 | new_init_action(ASKFIRST, bb_default_login_shell, ""); | 661 | new_init_action(ASKFIRST, bb_default_login_shell, ""); |
669 | //TODO: VC_1 instead of ""? "" is console -> ctty problems -> angry users | 662 | //TODO: VC_1 instead of ""? "" is console -> ctty problems -> angry users |
670 | new_init_action(ASKFIRST, bb_default_login_shell, VC_2); | 663 | new_init_action(ASKFIRST, bb_default_login_shell, VC_2); |
671 | new_init_action(ASKFIRST, bb_default_login_shell, VC_3); | 664 | new_init_action(ASKFIRST, bb_default_login_shell, VC_3); |
672 | new_init_action(ASKFIRST, bb_default_login_shell, VC_4); | 665 | new_init_action(ASKFIRST, bb_default_login_shell, VC_4); |
673 | /* sysinit */ | 666 | /* Reboot on Ctrl-Alt-Del */ |
674 | new_init_action(SYSINIT, INIT_SCRIPT, ""); | 667 | new_init_action(CTRLALTDEL, "reboot", ""); |
668 | /* Umount all filesystems on halt/reboot */ | ||
669 | new_init_action(SHUTDOWN, "umount -a -r", ""); | ||
670 | /* Swapoff on halt/reboot */ | ||
671 | new_init_action(SHUTDOWN, "swapoff -a", ""); | ||
672 | /* Restart init when a QUIT is received */ | ||
673 | new_init_action(RESTART, "init", ""); | ||
675 | return; | 674 | return; |
676 | } | 675 | } |
677 | 676 | ||
@@ -1058,10 +1057,13 @@ int init_main(int argc UNUSED_PARAM, char **argv) | |||
1058 | message(L_CONSOLE | L_LOG, "init started: %s", bb_banner); | 1057 | message(L_CONSOLE | L_LOG, "init started: %s", bb_banner); |
1059 | #endif | 1058 | #endif |
1060 | 1059 | ||
1060 | #if 0 | ||
1061 | /* It's 2013, does anyone really still depend on this? */ | ||
1062 | /* If you do, consider adding swapon to sysinot actions then! */ | ||
1061 | /* struct sysinfo is linux-specific */ | 1063 | /* struct sysinfo is linux-specific */ |
1062 | #ifdef __linux__ | 1064 | # ifdef __linux__ |
1063 | /* Make sure there is enough memory to do something useful. */ | 1065 | /* Make sure there is enough memory to do something useful. */ |
1064 | if (ENABLE_SWAPONOFF) { | 1066 | /*if (ENABLE_SWAPONOFF) - WRONG: we may have non-bbox swapon*/ { |
1065 | struct sysinfo info; | 1067 | struct sysinfo info; |
1066 | 1068 | ||
1067 | if (sysinfo(&info) == 0 | 1069 | if (sysinfo(&info) == 0 |
@@ -1075,6 +1077,7 @@ int init_main(int argc UNUSED_PARAM, char **argv) | |||
1075 | run_actions(SYSINIT); /* wait and removing */ | 1077 | run_actions(SYSINIT); /* wait and removing */ |
1076 | } | 1078 | } |
1077 | } | 1079 | } |
1080 | # endif | ||
1078 | #endif | 1081 | #endif |
1079 | 1082 | ||
1080 | /* Check if we are supposed to be in single user mode */ | 1083 | /* Check if we are supposed to be in single user mode */ |