How to compile Busybox?

user42276 picture user42276 · Mar 14, 2014 · Viewed 13.5k times · Source

(The i9100 and i9100p phones have Exynos 4210 SoC which includes Cortex A9 dual core 1.2Ghz processor which supports NEON.)

I will compile the latest busybox source snapshot available and upload it for everyone for free on internet and maybe even make my own free BusyboxInstaller.apk (I already downloaded today's 14th March snapshot from the official website) because so many busybox installers have very outdated versions and I want to take advantage of possible optimizations for the Cortex A9 cpu.

(NEON technology is a 128-bit SIMD (Single Instruction, Multiple Data) architecture extension.

It can can accelerate multimedia and signal processing algorithms such as video encode/decode, 2D/3D graphics, gaming, audio and speech processing, image processing, telephony, and sound synthesis.)

1 does such as mean it will also benefit my busybox?

2 What other instructions/anythingelse I can use to optimize for i9100 devices?

3 Can I compile on my phone instead of PC with only 1x2Ghz and 2GB RAM? I think it should be much quicker because it has 2x1.5GHz and 1GB RAM (I overclock only a bit) versus 1x2GHz, am I right?

4 How to compile busybox?

What are these options for?

Force NOMMU build
Additional CFLAGS
Additional LDFLAGS
Additional LDLIBS
all in general configuration and Busybox Library Tuning and debug (I googled for each for a few hours but nothing satisfactory)

What kind of applet links to install?

(./_install) BusyBox installation prefix

**I have eeror when following vinayhunachyai instructions.

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- install
/home/euphoria/Sourcery/busybox/scripts/gcc-version.sh: line 11: arm-none-linux-gnueabi-gcc: command not found
  CC      applets/applets.o
/bin/sh: 1: arm-none-linux-gnueabi-gcc: not found
scripts/Makefile.build:197: recipe for target 'applets/applets.o' failed
make[1]: *** [applets/applets.o] Error 127
Makefile:372: recipe for target 'applets_dir' failed
make: *** [applets_dir] Error 2

Answer

vinay hunachyal picture vinay hunachyal · Mar 18, 2014

How to compile busybox?

1st download toolchain. You can refer to this: Advice regarding installing ARM toolchain on Ubuntu VM (64bit)

  1. untar new source-code

  2. create default config

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- defconfig

A default configuration file is created.

  1. update config to change it to our needs:

make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig

The option to compile Busybox as a static executable, so that we don’t have to copy the dynamic libraries inside the root filesystem. The setting can be found in “Busybox Settings --> Build Options“. Also, select what utilities you want embedded in Busybox.

  1. Then, the following command builds Busybox and creates a directory called _install containing the root filesystem tree:

    make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- install.

Compile statically. If you compile dynamically then you need to copy libraries to target.

For more details see this link: http://balau82.wordpress.com/2010/03/27/busybox-for-arm-on-qemu/