BusyBox
BusyBox的截图 |
|
| 開發者 | Erik Andersen[1], Rob Landley[2], Denys Vlasenko[3] |
|---|---|
| 初始版本 | 1999年11月4日[4] |
| 作業系統 | Unix-like |
| 類型 | Independent SUSp XCU implementation |
BusyBox 是一個遵循GPL、以自由軟體形式發行的應用程式,由於執行檔尺寸小、並使用 Linux內核,這使得它非常適合使用於嵌入式系统。此外,由於BusyBox功能強大,因此有些人將 BusyBox 稱為 Linux 工具裡的瑞士軍刀。[5]
目录 |
歷史 [编辑]
BusyBox最初是由 布魯斯·斐倫斯 在 1996年為Debian GNU/Linux安裝盤編寫的, 其原始構想是希望在一張軟碟上能放入一個開機系統,以作為急救盤和安裝盤。後來它變成了崁入式Linux設備和系統和Linux發行版安裝程序的實質標準,因為每個Linux執行檔需要數Kb的空間,而整合兩百多個程式的BusyBox可以節省大量空間。
Enrique Zanardi負責維護BusyBox並專注在Debian 启动软盘安裝系統的需求直到 1998年,再由負責 Linux路由器计划的 Dave Cinege 接手。Cinege 做了一些增加:建立了一個模組化的Build環境、轉移 BusyBox's 目標到一般高階的 嵌入式系統。當 1999年 LRP 開發進度趨緩時,Lineo, Inc.的 Erik Andersen 在1999年開始正式地接手這個專案繼續維護它到2006年三月。在這段期間,Linux的 嵌入式系統的市場明顯地成長,連帶使BusyBox 轉趨成熟,同時擴展二者的使用群和功能。
Denis Vlasenko是目前BusyBox的維護者。
功能 [编辑]
BusyBox可以被自訂化以提供一個超過兩百種功能的子集。它可以提供多數詳列在單一UNIX規範裡的功能,以及許多使用者會想在 Linux 系統上看到的功能。BusyBox 使用ash。[6][7]在 BusyBox的網站上可以找到所有功能的列表。[8]
單一可執行檔 [编辑]
典型的電腦程式對每個應用程式都有個別的二進制(執行檔)檔案。BusyBox 是一單一二進制程式,這是許多應用程式的集合,在適當參數的特定方法下,每個都可透過以不同的名稱(每個不同的名字藉由符号链接或硬鏈接支援[9])呼叫單一 BusyBox 二進制程式來存取。
BusyBox 受惠於單一可執行檔策略,如此一來省去了每個執行檔必需有的檔頭 (特別是 ELF的可執行檔), 這也讓 Busybox 不需要 函式庫 便可達成程式碼共用。這個技巧與 FreeBSD 中的 crunchgen[10] 指令相似。與使用 crunchgen 建立的合併工具程式不同在於,Busybox 只提供每個工具程式的簡化版 (如: ls 指令不提供排序功能)。
共享通用的程式碼,並以程式大小最佳化為目標,使以 BusyBox 建構的系統所需要的空間遠小於使用對應的完整工具所需要的空間。研究 [11] 比較了GNU, Busybox, asmutils 及 Perl 實作的標準 Unix 指令發現特定狀況下,BusyBox 的執行速度會優於其他實作,但並非總是如此。
範例 [编辑]
BusyBox 所包含的程式只需要簡單的將名稱附加在第一個參數即可執行:
/bin/busybox ls
更常見的作法是,這些指令會以連結 (使用 硬連結 或者 符號連結) 至 BusyBox 可執行檔,BusyBox 會偵測其被連結時的名稱,並執行對應的指令。舉例來說,只要將 /bin/ls 連結到 /bin/busybox,即可執行
/bin/ls
命令 [编辑]
- ash - 符合 POSIX 的一个简单的shell
- awk - 将文件解析为记录及字段后,按模式匹配操作其内容
- cat - 将多个文件首尾相连显示于标准输出
- chmod
- cp
- date
- dd
- df - 印出檔案系統的使用統計
- dmesg
- echo
- egrep - 接受扩展RE的grep
- fgrep - 接受固定字符串模式的grep
- grep - 列出文件或标准输入中符合模式的行
- gunzip
- gzip
- kill - 關閉一個程序
- ln
- login
- ls - 列出目錄或檔案
- mdu
- mkdir - 建立一個目錄
- more
- mount 掛載儲存裝置
- mv - 移動檔案
- netstat
- ntpc
- ntpsync
- nvram
- pidof
- ping
- ps - 印出程序狀態
- pwd - 印出工作目錄
- rm - 刪除檔案
- rmdir - 移除目錄
- rstats
- sed
- sh
- sleep
- sync
- tar
- touch
- umount 移除掛載的儲存裝置
- uname
- usleep
- vi
- watch
- wget - HTTP或FTP下载工具
- zcat
註釋 [编辑]
- ^ Erik Andersen's Homepage
- ^ Active Projects, Rob Landley's website
- ^ Denys Vlasenko, BusyBox maintainer
- ^ http://www.softwarefreedom.org/resources/2009/busybox-complaint-2009-12-14.pdf
- ^ 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.
- ^ 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.
- ^ ash variants
- ^ BusyBox - The Swiss Army Knife of Embedded Linux
- ^ http://www-128.ibm.com/developerworks/library/l-busybox/index.html
- ^ crunchgen man page at freebsd.org
- ^ Doug Thayer, Keith Miller. Four UNIX Programs in Four UNIX Collections: Seeking Consistency in an Open Source Icon. Proceedings of Midwest Instruction and Computing Symposium. University of Minnesota, Morris. 16–17 April 2004.
參看 [编辑]
- toybox - complete implementation of the standard Linux command line utilities, with minimal external dependencies. by Rob Landley.
外部連結 [编辑]
- Project home page
- Products known to be using BusyBox
- Building Tiny Linux Systems with BusyBox
- Busybox simplifies embedded Linux systems a developerWorks article by M. Tim Jones