Quantcast
Channel: Linux Device Hacking
Viewing all articles
Browse latest Browse all 3178

Use uEnv.txt for Testing (19 replies)

$
0
0
My Pogo server have run on the NFS for more than 1 year, and I never worry about the lifespan of the SD card. An old IDE hard disk is attached to the Openwrt router by USB 2.0 and provide a stable rootfs for the Pogo.
Several months ago I got a new ASUS-merlin router, I am going to move the rootfs to the new one. This time, I'll try using uEnv.txt to test the NFS booting.

I put all tsunulukai's envs in uEnv.txt
cat /boot/uEnv.txt
net_dhcp_c=1
net_dhcp_s=1
net_c_ipaddr=
net_c_netmask=
net_c_gatewayip=
net_nfs_path=/srv/nfs/hosts/dockstar
net_nfs_dtb=boot/dts/kirkwood-dockstar.dtb
net_nfs_initrd=boot/uInitrd
net_nfs_kernel=boot/uImage
console=ttyS0,115200
autoload=no
net_check_dhcp_c=if test $net_dhcp_c -eq 1 ; then run net_set_c_ip_dhcp; else run net_set_c_ip_stat; fi;echo ** IP Address:  $ipaddr; echo ** Subnet Mask: $netmask; echo ** Def Gateway: $gatewayip
net_set_c_ip_dhcp=dhcp; echo; echo ** Getting IP Settings by DHCP (net_dhcp_c = 1):
net_set_c_ip_stat=setenv ipaddr $net_c_ipaddr; setenv netmask $net_c_netmask; setenv gatewayip $net_c_gatewayip; echo; echo ** Using static IP Settings (net_dhcp_c = 0):
net_check_dhcp_s=if test $net_dhcp_s -eq 1 && test $net_dhcp_c -eq 1 ; then run net_set_s_ip_dhcp; else run net_set_s_ip_stat; fi; echo ** NFS Boot Server: $net_nfs_server; echo
net_set_s_ip_dhcp=setenv net_nfs_server $serverip;echo; echo ** Getting NFS Boot Server by DHCP (net_dhcp_s and net_dhcp_c = 1):
net_set_s_ip_stat=echo; echo ** Using static NFS Boot Server (net_dhcp_s or net_dhcp_c = 0) :
net_load_dtb=echo NFS loading DTB     :$net_nfs_server:$net_nfs_path/$net_nfs_dtb ...   ; nfs $load_dtb_addr    $net_nfs_server:$net_nfs_path/$net_nfs_dtb; echo
net_load_initrd=echo NFS loading uInitrd :$net_nfs_server:$net_nfs_path/$net_nfs_initrd ...; nfs $load_initrd_addr $net_nfs_server:$net_nfs_path/$net_nfs_initrd; echo
net_load_uimage=echo NFS loading uImage  :$net_nfs_server:$net_nfs_path/$net_nfs_kernel ...; nfs $load_uimage_addr $net_nfs_server:$net_nfs_path/$net_nfs_kernel; echo
net_bootcmd=run net_check_dhcp_c; run net_check_dhcp_s; run net_set_bootargs; run net_bootcmd_exec
net_set_bootargs=setenv serverip $net_nfs_server; setenv bootargs console=$console root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=$net_nfs_server:$net_nfs_path/,rsize=32768,wsize=32768,hard,intr,udp,v3 ip=$ipaddr:$net_nfs_server:$gatewayip:$netmask:dockstar:eth0:off $mtdparts $custom_params; echo ** Kernel Boot Arguments:; echo ** $bootargs; echo
net_bootcmd_exec=run net_load_uimage; if run net_load_initrd; then if run net_load_dtb; then bootm $load_uimage_addr $load_initrd_addr $load_dtb_addr; else bootm $load_uimage_addr $load_initrd_addr; fi; else if run load_dtb; then bootm $load_uimage_addr - $load_dtb_addr; else bootm $load_uimage_addr; fi; fi

In netconsole:
run bootcmd_uenv

The envs are successfully imported
loading envs from mmc 0 ...
2346 bytes read in 15 ms (152.3 KiB/s)
importing envs ...

Viewing all articles
Browse latest Browse all 3178

Trending Articles