Busybox 配置、编译与文件系统构建

宿主机:Fedora13
目标机:tiny6140
交叉编译器:arm-linux-gcc-4.5.1
交叉编译器路径:/opt/FriendlyARM/toolschain/4.5.1/bin

busybox版本:1.22.1


一  制作根文件系统

1. 配置、编译 Busybox

Busybox 的配置方法类似于 linux 内核的配置。下载解压 Busybox-1.22.1tar.gz 工具包后,进
入 busybox-1.22.1 目录,运行“make menuconfig”
,根据需要选择需使用的模块,保存退出后
会在本地生成一个.config 文件,它指定 busybox 在编译的过程中需要包含哪些功能。


2. 安装图形化配置的依赖工具 Ncurses


安装 Ncurses 有两种方式:有互联网时使用 apt-get 命令来安装(默认方式)
;无互联网时
使用源码包来安装。

a)使用 apt-get 命令安装(有互联网)
#apt-get install libncurses5-dev

3 . 图形化配置

Busybox 文件存放目录:Loongson/share 龙芯服务器上  或者直接在网上下载最新版本:http://www.busybox.net/
提示:调整终端窗口到合适大小或者最大化。
#tar zxf busybox-1.22.2-default.tar.gz
#cd busybox-1.22.1-default
#make menuconfig
配置选择为:
Busybox Setings--->

General Configuration ---> (默认)
Build Options--->
[ ] Build Busybox as a static binary (no shared libs)
[*] Build shared libbusybox
(/opt/gcc-3.4.6-2f/bin/mipsel-linux-)Cross Compiler prefix (需要编辑)
Installation Options("make install"behavior)---> (默认)
Busybox Library Turning--->
[*] vi-style line editing commands(NEW)
[*] Fancy shell prompts(NEW)

Init Utilities---> (默认)
[*]init
[*]Suport reading an inittab file
[*]Run commands with leading dash with controlling tty
[*]Support running init from within an initrd (not initramfs)

Miscellaneous Utilities-->

[ ] inoice
[ ] ubiattach
[ ] ubidetach
[ ] ubimkvol
[ ] ubirmvol
[ ] ubirsvol
[ ] ubiupdatevol

图例说明:
(1)进入主界面 Busybox Configuration,如下图:

(2)
在主界面,
选择并进入 Busybox Setings--->选项,
可以看到 General Configuration --->
选项,按默认配置即可,如下图:

按<Exit>,返回 Busybox Settings 菜单。

(3)在 Busybox Settings 菜单,选择并进入 Build Options--->选项:

这里可选择静态编译或动态编译 busybox,


可根据需要任选一种编译方式进行编译。
(说明:
动态编译的 busybox 在构建文件系统时需要加入一些必须的动态库,而静态编译的 busybox 不
依赖动态库便可执行,构建文件系统时可省略拷贝动态库的步骤。
)
a)静态编译:
选择 Build Busybox as a static binary (no shared libs)选项,如下图:

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值