aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-10-29 00:07:31 +0000
committerEric Andersen <andersen@codepoet.org>1999-10-29 00:07:31 +0000
commitc1525e84dd6a3ac8252ce10e6ae605bd37d60797 (patch)
treebef01229299c4ad89f2e353df0e88af292a8795c /init
parent6b6b3f6ef2f44898a8bddfaae93cc4ef3aa79661 (diff)
downloadbusybox-w32-c1525e84dd6a3ac8252ce10e6ae605bd37d60797.tar.gz
busybox-w32-c1525e84dd6a3ac8252ce10e6ae605bd37d60797.tar.bz2
busybox-w32-c1525e84dd6a3ac8252ce10e6ae605bd37d60797.zip
Stuff
Diffstat (limited to 'init')
-rw-r--r--init/init.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/init/init.c b/init/init.c
index d950e2bef..b8cbbf64e 100644
--- a/init/init.c
+++ b/init/init.c
@@ -41,8 +41,6 @@
41#include <sys/vt.h> /* for vt_stat */ 41#include <sys/vt.h> /* for vt_stat */
42#include <sys/ioctl.h> 42#include <sys/ioctl.h>
43 43
44#define DEBUG_INIT
45
46#define CONSOLE "/dev/console" /* Logical system console */ 44#define CONSOLE "/dev/console" /* Logical system console */
47#define VT_PRIMARY "/dev/tty0" /* Virtual console master */ 45#define VT_PRIMARY "/dev/tty0" /* Virtual console master */
48#define VT_SECONDARY "/dev/tty1" /* Virtual console master */ 46#define VT_SECONDARY "/dev/tty1" /* Virtual console master */
@@ -272,7 +270,6 @@ static pid_t run(const char * const* command,
272} 270}
273 271
274 272
275#ifndef DEBUG_INIT
276static void shutdown_system(void) 273static void shutdown_system(void)
277{ 274{
278 const char* const swap_off_cmd[] = { "/bin/swapoff", "-a", 0}; 275 const char* const swap_off_cmd[] = { "/bin/swapoff", "-a", 0};
@@ -318,12 +315,9 @@ static void reboot_signal(int sig)
318 exit(0); 315 exit(0);
319} 316}
320 317
321#endif
322
323extern int init_main(int argc, char **argv) 318extern int init_main(int argc, char **argv)
324{ 319{
325 int run_rc = TRUE; 320 int run_rc = TRUE;
326 pid_t pid = 0;
327 pid_t pid1 = 0; 321 pid_t pid1 = 0;
328 pid_t pid2 = 0; 322 pid_t pid2 = 0;
329 struct stat statbuf; 323 struct stat statbuf;
@@ -333,13 +327,10 @@ extern int init_main(int argc, char **argv)
333 const char* const* tty0_commands = init_commands; 327 const char* const* tty0_commands = init_commands;
334 const char* const* tty1_commands = shell_commands; 328 const char* const* tty1_commands = shell_commands;
335 char *hello_msg_format = 329 char *hello_msg_format =
336 "init(%d) started: BusyBox v%s (%s) multi-call binary\r\n"; 330 "init started: BusyBox v%s (%s) multi-call binary\r\n";
337 const char *no_memory = 331 const char *no_memory =
338 "Sorry, your computer does not have enough memory.\r\n"; 332 "Sorry, your computer does not have enough memory.\r\n";
339 333
340 pid = getpid();
341
342#ifndef DEBUG_INIT
343 /* Set up sig handlers */ 334 /* Set up sig handlers */
344 signal(SIGUSR1, halt_signal); 335 signal(SIGUSR1, halt_signal);
345 signal(SIGSEGV, halt_signal); 336 signal(SIGSEGV, halt_signal);
@@ -353,7 +344,6 @@ extern int init_main(int argc, char **argv)
353 /* Turn off rebooting via CTL-ALT-DEL -- we get a 344 /* Turn off rebooting via CTL-ALT-DEL -- we get a
354 * SIGINT on CAD so we can shut things down gracefully... */ 345 * SIGINT on CAD so we can shut things down gracefully... */
355 reboot(RB_DISABLE_CAD); 346 reboot(RB_DISABLE_CAD);
356#endif
357 347
358 /* Figure out where the default console should be */ 348 /* Figure out where the default console should be */
359 console_init(); 349 console_init();
@@ -370,8 +360,8 @@ extern int init_main(int argc, char **argv)
370 putenv(PATH_DEFAULT); 360 putenv(PATH_DEFAULT);
371 361
372 /* Hello world */ 362 /* Hello world */
373 message(log, hello_msg_format, pid, BB_VER, BB_BT); 363 message(log, hello_msg_format, BB_VER, BB_BT);
374 fprintf(stderr, hello_msg_format, pid, BB_VER, BB_BT); 364 fprintf(stderr, hello_msg_format, BB_VER, BB_BT);
375 365
376 366
377 /* Mount /proc */ 367 /* Mount /proc */
@@ -385,7 +375,7 @@ extern int init_main(int argc, char **argv)
385 375
386 /* Make sure there is enough memory to do something useful */ 376 /* Make sure there is enough memory to do something useful */
387 set_free_pages(); 377 set_free_pages();
388 if (mem_total() < 2000) { 378 if (mem_total() < 3500) {
389 int retval; 379 int retval;
390 retval = stat("/etc/fstab", &statbuf); 380 retval = stat("/etc/fstab", &statbuf);
391 if (retval) { 381 if (retval) {