当前位置:网站首页>龙芯2K1000使用nfs挂载文件系统进行使用
龙芯2K1000使用nfs挂载文件系统进行使用
2022-08-02 03:30:00 【跑不了的你】
龙芯2K1000使用nfs挂载文件系统进行使用
- 在使用龙芯2K1000板子进行开发时,最方便的方式就是通过网络挂载文件系统NFS进行程序开发,这样能大大提高开发效率。
准备:
在龙芯2K上使用nfs挂载启动,首先需要主机上具有以下三个服务:
- 用于load记载linux内核的tftp服务。
- 用于给龙芯机器分配IP地址的DHCP服务。
- 最后存放用于启动挂载的文件系统的nfs服务。
龙芯内核配置:
- 1、一个支持从nfsroot挂载文件系统的可以运行在龙芯机器上的内核。
关于如何编译内核,如果交叉编译内核,这里不多说,大家参考一下这里就行:
http://dev.lemote.com/code/linux_loongson
为了能够支持nfsroot,除了基本的网络支持外,下面的几个选项是需要的:
要能够自动获取ip地址,所以要求你所在的网络有一个dhcp服务器,没有的话,自己配置一个吧(后面将介绍)。
Networking ---> Networking support
Networking options ---> Packet socket
Unix domain sockets
TCP/IP networking
IP: kernel level autoconfiguration
IP: DHCP support
要支持nfsroot,
File systems --->
Network File Systems --->
<*> NFS client support
Root file system on NFS
好了,可以编译内核了,关于最新的内核源代码,可以从这里下载。
-dev version: http://dev.lemote.com/cgit/rt4ls … oongson-dev-to-ralf
-stable version: http://dev.lemote.com/cgit/rt4ls.git/log/?h=to-ralf
主机服务配置:
TFTP服务配置
- 安装服务包
$ sudo apt-get install tftpd-hpa
- 启动服务,把/tftproot当tftp服务的主目录(不要想着其他方法,这个最easy不过)
$ sudo mkdir /tftproot
$ sudo in.tftpd -s -l /tftproot
启动完以后,把内核复制到/tftproot下就行了。
DHCP服务配置
如果你所在网络有这个服务,就不要再配置了,否则自己配置一个。
$ sudo apt-get install dhcp3-server
$ vim /etc/dhcpd.conf
ddns-update-style none;
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.121 192.168.1.121;
}
$ /usr/sbin/dhcpd
通过上面的配置,可以给你的机器分配一个192.168.1.121的地址,如果想要其他地址,可以修改这个配置。
NFS服务配置
这个也是非常easy了。
$ sudo apt-get install nfs-kernel-server
$ sudo apt-get install nfs-common
$ vim /etc/exports
/opt/loongos *(rw,sync,no_root_squash)
$ /etc/init.d/portmap restart
$ /etc/init.d/nfs-kernel-server start
//验证是否生效
$ showmount -e
$ mkdir /opt/loongos -p
$ chmod 777 /opt/loongos
启动步骤:
- 开机,按下DEL键,直到出现PMON>提示行。
PMON> ifaddr syn0 192.168.10.139 // 配置一个临时的ip地址,这个地址只在pmon中有效,如果想配置一个持久的,那么请用set ifconfig rtl0:192.168.1.121
PMON> load tftp://192.168.10.94/vmlinuz_usenfs // 装载那个支持nfsroot的内核
PMON> g root=/dev/nfs rw nfsroot=192.168.10.94:/opt/loongos ip=192.168.10.139:192.168.10.94:192.168.10.1:255.255.255.0::syn0:off console=tty console=ttyS0,115200 no_auto_cmd
- 文件系统中dev目录下的console节点和null节点不能创建,所以我去dev目录下检查了一下,发现居然没有这两个节点,因此我自己手动加入这两个节点:
mknode console c 5 1
mknode null c 1 3
如果没有问题,应该可以进入到一个基本的文件系统里头了。
关于ip的各个字段的含义:
ip=<client-ip>:<nfssever-ip>:<gateway-ip>:<netmask>:<host-name>:<device>:<auto-conf>
边栏推荐
- 【Popular Science Post】Detailed explanation of MDIO interface
- HDMI转MIPI CSI东芝转换芯片-TC358743XBG/TC358749XBG
- openmv学习 2022.5.9
- 如何快速搭建属于自己的物联网平台?
- uniCloud address book combat
- 单火线开关设计详解
- OneNET Studio与IoT Studio对比分析
- 【水位传感器与 Arduino 连接测量水位】
- [Arduino connected to GPS module (NEO-6M) to read positioning data]
- 移动云物联网预研及阿里云开发对比分析
猜你喜欢

R语言 —— 多元线性回归

GM8775C MIPI转LVDS调试资料分享

【Arduino 连接GP2Y1014AU0F 灰尘传感器】

野火ISO-V2学习

Case | industrial iot solutions, steel mills high-performance security for wisdom

Anaconda(Jupyter)里发现不能识别自己的GPU该怎么办?

【科普贴】I2C通讯协议详解——偏软件分析和逻辑分析仪实例分析

Type c PD 电路设计

【心率传感器与Arduino连接读取心率数据】

SyntaxError: unexpected character after line continuation character
随机推荐
openmv学习 2022.5.9
uniCloud通讯录实战
【plang 1.4.5】编写坦克(双人)游戏脚本
[Arduino connects the clock module to display the time on LCD1602]
GM7150,振芯科技,视频解码器,CVBS转BT656/601,QFN32,替换TVP5150/CJC5150
【Popular Science Post】UART Interface Communication Protocol
Personal image bed construction based on Alibaba Cloud OSS+PicGo
电子密码锁_毕设‘指导’
MOS管开关原理及应用详解
bluez5.50+pulseaudio实现蓝牙音响音频播放
基于阿里云OSS+PicGo的个人图床搭建
【霍尔效应传感器模块与 Arduino】
阿里云华为云对比分析
博达工业云与阿里云对比
【科普贴】UART接口通讯协议
无源域适应(SFDA)方向的领域探究和论文复现(第一部分)
sacalatest AnyFunSuite:no implicits found for parameter pos
【Arduino 连接GP2Y1014AU0F 灰尘传感器】
单火线开关设计详解
How to quickly build your own IoT platform?