[Android Software/Hacking General [Developers Only]] Paget96:
What is toybox?​

Toybox combines many common Linux command line utilities together into a single BSD-licensed executable. It's simple, small, fast, and reasonably standards-compliant.

Toybox's main goal is to make Android self-hosting by improving Android's command line utilities so it can build an installable Android Open Source Project image entirely from source under a stock Android system. After a talk at the 2013 Embedded Linux Conference explaining this plan (outline, video), Google merged toybox into AOSP and began shipping toybox in Android Mashmallow.

Toybox aims to provide one quarter of a theoretical "minimal native development environment", which is the simplest Linux system capable of rebuilding itself from source code and then building Linux From Scratch and the Android Open Source Project under the result. In theory, this should only require four packages:

1) Set of posix-ish command line utilities

2) Compiler

3) C library

4) Kernel.

This provides a reproducible and auditable base system, which with the addition of a few conveniences (vi, top, shell command line history...) can provide a usable interactive experience rather than just a headless build server.

Why is toybox?​

The 2015 toybox talk starts with links to three previous talks on the history and motivation of the project: "Why Toybox", "Why Public Domain", and "Why did I do Aboriginal Linux (which led me here)?". If you're really bored, there's even a half-finished a history page.

The toybox maintainer's earlier minimal self-hosting system project, Aboriginal Linux, got its minimal native development environment down to seven packages in its 1.0 release (busybox, uClibc, gcc, binutils, make, bash, and linux) and built Linux From Scratch under the result. That project was the reason toybox's maintainer became busybox maintainer, having done so much work to extend busybox to replace all the gnu tools in a Linux From Scratch build that the previous maintainer handed over the project (to spend more time on buildroot).

Despite the maintainer's history with busybox, toybox is a fresh from-scratch implementation under an android-compatible license. Busybox predates Android, but has never shipped with Android due to the license. As long as we're starting over anyway, we can do a better job.

These days, toybox is replacing busybox in Aboriginal Linux one command at a time, and each toybox release is regression tested by building Aboriginal Linux with it, then building Linux From Scratch under the result with the new toybox commands. The list of commands remaining is tracked in the roadmap, and the replacing busybox in Aboriginal Linux is one of the main goals for toybox' 1.0 release.

Building LFS requres fewer commands than building AOSP, which has a lot more build prerequisites. In theory some of those can be built from source as external packages (we're clearly not including our own java implementation), but some early prerequisites may need to be added to bootstrap AOSP far enough to build them (such as a read-only version of "git": how does repo download the AOSP source otherwise?)

Source: http://www.landley.net/toybox/about.html