For faster navigation, this Iframe is preloading the Wikiwand page for BusyBox.

BusyBox

BusyBox
原作者布鲁斯·佩伦斯
开发者Erik Andersen[1]、Rob Landley[2]、Denys Vlasenko[3]及其他人
首次发布1999年11月4日,​24年前​(1999-11-04[4]
当前版本
  • 1.36.0 (2023年1月3日;预发布版本)[5]
  • 1.36.1 (2023年5月19日;稳定版本)[5]
编辑维基数据链接
原始码库 编辑维基数据链接
编程语言C
操作系统类Unix系统
文件大小2.1 MB
类型
许可协议GNU GPL第二版(1.2.3版或更新[6]
网站www.busybox.net

BusyBox是一个遵循GPL协议、以自由软件形式发行的应用程式。Busybox在单一的可执行文件中提供了精简的Unix工具集,可运行于多款POSIX环境的操作系统,例如Linux(包括Android[7])、Hurd[8]、FreeBSD[8][9]等等。由于BusyBox可执行文件的文件比较小,使得它非常适合使用于嵌入式系统。作者将BusyBox称为“嵌入式Linux的瑞士军刀”。[10]

历史

[编辑]

BusyBox最初是由布鲁斯·斐伦斯在1996年为Debian GNU/Linux的软碟安装编写的[11],其原始构想是希望在一张软碟上能放入一个开机系统,以作为急救盘和安装盘。后来它变成了嵌入式Linux装置和系统和Linux发行版安装程序的实质标准,因为每个Linux可执行文件需要数KB的空间,而集成两百多个程序的BusyBox可以节省大量空间。例如:Debian GNU/Linux的安装光碟以BusyBox作为Shell程序。

Enrique Zanardi负责维护BusyBox并专注在Debian启动软碟英语Boot disk安装系统的需求直到1998年,再由负责Linux路由器计划英语Linux Router Project的Dave Cinege 接手。Cinege做了一些增加:建立了一个模块化的Build环境、转移BusyBox的目标到一般高阶的嵌入式系统。当1999年LRP开发进度趋缓时,Lineo, Inc.英语Lineo的Erik Andersen在1999年开始正式地接手这个项目继续维护它到2006年三月。在这段期间,Linux的嵌入式系统的市场明显地成长,连带使BusyBox转趋成熟,同时扩展二者的使用群和功能。

丹尼斯·弗拉先科英语Denis Vlasenko是目前BusyBox的维护者。

功能

[编辑]

BusyBox可以被自定义化以提供一个超过两百种功能的子集。它可以提供多数详列在单一UNIX规范里的功能,以及许多用户会想在Linux系统上看到的功能。BusyBox使用ash[12][13]在 BusyBox的网站上可以找到所有功能的列表。[14]

单一可执行文件

[编辑]

典型的计算机程序对每个应用程式都有个别的二进制可执行文件)文件。BusyBox 是单一二进制程序,这是许多应用程式的集合,在适当参数的特定方法下,每个都可透过以不同的名称(每个不同的名字借由符号链接硬链接支持[15])调用单一 BusyBox 二进制程序来存取。

BusyBox受惠于单一可执行文件策略,如此一来省去了每个可执行文件必需有的标头(特别是ELF的可执行文件),这也让Busybox不需要便可达成代码共享。这个技巧与FreeBSD中的crunchgen[16]指令相似。与使用crunchgen建立的合并工具程序不同在于,Busybox只提供每个工具程序的简化版(例如:ls指令不提供排序功能)。

共享通用的代码,并以程序大小优化为目标,使以BusyBox建构的系统所需要的空间远小于使用对应的完整工具所需要的空间。研究[17]比较了GNU、Busybox、asmutils及Perl实现的标准Unix指令发现特定状况下,BusyBox的执行速度会优于其他实现,但并非总是如此。

示例

[编辑]

BusyBox所包含的程序只需要简单的将名称附加在第一个参数即可执行:

/bin/busybox ls

更常见的作法是,这些指令会以链接(使用硬链接或者符号链接)至BusyBox可执行文件,BusyBox会侦测其被链接时的名称,并执行对应的指令。举例来说,只要将/bin/ls链接到/bin/busybox,即可执行

/bin/ls

命令

[编辑]

实际的命令列表按编译时的设置决定,在有Busybox的系统上执行busybox --list即可看到一个列表。

  • ash - 符合POSIX的一个简单的shell
  • awk - 将文件解析为记录及字段后,按模式匹配操作其内容
  • cat - 将多个文件首尾相连显示于标准输出
  • chmod - 更改文件的权限设置
  • cp - 拷贝文件或目录
  • date - 打印/设置日期时间
  • dd
  • df - 印出文件系统的使用统计
  • dmesg - 查看内核资讯
  • echo - 打印指定内容
  • egrep - 接受扩展正则表达式的grep
  • fgrep - 接受固定字符串模式的grep
  • grep - 列出文件或标准输入中符合模式的行
  • gzip
  • kill - 关闭一个程序
  • ln - 创建链接
  • login - 以某个用户身份登录
  • ls - 列出目录或文件
  • mdu
  • mkdir - 建立一个目录
  • more
  • mount 挂载存储装置
  • mv - 移动文件
  • netstat - 查看 TCP/IP 连接资讯
  • ntpc
  • ntpsync
  • nvram
  • pidof
  • ping
  • ps - 印出程序状态
  • pwd - 印出工作目录
  • rm - 删除文件
  • rmdir - 移除目录
  • rstats
  • sed
  • sh
  • sleep
  • sync - 将缓存写入到硬盘中
  • tar
  • touch
  • umount 移除挂载的存储装置
  • uname - 查看系统资讯
  • usleep
  • vi - 一个带有简单的模式提示的精简版仿vi编辑器
  • watch
  • wget - HTTP或FTP下载工具
  • zcat

参见

[编辑]
  • toybox英语toybox - complete implementation of the standard Linux command line utilities, with minimal external dependencies. by Rob Landley.

注释

[编辑]
  1. ^ Erik Andersen's Homepage. [2010-07-28]. (原始内容存档于2010-06-13). 
  2. ^ 活跃的项目页面存档备份,存于互联网档案馆),Rob Landley的网页
  3. ^ Denys Vlasenko页面存档备份,存于互联网档案馆),BusyBox维护者
  4. ^ 存档副本 (PDF). [2015-10-30]. (原始内容 (PDF)存档于2015-10-30). 
  5. ^ 5.0 5.1 https://busybox.net/news.html.
  6. ^ BusyBox. [2015-07-15]. (原始内容存档于2015-09-01). 
  7. ^ 存档副本. [2017-02-23]. (原始内容存档于2016-11-28). 
  8. ^ 8.0 8.1 存档副本. [2014-03-31]. (原始内容存档于2013-01-06). 
  9. ^ 存档副本. [2014-03-31]. (原始内容存档于2014-01-02). 
  10. ^ http://www.busybox.net/downloads/BusyBox.html页面存档备份,存于互联网档案馆) The self-dubbed slogan for 'The Swiss Army Knife of Embedded Linux' source. The slogan is right under the header.
  11. ^ 存档副本. [2020-09-18]. (原始内容存档于2018-06-15). 
  12. ^ http://busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/shell/Config.in?rev=11083[永久失效链接] 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.
  13. ^ ash variants. [2010-07-28]. (原始内容存档于2010-03-10). 
  14. ^ BusyBox - The Swiss Army Knife of Embedded Linux. [2010-07-28]. (原始内容存档于2010-06-11). 
  15. ^ 存档副本. [2010-07-28]. (原始内容存档于2008-12-09). 
  16. ^ crunchgen man page页面存档备份,存于互联网档案馆) at freebsd.org页面存档备份,存于互联网档案馆
  17. ^ Doug Thayer, Keith Miller. Four UNIX Programs in Four UNIX Collections: Seeking Consistency in an Open Source Icon (PDF). Proceedings of Midwest Instruction and Computing Symposium. University of Minnesota, Morris. 16–17 April 2004. [永久失效链接]

外部链接

[编辑]
{{bottomLinkPreText}} {{bottomLinkText}}
BusyBox
Listen to this article

This browser is not supported by Wikiwand :(
Wikiwand requires a browser with modern capabilities in order to provide you with the best reading experience.
Please download and use one of the following browsers:

This article was just edited, click to reload
This article has been deleted on Wikipedia (Why?)

Back to homepage

Please click Add in the dialog above
Please click Allow in the top-left corner,
then click Install Now in the dialog
Please click Open in the download dialog,
then click Install
Please click the "Downloads" icon in the Safari toolbar, open the first download in the list,
then click Install
{{::$root.activation.text}}

Install Wikiwand

Install on Chrome Install on Firefox
Don't forget to rate us

Tell your friends about Wikiwand!

Gmail Facebook Twitter Link

Enjoying Wikiwand?

Tell your friends and spread the love:
Share on Gmail Share on Facebook Share on Twitter Share on Buffer

Our magic isn't perfect

You can help our automatic cover photo selection by reporting an unsuitable photo.

This photo is visually disturbing This photo is not a good choice

Thank you for helping!


Your input will affect cover photo selection, along with input from other users.

X

Get ready for Wikiwand 2.0 🎉! the new version arrives on September 1st! Don't want to wait?