制作根文件系统需要:
1. /dev/console /dev/null
2. busybox
3. /etc/inittab
4. c lib
创建设备节点/dev/console /dev/null:
mknod console c 5 1
mknod null c 1 3
配置编译busybox,安装时需指定安装目录
配置busybox特性,make menuconfig, 生成.config
make
make install CONFIG_PREFIX=/path,安装后会在路径下自动创建/bin /sbin /usr
创建/etc/inittab
格式:<id>:<level>:<action>:<process>
console::askfirst:-/bin/sh
::sysinit:/etc/init.d/rcS
mkdir /sys
mkdir /proc
mkdir /tmp
创建fstab
#device mount-point type options dump fsck order
# mount proc
proc /proc proc defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev tmpfs defaults 0 0
创建/etc/init.d/rcS
mount -a
#auto create device using mdev
mkdir /dev/pts
mount -t devpts devpts /dev/pts
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -smdev > /proc/sys/kernel/hotplug
mdev -s
拷贝 c lib
mkdir /target/lib
cd /cross-compile-path/lib;
cp *.so* /target/lib -d
mkyaffs2image /target target.yaffs2
dnw target.yaffs2