Minor updates
authorEric Andersen <andersen@codepoet.org>
Sat, 11 Dec 1999 04:16:51 +0000 (04:16 -0000)
committerEric Andersen <andersen@codepoet.org>
Sat, 11 Dec 1999 04:16:51 +0000 (04:16 -0000)
README
TODO
init.c
init/init.c

diff --git a/README b/README
index 663a5d6..c71878c 100644 (file)
--- a/README
+++ b/README
@@ -16,11 +16,15 @@ the parts you do not need using C++ style (//) comments.
 After the build is complete a busybox.links file is generated which is
 then used by 'make install' to create symlinks to the busybox binary
 for all compiled in functions.  By default, 'make install' will place
-the symlink forest into `pwd`/busybox_install unless you have defined
-the PREFIX environment variable.
+the symlink forest into `pwd`/_install unless you have defined the 
+PREFIX environment variable.
 
 Please feed suggestions, bug reports, insults, and bribes back to:
        Erik Andersen 
        <andersen@lineo.com>
        <andersee@deban.org>
 
+<blatent plug>
+Many thanks to go to Lineo for paying me to work on busybox. 
+</blatent plug>
+
diff --git a/TODO b/TODO
index 2145db4..73660e9 100644 (file)
--- a/TODO
+++ b/TODO
@@ -9,6 +9,9 @@ around to it some time. If you have any good ideas, please let me know.
 
 * Allow tar to create archives with sockets, devices, and other special files
 * Add in a mini insmod, rmmod, lsmod
+* init clearly needs to support some type of minimalist /etc/inittab. I
+    currently have _way_ too much policy hardcoded in the source.  Adding
+    support for getty has made me realize how much that sucks.
 * dnsdomainname
 * traceroute/nslookup/netstat
 * rdate
diff --git a/init.c b/init.c
index 3c800b9..5203713 100644 (file)
--- a/init.c
+++ b/init.c
@@ -446,9 +446,11 @@ extern int init_main(int argc, char **argv)
     pid_t pid1 = 0;
     pid_t pid2 = 0;
     struct stat statbuf;
+    char which_vt1[30];
+    char which_vt2[30];
     const char* const rc_script_command[] = { INITSCRIPT, INITSCRIPT, 0};
-    const char* const getty1_command[] = { GETTY, GETTY, VT_PRIMARY, 0};
-    const char* const getty2_command[] = { GETTY, GETTY, VT_SECONDARY, 0};
+    const char* const getty1_command[] = { GETTY, GETTY, "38400", which_vt1, 0};
+    const char* const getty2_command[] = { GETTY, GETTY, "38400", which_vt2, 0};
     const char* const shell_command[] = { SHELL, "-" SHELL, 0};
     const char* const* tty1_command = shell_command;
     const char* const* tty2_command = shell_command;
@@ -516,11 +518,8 @@ extern int init_main(int argc, char **argv)
     } else
        message(CONSOLE|LOG, "Mounting /proc: failed!\n");
 
-fprintf(stderr, "got proc\n");
-
     /* Make sure there is enough memory to do something useful. */
     check_memory();
-fprintf(stderr, "got check_memory\n");
 
     /* Check if we are supposed to be in single user mode */
     if ( argc > 1 && (!strcmp(argv[1], "single") || 
@@ -529,7 +528,6 @@ fprintf(stderr, "got check_memory\n");
        tty1_command = shell_command;
        tty2_command = shell_command;
     }
-fprintf(stderr, "got single\n");
 
     /* Make sure an init script exists before trying to run it */
     if (single==FALSE && stat(INITSCRIPT, &statbuf)==0) {
@@ -541,19 +539,22 @@ fprintf(stderr, "got single\n");
     /* Make sure /sbin/getty exists before trying to run it */
     if (stat(GETTY, &statbuf)==0) {
        char* where;
-fprintf(stderr, "\n");
+       /* First do tty2 */
        wait_for_enter_tty2 = FALSE;
-       where = strrchr( console, '/');
+       where = strrchr( second_console, '/');
        if ( where != NULL) {
-           strcpy( (char*)getty2_command[2], where);
+           where++;
+           strncpy( which_vt2, where, sizeof(which_vt2));
        }
        tty2_command = getty2_command;
+
        /* Check on hooking a getty onto tty1 */
        if (run_rc == FALSE && single==FALSE) {
            wait_for_enter_tty1 = FALSE;
-           where = strrchr( second_console, '/');
+           where = strrchr( console, '/');
            if ( where != NULL) {
-               strcpy( (char*)getty1_command[2], where);
+               where++;
+               strncpy( which_vt1, where, sizeof(which_vt1));
            }
            tty1_command = getty1_command;
        }
index 3c800b9..5203713 100644 (file)
@@ -446,9 +446,11 @@ extern int init_main(int argc, char **argv)
     pid_t pid1 = 0;
     pid_t pid2 = 0;
     struct stat statbuf;
+    char which_vt1[30];
+    char which_vt2[30];
     const char* const rc_script_command[] = { INITSCRIPT, INITSCRIPT, 0};
-    const char* const getty1_command[] = { GETTY, GETTY, VT_PRIMARY, 0};
-    const char* const getty2_command[] = { GETTY, GETTY, VT_SECONDARY, 0};
+    const char* const getty1_command[] = { GETTY, GETTY, "38400", which_vt1, 0};
+    const char* const getty2_command[] = { GETTY, GETTY, "38400", which_vt2, 0};
     const char* const shell_command[] = { SHELL, "-" SHELL, 0};
     const char* const* tty1_command = shell_command;
     const char* const* tty2_command = shell_command;
@@ -516,11 +518,8 @@ extern int init_main(int argc, char **argv)
     } else
        message(CONSOLE|LOG, "Mounting /proc: failed!\n");
 
-fprintf(stderr, "got proc\n");
-
     /* Make sure there is enough memory to do something useful. */
     check_memory();
-fprintf(stderr, "got check_memory\n");
 
     /* Check if we are supposed to be in single user mode */
     if ( argc > 1 && (!strcmp(argv[1], "single") || 
@@ -529,7 +528,6 @@ fprintf(stderr, "got check_memory\n");
        tty1_command = shell_command;
        tty2_command = shell_command;
     }
-fprintf(stderr, "got single\n");
 
     /* Make sure an init script exists before trying to run it */
     if (single==FALSE && stat(INITSCRIPT, &statbuf)==0) {
@@ -541,19 +539,22 @@ fprintf(stderr, "got single\n");
     /* Make sure /sbin/getty exists before trying to run it */
     if (stat(GETTY, &statbuf)==0) {
        char* where;
-fprintf(stderr, "\n");
+       /* First do tty2 */
        wait_for_enter_tty2 = FALSE;
-       where = strrchr( console, '/');
+       where = strrchr( second_console, '/');
        if ( where != NULL) {
-           strcpy( (char*)getty2_command[2], where);
+           where++;
+           strncpy( which_vt2, where, sizeof(which_vt2));
        }
        tty2_command = getty2_command;
+
        /* Check on hooking a getty onto tty1 */
        if (run_rc == FALSE && single==FALSE) {
            wait_for_enter_tty1 = FALSE;
-           where = strrchr( second_console, '/');
+           where = strrchr( console, '/');
            if ( where != NULL) {
-               strcpy( (char*)getty1_command[2], where);
+               where++;
+               strncpy( which_vt1, where, sizeof(which_vt1));
            }
            tty1_command = getty1_command;
        }