Android Installing Busybox Command Line Tools

From OMAPpedia

Revision as of 23:05, 16 July 2010 by Leed.aguilar (Talk | contribs)
Jump to: navigation, search

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. Skip to Installing Busybox to filesystem if you select to use the prebuilt version. For the more information on the latest busybox environment visit: www.busybox.net

Configure and Build

Download busybox-1.13.3.tar.bz2 from www.busybox.net.

Extract the busybox source

$ tar jxf busybox-1.13.3.tar.bz2

Configure busybox

$ 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"
$ Linux Module Utilities --> () Default directory containing modules - Set this option to nothing
$ Linux Module Utilities --> () Default name of modules.dep - Set this option to nothing

Export path to where the cross-compiler is located on the host. For more information on setting up cross-compiler in environment visit: Cross Compilers

$ export PATH=$PATH:/<toolchain_folder>/bin/

Build busybox

$ make

Installing Busybox to filesystem

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

Edit the console service so that it runs the busybox shell and not the default shell by replacing:

$ vim init.rc
-service console /system/bin/sh
+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
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox