X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=INSTALL;h=4d0a09f9afafe0caed7e916ce860dbc4c07ad4eb;hb=c5598177bc4b38d349e4fdbd08d997c170ed2f8b;hp=00ba6633a37ce92912fac875331b136349823162;hpb=5c071bcf2f6bc923b5d6779b3563d08b80a8949d;p=oweals%2Fbusybox.git diff --git a/INSTALL b/INSTALL index 00ba6633a..4d0a09f9a 100644 --- a/INSTALL +++ b/INSTALL @@ -1,50 +1,123 @@ Building: ========= -You will usually build in the source-tree. +The BusyBox build process is similar to the Linux kernel build: -Alternatively you can build out-of-tree to have the object files separated -from the source. This allows for building several different configurations -from the same set of sources. + make menuconfig # This creates a file called ".config" + make # This creates the "busybox" executable + make install # or make PREFIX=/path/from/root install -A) Building in the source-tree: -------------------------------- +The full list of configuration and install options is available by typing: -1) Run 'make config' or 'make menuconfig' and select the - functionality that you wish to enable. + make help -2) Run 'make' +Quick Start: +============ -3) Run 'make install' or 'make PREFIX=/target install' to - install busybox and all the needed links. Some people - will prefer to install using hardlinks and will instead - want to run 'make install-hardlinks'.... +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. -B) Building out-of-tree: ------------------------- +To enable all features, use "make defconfig", which produces the largest +general-purpose configuration. (It's allyesconfig minus debugging options, +optional packaging choices, and a few special-purpose features requiring +extra configuration to use.) -1) make the directory to hold the object files and chdir to it: - 'mkdir /tmp/bb ; cd /tmp/bb' - Then prepare the config giving the full path to the source in top_srcdir: - make top_srcdir=/path/busybox -f /path/busybox/Makefile O=/tmp/b allyesconfig - - Note that O=$(pwd) is the default if no O= was specified. + make defconfig + make + PATH= ./busybox ash - You now have a buildable tree in $O and can run 'make' without the need - to specify any paths. +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. - Proceed with step #A2 above. +(Note that the standalone shell currently requires /proc/self/exe to +launch new applets.) +Configuring Busybox: +==================== -Installation: -============= +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.) -After the build is complete, a busybox.links file is generated. This is -used by 'make install' to create symlinks to the BusyBox binary for all -compiled in functions. By default, 'make install' will place the symlink -forest into `pwd`/_install unless you have defined the PREFIX environment -variable (i.e., 'make PREFIX=/tmp/foo install') +The manual configurator "make menuconfig" modifies the existing configuration. +(For systems without ncurses, try "make config" instead.) The two most +interesting starting configurations are "make allnoconfig" (to start with +everything disabled and add just what you need), and "make defconfig" (to +start with everything enabled and remove what you don't need). If menuconfig +is run without an existing configuration, make defconfig will run first to +create a known starting point. -If you wish to install hard links, rather than symlinks, you can use -'make PREFIX=/tmp/foo install-hardlinks' instead. +Other starting configurations (mostly used for testing purposes) include +"make allbaseconfig" (enables all applets but disables all optional features), +"make allyesconfig" (enables absolutely everything including debug features), +and "make randconfig" (produce a random configuration). +Configuring BusyBox produces a file ".config", which can be saved for future +use. Run "make oldconfig" to bring a .config file from an older version of +busybox up to date. + +Installing Busybox: +=================== + +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".) + +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 +a limited number of inodes). This install process uses the file +"busybox.links" (created by make), which contains the list of enabled applets +and the path at which to install them. + +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). + +If you enabled the busybox shared library feature (libbusybox.so) and want +to run tests without installing, set your LD_LIBRARY_PATH accordingly when +running the executable: + + LD_LIBRARY_PATH=`pwd` ./busybox + +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 building multiple configurations from +the same source directory, requires the ability to put the temporary files +somewhere else. + +To build out of tree, cd to an empty directory and configure busybox from there: + + make -f /path/to/source/Makefile defconfig + make + make install + +Alternately, use the O=$BUILDPATH option (with an absolute path) during the +configuration step, as in: + + make O=/some/empty/directory allyesconfig + cd /some/empty/directory + make + make PREFIX=. 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.