This article describes how to install the busybox command line tools in the Android file-system.
Please note that a pre-built version of busybox has been attached to this article if you would prefer not to build busybox yourself. To use the pre-built version please go to "installing busybox" and "make the busybox shell the default shell".
You can download the prebuilt version from here www.omapzoom.org/gf/download/wikifiles/317/1354/busybox
Building Busybox
To build busybox
-
Download the latest version of busybox from the following website. At the time of writing the latest version was v.1.13.3.
-
Extract the busybox source:
tar jxf busybox-1.13.3.tar.bz2
-
Configure busybox by running menuconfig
cd busybox-1.13.3/
make menuconfig
-
In menuconfig set the following options
Busybox Settings --> Build Options --> Build Busybox as a static binary (no shared libs) - Enable this option by pressing "Y"
Busybox Settings --> Build Options --> Cross compiler prefix - Set this option equal to "arm-none-linux-gnueabi-"
Busybox Settings --> Installation Options --> Don't use /usr - Enable this option by pressing "Y"
-
Export path to where the cross-compiler is located on the host, for example:
export PATH=/opt/arm/arm-2007q3/bin:$PATH
-
Build busybox
make
Installing Busybox
To install busybox in the target file-system
-
Create a /bin directory in the target file-system. For example:
mkdir /<path-to-android-fs>/bin
-
Copy the busybox binary to the /bin directory in the target file-system
cp busybox /<path-to-android-fs>/bin
-
Install the busybox command line tools on the target by executing the following commands:
cd /bin
./busybox --install
Make the Busybox shell the default shell
To make the busybox shell the default shell, edit the file "init.rc" in the target file-system as follows:
-
Edit the console service so that it runs the busybox shell and not the default shell by replacing:
service console /system/bin/sh
With:
service console /bin/sh
-
Add the path of the busybox command line tools to the system path variable by replacing:
export PATH /sbin:/system/sbin:/system/bin:/system/xbin
With
export PATH /bin:/sbin:/system/sbin:/system/bin:/system/xbin