//
//
// BusyBox Applications
-//#define BB_AR
-#define BB_BASENAME
-#define BB_CAT
-#define BB_CHMOD_CHOWN_CHGRP
-#define BB_CHROOT
-#define BB_CHVT
-#define BB_CLEAR
-//#define BB_CMP
-#define BB_CP_MV
-#define BB_CUT
-#define BB_DATE
-//#define BB_DC
-#define BB_DD
-//#define BB_DEALLOCVT
-#define BB_DF
-#define BB_DIRNAME
-#define BB_DMESG
-//#define BB_DOS2UNIX
-//#define BB_DPKG_DEB
-//#define BB_DUTMP
-#define BB_DU
-//#define BB_DUMPKMAP
-#define BB_ECHO
-//#define BB_EXPR
-//#define BB_FBSET
-//#define BB_FDFLUSH
-#define BB_FIND
-#define BB_FREE
-//#define BB_FREERAMDISK
-//#define BB_FSCK_MINIX
-//#define BB_GETOPT
-#define BB_GREP
-#define BB_GUNZIP
-#define BB_GZIP
-#define BB_HALT
-#define BB_HEAD
-//#define BB_HOSTID
-//#define BB_HOSTNAME
-#define BB_ID
-#define BB_INIT
-//#define BB_INSMOD
-#define BB_KILL
-#define BB_KILLALL
-//#define BB_LENGTH
-#define BB_LN
-//#define BB_LOADACM
-//#define BB_LOADFONT
-//#define BB_LOADKMAP
-#define BB_LOGGER
-//#define BB_LOGNAME
-#define BB_LS
-#define BB_LSMOD
-//#define BB_MAKEDEVS
-//#define BB_MD5SUM
-#define BB_MKDIR
-//#define BB_MKFIFO
-//#define BB_MKFS_MINIX
-#define BB_MKNOD
-#define BB_MKSWAP
-//#define BB_MKTEMP
-//#define BB_NC
-#define BB_MORE
-#define BB_MOUNT
-//#define BB_MT
-//#define BB_NSLOOKUP
-//#define BB_PING
-#define BB_POWEROFF
-//#define BB_PRINTF
-#define BB_PS
-#define BB_PWD
-//#define BB_RDATE
-//#define BB_READLINK
-#define BB_REBOOT
-//#define BB_RENICE
-#define BB_RESET
-#define BB_RM
-#define BB_RMDIR
-//#define BB_RMMOD
-//#define BB_RPMUNPACK
-#define BB_SED
-//#define BB_SETKEYCODES
#define BB_SH
-#define BB_SLEEP
-#define BB_SORT
-#define BB_SWAPONOFF
-#define BB_SYNC
-#define BB_SYSLOGD
-#define BB_TAIL
-#define BB_TAR
-//#define BB_TEE
-//#define BB_TEST
-//#define BB_TELNET
-#define BB_TOUCH
-//#define BB_TR
-#define BB_TRUE_FALSE
-#define BB_TTY
-//#define BB_UUENCODE
-//#define BB_UUDECODE
-#define BB_UMOUNT
-#define BB_UNIQ
-#define BB_UNAME
-//#define BB_UNIX2DOS
-//#define BB_UPDATE
-#define BB_UPTIME
-//#define BB_USLEEP
-//#define BB_WATCHDOG
-#define BB_WC
-//#define BB_WGET
-#define BB_WHICH
-#define BB_WHOAMI
-#define BB_XARGS
-#define BB_YES
// End of Applications List
//
//
//busybox. Some systems want this, others do not. Choose wisely. :-) This
//only has meaning when BB_FEATURE_SH_STANDALONE_SHELL is enabled.
// Only relevant if BB_SH is enabled.
-//BB_FEATURE_SH_APPLETS_ALWAYS_WIN
+#define BB_FEATURE_SH_APPLETS_ALWAYS_WIN
//
// Enable tab completion in the shell (not yet
// working very well -- so don't turn this on)
// Only relevant if BB_SH is enabled.
#define BB_FEATURE_SH_TAB_COMPLETION
//
-// Enable a simpler shell prompt of the form "path #" instead of the default
-// "[username@hostname path]#". Some deeply embedded systems don't have
-// usernames or even hostnames and the default prompt can look rather hideous
-// on them. Uncomment this option for a simpler, path-only prompt (which was
-// the default until around BusyBox-0.48):
+// Enable a simpler shell prompt of the form "path #"
+// instead of the default "[username@hostname path]#"
+//
+// Some deeply embedded systems don't have usernames or even hostnames,
+// and the default prompt can look rather hideous on them. Uncomment
+// this option for a simpler, path-only prompt (which was the default until
+// around BusyBox-0.48):
+//
#define BB_FEATURE_SH_SIMPLE_PROMPT
//
// Attempts to match usernames in a ~-prefixed path
-//#define BB_FEATURE_USERNAME_COMPLETION
+// XXX: Doesn't work without NSS, off by default
+#define BB_FEATURE_USERNAME_COMPLETION /* require NSS */
//
//Turn on extra fbset options
//#define BB_FEATURE_FBSET_FANCY
nfsmount.o cmdedit.o: %.o: %.h
$(OBJECTS): %.o: %.c Config.h busybox.h applets.h Makefile
- $(CC) $(CFLAGS) -c $*.c -o $*.o
utility.o: loop.h
docs/busybox.lineo.com/BusyBox.html
- rm -f docs/busybox.txt docs/busybox.dvi docs/busybox.ps \
docs/busybox.pdf docs/busybox.lineo.com/busybox.html
- - rm -f Config.h.ORG bb.def.h busybox.REGRESS.sh.results bb.OptionsAndFeatures
+ - rm -f multibuild.log Config.h.orig
- rm -rf docs/busybox _install
- rm -f busybox.links loop.h *~ *.o core
#include <sys/stat.h>
#endif
+#include "pwd_grp/pwd.h"
+
+
static const int MAX_HISTORY = 15; /* Maximum length of the linked list for the command line history */
enum {
#warning pivot root instead. Do not even bother till this work is done...
#warning You have been warned.
-#if ! defined BB_FEATURE_USE_PROCFS
-#error Sorry, I depend on the /proc filesystem right now.
-#endif
-
static void check_chroot(int sig)
{
char *argv_init[2] = { "init", NULL, };
#warning pivot root instead. Do not even bother till this work is done...
#warning You have been warned.
-#if ! defined BB_FEATURE_USE_PROCFS
-#error Sorry, I depend on the /proc filesystem right now.
-#endif
-
static void check_chroot(int sig)
{
char *argv_init[2] = { "init", NULL, };
struct built_in_command *x;
#ifdef BB_FEATURE_SH_STANDALONE_SHELL
struct BB_applet *applet;
- const char *name;
+ char *name;
#endif
/* Check if the command matches any of the non-forking builtins.
#else /*BB_FEATURE_OLD_MODULE_INTERFACE*/
-#if ! defined BB_FEATURE_USE_PROCFS
-#error Sorry, I depend on the /proc filesystem right now.
-#endif
-
extern int lsmod_main(int argc, char **argv)
{
int fd, i;
#else /*BB_FEATURE_OLD_MODULE_INTERFACE*/
-#if ! defined BB_FEATURE_USE_PROCFS
-#error Sorry, I depend on the /proc filesystem right now.
-#endif
-
extern int lsmod_main(int argc, char **argv)
{
int fd, i;
+#error Foo
/* vi: set sw=4 ts=4: */
/*
* Mini more implementation for busybox
{
int status = 0;
-#if defined BB_FEATURE_USE_PROCFS
char buf[255];
if (strcmp(filesystemType, "auto") == 0) {
- FILE *f = fopen("/proc/filesystems", "r");
-
- if (f == NULL)
- return (FALSE);
+ FILE *f = xfopen("/proc/filesystems", "r");
while (fgets(buf, sizeof(buf), f) != NULL) {
filesystemType = buf;
}
fclose(f);
} else
-#endif
#if defined BB_FEATURE_USE_DEVPS_PATCH
if (strcmp(filesystemType, "auto") == 0) {
int fd, i, numfilesystems;
/* Check if reading the mtab file failed */
if (mountTable == 0
-#if ! defined BB_FEATURE_USE_PROCFS
- ) {
-#else
- /* Bummer. fall back on trying the /proc filesystem */
- && (mountTable = setmntent("/proc/mounts", "r")) == 0) {
-#endif
+ /* Bummer. fall back on trying the /proc filesystem */
+ && (mountTable = setmntent("/proc/mounts", "r")) == 0) {
perror_msg("%s", mtab_file);
return;
}
if (length > 1 && directory[length - 1] == '/')
directory[length - 1] = '\0';
-#ifdef BB_FEATURE_USE_PROCFS
if (filesystemType == 0) {
struct mntent *p = find_mount_point(blockDevice, "/proc/mounts");
if (p && p->mnt_type)
filesystemType = p->mnt_type;
}
-#endif
m.mnt_fsname = blockDevice;
m.mnt_dir = directory;
m.mnt_type = filesystemType ? filesystemType : "default";
* the one using the /proc virtual filesystem.
*/
-#if ! defined BB_FEATURE_USE_PROCFS
-#error Sorry, I depend on the /proc filesystem right now.
-#endif
-
typedef struct proc_s {
char
cmd[16]; /* basename of executable file in call to exec(2) */
* the one using the /proc virtual filesystem.
*/
-#if ! defined BB_FEATURE_USE_PROCFS
-#error Sorry, I depend on the /proc filesystem right now.
-#endif
-
typedef struct proc_s {
char
cmd[16]; /* basename of executable file in call to exec(2) */
struct built_in_command *x;
#ifdef BB_FEATURE_SH_STANDALONE_SHELL
struct BB_applet *applet;
- const char *name;
+ char *name;
#endif
/* Check if the command matches any of the non-forking builtins.
#include <sys/stat.h>
#endif
+#include "pwd_grp/pwd.h"
+
+
static const int MAX_HISTORY = 15; /* Maximum length of the linked list for the command line history */
enum {
struct built_in_command *x;
#ifdef BB_FEATURE_SH_STANDALONE_SHELL
struct BB_applet *applet;
- const char *name;
+ char *name;
#endif
/* Check if the command matches any of the non-forking builtins.
# properly on its own. The most likely problems this will
# flush out are those involving preprocessor instructions in
# utility.c.
+#
+# TODO: some time it might be nice to list absolute and
+# differential object sizes for each option...
+#
$logfile = "multibuild.log";
+# How to handle all the BB_FEATURE_FOO lines
+if ($ARGV[0] eq "-all" ) { shift(@ARGV); $choice="all"; }
+if ($ARGV[0] eq "-none") { shift(@ARGV); $choice="none"; }
+# neither means, leave that part of Config.h alone
+
# Support building from pristine source
$make_opt = "-f $ARGV[0]/Makefile BB_SRC_DIR=$ARGV[0]" if ($ARGV[0] ne "");
open(C,"<Config.h.orig") || die;
while (<C>) {
if ($in_trailer) {
+ if (!$in_olympus) {
+ s/^\/\/#/#/ if ($choice eq "all" && !/USE_DEVPS_PATCH/);
+ s/^#/\/\/#/ if ($choice eq "none");
+ }
+ $in_olympus=1 if /End of Features List/;
$trailer .= $_;
} else {
$in_trailer=1 if /End of Applications List/;
close C;
# Do the real work ...
+$failed_tests=0;
for $a (@apps) {
# print "Testing build of applet $a ...\n";
open (O, ">Config.h") || die;
system("echo -e '\n***\n$a\n***' >>$logfile");
# todo: figure out why the "rm -f *.o" is needed
$result{$a} = system("rm -f *.o; make $make_opt busybox >>$logfile 2>&1");
- $flag = $result{$a} ? "FAIL" : "OK";
- print "Applet $a: $flag\n";
+ $flag = $result{$a} ? "FAILED!!!" : "ok";
+ printf("Applet %-20s: %s\n", $a, $flag);
+ $total_tests++;
+ $failed_tests++ if $flag eq "FAILED!!!";
+ # pause long enough to let user stop us with a ^C
+ select(undef, undef, undef, 0.05);
}
# Clean up our mess
system("mv -f Config.h.orig Config.h");
+print "$total_tests applets tested, $failed_tests failures\n";
print "See $logfile for details.\n";
+#error Foo
/* vi: set sw=4 ts=4: */
/*
* Mini more implementation for busybox
{
int status = 0;
-#if defined BB_FEATURE_USE_PROCFS
char buf[255];
if (strcmp(filesystemType, "auto") == 0) {
- FILE *f = fopen("/proc/filesystems", "r");
-
- if (f == NULL)
- return (FALSE);
+ FILE *f = xfopen("/proc/filesystems", "r");
while (fgets(buf, sizeof(buf), f) != NULL) {
filesystemType = buf;
}
fclose(f);
} else
-#endif
#if defined BB_FEATURE_USE_DEVPS_PATCH
if (strcmp(filesystemType, "auto") == 0) {
int fd, i, numfilesystems;
/* Busybox mount uses either /proc/filesystems or /dev/mtab to get the
* list of available filesystems used for the -t auto option */
-#if defined BB_FEATURE_USE_PROCFS && defined BB_FEATURE_USE_DEVPS_PATCH
-//#error Sorry, but busybox can't use both /proc and /dev/ps at the same time -- Pick one and try again.
-#error "Sorry, but busybox can't use both /proc and /dev/ps at the same time -- Pick one and try again."
-#endif
-
-
#if defined BB_MOUNT || defined BB_UMOUNT || defined BB_DF
# if defined BB_MTAB
const char mtab_file[] = "/etc/mtab";
# else
-# if defined BB_FEATURE_USE_PROCFS
-const char mtab_file[] = "/proc/mounts";
-# else
# if defined BB_FEATURE_USE_DEVPS_PATCH
const char mtab_file[] = "/dev/mtab";
# else
-# error With (BB_MOUNT||BB_UMOUNT||BB_DF) defined, you must define either BB_MTAB or ( BB_FEATURE_USE_PROCFS | BB_FEATURE_USE_DEVPS_PATCH)
+const char mtab_file[] = "/proc/mounts";
# endif
# endif
-# endif
#endif
extern void usage(const char *usage)
return pidList;
}
#else /* BB_FEATURE_USE_DEVPS_PATCH */
-#if ! defined BB_FEATURE_USE_PROCFS
-#error Sorry, I depend on the /proc filesystem right now.
-#endif
/* find_pid_by_name()
*
#endif
#if defined BB_BASENAME || defined BB_LN || defined BB_SH || defined BB_INIT || \
- defined BB_FEATURE_USE_PROCFS || defined BB_WGET
+ ! defined BB_FEATURE_USE_DEVPS_PATCH || defined BB_WGET
char *get_last_path_component(char *path)
{
char *s=path+strlen(path)-1;
#if defined BB_HOSTNAME || defined BB_LOADACM || defined BB_MORE \
|| defined BB_SED || defined BB_SH || defined BB_TAR || defined BB_UNIQ \
- || defined BB_WC || defined BB_CMP || defined BB_SORT || defined BB_WGET
+ || defined BB_WC || defined BB_CMP || defined BB_SORT || defined BB_WGET \
+ || defined BB_MOUNT
FILE *xfopen(const char *path, const char *mode)
{
FILE *fp;