
BYLD: Build Your Linux Disk
License: GPL2 (see LICENSE)

(C) 1999-2000, Erich Roncarolo <erich@roncarolo.eu.org>


This is the BusyBox package.

BusyBox is a multi-call binary that combines many common Unix
utilities into a single executable. Most people will create a
link to busybox for each function they wish to use, and BusyBox
will act like whatever it was invoked as. For example,

            ln -s ./busybox ls
            ./ls

will cause BusyBox to behave as 'ls' (if the 'ls' command has
been compiled into busybox). You can also invoke BusyBox by
providing it the command to run on the command line. For
example,

            ./busybox ls

will also cause BusyBox to behave as 'ls'.

BusyBox has been written with size-optimization in mind. It is
very easy to include or exclude the commands (or features) you
want installed. BusyBox tries to make itself useful to small
systems with limited resources.

Note the modular system is Makefile based, and purposely very
simplistic. It does no dependency checking. That is left for you
to figure out by trial and error.


BusyBox and BYLD.

Since version 1.0.1 BusyBox is stored in BYLD as a shar file. Why?
Because BusyBox is not used exactly as is in BYLD, but some files are
changed (see below), and when a new version is included I have a lot
of problems with CVS (remove old version, then add each file of new
version... Grrr...). Why I don't use tar file? Because shar produce
a text file and CVS likes text files more then binary files.
Buildfile extract BusyBox archive automatically.

To see which commands BusyBox implements in BYLD, look Config.h

If you want download a new version of BusyBox, there are two things
that you *must* change: first of all you should edit Buildfile and set
correctly BUSYBOX variable, then you must edit busybox.c, because
some definitions in busybox.c are wrong for BYLD. 
Main file contains a lot of lines in which are detailed commands:

static const struct Applet applets[] = {

#ifdef BB_BASENAME
	{"basename", basename_main, _BB_DIR_BIN},
#endif
#ifdef BB_BUSYBOX
	{"busybox", busybox_main, _BB_DIR_BIN},
#endif
#ifdef BB_BLOCK_DEVICE
	{"block_device", block_device_main, _BB_DIR_SBIN},
#endif
#ifdef BB_CAT
	{"cat", cat_main, _BB_DIR_BIN},
#endif
.........
#ifdef BB_GUNZIP
	{"zcat", gunzip_main, _BB_DIR_BIN},
#endif
#ifdef BB_TEST
	{"[", test_main, _BB_DIR_BIN},
#endif
	{0}
};

A constant like _BB_DIR_BIN is present in each definition: this constant
*must* be only _BB_DIR_BIN or _BB_DIR_SBIN tag: never _BB_DIR_USR_BIN !!
So the line:		{"xxx", xxx_main, _BB_DIR_USR_BIN},
should be changed in:	{"xxx", xxx_main, _BB_DIR_BIN},
Never mind if you change tag in _BB_DIR_BIN or _BB_SDIR_BIN.

Don't forget to edit Config.h!

If you want change (or add) a BusyBox command, you should start reading
busybox.c: it is very simple, so you can understand how BusyBox works.
A very simple command is cat.c: it should help you to understand.
Another simple command to start is dd.c: read it because it's a good example.
Instead an incredible complex command is gzip.c!

Good hacking!
