Compile BusyBox On Android OS

 原文网址


Compile BusyBox On Android OS

Busybox is a set of frequent-used unix tools, including awk, ifconfig, route, ip … etc.
If you would like to enjoy the shell in android ‘just like under unix’, busybox is a great tool to have on your android.
Here we provide some info on how to cross-compile busybox for android system.

  1. Download BusyBox Source Code

    You can get the source code from the BusyBox Official WebSite.

  2. Download ARM Cross-Compiler

    You can get the cross-compiler from codesourcery.com.
    Note: I tried to use the arm-eabi-* compiler in android_ndk, but it seems to need a lot of configurations (such as sysroot, etc.). Thus, I choose to use arm-none-linux-gnueabi-* compiler, it will make the following steps a lot easier.

  3. Setup .config File
    $ make menuconfig

    Select Busybox setting -> Build options -> select Build BusyBox as a static binary (no shared libs)
    and Set Cross Compiler prefix as “arm-none-linux-gnueabi-”

    $ make
    
  4. Push BusyBox into Android
    $ adb shell "mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system"
    $ adb shell "chmod 0777 /system/xbin"
    $ adb push busybox /system/xbin/
    $ adb shell "chmod 755 /system/xbin/busybox"
    $ adb shell "chmod 0755 /system/xbin"
    
  5. Usage of BusyBox
    $ busybox ifconfig

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值