2005-10-05 07:40:46 +00:00
|
|
|
Building:
|
|
|
|
=========
|
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
The BusyBox build process is similar to the Linux kernel build:
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
make menuconfig # This creates a file called ".config"
|
|
|
|
make # This creates the "busybox" executable
|
|
|
|
make install # or make PREFIX=/path/from/root install
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
The full list of configuration and install options is available by typing:
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
make help
|
2001-05-10 14:12:20 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
Quick Start:
|
|
|
|
============
|
2001-05-10 14:12:20 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
The easy way to try out BusyBox for the first time, without having to install
|
|
|
|
it, is to enable all features and then use "standalone shell" mode with a
|
|
|
|
blank command $PATH:
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
make allyesconfig
|
|
|
|
make
|
|
|
|
PATH= ./busybox ash
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
Standalone shell mode causes busybox's built-in command shell to run
|
|
|
|
any built-in busybox applets directly, without looking for external
|
|
|
|
programs by that name. Supplying an empty command path (as above) means
|
|
|
|
the only commands busybox can find are the built-in ones.
|
2005-10-07 17:44:14 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
(Note that the standalone shell requires the /proc directory to function.)
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
Configuring Busybox:
|
|
|
|
====================
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
Busybox is optimized for size, but enabling the full set of functionality
|
|
|
|
still results in a fairly large executable (more than 1 megabyte when
|
|
|
|
statically linked). To save space, busybox can be configured with only the
|
|
|
|
set of applets needed for each environment. The minimal configuration, with
|
|
|
|
all applets disabled, produces a 4k executable. (It's useless, but very small.)
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
The manual configurators "make config" and "make menuconfig" modify the
|
|
|
|
existing configuration. Quick ways to get starting configurations include
|
|
|
|
"make allyesconfig" (enables almost all options), "make allnoconfig" (disables
|
|
|
|
all options), "make allbaseconfig" (enables all applets but disables all
|
|
|
|
optional features), and "make defconfig" (reset to defaults).
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
Configuring BusyBox produces a file ".config", which can be saved for future
|
|
|
|
use.
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
Installing Busybox:
|
|
|
|
===================
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
Busybox is a single executable that can behave like many different commands,
|
|
|
|
and BusyBox uses the name it was invoked under to determine the desired
|
|
|
|
behavior. (Try "mv busybox ls" and then "./ls -l".)
|
2005-10-05 07:40:46 +00:00
|
|
|
|
2005-10-09 20:18:32 +00:00
|
|
|
Installing busybox consists of creating symlinks (or hardlinks) to the busybox
|
|
|
|
binary for each applet enabled in busybox, and making sure these symlinks are
|
|
|
|
in the shell's command $PATH. Running "make install" creates these symlinks,
|
|
|
|
or "make install-hardlinks" creates hardlinks instead (useful on systems with
|
2005-12-02 18:27:39 +00:00
|
|
|
a limited number of inodes). This install process uses the file
|
2005-10-09 20:18:32 +00:00
|
|
|
"busybox.links" (created by make), which contains the list of enabled applets
|
|
|
|
and the path at which to install them.
|
|
|
|
|
2005-12-02 18:27:39 +00:00
|
|
|
Installing links to busybox is not always necessary. The special applet name
|
|
|
|
"busybox" (or with any optional suffix, such as "busybox-static") uses the
|
|
|
|
first argument to determine which applet to behave as, for example
|
|
|
|
"./busybox cat LICENSE". (Running the busybox applet with no arguments gives
|
|
|
|
a list of all enabled applets.) The standalone shell can also call busybox
|
|
|
|
applets without links to busybox under other names in the filesystem. You can
|
|
|
|
also configure a standaone install capability into the busybox base applet,
|
|
|
|
and then install such links at runtime with one of "busybox --install" (for
|
|
|
|
hardlinks) or "busybox --install -s" (for symlinks).
|
2005-10-09 20:18:32 +00:00
|
|
|
|
|
|
|
Building out-of-tree:
|
|
|
|
=====================
|
|
|
|
|
|
|
|
By default, the BusyBox build puts its temporary files in the source tree.
|
|
|
|
Building from a read-only source tree, or to building multiple
|
|
|
|
configurations from the same source directory, requires the ability to
|
|
|
|
put the temporary files somewhere else.
|
|
|
|
|
|
|
|
To build out of tree, use the O=$BUILDPATH option during the configuration
|
|
|
|
step, as in:
|
|
|
|
|
|
|
|
make O=/some/empty/directory allyesconfig
|
|
|
|
cd /some/empty/directory
|
|
|
|
make
|
|
|
|
make PREFIX=. install
|
|
|
|
|
|
|
|
(Note, O= requires an absolute path.)
|
|
|
|
|
|
|
|
Alternately, cd to the empty directory and do this instead:
|
|
|
|
|
|
|
|
make top_srcdir=/path/to/source -f /path/to/source/Makefile allyesconfig
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
|
|
|
|
More Information:
|
|
|
|
=================
|
|
|
|
|
|
|
|
Se also the busybox FAQ, under the questions "How can I get started using
|
|
|
|
BusyBox" and "How do I build a BusyBox-based system?" The BusyBox FAQ is
|
|
|
|
available from http://www.busybox.net/FAQ.html or as the file
|
|
|
|
docs/busybox.net/FAQ.html in this tarball.
|