第三部分,根文件系统构建
根文件系统目录https://busybox.net/
- /bin,此目录存放着系统需要执行的可执行文件,一般都是一些命令 ls、mv等等
- /dev,与设备有关,如、dev/ttymxc0的读写操作实现对串口0的数据收发
- /etc 存放着各种配置目录
- /lib 存放着Linux所必需的库文件
- /mnt 临时挂载目录,一般是空目录
- /proc 此目录一般是空的,当 Linux 系统启动以后会将此目录作为 proc 文件系统的挂载点, proc是个虚拟文件系统,没有实际的存储设备。 proc 里面的文件都是临时存在的,一般用来存储系统运行信息文件
- /usr 不是 user 的缩写,而是 Unix Software Resource 的缩写,也就是 Unix 操作系统软件资源目录。 既然是软件资源目录,因此/usr 目录下也存放着很多软件,一般系统安装完成以后此目录占用的空间最多。
- /var 此目录存放一些可以改变的数据。
- /sbin 此目录页用户存放一些可执行文件,但是此目录下的文件或者说命令只有管理员才能使用,主要用户系统管理。
- /sys 系统启动以后此目录作为 sysfs 文件系统的挂载点, sysfs 是一个类似于 proc 文件系统的特殊文件系统, sysfs 也是基于 ram 的文件系统,也就是说它也没有实际的存储设备。此目录是系统设备管理的重要目录,此目录通过一定的组织结构向用户提供详细的内核数据结构信息
- /opt 可选的文件、软件存放区,由用户选择将哪些文件或软件放到此目录中。
编译根文件系统
- 配置NFS服务器环境
- 创建NFS服务器文件
mkdir ~/Linux/ROOTFS
解压根文件系统
修改顶层Makefile
ARCH ?= arm CROSS_COMPILE ?= /usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
添加库文件
拷贝/usr/local/arm/gcc/arm-linux-gnueabihf/libc/lib中的文件到rootfs/lib
cp *so* *.a ~/Linux/nfs/roorfs/lib/ -d
拷贝/usr/local/arm/gcc/arm-linux-gnueabihf/lib中的文件到rootfs/lib
cp *so* *.a ~/Linux/nfs/roorfs/lib/ -d
开启NFS服务
安装NFS服务器
sudo apt-get install nfs-kernel-server portmap
创建NFS文件夹
mkdir nfs
配置NFS
vi /etc/exports
在最后一行添加
/home/lux/Linux/nfs *(rw,sync,no_root_squash)
重启NFS
sudo /etc/init.d/nfs-kernel-server restart
根文件系统报错:
can-3v3: disabling ALSA device list: No soundcards found.
之后就没有了
通过nfs下载zImage文件到DRAM试试
nfs 80800000 192.168.30.110:/home/lux/Linux/nfs/zImage
报错:
Loading: *** ERROR: File lookup fail
看来是nfs功能不能使用,说是NFS版本高于uboot版本
修改文件
sudo vim /etc/default/nfs-kernel-server
# Number of servers to start up # RPCNFSDCOUNT=8 RPCNFSDCOUNT="-V 2 8" # Runtime priority of server (see nice(1)) RPCNFSDPRIORITY=0 # Options for rpc.mountd. # If you have a port-based firewall, you might want to set up # a fixed port here using the --port option. For more information, # see rpc.mountd(8) or http://wiki.debian.org/SecuringNFS # To disable NFSv4 on the server, specify '--no-nfs-version 4' here # RPCMOUNTDOPTS="--manage-gids" RPCMOUNTDOPTS="-V 2 --manage-gids" # Do you want to start the svcgssd daemon? It is only required for Kerberos # exports. Valid alternatives are "yes" and "no"; the default is "no". NEED_SVCGSSD="" # Options for rpc.svcgssd. # RPCSVCGSSDOPTS="" RPCSVCGSSDOPTS="--nfs-version 2,3,4 --debug --syslog"
本文含有隐藏内容,请 开通VIP 后查看