嵌入式系统根文件系统制作
一、主机环境
Linux vm-dev 2.6.9-42.EL RedHatEL4, VMWare6.0.3;
gcc version 3.4.6 20060404 (Red Hat 3.4.6-3) Thread model: posixgcc version 3.4.6
所需源文件: busybox-1.12.2.tar.bz2;
二、用 Busybox 创建 nfs 文件系统
1、解压 busybox-1.12.2.tar.bz2,路径为
[root@vm-dev rootfs]# ls
busybox-1.12.0.tar.bz2
[root@vm-dev rootfs]# tar -vxjf busybox-1.12.2.tar.bz2
[root@vm-dev rootfs]# cd busybox-1.12.2
[root@vm-dev busybox-1.12.2]# pwd
/opt/develop/lyj/common/porting/rootfs/busybox-1.12.2
[root@vm-dev busybox-1.12.2]# vi Makefile
[root@vm-dev busybox-1.12.2]#
修改 Makefile 中的 ARCH 和 CROSS_COMPILE 与本机的路径一致:
CROSS_COMPILE ?= arm-linux-
...
ARCH ?= arm
2、编译 busybox。先 make menuconfig,修改以下:
[root@vm-dev busybox-1.12.2]# make menuconfig
Busybox Settings --->
Build Options --->
[*] Build BusyBox as a static binary (no shared libs)
//直接编译成静态库,省事点
(/opt/crosstool/bin/arm-s3c2410-linux-gnu-) Cross Compiler prefix
//这里和 Makefile 里保持一致,应该写一处就行了
Installation Options --->
[ ] Don't use /usr
//使用 usr 目录
Busybox Library Tuning --->
[*] Fancy shell prompts
//一定要选上,否则很多转意字符无法识别
Shells --->
Choose your default shell (ash) --->
//这里选择 shell 为 ash,应该是默认选中的
--- ash
//把 ash 这档的选项全部选上
Miscellaneous Utilities --->
[ ] inotifyd