Not a big thing, a ready-compiled binary can be obtained from Benno’s blog “Android on busybox”
I played around with busybox and had to recompile. Here is how I did it!
- Get an ARM cross-compile toolchain, e.g. Sourcery G++ Lite 2008q1-126 for ARM GNU/Linux
- Get the busybox sources from the Busybox download page
make menuconfigand configure busybox as desired- Compile as given:
LDFLAGS="--static" CFLAGS="--static" make CROSS_COMPILE=arm-none-linux-gnueabi-At the end, you should have something like:
(hgschmidt@dai190)-(15:10:52)-| ~/trunk/bcollect/busybox-1.13.2 |:. file busybox
busybox: ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped - Push busybox to Android

jpitt42 · Feb 24, 12:29 AM · #
This was very helpful, thanks.Do you know why the toolchain in \"prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-\" doesn\'t work for cross-compiling? It doesn\'t seem to be finding the standard include files.
Also, any idea how to make \"busybox --install\" put the symlinks in a specific directory?
Hans · Feb 24, 12:43 AM · #
Hi jpitt42,in fact, the cross-compiler from the Android sources do work *dooh*. But, as you already found out, it is a mess getting all includes right. But you might take a look at Andrew Ross\'
agccon plausible.org.Still though, you definitely won\'t be able to compile (port) a quite big amount of already existing software with
agccand the cross-compiler from the Android sources! Another cross-compiler like Code Sourcery\'s one will always be of great help.About the
-install:Well, I didn\'t change that one yet because I simply call a given function of busybox as parameter:
$ busybox lsChanging that, I believe, is not so hard. I might post that solution in another upcoming blog post, ok?
John Michelau · Feb 25, 11:00 PM · #
Thanks for the help, Hans.I have the symlink installation working now. Here\'s what I did.
1 - Modify target/product/generic/root/init.rc to add /data/bin and /data/sbin to the PATH. This allows you to add binaries as I go without having to rebuild the ramdisk.
2 - Modify the install_links() function in libbb/appletlib.c from the busybox distro and rebuilt the binary.
static const char usr_bin [] ALIGN1 = \"./bin\";
static const char usr_sbin[] ALIGN1 = \"./sbin\";
static const char *const install_dir[] = {
&usr_bin [0], /* \"\", equivalent to \"/\" for concat_path_file() */
&usr_bin [0], /* \"/bin\" */
&usr_sbin[0], /* \"/sbin\" */
usr_bin,
usr_sbin
};
3 - Create /data/bin and /data/sbin on the target.
4 - Push busybox into /data/bin.
5 - Run \'busybox --install -s\' from the /data directory on the target.
6 - Remove the \'ls\' symlink from /data/bin, because it seems to be outputting a bunch of
garbage. I don\'t know why.
John Michelau · Feb 25, 11:03 PM · #
Small update to #1...1 - Modify target/product/generic/root/init.rc on the host to add /data/bin and /data/sbin to the PATH. Then rebuild the ramdisk. This allows you to add binaries as you go without having to rebuild the ramdisk again.
Hans · Feb 26, 06:10 PM · #
@John: Thanks for that! If there is time I will include that in my busybox version.