当前位置:网站首页>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挂载成功
边栏推荐
- 4. Flask cooperates with a tag to link internal routes
- Precipitate yourself and stay up late to sort out 100 knowledge points of interface testing professional literacy
- Mathematical knowledge (Euler function)
- Fabric.js 激活输入框
- C# 图片显示占用问题
- The El cascader echo only selects the questions that are not displayed
- 解析少儿编程中的动手搭建教程
- [Yu Yue education] autumn 2021 reference materials of Tongji University
- Fabric.js 背景不受视口变换影响
- Pycharm breakpoint management: temporarily cancel some breakpoints + run directly to a line
猜你喜欢

Go Chan's underlying principles

Knowledge arrangement about steam Education

Getting started with pytest ----- confitest Application of PY

Rhcsa --- work on the fourth day

ansible安装与使用
![[bus interface] Axi interface](/img/ee/95ade7811ec2c37fb67a77f0b6ae2a.jpg)
[bus interface] Axi interface

Change deepin to Alibaba image source

Hcip day 17

Virtual machine installation deepin system
![[Yu Yue education] autumn 2021 reference materials of Tongji University](/img/50/5136359b89a5d047fe648637643ad0.jpg)
[Yu Yue education] autumn 2021 reference materials of Tongji University
随机推荐
Lay the foundation for children's programming to become a basic discipline
Global and Chinese market of hydrocyclone desander 2022-2028: Research Report on technology, participants, trends, market size and share
Solution of DM database unable to open graphical interface
Pycharm breakpoint management: temporarily cancel some breakpoints + run directly to a line
Mathematical knowledge -- understanding and examples of fast power
Getting started with pytest ----- confitest Application of PY
js面试收藏试题1
Analyze the space occupied by the table according to segments, clusters and pages
从数组中找出和为目标的下标
Line by line explanation of yolox source code of anchor free series network (7) -- obj in head_ loss、Cls_ Loss and reg_ Calculation and reverse transmission of loss I
How to make an RPM file
paddle: ValueError:quality setting only supported for ‘jpeg‘ compression
C# 基于MQTTNet的服务端与客户端通信案例
Go GC garbage collection notes (three color mark)
go实现leetcode旋转数组
Exercise notes 13 (effective letter ectopic words)
Feign realizes file uploading and downloading
2022 Alibaba global mathematics competition, question 4, huhushengwei (blind box problem, truck problem) solution ideas
Change deepin to Alibaba image source
How do I interview for a successful software testing position? If you want to get a high salary, you must see the offer