先制作好启动tf卡,之后为了快速调试,可以通过nfs替换内核与设备树,无需重新制作启动tf卡。
开发板需要连接网线,uboot默认的网卡驱动在orangepi one上是可以使用的。
下面是nfs启动的步骤:
1、启动开发版,观测log,中断uboot的autoboot

2、在启动参数中设置根文件系统的路径和类型
setenv bootargs 'root=/dev/mmcblk0p2 rw rootfstype=ext4' 
根文件系统已事先保存在sd卡中
3. ubuntu主机需要开启nfs服务
安装服务:
sudo apt-get install nfs-kernel-server rpcbind 
设置nfs服务使用的文件夹,在/etc/exports文件中添加以下内容:
 /home/mypc/linux/nfs *(rw,sync,no_root_squash)
 
重启nfs服务
sudo /etc/init.d/nfs-kernel-server restart 
4、将zImage和dtb拷贝到nfs使用的路径 /home/mypc/linux/nfs下
5、在uboot中设置开发版的ip地址
=> setenv ipaddr 192.168.31.120   
6、ping nfs服务所在的主机,查看能否ping通
=> ping 192.168.31.124                                                          
Using ethernet@1c30000 device                                                   
host 192.168.31.124 is alive   
能ping通则可以通过nfs将服务器上的zImage和dtb拷贝到RAM中
7、通过nfs命令将zImage和dtb下载到开发板RAM中的指定地址中
将zImage下载到0x42000000地址处
=> nfs 0x42000000 192.168.31.124:/home/liby/linux/nfs/zImage                    
Using ethernet@1c30000 device                                                   
File transfer via NFS from server 192.168.31.124; our IP address is 192.168.31.0
Filename '/home/liby/linux/nfs/zImage'.                                         
Load address: 0x42000000                                                        
Loading: ########################################################T #########    
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         #################################################################      
         ##################################                                     
done                                                                            
Bytes transferred = 4832696 (49bdb8 hex)   
将dtb下载到0x43000000地址处
=> nfs 0x43000000 192.168.31.124:/home/liby/linux/nfs/sun8i-h3-orangepi-one.dtb 
Using ethernet@1c30000 device                                                   
File transfer via NFS from server 192.168.31.124; our IP address is 192.168.31.0
Filename '/home/liby/linux/nfs/sun8i-h3-orangepi-one.dtb'.                      
Load address: 0x43000000                                                        
Loading: #####                                                                  
done                                                                            
Bytes transferred = 20744 (5108 hex)  
8、启动内核
=> bootz 0x42000000 - 0x43000000                                                
## Flattened Device Tree blob at 43000000                                       
   Booting using the fdt blob at 0x43000000                                     
EHCI failed to shut down host controller.                                       
   Loading Device Tree to 49ff7000, end 49fff107 ... OK                         
                                                                                
Starting kernel ...                                                             
                                                                                
[    0.000000] Booting Linux on physical CPU 0x0  
... 
9. 登陆
Welcome to Buildroot                                                            
orangepipc login: root                                                          
Password:                                                                       
# ls                                                                            
# pwd                                                                           
/root  
                

















