OSDN Git Service

More stuff
authorEric Andersen <andersen@codepoet.org>
Sat, 16 Oct 1999 15:48:40 +0000 (15:48 -0000)
committerEric Andersen <andersen@codepoet.org>
Sat, 16 Oct 1999 15:48:40 +0000 (15:48 -0000)
Makefile
archival/gzip.c
busybox.def.h
gzip.c
init.c
init/init.c
mount.c
util-linux/mount.c

index 3069c07..4b05075 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -16,7 +16,7 @@ ifeq ($(DODEBUG),true)
     STRIP=
     LDFLAGS=
 else
-    CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
+    CFLAGS=-Wall -Os -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE
     LDFLAGS= -s
     STRIP= strip --remove-section=.note --remove-section=.comment busybox
 endif
index 4b1d32d..c7fb25e 100644 (file)
@@ -8,7 +8,7 @@
 #ifdef BB_GZIP
 
 #ifndef BB_ZCAT
-error: you need zcat to have gzip support!
+#error you need zcat to have gzip support!
 #endif
 
 const char gzip_usage[] = "gzip\nignores all command line arguments\ncompress stdin to stdout with -9 compression\n";
@@ -380,7 +380,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
 #  undef LZW
 #endif
 
-/* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
+/* $Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $ */
 /* tailor.h -- target dependent definitions
  * Copyright (C) 1992-1993 Jean-loup Gailly.
  * This is free software; you can redistribute it and/or modify it under the
@@ -391,7 +391,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
  * The target dependent functions should be defined in tailor.c.
  */
 
-/* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
+/* $Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $ */
 
 #if defined(__MSDOS__) && !defined(MSDOS)
 #  define MSDOS
@@ -767,7 +767,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
 #endif
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -976,7 +976,7 @@ void copy_block(buf, len, header)
 #include <stdio.h>
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -1592,7 +1592,7 @@ ulg deflate()
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -1925,7 +1925,7 @@ local void do_exit(int exitcode)
 #include <ctype.h>
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -2943,7 +2943,7 @@ local void set_file_type()
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -3142,7 +3142,7 @@ void display_ratio(num, den, file)
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 #include <ctype.h>
index a236520..15c8edc 100644 (file)
@@ -52,4 +52,4 @@
 //#define BB_UPDATE
 #define BB_UTILITY
 #define BB_ZCAT
-#define BB_GZIP
+//#define BB_GZIP
diff --git a/gzip.c b/gzip.c
index 4b1d32d..c7fb25e 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -8,7 +8,7 @@
 #ifdef BB_GZIP
 
 #ifndef BB_ZCAT
-error: you need zcat to have gzip support!
+#error you need zcat to have gzip support!
 #endif
 
 const char gzip_usage[] = "gzip\nignores all command line arguments\ncompress stdin to stdout with -9 compression\n";
@@ -380,7 +380,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
 #  undef LZW
 #endif
 
-/* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
+/* $Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $ */
 /* tailor.h -- target dependent definitions
  * Copyright (C) 1992-1993 Jean-loup Gailly.
  * This is free software; you can redistribute it and/or modify it under the
@@ -391,7 +391,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
  * The target dependent functions should be defined in tailor.c.
  */
 
-/* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */
+/* $Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $ */
 
 #if defined(__MSDOS__) && !defined(MSDOS)
 #  define MSDOS
@@ -767,7 +767,7 @@ extern int block_mode;   /* block compress mode -C compatible with 2.0 */
 #endif
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -976,7 +976,7 @@ void copy_block(buf, len, header)
 #include <stdio.h>
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -1592,7 +1592,7 @@ ulg deflate()
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -1925,7 +1925,7 @@ local void do_exit(int exitcode)
 #include <ctype.h>
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 /* ===========================================================================
@@ -2943,7 +2943,7 @@ local void set_file_type()
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 #include <ctype.h>
@@ -3142,7 +3142,7 @@ void display_ratio(num, den, file)
  */
 
 #ifdef RCSID
-static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $";
+static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $";
 #endif
 
 #include <ctype.h>
diff --git a/init.c b/init.c
index 19cbec1..ade29c7 100644 (file)
--- a/init.c
+++ b/init.c
@@ -99,7 +99,7 @@ run(const char* program, const char* const* arguments,
        };
 
        static const char       press_enter[] =
- "Please press Enter to activate this console. ";
+ "\nPlease press Enter to activate this console. ";
 
        int     pid;
 
@@ -388,13 +388,8 @@ init_main(int argc, char * * argv)
        arguments[j] = 0;
 
        if ( run_rc ) {
-               printf("running %s with args \"",rc);
-               for ( j = 0; j < argc; j++ ) {
-                       printf("%s ", arguments[j]);
-               }
-               printf("\" on console %s\n", console);
-               waitfor(run(rc, arguments, console, 0));
-               printf("done.\n");
+               run(rc, arguments, console, 0);
+               //waitfor(run(rc, arguments, console, 0));
        }
 
        if ( 0 == create_swap) {
@@ -414,19 +409,9 @@ init_main(int argc, char * * argv)
                        /*
                         arguments[0] = tty_commands[0];
                         */
-                           printf("running %s with args \"",tty_commands[0]);
-                           for ( j = 0; j < argc; j++ ) {
-                                   printf("%s ", arguments[j]);
-                           }
-                           printf("\" on console %s\n", first_terminal);
                        pid1 = run(tty_commands[0], arguments, first_terminal, 1);
                }
                if ( pid2 == 0 && tty_commands[1] ) {
-                           printf("running %s with args \"",tty_commands[0]);
-                           for ( j = 0; j < argc; j++ ) {
-                                   printf("%s ", arguments[j]);
-                           }
-                           printf("\" on console %s\n", first_terminal);
                        pid2 = run(tty_commands[1], arguments, second_terminal, 1);
                }
                wpid = wait(&status);
index 19cbec1..ade29c7 100644 (file)
@@ -99,7 +99,7 @@ run(const char* program, const char* const* arguments,
        };
 
        static const char       press_enter[] =
- "Please press Enter to activate this console. ";
+ "\nPlease press Enter to activate this console. ";
 
        int     pid;
 
@@ -388,13 +388,8 @@ init_main(int argc, char * * argv)
        arguments[j] = 0;
 
        if ( run_rc ) {
-               printf("running %s with args \"",rc);
-               for ( j = 0; j < argc; j++ ) {
-                       printf("%s ", arguments[j]);
-               }
-               printf("\" on console %s\n", console);
-               waitfor(run(rc, arguments, console, 0));
-               printf("done.\n");
+               run(rc, arguments, console, 0);
+               //waitfor(run(rc, arguments, console, 0));
        }
 
        if ( 0 == create_swap) {
@@ -414,19 +409,9 @@ init_main(int argc, char * * argv)
                        /*
                         arguments[0] = tty_commands[0];
                         */
-                           printf("running %s with args \"",tty_commands[0]);
-                           for ( j = 0; j < argc; j++ ) {
-                                   printf("%s ", arguments[j]);
-                           }
-                           printf("\" on console %s\n", first_terminal);
                        pid1 = run(tty_commands[0], arguments, first_terminal, 1);
                }
                if ( pid2 == 0 && tty_commands[1] ) {
-                           printf("running %s with args \"",tty_commands[0]);
-                           for ( j = 0; j < argc; j++ ) {
-                                   printf("%s ", arguments[j]);
-                           }
-                           printf("\" on console %s\n", first_terminal);
                        pid2 = run(tty_commands[1], arguments, second_terminal, 1);
                }
                wpid = wait(&status);
diff --git a/mount.c b/mount.c
index d7b2682..26d4693 100644 (file)
--- a/mount.c
+++ b/mount.c
@@ -174,17 +174,26 @@ extern int mount_main (int argc, char **argv)
     char *filesystemType = "auto";
     char *device = NULL;
     char *directory = NULL;
+    struct stat statBuf;
     int all = 0;
     int i;
 
+    if (stat("/etc/fstab", &statBuf) < 0) 
+       fprintf(stderr, "/etc/fstab file missing -- Please install one.\n\n");
+
     if (argc == 1) {
        FILE *mountTable;
        if ((mountTable = setmntent ("/proc/mounts", "r"))) {
            struct mntent *m;
            while ((m = getmntent (mountTable)) != 0) {
+               struct fstab* fstabItem;
                char *blockDevice = m->mnt_fsname;
-               if (strcmp (blockDevice, "/dev/root") == 0)
-                   blockDevice = (getfsfile ("/"))->fs_spec;
+               /* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */
+               if (strcmp (blockDevice, "/dev/root") == 0) {
+                   fstabItem = getfsfile ("/");
+                   if (fstabItem != NULL)
+                       blockDevice = fstabItem->fs_spec;
+               }
                printf ("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir,
                        m->mnt_type, m->mnt_opts);
            }
index d7b2682..26d4693 100644 (file)
@@ -174,17 +174,26 @@ extern int mount_main (int argc, char **argv)
     char *filesystemType = "auto";
     char *device = NULL;
     char *directory = NULL;
+    struct stat statBuf;
     int all = 0;
     int i;
 
+    if (stat("/etc/fstab", &statBuf) < 0) 
+       fprintf(stderr, "/etc/fstab file missing -- Please install one.\n\n");
+
     if (argc == 1) {
        FILE *mountTable;
        if ((mountTable = setmntent ("/proc/mounts", "r"))) {
            struct mntent *m;
            while ((m = getmntent (mountTable)) != 0) {
+               struct fstab* fstabItem;
                char *blockDevice = m->mnt_fsname;
-               if (strcmp (blockDevice, "/dev/root") == 0)
-                   blockDevice = (getfsfile ("/"))->fs_spec;
+               /* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */
+               if (strcmp (blockDevice, "/dev/root") == 0) {
+                   fstabItem = getfsfile ("/");
+                   if (fstabItem != NULL)
+                       blockDevice = fstabItem->fs_spec;
+               }
                printf ("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir,
                        m->mnt_type, m->mnt_opts);
            }