当前位置:网站首页>LS1046nfs挂载文件系统
LS1046nfs挂载文件系统
2022-07-02 05:08:00 【MHai】
对于嵌入式Linux开发,通过NFS挂载根文件系统,根文件系统无需下载到FLASH(FLASH还需要先擦除再写入),可以直接保存在Linux主机,而且在Linux开发的驱动程序也无需下载到Linux开发板的FLASH,这使得开发十分方便快捷,下面记录了通过NFS挂载根文件系统的过程。
linux虚拟机上的修改:
1)打开/etc/exports,编辑里面的内容为
/home/nfs *(rw,sync,insecure,no_root_squash,no_all_squash,no_subtree_check)
2)重新开启nfs
/etc/init.d/nfs-kernel-server restart
3)在/home/nsf放入文件系统
4)修改ls1046ardb_boot.scr文件
输入boot命令启动内核的过程中,设备会额外执行一个启动脚本:/boot/ls1046ardb_boot.scr
该脚本位于开发板/dev/mmcblk0p2中的/boot目录下,该脚本在执行过程中会重写bootargs环境变量,这样导致之前用户自己设置的bootargs会被覆盖掉,系统将不能从用户自定义的位置去挂载根文件系统。
ls1046ardb_boot.scr是一个二进制的程序,其中:
源文件位于:flexbuild/configs/board/ls1046ardb/manifest
编译生成的.scr文件位于:flexbuild/build/firmware/u-boot/ls1046ardb/ls1046ardb_boot.scr
编译命令为:flex-builder -i mkdistroscr -a arm64 -m ls1046ardb
其中源文件mainfest中与启动设置bootargs相关的是:
setenv bootargs console=ttyS0,115200 earlycon=uart8250,mmio,0x21c0500 root=PARTUUID=$partuuid3
rw rootwait board_name=$board_name serdes1=$serdes1 $othbootargs;
将上述语句中的setenv bootargs删除,然后重新编译生成.scr程序,并将其更新到开发板emmc的分区2(设备为:/dev/mmcblk0p2)的boot目录下。这样以后我们在uboot中设置的命令就不会被重写了。
5)在开发板u-boot阶段设置bootargs环境变量
=>setenv bootargs 'console=ttyS0,115200 earlycon=uart8250,mmio,0x21c0500 root
fstype=nfsroot root=/dev/nfs nfsroot=192.168.8.10:/home/nfs,proto=tcp,nfsvers=3,nolock
ip=192.168.8.46:192.168.8.10:192.168.8.1:255.255.255.0::eth1:off
board_name=$board_name serdes1=$serdes1 $othbootargs'
=>saveenv
192.168.8.10为ubuntu服务器ip,192.168.8.46为开发板ip,保证两ip在同一网段可ping通即可,在uboot阶段默认使用的网口是fm1-mac3,在此阶段该网口名为eth1,此处不可写为fm1-mac3。
重新启动后可实现nfs挂载根文件系统
在/home/nfs中创建aaa文件夹
可以看到开发板根目录出现了aaa文件夹,nfs挂载成功
边栏推荐
- 7.1 Résumé du concours de simulation
- go实现leetcode旋转数组
- Super detailed pycharm tutorial
- 4. Flask cooperates with a tag to link internal routes
- Application of intelligent robot in agricultural ecology
- Pytest learning ----- pytest assertion of interface automation testing
- Briefly introduce chown command
- How do I interview for a successful software testing position? If you want to get a high salary, you must see the offer
- 2022阿里巴巴全球数学竞赛 第4题 虎虎生威(盲盒问题、集卡问题)解决思路
- Global and Chinese market of cell culture freezers 2022-2028: Research Report on technology, participants, trends, market size and share
猜你喜欢

Virtual machine installation deepin system

Rhcsa --- work on the third day

Summary of database problems

黑馬筆記---Set系列集合

Here comes the chicken soup! Keep this quick guide for data analysts

2022阿里巴巴全球数学竞赛 第4题 虎虎生威(盲盒问题、集卡问题)解决思路

Using Kube bench and Kube hunter to evaluate the risk of kubernetes cluster

函数栈帧的创建和销毁

创新永不止步——nVisual网络可视化平台针对Excel导入的创新历程

Save the CDA from the disc to the computer
随机推荐
Creation and destruction of function stack frames
2022-003arts: recursive routine of binary tree
7.1 simulation summary
【ClickHouse】How to create index for Map Type Column or one key of it?
Change deepin to Alibaba image source
Cultivate primary and secondary school students' love for educational robots
国产全中文-自动化测试软件Apifox
Hcip day 17
Exercise notes 13 (effective letter ectopic words)
Orthogonal test method and function diagram method for test case design
Video multiple effects production, fade in effect and border background are added at the same time
Use of typescript classes
No logic is executed after the El form is validated successfully
Fabric.js 居中元素
Mysql重点难题(2)汇总
Domestic all Chinese automatic test software apifox
奠定少儿编程成为基础学科的原理
paddle: ValueError:quality setting only supported for ‘jpeg‘ compression
el-cascader回显只选中不显示的问题
Essence and physical meaning of convolution (deep and brief understanding)