diff options
author | Eric Andersen <andersen@codepoet.org> | 1999-10-16 15:48:40 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 1999-10-16 15:48:40 +0000 |
commit | cb6e25655f894c90e4befc4bee0e66794dd6858f (patch) | |
tree | e98863094266c328ffebe2920d0aead3c52cc121 | |
parent | 3c163822d88105450806fdb6a29fdfc2511267d1 (diff) | |
download | busybox-w32-cb6e25655f894c90e4befc4bee0e66794dd6858f.tar.gz busybox-w32-cb6e25655f894c90e4befc4bee0e66794dd6858f.tar.bz2 busybox-w32-cb6e25655f894c90e4befc4bee0e66794dd6858f.zip |
More stuff
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | archival/gzip.c | 18 | ||||
-rw-r--r-- | busybox.def.h | 2 | ||||
-rw-r--r-- | gzip.c | 18 | ||||
-rw-r--r-- | init.c | 21 | ||||
-rw-r--r-- | init/init.c | 21 | ||||
-rw-r--r-- | mount.c | 13 | ||||
-rw-r--r-- | util-linux/mount.c | 13 |
8 files changed, 48 insertions, 60 deletions
@@ -16,7 +16,7 @@ ifeq ($(DODEBUG),true) | |||
16 | STRIP= | 16 | STRIP= |
17 | LDFLAGS= | 17 | LDFLAGS= |
18 | else | 18 | else |
19 | CFLAGS=-Wall -O2 -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE | 19 | CFLAGS=-Wall -Os -fomit-frame-pointer -fno-builtin -D_GNU_SOURCE |
20 | LDFLAGS= -s | 20 | LDFLAGS= -s |
21 | STRIP= strip --remove-section=.note --remove-section=.comment busybox | 21 | STRIP= strip --remove-section=.note --remove-section=.comment busybox |
22 | endif | 22 | endif |
diff --git a/archival/gzip.c b/archival/gzip.c index 4b1d32ddd..c7fb25ed0 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #ifdef BB_GZIP | 8 | #ifdef BB_GZIP |
9 | 9 | ||
10 | #ifndef BB_ZCAT | 10 | #ifndef BB_ZCAT |
11 | error: you need zcat to have gzip support! | 11 | #error you need zcat to have gzip support! |
12 | #endif | 12 | #endif |
13 | 13 | ||
14 | const char gzip_usage[] = "gzip\nignores all command line arguments\ncompress stdin to stdout with -9 compression\n"; | 14 | 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 */ | |||
380 | # undef LZW | 380 | # undef LZW |
381 | #endif | 381 | #endif |
382 | 382 | ||
383 | /* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ | 383 | /* $Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $ */ |
384 | /* tailor.h -- target dependent definitions | 384 | /* tailor.h -- target dependent definitions |
385 | * Copyright (C) 1992-1993 Jean-loup Gailly. | 385 | * Copyright (C) 1992-1993 Jean-loup Gailly. |
386 | * This is free software; you can redistribute it and/or modify it under the | 386 | * 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 */ | |||
391 | * The target dependent functions should be defined in tailor.c. | 391 | * The target dependent functions should be defined in tailor.c. |
392 | */ | 392 | */ |
393 | 393 | ||
394 | /* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ | 394 | /* $Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $ */ |
395 | 395 | ||
396 | #if defined(__MSDOS__) && !defined(MSDOS) | 396 | #if defined(__MSDOS__) && !defined(MSDOS) |
397 | # define MSDOS | 397 | # define MSDOS |
@@ -767,7 +767,7 @@ extern int block_mode; /* block compress mode -C compatible with 2.0 */ | |||
767 | #endif | 767 | #endif |
768 | 768 | ||
769 | #ifdef RCSID | 769 | #ifdef RCSID |
770 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 770 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
771 | #endif | 771 | #endif |
772 | 772 | ||
773 | /* =========================================================================== | 773 | /* =========================================================================== |
@@ -976,7 +976,7 @@ void copy_block(buf, len, header) | |||
976 | #include <stdio.h> | 976 | #include <stdio.h> |
977 | 977 | ||
978 | #ifdef RCSID | 978 | #ifdef RCSID |
979 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 979 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
980 | #endif | 980 | #endif |
981 | 981 | ||
982 | /* =========================================================================== | 982 | /* =========================================================================== |
@@ -1592,7 +1592,7 @@ ulg deflate() | |||
1592 | */ | 1592 | */ |
1593 | 1593 | ||
1594 | #ifdef RCSID | 1594 | #ifdef RCSID |
1595 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 1595 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
1596 | #endif | 1596 | #endif |
1597 | 1597 | ||
1598 | #include <ctype.h> | 1598 | #include <ctype.h> |
@@ -1925,7 +1925,7 @@ local void do_exit(int exitcode) | |||
1925 | #include <ctype.h> | 1925 | #include <ctype.h> |
1926 | 1926 | ||
1927 | #ifdef RCSID | 1927 | #ifdef RCSID |
1928 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 1928 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
1929 | #endif | 1929 | #endif |
1930 | 1930 | ||
1931 | /* =========================================================================== | 1931 | /* =========================================================================== |
@@ -2943,7 +2943,7 @@ local void set_file_type() | |||
2943 | */ | 2943 | */ |
2944 | 2944 | ||
2945 | #ifdef RCSID | 2945 | #ifdef RCSID |
2946 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 2946 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
2947 | #endif | 2947 | #endif |
2948 | 2948 | ||
2949 | #include <ctype.h> | 2949 | #include <ctype.h> |
@@ -3142,7 +3142,7 @@ void display_ratio(num, den, file) | |||
3142 | */ | 3142 | */ |
3143 | 3143 | ||
3144 | #ifdef RCSID | 3144 | #ifdef RCSID |
3145 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 3145 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
3146 | #endif | 3146 | #endif |
3147 | 3147 | ||
3148 | #include <ctype.h> | 3148 | #include <ctype.h> |
diff --git a/busybox.def.h b/busybox.def.h index a236520c1..15c8edc43 100644 --- a/busybox.def.h +++ b/busybox.def.h | |||
@@ -52,4 +52,4 @@ | |||
52 | //#define BB_UPDATE | 52 | //#define BB_UPDATE |
53 | #define BB_UTILITY | 53 | #define BB_UTILITY |
54 | #define BB_ZCAT | 54 | #define BB_ZCAT |
55 | #define BB_GZIP | 55 | //#define BB_GZIP |
@@ -8,7 +8,7 @@ | |||
8 | #ifdef BB_GZIP | 8 | #ifdef BB_GZIP |
9 | 9 | ||
10 | #ifndef BB_ZCAT | 10 | #ifndef BB_ZCAT |
11 | error: you need zcat to have gzip support! | 11 | #error you need zcat to have gzip support! |
12 | #endif | 12 | #endif |
13 | 13 | ||
14 | const char gzip_usage[] = "gzip\nignores all command line arguments\ncompress stdin to stdout with -9 compression\n"; | 14 | 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 */ | |||
380 | # undef LZW | 380 | # undef LZW |
381 | #endif | 381 | #endif |
382 | 382 | ||
383 | /* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ | 383 | /* $Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $ */ |
384 | /* tailor.h -- target dependent definitions | 384 | /* tailor.h -- target dependent definitions |
385 | * Copyright (C) 1992-1993 Jean-loup Gailly. | 385 | * Copyright (C) 1992-1993 Jean-loup Gailly. |
386 | * This is free software; you can redistribute it and/or modify it under the | 386 | * 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 */ | |||
391 | * The target dependent functions should be defined in tailor.c. | 391 | * The target dependent functions should be defined in tailor.c. |
392 | */ | 392 | */ |
393 | 393 | ||
394 | /* $Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $ */ | 394 | /* $Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $ */ |
395 | 395 | ||
396 | #if defined(__MSDOS__) && !defined(MSDOS) | 396 | #if defined(__MSDOS__) && !defined(MSDOS) |
397 | # define MSDOS | 397 | # define MSDOS |
@@ -767,7 +767,7 @@ extern int block_mode; /* block compress mode -C compatible with 2.0 */ | |||
767 | #endif | 767 | #endif |
768 | 768 | ||
769 | #ifdef RCSID | 769 | #ifdef RCSID |
770 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 770 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
771 | #endif | 771 | #endif |
772 | 772 | ||
773 | /* =========================================================================== | 773 | /* =========================================================================== |
@@ -976,7 +976,7 @@ void copy_block(buf, len, header) | |||
976 | #include <stdio.h> | 976 | #include <stdio.h> |
977 | 977 | ||
978 | #ifdef RCSID | 978 | #ifdef RCSID |
979 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 979 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
980 | #endif | 980 | #endif |
981 | 981 | ||
982 | /* =========================================================================== | 982 | /* =========================================================================== |
@@ -1592,7 +1592,7 @@ ulg deflate() | |||
1592 | */ | 1592 | */ |
1593 | 1593 | ||
1594 | #ifdef RCSID | 1594 | #ifdef RCSID |
1595 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 1595 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
1596 | #endif | 1596 | #endif |
1597 | 1597 | ||
1598 | #include <ctype.h> | 1598 | #include <ctype.h> |
@@ -1925,7 +1925,7 @@ local void do_exit(int exitcode) | |||
1925 | #include <ctype.h> | 1925 | #include <ctype.h> |
1926 | 1926 | ||
1927 | #ifdef RCSID | 1927 | #ifdef RCSID |
1928 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 1928 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
1929 | #endif | 1929 | #endif |
1930 | 1930 | ||
1931 | /* =========================================================================== | 1931 | /* =========================================================================== |
@@ -2943,7 +2943,7 @@ local void set_file_type() | |||
2943 | */ | 2943 | */ |
2944 | 2944 | ||
2945 | #ifdef RCSID | 2945 | #ifdef RCSID |
2946 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 2946 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
2947 | #endif | 2947 | #endif |
2948 | 2948 | ||
2949 | #include <ctype.h> | 2949 | #include <ctype.h> |
@@ -3142,7 +3142,7 @@ void display_ratio(num, den, file) | |||
3142 | */ | 3142 | */ |
3143 | 3143 | ||
3144 | #ifdef RCSID | 3144 | #ifdef RCSID |
3145 | static char rcsid[] = "$Id: gzip.c,v 1.2 1999/10/06 20:25:32 andersen Exp $"; | 3145 | static char rcsid[] = "$Id: gzip.c,v 1.3 1999/10/16 15:48:40 andersen Exp $"; |
3146 | #endif | 3146 | #endif |
3147 | 3147 | ||
3148 | #include <ctype.h> | 3148 | #include <ctype.h> |
@@ -99,7 +99,7 @@ run(const char* program, const char* const* arguments, | |||
99 | }; | 99 | }; |
100 | 100 | ||
101 | static const char press_enter[] = | 101 | static const char press_enter[] = |
102 | "Please press Enter to activate this console. "; | 102 | "\nPlease press Enter to activate this console. "; |
103 | 103 | ||
104 | int pid; | 104 | int pid; |
105 | 105 | ||
@@ -388,13 +388,8 @@ init_main(int argc, char * * argv) | |||
388 | arguments[j] = 0; | 388 | arguments[j] = 0; |
389 | 389 | ||
390 | if ( run_rc ) { | 390 | if ( run_rc ) { |
391 | printf("running %s with args \"",rc); | 391 | run(rc, arguments, console, 0); |
392 | for ( j = 0; j < argc; j++ ) { | 392 | //waitfor(run(rc, arguments, console, 0)); |
393 | printf("%s ", arguments[j]); | ||
394 | } | ||
395 | printf("\" on console %s\n", console); | ||
396 | waitfor(run(rc, arguments, console, 0)); | ||
397 | printf("done.\n"); | ||
398 | } | 393 | } |
399 | 394 | ||
400 | if ( 0 == create_swap) { | 395 | if ( 0 == create_swap) { |
@@ -414,19 +409,9 @@ init_main(int argc, char * * argv) | |||
414 | /* | 409 | /* |
415 | arguments[0] = tty_commands[0]; | 410 | arguments[0] = tty_commands[0]; |
416 | */ | 411 | */ |
417 | printf("running %s with args \"",tty_commands[0]); | ||
418 | for ( j = 0; j < argc; j++ ) { | ||
419 | printf("%s ", arguments[j]); | ||
420 | } | ||
421 | printf("\" on console %s\n", first_terminal); | ||
422 | pid1 = run(tty_commands[0], arguments, first_terminal, 1); | 412 | pid1 = run(tty_commands[0], arguments, first_terminal, 1); |
423 | } | 413 | } |
424 | if ( pid2 == 0 && tty_commands[1] ) { | 414 | if ( pid2 == 0 && tty_commands[1] ) { |
425 | printf("running %s with args \"",tty_commands[0]); | ||
426 | for ( j = 0; j < argc; j++ ) { | ||
427 | printf("%s ", arguments[j]); | ||
428 | } | ||
429 | printf("\" on console %s\n", first_terminal); | ||
430 | pid2 = run(tty_commands[1], arguments, second_terminal, 1); | 415 | pid2 = run(tty_commands[1], arguments, second_terminal, 1); |
431 | } | 416 | } |
432 | wpid = wait(&status); | 417 | wpid = wait(&status); |
diff --git a/init/init.c b/init/init.c index 19cbec130..ade29c7c2 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -99,7 +99,7 @@ run(const char* program, const char* const* arguments, | |||
99 | }; | 99 | }; |
100 | 100 | ||
101 | static const char press_enter[] = | 101 | static const char press_enter[] = |
102 | "Please press Enter to activate this console. "; | 102 | "\nPlease press Enter to activate this console. "; |
103 | 103 | ||
104 | int pid; | 104 | int pid; |
105 | 105 | ||
@@ -388,13 +388,8 @@ init_main(int argc, char * * argv) | |||
388 | arguments[j] = 0; | 388 | arguments[j] = 0; |
389 | 389 | ||
390 | if ( run_rc ) { | 390 | if ( run_rc ) { |
391 | printf("running %s with args \"",rc); | 391 | run(rc, arguments, console, 0); |
392 | for ( j = 0; j < argc; j++ ) { | 392 | //waitfor(run(rc, arguments, console, 0)); |
393 | printf("%s ", arguments[j]); | ||
394 | } | ||
395 | printf("\" on console %s\n", console); | ||
396 | waitfor(run(rc, arguments, console, 0)); | ||
397 | printf("done.\n"); | ||
398 | } | 393 | } |
399 | 394 | ||
400 | if ( 0 == create_swap) { | 395 | if ( 0 == create_swap) { |
@@ -414,19 +409,9 @@ init_main(int argc, char * * argv) | |||
414 | /* | 409 | /* |
415 | arguments[0] = tty_commands[0]; | 410 | arguments[0] = tty_commands[0]; |
416 | */ | 411 | */ |
417 | printf("running %s with args \"",tty_commands[0]); | ||
418 | for ( j = 0; j < argc; j++ ) { | ||
419 | printf("%s ", arguments[j]); | ||
420 | } | ||
421 | printf("\" on console %s\n", first_terminal); | ||
422 | pid1 = run(tty_commands[0], arguments, first_terminal, 1); | 412 | pid1 = run(tty_commands[0], arguments, first_terminal, 1); |
423 | } | 413 | } |
424 | if ( pid2 == 0 && tty_commands[1] ) { | 414 | if ( pid2 == 0 && tty_commands[1] ) { |
425 | printf("running %s with args \"",tty_commands[0]); | ||
426 | for ( j = 0; j < argc; j++ ) { | ||
427 | printf("%s ", arguments[j]); | ||
428 | } | ||
429 | printf("\" on console %s\n", first_terminal); | ||
430 | pid2 = run(tty_commands[1], arguments, second_terminal, 1); | 415 | pid2 = run(tty_commands[1], arguments, second_terminal, 1); |
431 | } | 416 | } |
432 | wpid = wait(&status); | 417 | wpid = wait(&status); |
@@ -174,17 +174,26 @@ extern int mount_main (int argc, char **argv) | |||
174 | char *filesystemType = "auto"; | 174 | char *filesystemType = "auto"; |
175 | char *device = NULL; | 175 | char *device = NULL; |
176 | char *directory = NULL; | 176 | char *directory = NULL; |
177 | struct stat statBuf; | ||
177 | int all = 0; | 178 | int all = 0; |
178 | int i; | 179 | int i; |
179 | 180 | ||
181 | if (stat("/etc/fstab", &statBuf) < 0) | ||
182 | fprintf(stderr, "/etc/fstab file missing -- Please install one.\n\n"); | ||
183 | |||
180 | if (argc == 1) { | 184 | if (argc == 1) { |
181 | FILE *mountTable; | 185 | FILE *mountTable; |
182 | if ((mountTable = setmntent ("/proc/mounts", "r"))) { | 186 | if ((mountTable = setmntent ("/proc/mounts", "r"))) { |
183 | struct mntent *m; | 187 | struct mntent *m; |
184 | while ((m = getmntent (mountTable)) != 0) { | 188 | while ((m = getmntent (mountTable)) != 0) { |
189 | struct fstab* fstabItem; | ||
185 | char *blockDevice = m->mnt_fsname; | 190 | char *blockDevice = m->mnt_fsname; |
186 | if (strcmp (blockDevice, "/dev/root") == 0) | 191 | /* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */ |
187 | blockDevice = (getfsfile ("/"))->fs_spec; | 192 | if (strcmp (blockDevice, "/dev/root") == 0) { |
193 | fstabItem = getfsfile ("/"); | ||
194 | if (fstabItem != NULL) | ||
195 | blockDevice = fstabItem->fs_spec; | ||
196 | } | ||
188 | printf ("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir, | 197 | printf ("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir, |
189 | m->mnt_type, m->mnt_opts); | 198 | m->mnt_type, m->mnt_opts); |
190 | } | 199 | } |
diff --git a/util-linux/mount.c b/util-linux/mount.c index d7b2682ce..26d4693d0 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -174,17 +174,26 @@ extern int mount_main (int argc, char **argv) | |||
174 | char *filesystemType = "auto"; | 174 | char *filesystemType = "auto"; |
175 | char *device = NULL; | 175 | char *device = NULL; |
176 | char *directory = NULL; | 176 | char *directory = NULL; |
177 | struct stat statBuf; | ||
177 | int all = 0; | 178 | int all = 0; |
178 | int i; | 179 | int i; |
179 | 180 | ||
181 | if (stat("/etc/fstab", &statBuf) < 0) | ||
182 | fprintf(stderr, "/etc/fstab file missing -- Please install one.\n\n"); | ||
183 | |||
180 | if (argc == 1) { | 184 | if (argc == 1) { |
181 | FILE *mountTable; | 185 | FILE *mountTable; |
182 | if ((mountTable = setmntent ("/proc/mounts", "r"))) { | 186 | if ((mountTable = setmntent ("/proc/mounts", "r"))) { |
183 | struct mntent *m; | 187 | struct mntent *m; |
184 | while ((m = getmntent (mountTable)) != 0) { | 188 | while ((m = getmntent (mountTable)) != 0) { |
189 | struct fstab* fstabItem; | ||
185 | char *blockDevice = m->mnt_fsname; | 190 | char *blockDevice = m->mnt_fsname; |
186 | if (strcmp (blockDevice, "/dev/root") == 0) | 191 | /* Note that if /etc/fstab is missing, libc can't fix up /dev/root for us */ |
187 | blockDevice = (getfsfile ("/"))->fs_spec; | 192 | if (strcmp (blockDevice, "/dev/root") == 0) { |
193 | fstabItem = getfsfile ("/"); | ||
194 | if (fstabItem != NULL) | ||
195 | blockDevice = fstabItem->fs_spec; | ||
196 | } | ||
188 | printf ("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir, | 197 | printf ("%s on %s type %s (%s)\n", blockDevice, m->mnt_dir, |
189 | m->mnt_type, m->mnt_opts); | 198 | m->mnt_type, m->mnt_opts); |
190 | } | 199 | } |