What Makes BusyBox Small? - Linux Embedded systems

One of the first questions about Busy Box is, “If it’s smaller, what’s missing?” BusyBox’s tools are smaller than their full-sized cousins for the following reasons:

  • Less functionality: Busy Box applets contain less functionality. Consider the difference between grep on Busy Box and the GNU grep found on a desktop system: absent is support for Perl regular expressions, special handling for line formatted data, and binary files. This isn’t a criticism of the applet, because the GNU grep tool has been growing in functionality for decades without much consideration of the size of the application on a desktop system, functionality trumps size.
  • No backward compatibility: The tools that run on a desktop system need to work in a uniform manner, because an upgrade can’t break scripts that expect the program to work in a certain way, even if that behavior is a bug. BusyBox doesn’t concern itself with backward compatibility.
  • Less help: Although you can remove the command-line help (if a user will never see the help, it’s a waste of space), even the help present is more terse than that found on a desktop-oriented utility. Online help consumes space and doesn’t contribute to the functionality of the applet; in that way, it can be viewed as dead weight.
  • Engineered to be small: The size matters to BusyBox developers. There’s a focus on making sure that a minimum amount of code is added to implement a feature and that you have control over what goes into the final executable. Not only do you have control over what applets get built, but you also control what features are in those applets, to squeeze every byte from the binary.

The most important difference is that the engineering is concentrated on making the code as small as possible. Even as the features have increased for BusyBox, the focus on making the code small has resulted in a very favorable code-to-functionality ratio. In addition, Busy Box is highly configurable, allowing you to create a build containing just the required applets and leaving you in control of the size and resource consumption.

The missing functionality means that some shell scripts that use the full sized tools won’t work when you use Busy Box applets, because they require options that aren’t supported. There isn’t a tool to find these problems; it’s a matter of testing the scripts to verify that they work properly.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Linux Embedded systems Topics