1.1 创建目录
#mkdir rootfs
#cd rootfs
#mkdir bin dev etc lib proc sbin sys usr mnt tmp var
#mkdir usr/bin usr/lib usr/sbin lib/modules
1.2 创建设备
#cd rootfs/dev
#mknod -m 666 console c 5 1
#mknod -m 666 null c 1 3
1.3 加 加 入 配置 文件
#tar etc.tar.gz
#mv etc/* …/root/etc/ -rf
1.4 添加 内核模块
#cd …/linux
#make modules ARCH=arm CROSS_COMPILE=arm-linux-
#make modules_install ARCH=arm INSTALL_MOD_PATH=…/rootfs
1.5 编译/ 安装busybox
1. 配置busybox
#make menuconfig
Busybox Settings ?build Options->
? 中 选中 “Build busybox as a static binary”, 静态链接
? Cross Compiler prefix (arm-linux-)
Installation Options->
? 中 选中 “Don‘t use /usr”, 选中 该 项可以避免busybox 被安装到宿主 系统的
/usr 目录下 , 破坏宿主 系统
? Busybox Installation Prefix (/xxx/rootfs)
该 选项表 明 编译后的 的busybox的 的 安装 位
2. 编译 、 安装busybox
? make
? make install
挂载
使用Initramfs
1. #cd …/rootfs/
#ln –s ./bin/busybox init
2. 配置Linux内 内 核 , 支持initramfs
3. 编译 内 核
4. setenv bootargs noinitrd console=ttySAC0,115200
使用NFS
setenv bootargs noinitrd
console=ttySAC0,115200 init=/init
root=/dev/nfs rw
nfsroot=192.168.1.3:/home/S5-
driver/lesson9/rootfs ip=192.168.1.6:192.168.1.3:192.168.1.1:25
5.255.255.0::eth0:off