Ubuntu20.04搭建嵌入式linux网络加载内核、设备树和根文件系统

文章目录

Ubuntu20.04搭建嵌入式linux网络加载内核、设备树和根文件系统

TFTP服务搭建

shell 复制代码
sudo apt install tftpd-hpa
sudo mkdir /srv/tftp
sudo chmod -R 755 /srv/tftp


sudo vim /etc/default/tftpd-hpa  #修改配置文件
TFTPROOT="/srv/tftp"


sudo systemctl restart tftpd-hpa

测试

shell 复制代码
tftp localhost
tftp> get filename
tftp> quit
shell 复制代码
tftp localhost
tftp> put filename
tftp> quit

NFS服务搭建

shell 复制代码
sudo apt install nfs-kernel-server rpcbind
sudo mkdir /srv/nfs

sudo vim /etc/exports  #修改配置文件
/srv/nfs *(rw,sync,no_root_squash)


sudo /etc/init.d/nfs-kernel-server restart

测试

shell 复制代码
sudo mount -t nfs 192.168.8.9:/srv/nfs /mnt/nfs

uboot配置

shell 复制代码
setenv bootcmd 'tftp 80800000 zImage; tftp 83000000 xx.dtb;bootz 80800000 - 83000000'
setenv bootargs 'console=tty1 console=ttymxc0,115200 root=/dev/nfs nfsroot=192.168.8.8:/srv/nfs,proto=tcp rw ip=192.168.8.9:192.168.8.8:192.168.8.1:255.255.255.0::eth0:off'
setenv ethaddr b8:ae:1d:01:00:00
setenv gatewayip 192.168.8.1
setenv netmask 255.255.255.0
setenv serverip 192.168.8.8
setenv ipaddr 192.168.8.9
saveenv

reset

外链图片转存中...(img-KgXf3w9o-1720489002326)\]# Ubuntu20.04搭建嵌入式linux网络加载内核、设备树和根文件系统 ## TFTP服务搭建 ```shell sudo apt install tftpd-hpa sudo mkdir /srv/tftp sudo chmod -R 755 /srv/tftp sudo vim /etc/default/tftpd-hpa #修改配置文件 TFTPROOT="/srv/tftp" sudo systemctl restart tftpd-hpa ``` ### 测试 ```shell tftp localhost tftp> get filename tftp> quit ``` ```shell tftp localhost tftp> put filename tftp> quit ``` ## NFS服务搭建 ```shell sudo apt install nfs-kernel-server rpcbind sudo mkdir /srv/nfs sudo vim /etc/exports #修改配置文件 /srv/nfs *(rw,sync,no_root_squash) sudo /etc/init.d/nfs-kernel-server restart ``` ### 测试 ```shell sudo mount -t nfs 192.168.8.9:/srv/nfs /mnt/nfs ``` ## U-BOOT配置 ```shell setenv bootcmd 'tftp 80800000 zImage; tftp 83000000 xx.dtb;bootz 80800000 - 83000000' setenv bootargs 'console=tty1 console=ttymxc0,115200 root=/dev/nfs nfsroot=192.168.8.8:/srv/nfs,proto=tcp rw ip=192.168.8.9:192.168.8.8:192.168.8.1:255.255.255.0::eth0:off' setenv ethaddr b8:ae:1d:01:00:00 setenv gatewayip 192.168.8.1 setenv netmask 255.255.255.0 setenv serverip 192.168.8.8 setenv ipaddr 192.168.8.9 saveenv reset ``` ![image-20240709091001341](https://img-blog.csdnimg.cn/img_convert/937e556b03638df82f23aea47b4ad9a3.png)

相关推荐
wanhengidc1 小时前
当云手机出现卡顿怎么办?
运维·服务器·安全·智能手机
七七&5566 小时前
2024年08月13日 Go生态洞察:Go 1.23 发布与全面深度解读
开发语言·网络·golang
寻道模式6 小时前
【运维心得】三步10分钟拆装笔记本键盘
运维·计算机外设·笔记本
元清加油6 小时前
【Golang】:函数和包
服务器·开发语言·网络·后端·网络协议·golang
炫友呀7 小时前
Centos 更新/修改宝塔版本
linux·运维·centos
闻道且行之7 小时前
嵌入式|VNC实现开发板远程Debian桌面
运维·debian·嵌入式
向日葵.8 小时前
fastdds.ignore_local_endpoints 属性
服务器·网络·php
IT成长日记8 小时前
【自动化运维神器Ansible】Playbook中的when条件判断:精细化控制任务执行
运维·自动化·ansible·playbook·when·条件判断
athink_cn10 小时前
HTTP/2新型漏洞“MadeYouReset“曝光:可发动大规模DoS攻击
网络·网络协议·安全·http·网络安全
zzc92110 小时前
TLSv1.2协议与TCP/UDP协议传输数据内容差异
网络·测试工具·安全·wireshark·ssl·密钥·tlsv1.2