Software:BusyBox

From HandWiki
Revision as of 14:26, 9 February 2024 by Smart bot editor (talk | contribs) (fixing)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Collection of Unix tools
BusyBox
BusyBoxLogo.png
Busybox DG834Gt.PNG
Original author(s)Bruce Perens
Developer(s)Erik Andersen,[1] Rob Landley,[2] Denys Vlasenko[3] and others
Initial releaseNovember 4, 1999; 25 years ago (1999-11-04)[4]
Stable release1.36.1 (May 19, 2023; 19 months ago (2023-05-19)) [±][5]
Written inC
Operating systemUnix-like
Size2.1 MB (compressed "tar.bz2")
Type
LicenseSince 1.3.0: GPL-2.0-only[6]
Until 1.2.2.1: GPL-2.0-or-later[7]
Websitewww.busybox.net

BusyBox is a software suite that provides several Unix utilities in a single executable file. It runs in a variety of POSIX environments such as Linux, Android,[8] and FreeBSD,[9] although many of the tools it provides are designed to work with interfaces provided by the Linux kernel. It was specifically created for embedded operating systems with very limited resources. The authors dubbed it "The Swiss Army knife of Embedded Linux",[10] as the single executable replaces basic functions of more than 300 common commands. It is released as free software under the terms of the GNU General Public License v2, after controversially deciding not to move to version 3.[6]

History

Origins

Originally written by Bruce Perens in 1995 and declared complete for his intended usage in 1996,[11] BusyBox initially aimed to put a complete bootable system on a single floppy disk that would serve both as a rescue disk and as an installer for the Debian distribution. Since that time, it has been extended to become the de facto standard core user space toolset for embedded Linux devices and Linux distribution installers. Since each Linux executable requires several kilobytes of overhead, having the BusyBox program combine over two hundred programs together often saves substantial disk space and system memory.

BusyBox was maintained by Enrique Zanardi and focused on the needs of the Debian boot-floppies installer system until early 1998, when Dave Cinege took it over for the Linux Router Project (LRP). Cinege made several additions, created a modularized build environment, and shifted BusyBox's focus into general high-level embedded systems. As LRP development slowed down in 1999, Erik Andersen, then of Lineo, Inc., took over the project and became the official maintainer between December 1999 and March 2006. During this time the Linux embedded marketplace exploded in growth, and BusyBox matured greatly, expanding both its user base and functionality. Rob Landley became the maintainer in 2005 until late 2006, then Denys Vlasenko took over as the current maintainer.

GPLv2/GPLv3 controversies

In September 2006, after heavy discussions and controversies between project maintainer Rob Landley and Bruce Perens,[12] the BusyBox[13][14] project decided against adopting the GNU Public License Version 3 (GPLv3); the BusyBox license was clarified as being GPL-2.0-only.[15]

Since October 2006, Denys Vlasenko has taken over maintainership of BusyBox from Rob Landley, who has started Toybox, also as a result of the license controversies.[13][16]

GPL lawsuits

In late 2007, BusyBox also came to prominence for actively prosecuting violations of the terms of its license (the GPL) in the United States District Court for the Southern District of New York.[17]

What was claimed to be the first US lawsuit over a GPL violation concerned use of BusyBox in an embedded device. The lawsuit,[17] case 07-CV-8205 was filed on September 20, 2007, by the Software Freedom Law Center (SFLC) on behalf of Andersen and Landley against Monsoon Multimedia Inc., after BusyBox code was discovered in a firmware upgrade and attempts to contact the company had apparently failed. The case was settled with release of the Monsoon version of the source and payment of an undisclosed amount of money to Andersen and Landley.[18]

On November 21, 2007, the SFLC brought two similar lawsuits on behalf of Andersen and Landley against two more companies, Xterasys (case 07-CV-10455) and High-Gain Antennas (case 07-CV-10456).[19][20] The Xterasys case was settled on December 17 for release of source code used and an undisclosed payment,[21] and the High-Gain Antennas case on March 6, 2008, for active license compliance and an undisclosed payment.[22] On December 7, 2007, a case was brought against Verizon Communications over its distribution of firmware for Actiontec routers;[23][24] this case was settled March 17, 2008 on condition of license compliance, appointment of an officer to oversee future compliance with free software licenses, and payment of an undisclosed sum.[25] Further suits were brought on June 9, 2008, against Bell Microproducts (case 08-CV-5270) and SuperMicro (case 08-CV-5269),[26] the Super Micro case being settled on July 23, 2008.[27] BusyBox and Bell Microproducts also settled out of court on October 17.[28]

On December 14, 2009, a new lawsuit was filed naming fourteen defendants including Best Buy, JVC, Samsung and others.[29][30][31] In February 2010 Samsung released its LN52A650 TV firmware under GPLv2,[32] which was used later as a reference by the SamyGO community project.[33]

On about August 3, 2010, BusyBox won from Westinghouse a default judgement of triple damages of $90,000 and lawyers' costs and fees of $47,865, and possession of "presumably a lot of high-def TVs" as infringing equipment in the lawsuit Software Freedom Conservancy v. Best Buy, et al., the GPL infringement case noted in the paragraph above.[34]

No other developers, including original author Bruce Perens and maintainer Dave Cinege, were represented in these actions or party to the settlements. On December 15, 2009, Perens released a statement expressing his unhappiness with some aspects of the legal situation, and in particular alleged that the current BusyBox developers "appear to have removed some of the copyright statements of other BusyBox developers, and appear to have altered license statements".[35]

Features

BusyBox can be customized to provide a subset of over two hundred utilities. It can provide most of the utilities specified in the Single Unix Specification (SUS) plus many others that a user would expect to see on a Linux system. BusyBox uses the Almquist shell, also known as A Shell, ash and sh.[36] An alternative for customization is the smaller 'hush' shell. "Msh" and "lash" used to be available.[37]

As it is a complete bootstrap system, it will further replace the init daemon and udev (or the latter-day systemd) using itself to be called as init on startup and mdev at hotplug time.

The BusyBox website provides a full list of the utilities implemented.[38]

Single binary

Typical computer programs have a separate binary (executable) file for each application. BusyBox is a single binary, which is a conglomerate of many applications, each of which can be accessed by calling the single BusyBox binary with various names (supported by having a symbolic link or hard link for each different name)[39] in a specific manner with appropriate arguments.

BusyBox benefits from the single binary approach, as it reduces the overhead introduced by the executable file format (typically ELF), and it allows code to be shared between multiple applications without requiring a library. This technique is similar to what is provided by the crunchgen[40] command in FreeBSD, the difference being that BusyBox provides simplified versions of the utilities (for example, an ls command without file sorting ability), while a crunchgen generated sum of all the utilities would offer the fully functional versions.

Sharing of the common code, along with routines written with size-optimization in mind, can make a BusyBox system use much less storage space than a system built with the corresponding full versions of the utilities replaced by BusyBox. Research[41] that compared GNU, BusyBox, asmutils and Perl implementations of the standard Unix commands showed that in some situations BusyBox may perform faster than other implementations, but not always.

Commands

The official BusyBox documentation lists an overview of the available commands and their command-line options.

List of BusyBox commands[42]

  • test – Built-in evaluation
  • acpid
  • adduser
  • adjtimex
  • ash
  • ar
  • arp
  • arping
  • ash
  • basename
  • beep
  • blkid
  • brctl
  • bunzip2
  • bzcat
  • bzip2
  • cal
  • cat — Print content of one or more files to stdout.
  • catv
  • chat
  • chattr
  • chgrp
  • chmod — Change file modes
  • chown
  • chpasswd
  • chpst
  • chroot
  • chrt
  • chvt
  • cksum
  • clear
  • cmp
  • comm
  • cp — Copy
  • cpio
  • crond
  • crontab
  • cryptpw
  • cut
  • date — Display system date/time
  • dc
  • dd — Copy a file with converting and formatting
  • deallocvt
  • delgroup
  • deluser
  • depmod
  • devmem
  • df — Print filesystem usage statistics
  • dhcprelay
  • diff
  • dirname
  • dnsd
  • dnsdomainname
  • dos2unix
  • dpkg
  • du
  • dumpkmap
  • dumpleases
  • echo — Display a specified line of text.
  • ed
  • eject
  • env
  • envdir
  • envuidgid
  • expand
  • expr
  • fakeidentd
  • false
  • fbset
  • fbsplash
  • fdflush
  • fdformat
  • fdisk
  • find
  • findfs
  • flash_lock
  • flash_unlock
  • fold
  • free
  • freeramdisk
  • fsck.minix
  • fsck
  • fsync
  • ftpd
  • ftpget
  • ftpput
  • fuser
  • getopt
  • getty
  • grep — Search for PATTERN in each FILE or standard input.
  • gunzip — Compressed file expansion.
  • gzip — File compression.
  • hd
  • hdparm
  • head
  • hexdump
  • hostid
  • hostname
  • httpd — HTTP server daemon
  • hush
  • hwclock
  • id
  • ifconfig
  • ifdown
  • ifenslave
  • ifplugd
  • ifup
  • inetd
  • inotifyd
  • insmod
  • install
  • ionice
  • ip
  • ipaddr
  • ipcalc
  • ipcrm
  • ipcs
  • iplink
  • iproute
  • iprule
  • iptunnel
  • kbd_mode
  • kill — Send a signal to a process.
  • killall
  • klogd
  • last
  • length
  • less
  • linux32
  • linux64
  • linuxrc
  • ln — Create a link named LINK_NAME or DIRECTORY to the specified TARGET.
  • loadfont
  • loadkmap
  • logger
  • login — Begin a new session on the system
  • logname
  • logread
  • losetup
  • lpd
  • lpq
  • lpr
  • ls — List of files or folders
  • lsattr
  • lsmod
  • lzmacat
  • lzop
  • lzopcat
  • makemime
  • man
  • md5sum
  • mdev — akin to udev
  • mesg
  • microcom
  • mkdir — Create a folder
  • mkdosfs
  • mkfifo
  • mkfs.minix
  • mkfs.vfat
  • mknod
  • mkpasswd
  • mkswap
  • mktemp
  • modprobe
  • more — View FILE or standard input one screen-full at a time
  • mount — Mount file systems
  • mountpoint
  • mt
  • mv — move file
  • nameif
  • nc — networking Swiss army knife.
  • netstat — Display networking information.
  • nice
  • nmeter
  • nohup
  • nslookup
  • ntpc
  • ntpsync
  • nvram
  • od
  • openvt
  • passwd
  • patch
  • pgrep
  • pidof — List PIDs of all processes with names that match NAMEs
  • ping6
  • ping — Send ICMP ECHO_REQUEST packets to network hosts
  • pipe_progress
  • pivot_root
  • pkill
  • popmaildir
  • printenv
  • printf
  • ps — Report process status
  • pscan
  • pwd — Print working directory
  • raidautorun
  • rdate
  • rdev
  • readlink
  • readprofile
  • reformime
  • renice
  • reset
  • resize
  • rm — Erase file
  • rmdir — Remove directory
  • rmmod
  • route
  • rpm
  • rstats — Copyright of BusyBox
  • rx
  • script
  • scriptreplay
  • sed — Text stream editor
  • sendmail
  • seq
  • setarch
  • setconsole
  • setfont
  • sh
  • sha1sum — Compute and check SHA-1 message digest
  • sha256sum — Compute and check SHA-256 message digest
  • sha512sum
  • showkey
  • slattach
  • sleep — Suspend program execution for a specified time
  • softlimit
  • sort
  • split
  • stat
  • strings
  • stty — Change and print terminal line settings
  • su — Execute commands with privileges of another user account
  • sum — Checksum and count blocks in a file
  • sv
  • switch_root
  • sync — Write all buffered file system blocks to disk
  • tac — Concatenate and print files in reverse line order
  • tail — Output last of file
  • tar
  • tee — Send output to multiple files
  • test
  • time
  • top
  • touch — Update the last-modified date on the given FILE[s]
  • tr — Translate or delete characters
  • true
  • tty
  • udhcpc — Small DHCP client
  • umount — Unmount file systems
  • uname — Display system information
  • uptime — Tell how long the system has been running.
  • uudecode
  • uuencode
  • usleep — Pause for N [microseconds]
  • vconfig — VLAN (802.1q) configuration program
  • vlock — Virtual Console lock program
  • vi — (visual) Edit FILE
  • volname — Return volume name
  • watch — Execute a program periodically
  • watchdog — Software watchdog daemon
  • wc — Word, line, and byte or character count
  • which — Shows the full path of (shell) commands
  • who — Display who is on the system
  • whoami — Print effective userid
  • xargs — Construct argument lists and invoke utility
  • yes — to print a string repetitively
  • yes
  • zcat — Uncompress to stdout


Examples

Programs included in BusyBox can be run simply by adding their name as an argument to the BusyBox executable:

/bin/busybox ls

More commonly, the desired command names are linked (using hard or symbolic links) to the BusyBox executable; BusyBox reads argv[0] to find the name by which it is called, and runs the appropriate command, for example just

/bin/ls

after /bin/ls is linked to /bin/busybox. This works because the first argument passed to a program is the name used for the program call, in this case the argument would be "/bin/ls". BusyBox would see that its "name" is "ls" and act like the "ls" program.

Appliances and reception

BusyBox is used by several operating systems running on embedded systems and is an essential component of distributions such as OpenWrt, OpenEmbedded (including the Yocto Project) and Buildroot. The Sharp Zaurus utilizes BusyBox extensively for ordinary Unix-like tasks performed on the system's shell.[43]

BusyBox is also an essential component of VMware ESXi, and Alpine Linux, both of which are not embedded distributions.

It is necessary for several root applications on Android and is also preinstalled with some "1 Tap Root" solutions such as Kingo Root.

Controversy over Toybox

Toybox was started early 2006 under the GPL-2.0-only license by former BusyBox maintainer Rob Landley as a result of the controversies around GPLv3/GPLv2 discussions. At the end of 2011[44] it was relicensed under the BSD-2-Clause license after the project went dormant.[45] In March 2013, it was relicensed again under the 0BSD license.[46] On January 11, 2012, Tim Bird, a Sony employee, suggested creating an alternative to BusyBox which would not be under the GNU General Public License. He suggested it be based on the dormant Toybox.[47] In January 2012 the proposal of creating a BSD licensed 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.[48] The starter of BusyBox based lawsuits, Rob Landley, responded that this was intentional as he came to the conclusion that the lawsuits resulted not in the hoped for positive outcomes and he wanted to stop them "in whatever way I see fit".[49][50]

See also

References

  1. "Erik Andersen's Homepage". http://www.codepoet.org/andersen/erik/erik.html. 
  2. Active Projects , Rob Landley's website
  3. Denys Vlasenko , BusyBox maintainer
  4. "Archived copy". http://www.softwarefreedom.org/resources/2009/busybox-complaint-2009-12-14.pdf. 
  5. "Release history". https://www.busybox.net/. 
  6. 6.0 6.1 "BusyBox". https://www.busybox.net/license.html. 
  7. "busybox-1.2.2.1.tar.bz2". https://busybox.net/downloads/busybox-1.2.2.1.tar.bz2. "From changelog: This is the last release of BusyBox under the old "GPLv2 or later" dual license. Future versions (containing changes after svn 16112) will just be GPLv2 only, without the "or later"." 
  8. BitCubate X. "BusyBox Classic". https://play.google.com/store/apps/details?id=busybox.lite&hl=en. 
  9. "FreeBSD port overview". http://portsmon.freebsd.org/portoverview.py?category=sysutils&portname=busybox. 
  10. "The slogan for 'The Swiss Army Knife of Embedded Linux' source". https://www.busybox.net/about.html. 
  11. Landley, Rob. "BusyBox forensic analysis" (TXT). https://busybox.net/~landley/forensics.txt. 
  12. Statement on Busybox Lawsuits on Bruce Perens' Weblog (December 15, 2009, archived)
  13. 13.0 13.1 Corbet, Jonathan (2006-10-01). "Busy busy busybox". LWN.net. https://lwn.net/Articles/202106/. "Since BusyBox can be found in so many embedded systems, it finds itself at the core of the GPLv3 anti-DRM debate. [...]The real outcomes, however, are this: BusyBox will be GPLv2 only starting with the next release. It is generally accepted that stripping out the "or any later version" is legally defensible, and that the merging of other GPLv2-only code will force that issue in any case" 
  14. Landley, Rob (2006-09-09). "Re: Move GPLv2 vs v3 fun…". lwn.net. https://lwn.net/Articles/202110/. "Don't invent a straw man argument please. I consider licensing BusyBox under GPLv3 to be useless, unnecessary, overcomplicated, and confusing, and in addition to that it has actual downsides. 1) Useless: We're never dropping GPLv2." 
  15. GPL version 2 only for BusyBox 1.3.0. on lwn.net
  16. Landley, Robert (2006-09-30). "I'm going out now. I may be some time". busybox (Mailing list). Archived from the original on July 18, 2016. Retrieved July 21, 2016.
  17. 17.0 17.1 On Behalf of BusyBox Developers Andersen and Landley, SFLC Files First Ever U.S. GPL Violation Lawsuit (Software Freedom Law Center September 20, 2007)
  18. Byfield, Bruce (October 30, 2007). "Settlement reached in Busybox-Monsoon GPL case". Linux.com. http://www.linux.com/feature/120629. 
  19. Linux legal team sues over GPL violations (Martin LaMonica, CNET News.com, November 21, 2007)
  20. "Second Round of GPL Infringement Lawsuits Filed on Behalf of BusyBox Developers". http://www.softwarefreedom.org/news/2007/nov/20/busybox/. 
  21. "BusyBox Developers and Xterasys Corporation Agree to Settle GPL Lawsuit". http://www.softwarefreedom.org/news/2007/dec/17/busybox-xterasys-settlement/. 
  22. BusyBox Developers and High-Gain Antennas Agree to Dismiss GPL Lawsuit (SFLC press release)
  23. Gross, Grant (December 7, 2007). "Open-source legal group strikes again on BusyBox, suing Verizon". Computerworld. https://www.computerworld.com/article/2537947. 
  24. "BusyBox Developers File GPL Infringement Lawsuit Against Verizon Communications". http://www.softwarefreedom.org/news/2007/dec/07/busybox/. 
  25. Verizon Settles Open Source Software Lawsuit (Paul McDougell, InformationWeek, March 17, 2008)
  26. SFLC Files Another Round of GPL Violation Lawsuits on Behalf of BusyBox Developers (SFLC press release)
  27. BusyBox Developers and Supermicro Agree to End GPL Lawsuit: Good Faith Discussions Result in Dismissal of Copyright Infringement Case (SFLC press release)
  28. 2008. Andersen v. Bell Microproducts, Inc., No. 08-cv-5270, Doc. No. 16 (S.D.N.Y. Oct. 17, 2008) (notice of voluntary dismissal)
  29. Perlow, Jason (December 16, 2009). "How to avoid modern day public GPL floggings". zdnet.com. http://www.zdnet.com/article/how-to-avoid-modern-day-public-gpl-floggings/. "Public floggings and executions like the recent SFLC lawsuit could be avoided if actual standards and procedures for compliance with the GPL and other Free and Open Source licenses actually existed." 
  30. Best Buy, Samsung, Westinghouse, 11 more named in GPL lawsuit on cnet.com
  31. The Software Freedom Conservancy, Inc. & Mr. Erik Andersen vs BestBuy, Samung, Westinghouse, JVC, Western Digital, Bosch, Phoebe Micro, Humax, ... (New York, 2009)
  32. Visual Display - Open Source on samsung.com "Please download the links below We use GPLv2 and LGPLv2.1, not GPLv3 and LGPLv3. Model: LN40A650 / LN52A650 / LN52A750 [...] LN52A750.zip" (archived 2010)
  33. Main_Page on samygo.tv
  34. Jones, Pamela (2010-08-03). "BusyBox and the GPL Prevail Again - Updated 4Xs". http://www.groklaw.net/article.php?story=20100803132055210. 
  35. Bruce Perens, "Statement on Busybox lawsuits", perens.com (December 15, 2009).
  36. "ash variants". http://www.in-ulm.de/~mascheck/various/ash/#busybox. 
  37. "Use the new 'select' option to make the shell config". 2003-08-08. https://git.busybox.net/busybox/commit/shell/Config.in?id=b287e2e27a388deecd9d9580f2a846b2b2efff42. "The 'ash' shell adds about 60k in the default configuration and is the most complete and most pedantically correct shell included with busybox. This shell is actually a derivative of the Debian 'dash' shell (by Herbert Xu), which was created by porting the 'ash' shell (written by Kenneth Almquist) from NetBSD." 
  38. "BusyBox – The Swiss Army Knife of Embedded Linux". https://www.busybox.net/downloads/BusyBox.html. 
  39. "BusyBox simplifies embedded Linux systems: A small toolkit for small environments". http://www-128.ibm.com/developerworks/library/l-busybox/index.html. 
  40. crunchgen(1) – FreeBSD General Commands Manual
  41. Thayer, Doug; Miller, Keith (April 16–17, 2004). "Four UNIX Programs in Four UNIX Collections: Seeking Consistency in an Open Source Icon". University of Minnesota, Morris. http://www.micsymposium.org/mics_2004/ThayerMiller.pdf. Retrieved December 5, 2011. 
  42. "BusyBox Command Help". https://www.busybox.net/downloads/BusyBox.html#commands. 
  43. "Linux on the Road". http://tldp.org/LDP/Mobile-Guide/html/Mobile-Guide.html#mobile-guide-p3-handheld-devices-pdas. 
  44. Landley, Rob. "License change commit". http://landley.net/hg/toybox/rev/f3a00ece7966. 
  45. "Toybox news". http://landley.net/toybox/. 
  46. Landley, Rob. "Simplify license text, as mentioned on the mailing list.". http://landley.net/hg/toybox/rev/264b9da809df. 
  47. "Busybox replacement project". 2012-01-11. http://www.elinux.org/index.php?title=Busybox_replacement_project&oldid=83858. 
  48. "Garrett: The ongoing fight against GPL enforcement". LWN.net. 2012-01-31. https://lwn.net/Articles/478249/. "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." 
  49. "Garrett: The ongoing fight against GPL enforcement". LWN.net. 2012-01-31. https://lwn.net/Articles/478361/. ">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." 
  50. Proffitt, Brian (2012-02-02). "GPL enforcement sparks community flames - Throwing the GPL baby out with the enforcement bath water?". ITworld. http://www.itworld.com/article/2732025/open-source-tools/gpl-enforcement-sparks-community-flames.html. 

Further reading

External links