Welcome! Log In Create A New Profile

Advanced

What is the correct "bootcmd" value for NFS with the new uBoot?

Posted by SiliCAT 
What is the correct "bootcmd" value for NFS with the new uBoot?
November 05, 2016 11:23PM
With the new uBoot, the default env var
bootcmd=run bootcmd_uenv; run scan_disk; run set_bootargs; run bootcmd_exec

According to some tutorial about NFS boot,
Bootcmd=usb start; run force_rescue_bootcmd; run ubifs_bootcmd; run usb_bootcmd; usb stop; run net_bootcmd; run rescue_bootcmd; run pogo_bootcmd; reset
or
bootcmd=run bootcmd_usb; run bootcmd_mmc; run bootcmd_sata; run net_bootcmd; run bootcmd_pogo; reset

I’ve read "Booting process in multiple drives configuration", but still I have no idea how to set the bootcmd to support NFS and other devices in the load chain for the new uBoot.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 06, 2016 03:56PM
SiliCAT,

> I’ve read "Booting process in multiple drives
> configuration", but still I have no idea how to
> set the bootcmd to support NFS and other devices
> in the load chain for the new uBoot.

Did you set up as describe in the Wiki thread:

Quote

NFS

NFS - HowTo set up NFS shares (and boot NFS rootfs)

If you did, post your envs here and I'll help.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 07, 2016 08:39AM
Hi bodhi,

Thanks a lot.
Very appreciate for your help. I'm going to test my envs recently when I get some spare time.
I'll update my test later.



Edited 1 time(s). Last edit at 11/07/2016 08:42AM by SiliCAT.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 08, 2016 09:05PM
TEST1: Old uBoot, Old rootfs
Failed.

NFS Server: OpenWrt Chaos Calmer 15.05.1 @ TP-Link TL-WR1043N/ND v2
rootfs: 4.2.0-kirkwood-tld-1
NFS Client: U-Boot 2014.07-tld-1 @ Pogoplug V4

Pogov4> run net_bootcmd
BOOTP broadcast 1
DHCP client bound to address 172.16.16.221

** net_dhcp_c = 1 --> Getting IP Settings by DHCP
** IP Address: 172.16.16.221
** Subnet Mask: 255.255.255.0
** Def Gateway: 172.16.16.253

** net_dhcp_s or net_dhcp_c = 0 --> Using static NFS Boot Server
** NFS Boot Server: 172.16.16.101

Using egiga0 device
File transfer via NFS from server 172.16.16.101; our IP address is 172.16.16.221
Filename '/srv/nfs/hosts/PogoplugV4/boot/dts/kirkwood-pogoplug_v4.dtb'.
Load address: 0x1c00000
Loading: *** ERROR: File lookup fail

done
Using egiga0 device
File transfer via NFS from server 172.16.16.101; our IP address is 172.16.16.221
Filename '/srv/nfs/hosts/PogoplugV4/boot/uImage'.
Load address: 0x800000
Loading: *** ERROR: File lookup fail

done

** Kernel Boot Arguments: console=ttyS0,115200 root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=172.16.16.101:/srv/nfs/hosts/PogoplugV4,v3,tcp ip=172.16.16.221:172.16.16.101:172.16.16.253:255.255.255.0:pogoplugv4:eth0:off mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)

Using egiga0 device
File transfer via NFS from server 172.16.16.101; our IP address is 172.16.16.221
Filename '/srv/nfs/hosts/PogoplugV4/boot/uInitrd'.
Load address: 0x1100000
Loading: *** ERROR: File lookup fail

done
Wrong Image Format for bootm command
ERROR: can't get kernel image!

IF use a Debian NFS Server (NOT OpenWRT), THEN pogoplugV4 boots successfully.
Pogov4> run net_bootcmd
BOOTP broadcast 1
DHCP client bound to address 172.16.16.221

** net_dhcp_c = 1 --> Getting IP Settings by DHCP
** IP Address: 172.16.16.221
** Subnet Mask: 255.255.255.0
** Def Gateway: 172.16.16.253

** net_dhcp_s or net_dhcp_c = 0 --> Using static NFS Boot Server
** NFS Boot Server: 172.16.16.101

Using egiga0 device
File transfer via NFS from server 172.16.16.101; our IP address is 172.16.16.221
Filename '/srv/nfs/hosts/PogoplugV4/boot/dts/kirkwood-pogoplug_v4.dtb'.
Load address: 0x1c00000
Loading: ###
done
Bytes transferred = 10246 (2806 hex)
Using egiga0 device
File transfer via NFS from server 172.16.16.101; our IP address is 172.16.16.221
Filename '/srv/nfs/hosts/PogoplugV4/boot/uImage'.
Load address: 0x800000
Loading: #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  ##############################
done
Bytes transferred = 3147200 (3005c0 hex)

** Kernel Boot Arguments: console=ttyS0,115200 root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=172.16.16.101:/srv/nfs/hosts/PogoplugV4,v3,tcp ip=172.16.16.221:172.16.16.101:172.16.16.253:255.255.255.0:pogoplugv4:eth0:off mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)

Using egiga0 device
File transfer via NFS from server 172.16.16.101; our IP address is 172.16.16.221
Filename '/srv/nfs/hosts/PogoplugV4/boot/uInitrd'.
Load address: 0x1100000
Loading: #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #################################################################
  #########
done
Bytes transferred = 6698725 (6636e5 hex)
## Booting kernel from Legacy Image at 00800000 ...
  Image Name: Linux-4.2.0-kirkwood-tld-1
  Created: 2015-11-20 20:12:30 UTC
  Image Type: ARM Linux Kernel Image (uncompressed)
  Data Size: 3147136 Bytes = 3 MiB
  Load Address: 00008000
  Entry Point: 00008000
  Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
  Image Name: initramfs-4.2.0-kirkwood-tld-1
  Created: 2015-11-20 20:12:43 UTC
  Image Type: ARM Linux RAMDisk Image (gzip compressed)
  Data Size: 6698661 Bytes = 6.4 MiB
  Load Address: 00000000
  Entry Point: 00000000
  Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
  Booting using the fdt blob at 0x1c00000
  Loading Kernel Image ... OK
  Loading Ramdisk to 074b5000, end 07b186a5 ... OK
  Loading Device Tree to 074af000, end 074b4805 ... OK
Using machid 0xf78 from environment

Starting kernel ...

The OpenWRT NFS service can be accessed by my laptop.
mount 172.16.16.101:/srv/nfs/hosts/PogoplugV4 /tmp/rootfs/
ls /tmp/rootfs
bin  boot  dev  etc  home  lib  lost+found  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var

Problem:
It looks like the OpenWRT NFS service isn't compatible with the uBoot client?
Is there any way to make them work together?

PS:
OpenWRT NFS server Installation and Configuration
opkg update
opkg install nfs-kernel-server
cat >> /etc/exports
/srv/nfs/hosts/PogoplugV4 172.16.16.0/255.255.255.0(rw,sync,no_root_squash,no_subtree_check)
/etc/init.d/portmap start
/etc/init.d/nfsd start
/etc/init.d/portmap enable
/etc/init.d/nfsd enable
PogoplugV4 envs
net_dhcp_c=1
net_dhcp_s=0
net_nfs_dtb=/boot/dts/kirkwood-pogoplug_v4.dtb
net_nfs_kernel=/boot/uImage
net_nfs_initrd=/boot/uInitrd
autoload=no
net_bootcmd=run net_check_dhcp_c; run net_check_dhcp_s; run net_set_bootargs; run net_boot
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,v3,tcp ip=$ipaddr:$net_nfs_server:$gatewayip:$netmask:pogoplugv4:eth0:off $mtdparts
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 ** net_dhcp_c = 1 --> Getting IP Settings by DHCP
net_set_c_ip_stat=setenv ipaddr $net_c_ipaddr; setenv netmask $net_c_netmask; setenv gatewayip $net_c_gatewayip; echo; echo ** net_dhcp_c = 0 --> Using static IP Settings
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 ** net_dhcp_s and net_dhcp_c = 1 --> Getting NFS Boot Server by DHCP
net_set_s_ip_stat=echo; echo ** net_dhcp_s or net_dhcp_c = 0 --> Using static NFS Boot Server
net_boot=nfs 0x1c00000 ${net_nfs_server}:${net_nfs_path}${net_nfs_dtb}; nfs 0x800000 ${net_nfs_server}:${net_nfs_path}${net_nfs_kernel}; echo; echo ** Kernel Boot Arguments: $bootargs; echo;if nfs 0x1100000 ${net_nfs_server}:${net_nfs_path}${net_nfs_initrd}; then bootm 0x800000 0x1100000 0x1c00000;else bootm 0x800000 - 0x1c00000;fi
net_nfs_server=172.16.16.16
net_nfs_path=/srv/nfs/hosts/PogoplugV4



Edited 3 time(s). Last edit at 11/08/2016 09:20PM by SiliCAT.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 09, 2016 12:30AM
SiliCAT,

You are making it too complicated!

From Wiki thread:

Quote

NFS

NFS - HowTo set up NFS shares (and boot NFS rootfs)

http://forum.doozan.com/read.php?2,28351


Quote

"Section Three" Boot from NFS share

The following link gives the steps necessary to configure your u-boot to boot from the NFS share. Please note though that although it discusses using TFTP in the process, this is not necessary and those steps can be avoided.
Boot your Dockstar/Plug by TFTP/NFS

an example uboot statement kindly provided by the master of u-boot @bodhi is included below for you to amend / modify to match your share description and nfs path

bootcmd_nfs=setenv nfs_server "192.168.0.224"; setenv nfs_path "/srv/nfs/hosts/tldDebian2"; setenv nfs_bootcmd "run nfs_set_bootargs; run nfs_boot"; setenv nfs_ipconfig "192.168.0.229:192.168.0.224:192.168.0.1:255.255.0.0:tldDebian2::off"; setenv nfs_set_bootargs "setenv bootargs console=ttyS0,115200 root=/dev/nfs nfsroot=$nfs_server:$nfs_path,v3 rootfstype=nfs rootwait  ip=$nfs_ipconfig $mtdparts"; setenv nfs_load_uimage "nfs 0x800000 $nfs_server:$nfs_path/boot/uImage"; setenv nfs_load_uinitrd "nfs 0x1100000 $nfs_server:$nfs_path/boot/uInitrd"; setenv nfs_load_dtb "nfs 0x1c00000 $nfs_server:$nfs_path/boot/dts/kirkwood-pogo_e02.dtb"; setenv nfs_bootm "bootm 0x800000 0x1100000 0x1c00000"; setenv nfs_boot "run nfs_load_uimage; run nfs_load_uinitrd; run nfs_load_dtb; run nfs_bootm"; echo "Booting NFS root…"; run nfs_bootcmd

Modify bootcmd_nfs above for OpenWrt :

- take out the uInitrd related stuff.
- adjust the path of uImage and the DTB
- adjust the hostname and IP addresses to conform with your environment.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 11/09/2016 12:32AM by bodhi.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 09, 2016 06:15AM
bodhi Wrote:
-------------------------------------------------------

>
> Modify bootcmd_nfs above for OpenWrt :
>
> - take out the uInitrd related stuff.
> - adjust the path of uImage and the DTB
> - adjust the hostname and IP addresses to conform
> with your environment.


Hi bodhi,

Thanks for your help.

I tried this:
setenv bootcmd_nfs_test 'setenv nfs_server "172.16.16.101"; setenv nfs_path "/srv/nfs/hosts/PogoplugV4"; setenv nfs_bootcmd "run nfs_set_bootargs; run nfs_boot"; setenv nfs_ipconfig "172.16.16.117:172.16.16.101:172.16.16.253:255.255.255.0:PogoplugV4::off"; setenv nfs_set_bootargs "setenv bootargs console=ttyS0,115200 root=/dev/nfs nfsroot=$nfs_server:$nfs_path,v3 rootfstype=nfs rootwait  ip=$nfs_ipconfig $mtdparts"; setenv nfs_load_uimage "nfs 0x800000 $nfs_server:$nfs_path/boot/uImage"; setenv nfs_load_dtb "nfs 0x1c00000 $nfs_server:$nfs_path/boot/dts/kirkwood-pogoplug_v4.dtb"; setenv nfs_bootm "bootm 0x800000 0x1100000 0x1c00000"; setenv nfs_boot "run nfs_load_uimage; run nfs_load_dtb; run nfs_bootm"; echo "Booting NFS root…"; run nfs_bootcmd'

Pogov4> run bootcmd_nfs_test
Booting NFS root…
Using egiga0 device
File transfer via NFS from server 172.16.16.101; our IP address is 172.16.16.117
Filename '/srv/nfs/hosts/PogoplugV4/boot/uImage'.
Load address: 0x800000
Loading: *** ERROR: File lookup fail

done
Using egiga0 device
File transfer via NFS from server 172.16.16.101; our IP address is 172.16.16.117
Filename '/srv/nfs/hosts/PogoplugV4/boot/dts/kirkwood-pogoplug_v4.dtb'.
Load address: 0x1c00000
Loading: *** ERROR: File lookup fail

done
Wrong Image Format for bootm command
ERROR: can't get kernel image!

The ERROR is: File lookup fail

But I'm able to access the file "/srv/nfs/hosts/PogoplugV4/boot/uImage" from my laptop.
It just can not be accessed by the uboot.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 09, 2016 08:43AM
I tried a simple command
 nfs 0x1c00000 172.16.16.101:/tmp/nfs/kirkwood-pogoplug_v4.dtb

It doesn't work.
Using egiga0 device
File transfer via NFS from server 172.16.16.101; our IP address is 172.16.16.117
Filename '/tmp/nfs/kirkwood-pogoplug_v4.dtb'.
Load address: 0x1c00000
Loading: *** ERROR: File lookup fail

I can get the remote nfs file 172.16.16.101:/tmp/nfs/kirkwood-pogoplug_v4.dtb from my laptop.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 09, 2016 04:52PM
Make sure you are running version 3 or version 2 NFS for this. Our u-boot actually run version 2, but it can access version 3 NFS (the NFS server version 3 can provide version 2 file system).

/srv/nfs/hosts/PogoplugV4 172.16.16.0/255.255.255.0(rw,sync,no_root_squash,no_subtree_check)

Which version does this installs?

opkg install nfs-kernel-server

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)



Edited 1 time(s). Last edit at 11/09/2016 04:54PM by bodhi.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 09, 2016 05:55PM
root@OpenWrt:~# cat /proc/fs/nfsd/versions
-2 +3

It seems the nfs v2 is disabled.
I'm not very sure.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 09, 2016 06:08PM
>
> It seems the nfs v2 is disabled.

That would be a really bad decision. Hope you can set it. If it is not controlled by users, hope the LEDE developers has correct it.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 10, 2016 12:31PM
I have to use tftp to load the uImage
setenv net_boot 'tftp 0x1c00000 $net_tftp_dtb; tftp 0x800000 $net_tftp_kernel; echo; echo ** Kernel Boot Arguments: $bootargs; echo;if tftp 0x1100000 $net_tftp_initrd; then bootm 0x800000 0x1100000 0x1c00000;else bootm 0x800000 - 0x1c00000;fi'

It works.

For the new U-Boot 2016.05, if the uInitrd is loaded, the boot process will break.
If just the uImage and DTB is loaded, the boot process will complete.

What is the disadvantage if the uInitrd is not loaded into the system?
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 10, 2016 01:25PM
SiliCAT Wrote:
-------------------------------------------------------
> I have to use tftp to load the uImage
>
> setenv net_boot 'tftp 0x1c00000 $net_tftp_dtb;
> tftp 0x800000 $net_tftp_kernel; echo; echo **
> Kernel Boot Arguments: $bootargs; echo;if tftp
> 0x1100000 $net_tftp_initrd; then bootm 0x800000
> 0x1100000 0x1c00000;else bootm 0x800000 -
> 0x1c00000;fi'
>
>
> It works.
>
> For the new U-Boot 2016.05, if the uInitrd is
> loaded, the boot process will break.
> If just the uImage and DTB is loaded, the boot
> process will complete.
>
> What is the disadvantage if the uInitrd is
> not loaded into the system?

OpenWrt does not use uInitrd, so booting that uImage is enough. Booting Debian or Arch or any other distro with normal drives, uInitrd is strongly recommended. Even with a bare bone initrd, it's very useful. In some configuration, you must have initrd to make it work.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 10, 2016 02:44PM
bodhi Wrote:
-------------------------------------------------------

>
> OpenWrt does not use uInitrd, so booting that
> uImage is enough. Booting Debian or Arch or any
> other distro with normal drives, uInitrd is
> strongly recommended. Even with a bare bone
> initrd, it's very useful. In some configuration,
> you must have initrd to make it work.

Hi bodhi,

I'm booting the Kernel 4.8.3 Kirkwood Debian. OpenWRT is just a Router which serves the files as a remote NFS server.
I don't know why the Debian cannot boot successfully when I use
bootm 0x800000 0x1100000 0x1c00000
0x800000 - uImage
0x1100000 - uInitrd
0x1c00000 - DTB

The bootargs is
bootargs=console= root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=172.16.16.250:/srv/nfs/hosts/PogoplugV4,v3,tcp ip=172.16.16.220:172.16.16.250:172.16.16.250:255.255.255.0:pogoplugv4:eth0:off mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)


Could you give me some advice about how to make the uInitrd work?



Edited 1 time(s). Last edit at 11/10/2016 04:13PM by SiliCAT.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 11, 2016 01:23AM
SiliCAT,

Post the entire serial boot log so I can see why uInitrd is not working.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 15, 2016 04:32PM
Hi bodhi,

My entire serial boot log is:
U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:41:47 -0700)
Pogoplug V4

SoC:   Kirkwood 88F6192_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   kwsdio: 0
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Hit any key to stop autoboot:  0
Pogov4> run net_bootcmd
BOOTP broadcast 1
DHCP client bound to address 192.168.101.120 (4 ms)

** net_dhcp_c = 1 --> Getting IP Settings by DHCP
** IP Address: 192.168.101.120
** Subnet Mask: 255.255.255.0
** Def Gateway: 192.168.101.101

** net_dhcp_s or net_dhcp_c = 0 --> Using static TFTP and NFS Boot Server
** TFTP Boot Server: 192.168.101.101
** NFS Boot Server: 192.168.101.101

Using egiga0 device
TFTP from server 192.168.101.101; our IP address is 192.168.101.120
Filename 'dts/kirkwood-pogoplug_v4.dtb'.
Load address: 0x1c00000
Loading: #
         31.3 KiB/s
done
Bytes transferred = 10246 (2806 hex)
Using egiga0 device
TFTP from server 192.168.101.101; our IP address is 192.168.101.120
Filename 'uImage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         ####################
         4 MiB/s
done
Bytes transferred = 3154896 (3023d0 hex)

** Kernel Boot Arguments: console= root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=192.168.101.101:/srv/nfs/hosts/PogoplugV4,v3,tcp ip=192.168.101.120:192.168.101.101:192.168.101.101:255.255.255.0:pogoplugv4:eth0:off mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)

Using egiga0 device
TFTP from server 192.168.101.101; our IP address is 192.168.101.120
Filename 'uInitrd'.
Load address: 0x1100000
Loading: #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         #################################################################
         ###################################
         4 MiB/s
done
Bytes transferred = 7179935 (6d8e9f hex)
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.4.0-kirkwood-tld-1
   Created:      2016-02-19   5:55:25 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3154832 Bytes = 3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Loading init Ramdisk from Legacy Image at 01100000 ...
   Image Name:   initramfs-4.4.0-kirkwood-tld-1
   Created:      2016-02-19   7:33:04 UTC
   Image Type:   ARM Linux RAMDisk Image (gzip compressed)
   Data Size:    7179871 Bytes = 6.8 MiB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000
   Loading Kernel Image ... OK
   Loading Ramdisk to 07435000, end 07b0de5f ... OK
   Loading Device Tree to 0742f000, end 07434805 ... OK
Using machid 0xf78 from environment

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

The process stuck there.

If I downgrade the uboot to uBoot 2014, with the same nfs rootfs and envs, I can boot the debian system successfully.



Edited 1 time(s). Last edit at 11/15/2016 04:33PM by SiliCAT.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 15, 2016 04:44PM
Meanwhile, the boot process can complete without uInitrd.

U-Boot 2016.05-tld-1 (Jun 12 2016 - 13:41:47 -0700)
Pogoplug V4

SoC:   Kirkwood 88F6192_A1
DRAM:  128 MiB
WARNING: Caches not enabled
NAND:  128 MiB
MMC:   kwsdio: 0
In:    serial
Out:   serial
Err:   serial
Net:   egiga0
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Using egiga0 device

ARP Retry count exceeded; starting again
ping failed; host 172.16.16.118 is not alive
Hit any key to stop autoboot:  0
Pogov4> run net_bootcmd
BOOTP broadcast 1
DHCP client bound to address 192.168.101.120 (4 ms)

** net_dhcp_c = 1 --> Getting IP Settings by DHCP
** IP Address: 192.168.101.120
** Subnet Mask: 255.255.255.0
** Def Gateway: 192.168.101.101

** net_dhcp_s or net_dhcp_c = 0 --> Using static TFTP and NFS Boot Server
** TFTP Boot Server: 192.168.101.101
** NFS Boot Server: 192.168.101.101

Using egiga0 device
TFTP from server 192.168.101.101; our IP address is 192.168.101.120
Filename 'dts/kirkwood-pogoplug_v4.dtb'.
Load address: 0x1c00000
Loading: #
         625 KiB/s
done
Bytes transferred = 10246 (2806 hex)
Using egiga0 device
TFTP from server 192.168.101.101; our IP address is 192.168.101.120
Filename 'uImage'.
Load address: 0x800000
Loading: #################################################################
         #################################################################
         #################################################################
         ####################
         4.2 MiB/s
done
Bytes transferred = 3154896 (3023d0 hex)

** Kernel Boot Arguments: console= root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=192.168.101.101:/srv/nfs/hosts/PogoplugV4,v3,tcp ip=192.168.101.120:192.168.101.101:192.168.101.101:255.255.255.0:pogoplugv4:eth0:off mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)

Using egiga0 device
TFTP from server 192.168.101.101; our IP address is 192.168.101.120
Filename 'uInitrd'.
Load address: 0x1100000
Loading: *
TFTP error: 'file /srv/tftp/uInitrd not found' (1)
Not retrying...
## Booting kernel from Legacy Image at 00800000 ...
   Image Name:   Linux-4.4.0-kirkwood-tld-1
   Created:      2016-02-19   5:55:25 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3154832 Bytes = 3 MiB
   Load Address: 00008000
   Entry Point:  00008000
   Verifying Checksum ... OK
## Flattened Device Tree blob at 01c00000
   Booting using the fdt blob at 0x1c00000
   Loading Kernel Image ... OK
   Loading Device Tree to 07b09000, end 07b0e805 ... OK
Using machid 0xf78 from environment

Starting kernel ...

Uncompressing Linux... done, booting the kernel.

Debian GNU/Linux 8 debian ttyS0

debian login:

root@debian:~# dmesg
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Initializing cgroup subsys cpuset
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Initializing cgroup subsys cpuacct
[    0.000000] Linux version 4.4.0-kirkwood-tld-1 (root@tldDebian) (gcc version 4.9.2 (Debian 4.9.2-10) ) #1 PREEMPT Mon Jan 25 20:35:24 PST 2016
[    0.000000] CPU: Feroceon 88FR131 [56251311] revision 1 (ARMv5TE), cr=0005397f
[    0.000000] CPU: VIVT data cache, VIVT instruction cache
[    0.000000] Machine model: Pogoplug v4
[    0.000000] Memory policy: Data cache writeback
[    0.000000] On node 0 totalpages: 32768
[    0.000000] free_area_init_node: node 0, pgdat c08a06b4, node_mem_map c7ef9000
[    0.000000]   Normal zone: 256 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 32768 pages, LIFO batch:7
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
[    0.000000] Kernel command line: console= root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=192.168.101.101:/srv/nfs/hosts/PogoplugV4,v3,tcp ip=192.168.101.120:192.168.101.101:192.168.101.101:255.255.255.0:pogoplugv4:eth0:off mtdparts=orion_nand:2M(u-boot),3M(uImage),3M(uImage2),8M(failsafe),112M(root)
[    0.000000] PID hash table entries: 512 (order: -1, 2048 bytes)
[    0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
[    0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
[    0.000000] Memory: 120640K/131072K available (6007K kernel code, 573K rwdata, 1992K rodata, 296K init, 312K bss, 10432K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
    vmalloc : 0xc8800000 - 0xff800000   ( 880 MB)
    lowmem  : 0xc0000000 - 0xc8000000   ( 128 MB)
    modules : 0xbf000000 - 0xc0000000   (  16 MB)
      .text : 0xc0008000 - 0xc07d7ef4   (8000 kB)
      .init : 0xc07d8000 - 0xc0822000   ( 296 kB)
      .data : 0xc0822000 - 0xc08b169c   ( 574 kB)
       .bss : 0xc08b169c - 0xc08ff9d0   ( 313 kB)
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  Build-time adjustment of leaf fanout to 32.
[    0.000000] NR_IRQS:16 nr_irqs:16 16
[    0.000000] clocksource: orion_clocksource: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 11467562657 ns
[    0.000014] sched_clock: 32 bits at 166MHz, resolution 6ns, wraps every 12884901885ns
[    0.000497] Console: colour dummy device 80x30
[    0.000539] Calibrating delay loop... 795.44 BogoMIPS (lpj=3977216)
[    0.090135] pid_max: default: 32768 minimum: 301
[    0.090301] Security Framework initialized
[    0.090418] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090451] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.091661] Initializing cgroup subsys io
[    0.091712] Initializing cgroup subsys devices
[    0.091750] Initializing cgroup subsys freezer
[    0.091803] Initializing cgroup subsys net_cls
[    0.091929] CPU: Testing write buffer coherency: ok
[    0.092637] Setting up static identity map for 0x8200 - 0x8258
[    0.093096] mvebu-soc-id: MVEBU SoC ID=0x6281, Rev=0x3
[    0.098772] devtmpfs: initialized
[    0.105872] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.106579] prandom: seed boundary self test passed
[    0.112310] prandom: 100 self tests passed
[    0.112367] pinctrl core: initialized pinctrl subsystem
[    0.114508] NET: Registered protocol family 16
[    0.115328] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.140168] cpuidle: using governor ladder
[    0.170169] cpuidle: using governor menu
[    0.170909] Feroceon L2: Enabling L2
[    0.170974] Feroceon L2: Cache support initialised.
[    0.171536] [Firmware Info]: /ocp@f1000000/ethernet-controller@72000/ethernet0-port@0: local-mac-address is not set
[    0.179102] No ATAGs?
[    0.212285] vgaarb: loaded
[    0.212813] usbcore: registered new interface driver usbfs
[    0.212932] usbcore: registered new interface driver hub
[    0.213052] usbcore: registered new device driver usb
[    0.214751] clocksource: Switched to clocksource orion_clocksource
[    0.296351] NET: Registered protocol family 2
[    0.297529] TCP established hash table entries: 1024 (order: 0, 4096 bytes)
[    0.297569] TCP bind hash table entries: 1024 (order: 0, 4096 bytes)
[    0.297600] TCP: Hash tables configured (established 1024 bind 1024)
[    0.297703] UDP hash table entries: 256 (order: 0, 4096 bytes)
[    0.297738] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[    0.298018] NET: Registered protocol family 1
[    0.298600] RPC: Registered named UNIX socket transport module.
[    0.298618] RPC: Registered udp transport module.
[    0.298629] RPC: Registered tcp transport module.
[    0.298640] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.298670] PCI: CLS 0 bytes, default 32
[    0.299284] NetWinder Floating Point Emulator V0.97 (double precision)
[    0.300818] futex hash table entries: 256 (order: -1, 3072 bytes)
[    0.300921] audit: initializing netlink subsys (disabled)
[    0.300985] audit: type=2000 audit(0.290:1): initialized
[    0.301477] Initialise system trusted keyring
[    0.301992] zbud: loaded
[    0.302402] VFS: Disk quotas dquot_6.6.0
[    0.302501] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[    0.303292] NFS: Registering the id_resolver key type
[    0.303346] Key type id_resolver registered
[    0.303359] Key type id_legacy registered
[    0.303397] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.303418] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
[    0.303740] jffs2: version 2.2. (NAND) (SUMMARY)  \xffffffc2\xffffffa9 2001-2006 Red Hat, Inc.
[    0.304485] Key type big_key registered
[    0.321176] Key type asymmetric registered
[    0.321210] Asymmetric key parser 'x509' registered
[    0.321345] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.321374] io scheduler noop registered
[    0.321396] io scheduler deadline registered
[    0.321485] io scheduler cfq registered (default)
[    0.322804] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 36
[    0.322828] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 37
[    0.322846] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 38
[    0.322864] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 39
[    0.322881] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 40
[    0.322899] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 41
[    0.322916] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 42
[    0.322934] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 43
[    0.322951] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 44
[    0.322969] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 45
[    0.322986] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 46
[    0.323003] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 47
[    0.323021] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 48
[    0.323039] kirkwood-pinctrl f1010000.pin-controller: unknown pinctrl group 49
[    0.323514] kirkwood-pinctrl f1010000.pin-controller: registered pinctrl driver
[    0.324476] irq: Cannot allocate irq_descs @ IRQ34, assuming pre-allocated
[    0.325287] irq: Cannot allocate irq_descs @ IRQ66, assuming pre-allocated
[    0.326518] mvebu-pcie mbus:pcie-controller: PCI host bridge to bus 0000:00
[    0.326547] pci_bus 0000:00: root bus resource [io  0x1000-0xfffff]
[    0.326568] pci_bus 0000:00: root bus resource [mem 0xe0000000-0xefffffff]
[    0.326588] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.326607] pci_bus 0000:00: scanning bus
[    0.326663] pci 0000:00:01.0: [11ab:6281] type 01 class 0x060400
[    0.326739] pci 0000:00:01.0: calling pci_fixup_ide_bases+0x0/0x40
[    0.327152] pci_bus 0000:00: fixups for bus
[    0.327175] PCI: bus0: Fast back to back transfers disabled
[    0.327196] pci 0000:00:01.0: scanning [bus 00-00] behind bridge, pass 0
[    0.327214] pci 0000:00:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[    0.327237] pci 0000:00:01.0: scanning [bus 00-00] behind bridge, pass 1
[    0.327485] pci_bus 0000:01: scanning bus
[    0.327507] pci_bus 0000:01: fixups for bus
[    0.327519] PCI: bus1: Fast back to back transfers enabled
[    0.327536] pci_bus 0000:01: bus scan returning with max=01
[    0.327557] pci_bus 0000:01: busn_res: [bus 01-ff] end is updated to 01
[    0.327578] pci_bus 0000:00: bus scan returning with max=01
[    0.327601] pci 0000:00:01.0: fixup irq: got 0
[    0.327617] pci 0000:00:01.0: assigning IRQ 00
[    0.327653] pci 0000:00:01.0: PCI bridge to [bus 01]
[    0.327779] pcieport 0000:00:01.0: enabling bus mastering
[    0.328130] mv_xor f1060800.xor: Marvell shared XOR driver
[    0.365777] mv_xor f1060800.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.366118] mv_xor f1060900.xor: Marvell shared XOR driver
[    0.405753] mv_xor f1060900.xor: Marvell XOR (Registers Mode): ( xor cpy intr )
[    0.406470] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.408615] f1012000.serial: ttyS0 at MMIO 0xf1012000 (irq = 25, base_baud = 10416666) is a 16550A
[    0.410541] nand: device found, Manufacturer ID: 0xad, Chip ID: 0xf1
[    0.410558] nand: Hynix H27U1G8F2BTR-BC
[    0.410573] nand: 128 MiB, SLC, erase size: 128 KiB, page size: 2048, OOB size: 64
[    0.410599] Scanning device for bad blocks
[    0.495319] 5 cmdlinepart partitions found on MTD device orion_nand
[    0.495336] Creating 5 MTD partitions on "orion_nand":
[    0.495367] 0x000000000000-0x000000200000 : "u-boot"
[    0.497264] 0x000000200000-0x000000500000 : "uImage"
[    0.499028] 0x000000500000-0x000000800000 : "uImage2"
[    0.500783] 0x000000800000-0x000001000000 : "failsafe"
[    0.502583] 0x000001000000-0x000008000000 : "root"
[    0.506289] libphy: Fixed MDIO Bus: probed
[    0.506800] libphy: orion_mdio_bus: probed
[    0.507877] mv643xx_eth: MV-643xx 10/100/1000 ethernet driver version 1.4
[    1.582937] mv643xx_eth_port mv643xx_eth_port.0 eth0: port 0 with MAC address 00:25:31:03:f1:8e
[    1.583170] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.583221] ehci-pci: EHCI PCI platform driver
[    1.583354] ehci-orion: EHCI orion driver
[    1.583624] orion-ehci f1050000.ehci: EHCI Host Controller
[    1.583680] orion-ehci f1050000.ehci: new USB bus registered, assigned bus number 1
[    1.583922] orion-ehci f1050000.ehci: irq 29, io mem 0xf1050000
[    1.594816] orion-ehci f1050000.ehci: USB 2.0 started, EHCI 1.00
[    1.595164] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    1.595185] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.595202] usb usb1: Product: EHCI Host Controller
[    1.595218] usb usb1: Manufacturer: Linux 4.4.0-kirkwood-tld-1 ehci_hcd
[    1.595233] usb usb1: SerialNumber: f1050000.ehci
[    1.596354] hub 1-0:1.0: USB hub found
[    1.596418] hub 1-0:1.0: 1 port detected
[    1.597814] mousedev: PS/2 mouse device common for all mice
[    1.914796] usb 1-1: new high-speed USB device number 2 using orion-ehci
[    2.077305] usb 1-1: New USB device found, idVendor=154b, idProduct=005b
[    2.077327] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    2.077343] usb 1-1: Product: USB 2.0 FD
[    2.077359] usb 1-1: Manufacturer: PNY Technologies
[    2.077373] usb 1-1: SerialNumber: AA00000000003920
[    2.604789] rtc-mv f1010300.rtc: internal RTC not ticking
[    2.605103] i2c /dev entries driver
[    2.606936] hidraw: raw HID events driver (C) Jiri Kosina
[    2.607506] drop_monitor: Initializing network drop monitor service
[    2.607902] NET: Registered protocol family 17
[    2.608292] Key type dns_resolver registered
[    2.609633] registered taskstats version 1
[    2.609716] Loading compiled-in X.509 certificates
[    2.609817] zswap: loaded using pool lzo/zbud
[    2.611438] Key type encrypted registered
[    2.612184] hctosys: unable to open rtc device (rtc0)
[    6.362127] mv643xx_eth_port mv643xx_eth_port.0 eth0: link up, 1000 Mb/s, full duplex, flow control disabled
[    6.385024] IP-Config: Complete:
[    6.385052]      device=eth0, hwaddr=00:25:31:03:f1:8e, ipaddr=192.168.101.120, mask=255.255.255.0, gw=192.168.101.101
[    6.385067]      host=pogoplugv4, domain=, nis-domain=(none)
[    6.385081]      bootserver=192.168.101.101, rootserver=192.168.101.101, rootpath=
[    6.385120] PM: Hibernation image not present or could not be loaded.
[    6.385333] Warning: unable to open an initial console.
[    6.402434] VFS: Mounted root (nfs filesystem) on device 0:15.
[    6.403007] devtmpfs: mounted
[    6.404315] Freeing unused kernel memory: 296K (c07d8000 - c0822000)
[    9.232084] systemd-udevd[204]: starting version 215
[    9.434429] random: udevd urandom read with 109 bits of entropy available
[    9.881084] random: nonblocking pool is initialized
[    9.938346] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[   10.485175] orion_wdt: Initial timeout 25 sec
[   10.637971] marvell-cesa: probe of f1030000.crypto failed with error -524
[   10.798107] mvsdio f1090000.mvsdio: Got CD GPIO
[   10.829772] SCSI subsystem initialized
[   10.942288] usb-storage 1-1:1.0: USB Mass Storage device detected
[   10.966133] scsi host0: usb-storage 1-1:1.0
[   10.966917] usbcore: registered new interface driver usb-storage
[   10.976839] usbcore: registered new interface driver uas
[   10.991698] libata version 3.00 loaded.
[   11.012384] sata_mv f1080000.sata: version 1.28
[   11.012703] sata_mv f1080000.sata: slots 32 ports 1
[   11.039177] scsi host1: sata_mv
[   11.039713] ata1: SATA max UDMA/133 irq 32
[   11.384811] ata1: SATA link down (SStatus 0 SControl F300)
[   12.119609] scsi 0:0:0:0: Direct-Access     PNY      USB 2.0 FD       1100 PQ: 0 ANSI: 0 CCS
[   12.173519] sd 0:0:0:0: [sda] 7975296 512-byte logical blocks: (4.08 GB/3.80 GiB)
[   12.174373] sd 0:0:0:0: [sda] Write Protect is off
[   12.174402] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[   12.175130] sd 0:0:0:0: [sda] No Caching mode page found
[   12.175155] sd 0:0:0:0: [sda] Assuming drive cache: write through
[   12.184918]  sda: sda1
[   12.188885] sd 0:0:0:0: [sda] Attached SCSI removable disk
[   12.220476] sd 0:0:0:0: Attached scsi generic sg0 type 0
[   19.632296] NET: Registered protocol family 10
root@debian:~#



Edited 1 time(s). Last edit at 11/15/2016 04:45PM by SiliCAT.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 15, 2016 06:39PM
Quote

If I downgrade the uboot to uBoot 2014, with the same nfs rootfs and envs, I can boot the debian system successfully.

This is because the envs are different. So I think your envs settings in the new u-boot is not correct. Let's look at that again.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 15, 2016 06:53PM
The script to set the envs:

#!/bin/bash

fw_setenv autoload 'no'
fw_setenv net_bootcmd 'run net_check_dhcp_c; run net_check_dhcp_s; run net_set_bootargs; run net_boot'

fw_setenv net_boot 'tftp 0x1c00000 $net_tftp_dtb; tftp 0x800000 $net_tftp_kernel; echo; echo ** Kernel Boot Arguments: $bootargs; echo;if tftp 0x1100000 $net_tftp_initrd; then bootm 0x800000 0x1100000 0x1c00000;else bootm 0x800000 - 0x1c00000;fi'

fw_setenv net_set_bootargs 'setenv serverip $net_tftp_server; setenv bootargs console=$console root=/dev/nfs rw rootfstype=nfs rootwait nfsroot=$net_nfs_server:$net_nfs_path,v3,tcp ip=$ipaddr:$net_nfs_server:$gatewayip:$netmask:pogoplugv4:eth0:off $mtdparts'

fw_setenv 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'
fw_setenv net_set_c_ip_dhcp 'dhcp; echo; echo ** net_dhcp_c = 1 --> Getting IP Settings by DHCP'
fw_setenv net_set_c_ip_stat 'setenv ipaddr $net_c_ipaddr; setenv netmask $net_c_netmask; setenv gatewayip $net_c_gatewayip; echo; echo ** net_dhcp_c = 0 --> Using static IP Settings'
fw_setenv 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 ** TFTP Boot Server: $net_tftp_server; echo ** NFS Boot Server: $net_nfs_server; echo'
fw_setenv net_set_s_ip_dhcp 'setenv net_tftp_server $serverip; setenv net_nfs_server $serverip;echo; echo ** net_dhcp_s and net_dhcp_c = 1 --> Getting TFTP and NFS Boot Server by DHCP'
fw_setenv net_set_s_ip_stat 'echo; echo ** net_dhcp_s or net_dhcp_c = 0 --> Using static TFTP and NFS Boot Server'

fw_setenv net_dhcp_c '1'
fw_setenv net_dhcp_s '0'
fw_setenv net_c_ipaddr ''
fw_setenv net_c_netmask ''
fw_setenv net_c_gatewayip ''
fw_setenv net_tftp_server '172.16.16.250'
fw_setenv net_nfs_server '172.16.16.250'
fw_setenv net_tftp_kernel 'uImage'
fw_setenv net_tftp_initrd 'uInitrd'
fw_setenv net_tftp_dtb 'dts/kirkwood-pogoplug_v4.dtb'
fw_setenv net_nfs_path '/srv/nfs/hosts/PogoplugV4'
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 15, 2016 07:24PM
SiliCAT,

why dont you modify this command to use tftp to load uImage and uInitrd in the new uboot?

Quote

bootcmd_nfs=setenv nfs_server "192.168.0.224"; setenv nfs_path "/srv/nfs/hosts/tldDebian2"; setenv nfs_bootcmd "run nfs_set_bootargs; run nfs_boot"; setenv nfs_ipconfig "192.168.0.229:192.168.0.224:192.168.0.1:255.255.0.0:tldDebian2::off"; setenv nfs_set_bootargs "setenv bootargs console=ttyS0,115200 root=/dev/nfs nfsroot=$nfs_server:$nfs_path,v3 rootfstype=nfs rootwait ip=$nfs_ipconfig $mtdparts"; setenv nfs_load_uimage "nfs 0x800000 $nfs_server:$nfs_path/boot/uImage"; setenv nfs_load_uinitrd "nfs 0x1100000 $nfs_server:$nfs_path/boot/uInitrd"; setenv nfs_load_dtb "nfs 0x1c00000 $nfs_server:$nfs_path/boot/dts/kirkwood-pogo_e02.dtb"; setenv nfs_bootm "bootm 0x800000 0x1100000 0x1c00000"; setenv nfs_boot "run nfs_load_uimage; run nfs_load_uinitrd; run nfs_load_dtb; run nfs_bootm"; echo "Booting NFS root…"; run nfs_bootcmd

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 15, 2016 08:52PM
Hi bodhi,

You are right.

Your env works.

setenv bootcmd_nfs 'setenv serverip "192.168.101.101"; setenv nfs_server "192.168.101.101"; setenv nfs_path "/srv/nfs/hosts/PogoplugV4"; setenv nfs_bootcmd "run nfs_set_bootargs; run nfs_boot"; setenv nfs_ipconfig "192.168.101.10:192.168.101.101:192.168.101.101:255.255.255.0:PogoplugV4::off"; setenv nfs_set_bootargs "setenv bootargs console=ttyS0,115200 root=/dev/nfs nfsroot=$nfs_server:$nfs_path,v3 rootfstype=nfs rootwait ip=$nfs_ipconfig $mtdparts"; setenv tftp_load_uimage "tftp 0x800000 uImage"; setenv tftp_load_uinitrd "tftp 0x1100000 uInitrd"; setenv tftp_load_dtb "tftp 0x1c00000 dts/kirkwood-pogoplug_v4.dtb"; setenv nfs_bootm "bootm 0x800000 0x1100000 0x1c00000"; setenv nfs_boot "run tftp_load_uimage; run tftp_load_uinitrd; run tftp_load_dtb; run nfs_bootm"; echo "Booting NFS root…"; run nfs_bootcmd'
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 15, 2016 09:38PM
Just set console
fw_setenv console 'ttyS0,115200'

And the script also works now.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 16, 2016 02:50PM
SiliCAT,

You should find out why your OpenWrt share does not support nfs v2/3. Booting kernel with tftp is OK, but it is another extra part that is uneccessary and make your backup little bit more akward.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 17, 2016 06:38AM
bodhi Wrote:
-------------------------------------------------------
> SiliCAT,
>
> You should find out why your OpenWrt share does
> not support nfs v2/3. Booting kernel with tftp is
> OK, but it is another extra part that is
> uneccessary and make your backup little bit more
> akward.


Hi bodhi,

I'll try to figure this out when I have some free time.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 22, 2016 11:19AM
No one cares about NFSv2.
https://forum.openwrt.org/viewtopic.php?id=68632

The compile command is in openwrt/package/kernel/linux/modules/fs.mk

define KernelPackage/fs-nfsd
  SUBMENU:=$(FS_MENU)
  TITLE:=NFS kernel server support
  DEPENDS:=+kmod-fs-nfs-common +kmod-fs-exportfs
  KCONFIG:= \
        CONFIG_NFSD \
        CONFIG_NFSD_FAULT_INJECTION=n
  FILES:=$(LINUX_DIR)/fs/nfsd/nfsd.ko
  AUTOLOAD:=$(call AutoLoad,40,nfsd)
endef

The source code is in linux/fs/nfsd. I can see the nfsproc (It is for Ver2) is included in the Makefile.
Why there isn't NFSv2 support in the nfsd.ko module?



Edited 1 time(s). Last edit at 11/22/2016 11:21AM by SiliCAT.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 22, 2016 02:33PM
SiliCAT,

> No one cares about NFSv2.
> https://forum.openwrt.org/viewtopic.php?id=68632
>

:) Perhaps.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 22, 2016 06:39PM
bodhi Wrote:
-------------------------------------------------------
> SiliCAT,
>
> > No one cares about NFSv2.
> >
> https://forum.openwrt.org/viewtopic.php?id=68632
> >
>
> :) Perhaps.

You should consider not using OpenWrt for a NAS, switch to Debian for this. It is a special purpose Linux dístro, not a general Linux system like Debian or Arch.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 23, 2016 01:30AM
I think this is the reasons why I use OpenWrt for the NFS server:
1. I found using the SD card or the Flash Drive as the rootfs is unreliable, and I have to worry about the lifespan of the memory chips.
2. I don't want an extra device and extra energy consumption. An OpenWRT router is always power on.
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 23, 2016 02:01AM
SiliCAT,

All good points. However, what I think:

> 1. I found using the SD card or the Flash Drive as
> the rootfs is unreliable, and I have to worry
> about the lifespan of the memory chips.

I've been using the same Sandisk flash drives as rootfs for 4,5 years on most of my plugs, running 24/7. What I did to make sure they last:
http://forum.doozan.com/read.php?2,13702,13704#msg-13704

And I always have a master backup for all Kirkwood plugs. I just use that to create a new one, tweak a few thing: hostname, static ip address,...

> 2. I don't want an extra device and extra energy
> consumption. An OpenWRT router is always power on.

FWIW, the Pogo E02 or Pogo Mobile run on less than 5w. But your point is good, why even use that 5w if you don't have to.

Your configuration will be better when u-boot has NFS v3/v4. I believe a few months we will have it (this issue is active in mainline).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 23, 2016 09:24PM
> I've been using the same Sandisk flash drives as
> rootfs for 4,5 years on most of my plugs, running
> 24/7. What I did to make sure they last:
> http://forum.doozan.com/read.php?2,13702,13704#msg
> -13704
>
> And I always have a master backup for all Kirkwood
> plugs. I just use that to create a new one, tweak
> a few thing: hostname, static ip address,...
>

Very helpful:)

Occasionally, I'm trying to exploit the box's full potential(running database, compiling software, etc). A rootfs on the NFS will bring some convenience...

>
> Your configuration will be better when u-boot has
> NFS v3/v4. I believe a few months we will have it
> (this issue is active in mainline).


Wow, just can't wait!
Re: What is the correct "bootcmd" value for NFS with the new uBoot?
November 23, 2016 10:13PM
I will post my shell script for upgrading kernel in NFS rootfs using chroot. Remind me if I forget :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: