本文共 1604 字,大约阅读时间需要 5 分钟。
各种形形色色的linux系统的不同实际是不同的文件系统,下面介绍制作arm嵌入式文件系统
1.创建目录
#mkdir rootfs#cd rootfs#nkdir bin dev etc lib proc sbin sys usr mnt tmp var#mkdir usr/bin usr/lib usr/sbin lib/modules
2.创建设备文件
#cd rootfs/dev#mknod -m 666 console c 5 1#mknod -m 666 null c 1 3
3.添加配置文件
添加tar etc.tar.gz mv etc/* …/root/etc/ -rf 4.编译内核模块 make modules ARCH=arm CROSS_COMPILE=arm-linux- 5.添加模块文件 make modules install ARCH=arm INSTALL_MOD_PATH=/rootfs 6.编译/安装busybox 嵌入式中的瑞士军刀 tar xvzf busybox.tar 进入解压目录: make menuconfig 选中Busybox Settings,然后按回车进入到Busybox Settings 界面在Busybox Settings 配置选项里面需要修改两个地方,第一个是Build Optiions-> Cross Compiler prefix,它是指定用什么编译器来编译Busybox,输入使用的交叉编译工具arm-none-linux-gnueabi-,然后退出。
回到Busybox Settings 设置界面,选中Installation Options 如上图,然后按回车,进入Installation Options 配置界面,选中BusyBox installation prefix 如上图所示,然后按回车进入BusyBox installation
prefix 配置界面,,然后输入“rootfs”,然后exit,然后按回车保存配置,退出配置界面。 7.编译busybox 执行make编译 8.安装 make install1.系统类型
1.基于NandFlash的文件系统 1.1、yaffs2 1.2、UbiFS(可读可写) 2.基于NorFlash的文件系统 2.1Jffs2(可读可写) 3.基于内存的文件系统3.1Ramdisk 3.2Initramfs(启动速度快) 4.基于网络的文件系统4.1NFS(开发阶段)2、使用Initramfs文件系统
#cd rootfs#ln -s ./bin/busybox init
进入内核,make menuconfig ARCH=arm,配置输入rootfs路径
编译内核 make uImage ARCH=arm CROSS_COMPILE=arm-linux- 将编译好的文件下载到系统中 3.使用NFS网络文件系统 进入内核使用make menuconfig ARCH=arm,配置NFS,make uImage ARCH=arm CROSS_COMPILE=arm-linux- 将编译好的文件下载到系统中 启动开发板, setenv bootargs noinitrd console=ttySAC0,115200 init=/init root=/dev/nfs rw nfsroot=192.168.1.3:/home/S5-driver/lesson9/rootfs,proto=tcp,nfsvers=3 ip=192.168.1.6:192.168.1.3:192.168.1.1:25 5.255.255.0::eth0:off 此刻,在PC机拷贝文件到roofs,在开发板直接查看。转载地址:http://jvomb.baihongyu.com/