aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-12-11 04:16:51 +0000
committerEric Andersen <andersen@codepoet.org>1999-12-11 04:16:51 +0000
commit84b009256f2c17908ed768fea67bba8380ee1f26 (patch)
tree33a81760971a95856be3db8344c38fc235e07c91 /init
parentb52a218c95ac69977e0a7e1c0ab9563c28e145d0 (diff)
downloadbusybox-w32-84b009256f2c17908ed768fea67bba8380ee1f26.tar.gz
busybox-w32-84b009256f2c17908ed768fea67bba8380ee1f26.tar.bz2
busybox-w32-84b009256f2c17908ed768fea67bba8380ee1f26.zip
Minor updates
Diffstat (limited to 'init')
-rw-r--r--init/init.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/init/init.c b/init/init.c
index 3c800b9b2..5203713ca 100644
--- a/init/init.c
+++ b/init/init.c
@@ -446,9 +446,11 @@ extern int init_main(int argc, char **argv)
446 pid_t pid1 = 0; 446 pid_t pid1 = 0;
447 pid_t pid2 = 0; 447 pid_t pid2 = 0;
448 struct stat statbuf; 448 struct stat statbuf;
449 char which_vt1[30];
450 char which_vt2[30];
449 const char* const rc_script_command[] = { INITSCRIPT, INITSCRIPT, 0}; 451 const char* const rc_script_command[] = { INITSCRIPT, INITSCRIPT, 0};
450 const char* const getty1_command[] = { GETTY, GETTY, VT_PRIMARY, 0}; 452 const char* const getty1_command[] = { GETTY, GETTY, "38400", which_vt1, 0};
451 const char* const getty2_command[] = { GETTY, GETTY, VT_SECONDARY, 0}; 453 const char* const getty2_command[] = { GETTY, GETTY, "38400", which_vt2, 0};
452 const char* const shell_command[] = { SHELL, "-" SHELL, 0}; 454 const char* const shell_command[] = { SHELL, "-" SHELL, 0};
453 const char* const* tty1_command = shell_command; 455 const char* const* tty1_command = shell_command;
454 const char* const* tty2_command = shell_command; 456 const char* const* tty2_command = shell_command;
@@ -516,11 +518,8 @@ extern int init_main(int argc, char **argv)
516 } else 518 } else
517 message(CONSOLE|LOG, "Mounting /proc: failed!\n"); 519 message(CONSOLE|LOG, "Mounting /proc: failed!\n");
518 520
519fprintf(stderr, "got proc\n");
520
521 /* Make sure there is enough memory to do something useful. */ 521 /* Make sure there is enough memory to do something useful. */
522 check_memory(); 522 check_memory();
523fprintf(stderr, "got check_memory\n");
524 523
525 /* Check if we are supposed to be in single user mode */ 524 /* Check if we are supposed to be in single user mode */
526 if ( argc > 1 && (!strcmp(argv[1], "single") || 525 if ( argc > 1 && (!strcmp(argv[1], "single") ||
@@ -529,7 +528,6 @@ fprintf(stderr, "got check_memory\n");
529 tty1_command = shell_command; 528 tty1_command = shell_command;
530 tty2_command = shell_command; 529 tty2_command = shell_command;
531 } 530 }
532fprintf(stderr, "got single\n");
533 531
534 /* Make sure an init script exists before trying to run it */ 532 /* Make sure an init script exists before trying to run it */
535 if (single==FALSE && stat(INITSCRIPT, &statbuf)==0) { 533 if (single==FALSE && stat(INITSCRIPT, &statbuf)==0) {
@@ -541,19 +539,22 @@ fprintf(stderr, "got single\n");
541 /* Make sure /sbin/getty exists before trying to run it */ 539 /* Make sure /sbin/getty exists before trying to run it */
542 if (stat(GETTY, &statbuf)==0) { 540 if (stat(GETTY, &statbuf)==0) {
543 char* where; 541 char* where;
544fprintf(stderr, "\n"); 542 /* First do tty2 */
545 wait_for_enter_tty2 = FALSE; 543 wait_for_enter_tty2 = FALSE;
546 where = strrchr( console, '/'); 544 where = strrchr( second_console, '/');
547 if ( where != NULL) { 545 if ( where != NULL) {
548 strcpy( (char*)getty2_command[2], where); 546 where++;
547 strncpy( which_vt2, where, sizeof(which_vt2));
549 } 548 }
550 tty2_command = getty2_command; 549 tty2_command = getty2_command;
550
551 /* Check on hooking a getty onto tty1 */ 551 /* Check on hooking a getty onto tty1 */
552 if (run_rc == FALSE && single==FALSE) { 552 if (run_rc == FALSE && single==FALSE) {
553 wait_for_enter_tty1 = FALSE; 553 wait_for_enter_tty1 = FALSE;
554 where = strrchr( second_console, '/'); 554 where = strrchr( console, '/');
555 if ( where != NULL) { 555 if ( where != NULL) {
556 strcpy( (char*)getty1_command[2], where); 556 where++;
557 strncpy( which_vt1, where, sizeof(which_vt1));
557 } 558 }
558 tty1_command = getty1_command; 559 tty1_command = getty1_command;
559 } 560 }