使用 busybox 为 龙芯2f 创建 文件系统,假定你已经安装好了交叉编译工具。//参见
1. 下载需要的文件
busybox-1.19.4.tar.bz2
2.解压,配置和编译
#tar -jxf busybox-1.19.4.tar.bz2
#cd busybox...
# make ARCH=mips CROSS_COMPILE=mips64el-st-linux-gnu- defconfig
# mkdir ../install
# make ARCH=mips CROSS_COMPILE=mips64el-st-linux-gnu- menuconfig
Busybox Settings --->
Build Options --->
Cross Compiler prefix
填入: mips64el-st-linux-gnu-
BusyBox installation prefix
填入: ../install
Busybox Settings --->
Build Options --->
[*] Build BusyBox as a static binary (no shared libs)
#make ARCH=mips CROSS_COMPILE=mips64el-st-linux-gnu- -j8
#make ARCH=mips CROSS_COMPILE=mips64el-st-linux-gnu- install
3. 继续完善
创建设备结点和目录
#cd ../install
#mkdir dev
#cd dev
#mknod console c 5 1
#mknod null c 3 1
#cd ../
#mkdir tmp root etc proc sys mnt lib
#echo "root::0:0:root:/bin/sh" > etc/passwd
#echo "root:x:0:" > etc/groups
#echo "::respawn:/sbin/getty 38400 tty1" > etc/inittab
#mkdir lib/modules
#mkdir lib/modules/3.0.4v1
#mkdir etc/init.d
#cd etc/init.d
#vim rcS
输入如下内容,保存
#!/bin/ash
mount -t proc proc /proc
mount -t sysfs sysfs /sys
echo "Welcome! Master!"
#chmod a+rwx rcS
到此,文件系统制作完毕,很简单吧!