Android gets a toybox
The toybox project has been around for a while, and now it looks to be achieving one of its longtime goals: inclusion into Android. Toybox is a replacement for many Linux command-line utilities that is targeted at embedded systems—similar to BusyBox. It was created by Rob Landley, who is also a former BusyBox maintainer, and has a BSD license rather than BusyBox's GPLv2—something that was likely important for the notoriously GPL-averse Android project.
Landley started toybox in 2006 under the GPLv2, but soon switched to the BSD license. The project was largely dormant until he restarted development in 2011 with the goal of being a drop-in replacement for Android's toolbox that, like BusyBox and toybox, encompasses multiple command-line utilities in a single binary.
Toolbox, though, has long been a source of frustration for Android developers, some of whom replace it with BusyBox as one of their first acts on any new Android system. Developers have found that toolbox lacks many of the commands they need, while also providing commands with different behavior and command-line options than they are used to from Linux.
Landley released toybox 0.5.1 on November 19. That release is a bug fix update to 0.5.0 that we looked at in October.
Prior to that, though, Jason Spiro filed a bug in the Android Open Source Project (AOSP) bug tracker asking that the project incorporate toybox. There was some back-and-forth in the bug comments between Bionic (Android's C library) maintainer Elliott Hughes and Landley that resulted in a toybox that would build for Android. After that, toybox was added to the AOSP Git repository.
But there is more than just adding the code. Hughes posted a status report on December 18 to the toybox mailing list (which was updated on January 1) that listed various utilities in the AOSP master branch that use toybox as the underlying binary. The list has quite a number of new commands that were not available in toolbox, as well as more than two dozen commands where the toybox version replaces the one in toolbox. There are also some notes for commands that need to be looked at or fixed in toybox before Android can switch to using them.
For example, Hughes lists missing command-line arguments for several commands (e.g. cat, cmp, grep), but patches are pending for many of those. Other commands, such as ifconfig and inotifyd, appear to provide a superset of the functionality required by Android, but more testing needs to be done.
There are a couple of advantages that toybox brings to the table. The utilities work more like the GNU versions, which should be more familiar to Linux users than the NetBSD-based versions that are in toolbox. It also neatly avoids the GPL that comes with both the GNU utilities and BusyBox, which is frowned upon (at least) for Android user space.
In fact, the license difference is one reason that another embedded Linux distribution, Tizen, is looking at toybox. It currently uses the GNU coreutils package that is GPLv3-licensed. The anti-Tivo-ization language in that version of the GPL evidently worries some device manufacturers that have a "managed platform" (e.g. phones, TVs, in-vehicle infotainment or IVI). Tizen test systems have been built to use toybox instead without any problems, as reported on the wiki page, but it appears that more testing needs to be done.
Landley's larger vision is to use stock Android phones as a development platform by adding USB devices for keyboard, mouse, and display. There are hurdles, however, since Android kernels tend to only support USB gadget mode—plugging in a hub with input and output devices does not work on stock Android devices. He also described his plans, with links to a talk he gave about them, in a comment on the AOSP bug. It's not at all clear that Google (or even some Google developers such as Hughes) share those goals, but it is clear that Android will be moving away from toolbox and toward toybox in coming releases. That certainly gives the project a nice boost.
Shortly after the project restarted, it came under fire from Matthew Garrett and others because it was perceived as providing a way to avoid the license-compliance efforts that surround BusyBox. While Google is not circumventing the GPL in its work—other than the kernel, it tries to avoid the license entirely—the Android downstreams have sometimes played fast and loose with the GPL-licensed kernel (and possibly other GPL code). But other devices that currently ship BusyBox could switch to toybox to avoid compliance efforts based on BusyBox, which is Garrett's complaint.
The BusyBox compliance front has been quiet lately, at least visibly, so the Software Freedom Conservancy (SFC) (which has been leading those efforts) may have turned its attention elsewhere. There may also be ongoing compliance efforts that have not been made public, which is the norm unless a lawsuit is filed. The SFC also has a compliance project for the Linux kernel that could be used against vendors that are not publishing their kernel source as required by the GPL. Once again, though, any kernel compliance work from that project is proceeding quietly at this point.
Landley has been a vocal opponent of the BusyBox lawsuits since he ceased being one of the plaintiffs in those suits. So any reduction in those kinds of actions due to the adoption of toybox will likely be a satisfying outcome for him. In any case, more free code seeing wider adoption is certainly a good thing for the community. It may mean that certain kinds of GPL enforcement will need to change, but enforcing the license on the actual code of interest, rather than using BusyBox as a proxy, is likely to work out better in the long run.