Toybox is a
free and open-source software implementation of over 200
Unix command line utilities such as ls, cp, and mv. The Toybox project was started in 2006,[3] and became a
0BSD licensed
BusyBox alternative.[4][5] Toybox is used for most of
Android's command-line tools in all currently supported Android versions, and is also used to build Android on Linux and macOS. All of the tools are tested on Linux, and many of them also work on BSD and macOS.
Functionality and aim
Toybox aims to provide a
BSD licensed replacement for the
GPL licensed
BusyBox.[6]
Toybox's major technical design goals are simplicity, smallness, speed and standard compliance.[7] Toybox aims to be mostly
POSIX-2008 and
LSB 4.1 compatible, and doesn't focus on having every option found in
GNU counterparts.[3]
Toybox is licensed using the
permissive0BSD license, where BusyBox uses the
copyleftGNU General Public License, which led to different usage domains. BusyBox is mostly used in the copyleft
FOSS domain, while Toybox is used mostly with
permissive licensed projects and by commercial companies, e.g. Google's
Android,[8] which is an explicit target of Toybox.[9] Feature-wise, Toybox has not reached parity with BusyBox.
History
Toybox was started in early 2006 by Rob Landley[3][5] after he ended his BusyBox maintainership due to a dispute with
Bruce Perens, the original creator of BusyBox.[10]
In 2008, the project went dormant[4] until the end of 2011. Rob Landley resumed work on Toybox, starting with
relicensing from the
GPL-2.0-only license to the
BSD-2-Clause license[11][12] with the goal of superseding the Android command line implementation.[13]
At the beginning of 2012,
Sony employee Tim Bird suggested creating a permissively licensed alternative to BusyBox.[6] In March 2013, the project was relicensed to an even more permissive
0BSD license.[14]
At the end of 2014, Toybox was integrated into the
Android6.0.x "Marshmallow" development branches for use on devices.[15][8][16] In 2018, a host Toybox prebuilt was added to AOSP to help make the Android build itself more hermetic.[17]
Controversy
In January 2012 the proposal of creating a BSD license alternative to the GPL licensed BusyBox project drew harsh criticism from
Matthew Garrett for taking away the only relevant tool for
copyright enforcement of the
Software Freedom Conservancy group.[18] Rob Landley, who had started the BusyBox-based lawsuits, responded that this was intentional, explaining that the lawsuits had not benefited the project but that they had led to corporate avoidance, expressing a desire to stop the lawsuits "in whatever way I see fit".[19][20][21]
Project progress
The official Toybox documentation lists an overview of the available, partially available, and missing commands.[22] As of November 2021, Version 0.8.6 achieves approximately 80% of the project's implementation goals targeted for 1.0.[23]
List of Toybox Commands
acpi — Show status of power sources and thermal devices.
pidof — Print the PIDs of all processes with the given names.
ping — Check network connectivity by sending packets to a host and reporting its response.
pivot root — Swap OLD and NEW filesystems (as if by simultaneous mount—move), and move all processes with chdir or chroot under OLD into NEW (including kernel threads) so OLD may be unmounted.
pkill — look up or signal processes based on name and other
pmap — Report the memory map of a process or processes.
unshare — Create new container namespace for this process and its children, so some attribute is not shared with the parent process.
uptime — Tell the current time, how long the system has been running, the number of users, and the system load averages for the past 1, 5 and 15 minutes.
^Landley, Robert.
"Design Docs". Toybox project website. Retrieved 18 February 2015. Toybox combines the most common Linux command line utilities together into a single BSD-licensed executable. It's simple, small, fast, and reasonably standards-compliant (
POSIX-2008 and LSB 4.1).
^
abtoybox on android.googlesource.com (2014-12-28)
^"Garrett: The ongoing fight against GPL enforcement".
LWN.net. 2012-01-31. Retrieved 2014-03-04. The real problem here is that the [Software Freedom Conservancy's] reliance on Busybox means that they're only able to target infringers who use that Busybox code. No significant kernel copyright holders have so far offered to allow the SFC to enforce their copyrights, with the result that enforcement action will grind to a halt as vendors move over to this Busybox replacement.
^"Garrett: The ongoing fight against GPL enforcement".
LWN.net. 2012-01-31. Retrieved 2014-03-04. >As the ex-maintainer of busybox who STARTED those lawsuits in the first place and now HUGELY REGRETS ever having done so, I think I'm entitled to stop the lawsuits in whatever way I see fit. They never resulted in a single line of code added to the busybox repository. They HAVE resulted in more than one company exiting Linux development entirely and switching to non-Linux operating systems for their embedded products, and they're a big part of the reason behind Android's "No GPL in userspace" policy.