当前位置:网站首页>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挂载成功
边栏推荐
- Orthogonal test method and function diagram method for test case design
- Typescript function details
- List of common bugs in software testing
- Dark horse notes -- Set Series Collection
- Implementation of leetcode two number addition go
- 黑马笔记---Set系列集合
- 黑馬筆記---Set系列集合
- Map in JS (including leetcode examples)
- Precipitate yourself and stay up late to sort out 100 knowledge points of interface testing professional literacy
- Exercise notes 13 (effective letter ectopic words)
猜你喜欢
将光盘中的cda保存到电脑中
[high speed bus] Introduction to jesd204b
Change deepin to Alibaba image source
Rhcsa --- work on the third day
How do I interview for a successful software testing position? If you want to get a high salary, you must see the offer
Virtual machine installation deepin system
The El cascader echo only selects the questions that are not displayed
Online incremental migration of DM database
Save the CDA from the disc to the computer
Fabric.js 激活输入框
随机推荐
Fabric.js 激活输入框
Case sharing | intelligent Western Airport
How do I interview for a successful software testing position? If you want to get a high salary, you must see the offer
LM09丨费雪逆变换反转网格策略
Go implements leetcode rotation array
paddle: ValueError:quality setting only supported for ‘jpeg‘ compression
Application of intelligent robot in agricultural ecology
Mathematical knowledge -- understanding and examples of fast power
DMA Porter
Use of typescript classes
CubeMx DMA笔记
Hcip day 17
数学问题(数论)试除法做质数的判断、分解质因数,筛质数
Global and Chinese market of impact roll 2022-2028: Research Report on technology, participants, trends, market size and share
農業生態領域智能機器人的應用
数学知识(欧拉函数)
2022 Alibaba global mathematics competition, question 4, huhushengwei (blind box problem, truck problem) solution ideas
10 minute quick start UI automation ----- puppeter
Differential identities (help find mean, variance, and other moments)
Pyflink writes MySQL examples with JDBC