imx6ul+nfs挂载

一、先在PC端搭建NFS服务器
sudo apt-get   install   nfs-kernel-server
二、设置共享目录
vim /etc/exporrts
在后面添加路径,下面是我的目录:
/work/nfs/imx6ul/rootfs   *(rw,sync,no_root_squash)
三、重启nfs
service nfs-server restart

四、把出厂镜像的rootfs拷贝到虚拟机中,并解压到/work/nfs/imx6ul/rootfs目录下
tar -jxf rootfs_tqimx6ul_CoreB_v1.0.tar.bz2 -C ./rootfs
五、设置uboot,nfs启动参数
下面是我的设置步骤:
#####   TQ-IMX6UL U-boot MENU    #####
          [SDCARD MODE]
###################################

[1] Download u-boot.bin to Nand Flash
[2] Download Logo image(logo.bin) to Nand Flash
[3] Download Linux Kernel (zImage.bin) to Nand Flash
[4] Download Device tree blob(*.dtb)
[5] Download UBIFS image (root.ubifs) to Nand Flash
[6] Download YAFFS image (root.yaffs2) to Nand Flash
[7] Download all (uboot,kernel,dtb,rootfs)
[8] Boot the system
[9] Format the Nand Flash
[0] Set the boot parameters
[n] Enter TFTP download mode menu
[r] Restart u-boot
[a] test kernel and dtb
[q] Return console
[x] read uboot to sdcard
Please press a key to continue :0

#####   TQ-IMX6UL U-boot MENU    #####
          [SET PARAMS]
###################################

[1] Set NFS boot parameter
[2] Set YAffS boot parameter Standard Linux
[3] Set UBIfs boot parameter Standard Linux
[4] Set MMC boot parameter Standard Linux
[5] Set Download Image name
[6] Set TFTP parameters(serverip,ipaddr...)
[s] Save the parameters to Nand Flash
[c] Choice lcd type
[e] reset default environment variables
[r] Restart u - boot
[q] Return Main menu
Please press a key to continue :1
Enter the NFS Server(PC) IP address: (192.168.1.146)主要设置这个

Enter the IP address: (192.168.1.40)

Enter the NFS Gateway IP address: (192.168.1.2)

Enter the Net Mask: (255.255.255.0)

Enter NFS directory: (/work/nfs/imx6ul/rootfs)还有这个

Save parameters?(y/n)
y
六、重启内核
1、重sd卡启动:
前提,内核文件和dtb文件已经拷贝到分区1
2、重nand启动:
前提,内核文件和dtb文件已经烧写到nand中

挂载成功的信息:
  #0: wm8960-audio
VFS: Mounted root (nfs filesystem) readonly on device 0:14.
devtmpfs: mounted
Freeing unused kernel memory: 324K (80ae7000 - 80b38000)
Starting logging: OK

挂载成功,但是没有运行成功,卡死,出现如下问题:
nfs: server IP地址 not responding, still trying

解决:
更改文件系统中etc/profile.d/embedsky_set.sh文件
    #network config
    mode=2  #0----dhcp 1----static ip




你可能感兴趣的:(linux学习过程)