安裝busybox-1.01.tar

[1]解壓縮

# tar xzvf busybox-1.01.tar

[2] 設定組態

# cd  /usr/src/busybox-1.01

# make menuconfig

若出現以下錯誤

 

install-busybox01.JPG

 

 

則是因為ubuntu還需要去下載安裝libncurses5-dev

執行

# Sudo apt-get install libncurses5-dev

安裝好之後重新執行

# make menuconfig

即可進入設定組態畫面

 

install-busybox02.JPG

 

 

重要選項: Build Options

[*] Build BusyBox as a static binary (no shared libs)

[ ] Build with Large File Support (for accessing files > 2 GB)

[*] Do you want to build BusyBox with a Cross Compiler?

()  Any extra CFLAGS options for the compiler?

必須選擇以跨平台編譯器建置busybox

[*] Do you want to build BusyBox with a Cross Compiler?

並在其下輸入Cross-Compiler之路徑及名稱 (Cross-Compiler Prefix) :

/usr/local/arm/3.4.1/bin/arm-linux-

 

[3]建立相依的樹狀結構:  make  dep

 

[4]產生套件:  make   ( 建置結果產生二進位執行檔 busybox)

 

一般來說,使用busybox不需要inittab

(Busybox所讀取的inittab檔之格式與一般Linux所讀取的inittab檔之格式不同)

 

開機時要自動執行的工作,可以放在/etc/init.d/rcS中。

 

[5] 安裝busybox

# mkdir  /home/flykof/busyboxRoot

# make  PREFIX=/home/flykof/busyboxRoot  install

# chmod  +s  /home/flykof/busyboxRoot/bin/busybox

 

[6]加入執行所需檔案及建立符號連結

直接以功能名稱讓busybox執行該功能: 建立符號連結

[root@coyote]$ tree

.

|-- bin

|   |-- ash -> busybox

|   |-- busybox

|   |-- cat -> busybox

|   |-- cp -> busybox

|   |-- ...

|   '-- zcat -> busybox

|-- linuxrc -> bin/busybox

|-- sbin

|   |-- halt -> ../bin/busybox

|   |-- ifconfig -> ../bin/busybox

|   |-- init -> ../bin/busybox

|   |-- klogd -> ../bin/busybox

|   |-- ...

|   '-- syslogd -> ../bin/busybox

'-- usr

    |-- bin

    |   |-- [ -> ../../bin/busybox

    |   |-- basename -> ../../bin/busybox

    |-- ...

    |   |-- xargs -> ../../bin/busybox

    |   '-- yes -> ../../bin/busybox

    '-- sbin

        '-- chroot -> ../../bin/busybox

 

[7] /usr/src/busyboxRoot 新增或刪除目錄、建立設備節點等等。

# cd  /home/flykof/busyboxRoot/

# mkdir  dev

# mknod  dev/console  c  5  1

# mkdir   etc

# mkdir   proc

# chmod  555  proc

 

 


 

arrow
arrow
    全站熱搜

    flykof 發表在 痞客邦 留言(0) 人氣()