使用 busybox 為 龍芯2f 創建 文件系統,假定你已經安裝好了交叉編譯工具。//參見
1. 下載需要的文件
busybox-1.19.4.tar.bz2
BusyBox各版本下載 http://www.linuxidc.com/Linux/2011-08/40704.htm
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
到此,文件系統制作完畢,很簡單吧!