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
#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";
# 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
* 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
#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
/* ===========================================================================
#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
/* ===========================================================================
*/
#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>
#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
/* ===========================================================================
*/
#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>
*/
#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>
//#define BB_UPDATE
#define BB_UTILITY
#define BB_ZCAT
-#define BB_GZIP
+//#define BB_GZIP
#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";
# 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
* 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
#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
/* ===========================================================================
#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
/* ===========================================================================
*/
#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>
#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
/* ===========================================================================
*/
#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>
*/
#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>
};
static const char press_enter[] =
- "Please press Enter to activate this console. ";
+ "\nPlease press Enter to activate this console. ";
int pid;
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) {
/*
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);
};
static const char press_enter[] =
- "Please press Enter to activate this console. ";
+ "\nPlease press Enter to activate this console. ";
int pid;
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) {
/*
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);
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);
}
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);
}