android 安装busybox

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.

http://www.busybox.net

  • 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

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值