Skip to content
Search

Toybox

lastmod 2025-11-04created 2025-11-041 edits

An all-in-one Linux command-line tool

About

  • A lightweight multi-call binary tool that combines a set of Linux commands into a single executable; an open-source utility developed as an alternative to BusyBox
  • Just download and run a single executable (toybox-x86_64) to get basic commands such as echo, cp, mv, and cat from one binary
  • Conforms to the POSIX-2008 and LSB 4.1 standards, emphasizing fast execution, a simple structure, and standards compliance
  • The project's original core goal was to make Android a fully self-hosting environment, designed so that AOSP can be built on Android itself
    • Google recognized this philosophy and integrated Toybox into AOSP, shipping it by default since Android Marshmallow in 2015
    • BusyBox's GPLv2 license is incompatible with Android, but ToyBox was rewritten under a BSD license compatible with Android
    • Aims to remove the dependency on GNU tools and provide a more transparent, reproducible build environment
  • Toybox aims for 'a self-building system with at least four components'
    • POSIX command set, compiler, C standard library, kernel
    • This setup creates a reproducible base system, which can then be extended into a practical environment by adding an editor (vi), monitoring (top), shell history, and so on
  • Subcommands can be invoked through the "toybox" command, or symbolic links can be created with each command name to use them like regular commands
  • Follows the same build structure as the Linux kernel (make menuconfig; make; make install), with features to include selectable via a .config file
  • Fully supports cross-compilation environments; static binaries can be built for non-x86 targets such as ARM
  • A minimal Toybox-based Linux system can be built with scripts/mkroot.sh
    • Create a root file system with make root, then run chroot
    • Using qemu together with a cross compiler sets up a self-booting mini Linux environment
  • Built-in help system: check each command's description with toybox help <command>

See also

Favorite site

author Zer0 sitemap