Chinaunix首页 | 论坛 | 博客
  • 博客访问: 86199
  • 博文数量: 21
  • 博客积分: 766
  • 博客等级: 军士长
  • 技术积分: 185
  • 用 户 组: 普通用户
  • 注册时间: 2009-12-29 10:27
文章分类

全部博文(21)

文章存档

2012年(5)

2010年(10)

2009年(6)

我的朋友

分类: LINUX

2010-05-18 15:43:07

Installing Busybox command line tools

Installing Busybox Command Line Tools


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

 

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 //bin
  • Copy the busybox binary to the /bin directory in the target file-system

cp busybox //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

 

阅读(1704) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~