linux零零散散看了很长时间的内核代码了,前段时间本打算把flash/ubifs彻底看懂,看了两周初始化和挂载流程是清楚了,但再细抠深究发现数据结构越看越多,也就越来越看不懂了。为了找找信心,打算看几个busybox中的小程序。
计划采用嵌入式开发最常用的,NFS作为根文件系统方式,来运行编出来的应用程序。开发板配套的fedora 9没法用eclipse看代码,所以还是先在新系统(lsb_release -a
:Ubuntu 20.04 LTS)试试,不行再换回fedora 9。
安装NFS服务端
- 查询nfs包:
apt search -n nfs
,找到两个相关的,看意思一个作用户服务运行,一个作内核服务运行,没有百度到这两种区别在哪里,为什么有这两种场景;nfs-ganesha/focal 3.0.3-0ubuntu3 amd64
NFS server in User Space
nfs-kernel-server/focal-updates,focal-security 1:1.3.4-2.5ubuntu3.3 amd64
support for NFS kernel server - 安装nfs服务:
sudo apt install nfs-kernel-server
,提示需要安装以下包;keyutils libnfsidmap2 libtirpc-common libtirpc3 nfs-common nfs-kernel-server rpcbind
- 配置nfs服务:
sudo vim /etc/exports
,追加一行/wrk/rootfs *(rw,sync,no_root_squash)
- 启动nfs服务:
sudo systemctl restart rpcbind
sudo systemctl start nfs-server
- 本地挂载验证:
sudo mount -t nfs localhost:/wrk/rootfs /mnt
,查看/mnt的内容与/wrk/rootfs是否一致。
开发板配置
- 通过友善之臂提供的MiniTools修改内核命令行,内容如下:
console=ttySAC0,115200 root=/dev/nfs nfsroot=10.3.3.22:/wrk/rootfs ip=10.3.3.5:10.3.3.22:10.3.3.1:255.255.0:tiny6410:eth0:off
- 继续启动开发板,成功挂载打印如下:
eth0: link down
eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
IP-Config: Complete:
device=eth0, addr=10.3.3.5, mask=255.255.0.0, gw=10.3.3.1,
host=tiny6410, domain=, nis-domain=(none),
bootserver=10.3.3.22, rootserver=10.3.3.22, rootpath=
Freeing init memory: 1408K
1Wire touchscreen OK
FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
fa_cpu_pfn: module license ‘Proprietary’ taints kernel.
Disabling lock debugging due to kernel taint
FriendlyARM proprietary driver for mini6410 initialized.
[31/Dec/1999:18:10:36 +0000] boa: server version Boa/0.94.13
[31/Dec/1999:18:10:36 +0000] boa: server built Dec 30 2010 at 11:18:35.
[31/Dec/1999:18:10:36 +0000] boa: starting server pid=965, port 80Try to bring eth0 interface up…NFS root …Done
Please press Enter to activate this console.
前几天某上午去某羊数据面试linux驱动,对方表示 我的能力跟学过几天linux、刚从学校毕业的一样,嘲笑般的说我要得太高了,太高了。一个12年毕业搬砖八年的我,不知道应该需要什么感受,想想这比起之前一些谈了一个多小时让回去等消息的也是不错的结果了,至少知道为什么没有后文。