diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-12-11 04:16:51 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-12-11 04:16:51 +0000 |
commit | 84b009256f2c17908ed768fea67bba8380ee1f26 (patch) | |
tree | 33a81760971a95856be3db8344c38fc235e07c91 | |
parent | b52a218c95ac69977e0a7e1c0ab9563c28e145d0 (diff) | |
download | busybox-w32-84b009256f2c17908ed768fea67bba8380ee1f26.tar.gz busybox-w32-84b009256f2c17908ed768fea67bba8380ee1f26.tar.bz2 busybox-w32-84b009256f2c17908ed768fea67bba8380ee1f26.zip |
Minor updates
-rw-r--r-- | README | 8 | ||||
-rw-r--r-- | TODO | 3 | ||||
-rw-r--r-- | init.c | 23 | ||||
-rw-r--r-- | init/init.c | 23 |
4 files changed, 33 insertions, 24 deletions
@@ -16,11 +16,15 @@ the parts you do not need using C++ style (//) comments. | |||
16 | After the build is complete a busybox.links file is generated which is | 16 | After the build is complete a busybox.links file is generated which is |
17 | then used by 'make install' to create symlinks to the busybox binary | 17 | then used by 'make install' to create symlinks to the busybox binary |
18 | for all compiled in functions. By default, 'make install' will place | 18 | for all compiled in functions. By default, 'make install' will place |
19 | the symlink forest into `pwd`/busybox_install unless you have defined | 19 | the symlink forest into `pwd`/_install unless you have defined the |
20 | the PREFIX environment variable. | 20 | PREFIX environment variable. |
21 | 21 | ||
22 | Please feed suggestions, bug reports, insults, and bribes back to: | 22 | Please feed suggestions, bug reports, insults, and bribes back to: |
23 | Erik Andersen | 23 | Erik Andersen |
24 | <andersen@lineo.com> | 24 | <andersen@lineo.com> |
25 | <andersee@deban.org> | 25 | <andersee@deban.org> |
26 | 26 | ||
27 | <blatent plug> | ||
28 | Many thanks to go to Lineo for paying me to work on busybox. | ||
29 | </blatent plug> | ||
30 | |||
@@ -9,6 +9,9 @@ around to it some time. If you have any good ideas, please let me know. | |||
9 | 9 | ||
10 | * Allow tar to create archives with sockets, devices, and other special files | 10 | * Allow tar to create archives with sockets, devices, and other special files |
11 | * Add in a mini insmod, rmmod, lsmod | 11 | * Add in a mini insmod, rmmod, lsmod |
12 | * init clearly needs to support some type of minimalist /etc/inittab. I | ||
13 | currently have _way_ too much policy hardcoded in the source. Adding | ||
14 | support for getty has made me realize how much that sucks. | ||
12 | * dnsdomainname | 15 | * dnsdomainname |
13 | * traceroute/nslookup/netstat | 16 | * traceroute/nslookup/netstat |
14 | * rdate | 17 | * rdate |
@@ -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 | ||
519 | fprintf(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(); |
523 | fprintf(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 | } |
532 | fprintf(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; |
544 | fprintf(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 | } |
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 | ||
519 | fprintf(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(); |
523 | fprintf(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 | } |
532 | fprintf(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; |
544 | fprintf(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 | } |