T20 TFTP/NFS boot with no DHCP

I really hope you can help me for this issue.

Our R&S environment has the constraint that any linux embedded target and crossdevelopment server must

have a static IP.

Moreover any of the developers must manage through TFTP/NFS its own version of Linux kernel and Root

File System, according to their names written on U-boot parameters.

For T20 targets, as long we used 2.3 BSP, this was easly accomplished, as TFTP/NFS boot relied on static

IPs.

Now I am trying the move T20 targets directly to the more advanced V2.8.1 BSP, where TFTP/NFS boot is

based on DHCP (truly from 2.4 BSP).

I tried to recover the V2.3 TFTP/NFS boot method on a T20 target safely updated to V2.8.1.

It is based on the following extra U-Boot entries:

kernel2=kern_t20evm_img_mv // Exactly the V2.8.1 zImage

nfsdisk2=nfst20evm_mv // Exactly the V2.8.1 rootfs

nfsboot2=run setup; setenv bootargs ${defargs} ${mtdparts} ${nfsargs} ${setupargs} ${vidargs}; echo Booting

from TFTP/NFS…; usb start && tftpboot ${kernel2} && bootz ${loadaddr}

and

nfsboot2_set=setenv ip ip=${ipaddr}; setenv nfsargs r=/dev/nfs rw nfsroot=${serverip}:/mnt/${nfsdisk2},nolock
${ip}; setenv bootcmd run nfsboot2; setenv debug_uartport lsport,0 ${memargs}; saveenv

Kernel transfer is OK:

Waiting for Ethernet connection… done.

Using asix_eth device

TFTP from server 192.168.1.69; our IP address is 192.168.1.79

Filename ‘kern_t20evm_img_mv’.

Load address: 0x1000000

Loading: *################################################## 3.9 MiB

 1.5 MiB/s

done

Bytes transferred = 4084592 (3e5370 hex)

Starting kernel …

[ 0.000000] Linux version 3.1.10-2.8.1+g8e1745b5e506 (oe-user@oe-host) (gcc version 7.2.0 (GCC) ) #1

SMP PREEMPT Mon Mar 12 13:37:34 CET 2018

[ 0.000000] CPU: ARMv7 Processor [411fc090] revision 0 (ARMv7), cr=10c5387d

[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache

[ 0.000000] Machine: Toradex Colibri T20

[ 0.000000] Found fbmem: 00c00000@17400000

[ 0.000000] Found nvmem: 08000000@18000000

[ 0.000000] Tegra reserved memory:

[ 0.000000] LP0: 00000000 - 00000000

[ 0.000000] Bootloader framebuffer: 17400000 - 17ffffff

[ 0.000000] Bootloader framebuffer2: 00000000 - 00000000

[ 0.000000] Framebuffer: 16700000 - 16ffffff

[ 0.000000] 2nd Framebuffer: 17000000 - 17ffffff

[ 0.000000] Carveout: 18000000 - 1fffffff

[ 0.000000] Vpr: 00000000 - 00000000

[ 0.000000] Memory policy: ECC disabled, Data cache writealloc

[ 0.000000] Tegra SKU: 8 Rev: A03 CPU Process: 1 Core Process: 1 Speedo ID: 1

[ 0.000000] Tegra Revision: A03 prime SKU: 0x8 CPU Process: 1 Core Process: 1

[ 0.000000] L310 cache controller enabled

[ 0.000000] l2x0: 8 ways, CACHE_ID 0x410000c4, AUX_CTRL 0x7e080001, Cache size: 1048576 B

[ 0.000000] PERCPU: Embedded 8 pages/cpu @c0cf6000 s10336 r8192 d14240 u32768

[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 90904

[ 0.000000] Kernel command line: vmalloc=128M usb_high_speed=1 user_debug=30

mtdparts=tegra_nand:2m(u-boot)ro,1m(u-boot-env),1m(cfgblock)ro,-(ubi) r=/dev/nfs rw

nfsroot=192.168.1.69:/mnt/nfst20evm_mv,nolock ip=192.168.1.79 asix_mac=00:0e:c6:87:72:01 con

soleblank=0 no_console_suspend=1 console=tty1 console=ttyS0,115200n8 debug_uartport=lsport,0

mem=372M@0M fbmem=12M@372M nvmem=128M@384M video=tegrafb0:640x480-16@60

[ 0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)

[ 0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)

[ 0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)

[ 0.000000] Memory: 358MB = 358MB total

[ 0.000000] Memorybut NFS fails: 352840k/352840k available, 28088k reserved, 0K highmem

but NFS fails…

[ 6.230825] Enabling Tegra protected aperture at 0x16700000

[ 6.239284] registered taskstats version 1

[ 6.246317] regulator_init_complete: REG-LDO_9: incomplete constraints, leaving on

[ 6.261275] input: gpio-keys as /devices/platform/gpio-keys.0/input/input1

[ 6.271010] rtc-ds1307 0-0068: hctosys: unable to read the hardware clock

[ 6.281462] eth0: rxqlen 0 → 5

[ 6.299365] IP-Config: Guessing netmask 255.255.255.0

[ 6.306795] IP-Config: Complete:

[ 6.312213] device=eth0, addr=192.168.1.79, mask=255.255.255.0, gw=255.255.255.255,

[ 6.322489] host=192.168.1.79, domain=, nis-domain=(none),

[ 6.330777] bootserver=255.255.255.255, rootserver=192.168.1.69, rootpath=

[ 6.393705] eth0: ax88772b - Link status is: 0

[ 6.521706] eth0: ax88772b - Link status is: 1

[ 102.509568] VFS: Unable to mount root fs via NFS, trying floppy.

[ 102.523623] VFS: Cannot open root device “(null)” or unknown-block(2,0)

[ 102.537393] Please append a correct “root=” boot option; here are the available partitions:

[ 102.560254] 1f00 2048 mtdblock0 (driver?)

[ 102.573242] 1f01 1024 mtdblock1 (driver?)

[ 102.585923] 1f02 1024 mtdblock2 (driver?)

[ 102.598516] 1f03 1044480 mtdblock3 (driver?)

[ 102.611052] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

[ 102.634195] (unwind_backtrace+0x0/0xe8) from (dump_stack+0x20/0x24)

[ 102.657827] (dump_stack+0x20/0x24) from (panic+0x7c/0x194)

[ 102.680714] (panic+0x7c/0x194) from (mount_block_root+0x1b8/0x218)

[ 102.704728] (mount_block_root+0x1b8/0x218) from (mount_root+0xc0/0x110)

[ 102.729834] (mount_root+0xc0/0x110) from

(prepare_namespace+0x154/0x194)

[ 102.755460] (prepare_namespace+0x154/0x194) from

(kernel_init+0xe8/0x130)

[ 102.781245] (kernel_init+0xe8/0x130) from (kernel_thread_exit+0x0/0x8)

Any hints ?

Thank you in advance for your attention.

As mentioned before it definitely was never our intention to having changed anything concerning any of this however as open-source progresses a few details may change in some subtle way here and there.

How about trying it along those lines?

setenv stdout serial
setenv gatewayip 192.168.10.1
setenv ipaddr 192.168.10.2
setenv serverip 192.168.10.1
setenv boot_file zImage-colibri_t20
setenv setupnfsargs 'setenv nfsargs ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:colibri-t20:eth0:off:8.8.8.8:8.8.4.4 nfsroot=${serverip}:rootfs-colibri_t20,v4,tcp,clientaddr=0.0.0.0 root=/dev/nfs rw'
setenv nfsboot 'usb start; run setup; run setupnfsargs; setenv bootargs ${defargs} ${mtdparts} ${nfsargs} ${setupargs} ${vidargs}; echo Booting via TFTP/NFS...; run nfsdtbload; tftp ${kernel_addr_r} ${boot_file} && run fdt_fixup && bootz ${kernel_addr_r} - ${dtbparam}'
run nfsboot

That works fine with my regular daily NFS setup even after having disabled the DHCP server which usually does the auto configuration thereof.

Some more details about many of the used Linux kernel boot configuration items may be found here.

I really appreciate your prompt and accurate support. I adapted your U-boot entries to my network configuration, tried changing many options and servers, but after a successful kernel TFTP load, no NFS Root File System is mounted on the target: the kernel hangs for a while, then crashes.

The zImage image I was using was obtained through https://developer.toradex.com/knowledge-base/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux and I gave for granted that NFS client support was enabled… I had no way to retrieve the kernel configuration options for such build coming from bitbake. To my error I found that on a target updated with such image, UBI boot showed that /dev/nfs was absent !

Then I compiled from sources a brand new 2.8b2 BSP kernel, git clone -b tegra git://git.toradex.com/linux-toradex.git making sure that NFS client 3 and 4 were enabled… But the TFTP/NFS boot failed again with similar results:

  1. By the way in printouts I find the warnings:

    Filename ‘tegra20-colibri-eval-v3.dtb’.
    Load address: 0x2000000
    Loading: *
    TFTP error: ‘File not found’ (1)
    Not retrying…

I cannot figure out what tegra20-colibri-eval-v3.dtb is and and is located.

My U-Boot entries…

ipaddr=192.168.1.79
gatewayip=192.168.1.2
serverip=192.168.1.69
setupnfsargs=setenv nfsargs ip=${ipaddr}:${serverip}:${gatewayip}:colibri-t20:eth0:off nfsroot=${serverip}:/rootfs,tcp,nolock,nfsvers=4 root=/dev/nfs rw
nfsboot=usb start; run setup; run setupnfsargs; setenv bootargs ${defargs} ${mtdparts} ${nfsargs} ${setupargs} ${vidargs};echo TFTP/NFS boot...; run nfsdtbload; tftp ${kernel_addr_r} ${boot_file} && run fdt_fixup && bootz ${kernel_addr_r} - ${dbtparam}

Colibri T20 # run nfsboot
starting USB...
USB0:   USB EHCI 1.00
USB1:   USB EHCI 1.00
USB2:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning bus 1 for devices... 2 USB Device(s) found
scanning bus 2 for devices... 2 USB Device(s) found
TFTP/NFS boot...
Waiting for Ethernet connection... done.
Using asix_eth device
TFTP from server 192.168.1.69; our IP address is 192.168.1.79
Filename 'tegra20-colibri-eval-v3.dtb'.
Load address: 0x2000000
Loading: *
TFTP error: 'File not found' (1)
Not retrying...
Using asix_eth device
TFTP from server 192.168.1.69; our IP address is 192.168.1.79
Filename 'zImage'.
Load address: 0x1000000
Loading: *##################################################  3.8 MiB	 514.6 KiB/s
done
Bytes transferred = 3988392 (3cdba8 hex)
Starting kernel ...
[    0.000000] Linux version 3.1.10-g8e1745b5e506 (venturi@linux3-rs.ebneuro.intranet) (gcc version 5.2.1 20151005 (Linaro GCC 5.2-2015.11-2) ) #2 SMP PREEMPT Thu Mar 29 16:56:05 CEST 2018
[    0.000000] CPU: ARMv7 Processor [411fc090] revision 0 (ARMv7), cr=10c5387d
[    0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: Toradex Colibri T20
[    0.000000] Found fbmem: 00c00000@17400000
[    0.000000] Found nvmem: 08000000@18000000
[    0.000000] Tegra reserved memory:
[    0.000000] LP0:                     00000000 - 00000000
[    0.000000] Bootloader framebuffer:  17400000 - 17ffffff
[    0.000000] Bootloader framebuffer2: 00000000 - 00000000
[    0.000000] Framebuffer:             16700000 - 16ffffff
[    0.000000] 2nd Framebuffer:         17000000 - 17ffffff
[    0.000000] Carveout:                18000000 - 1fffffff
[    0.000000] Vpr:                     00000000 - 00000000
[    0.000000] Memory policy: ECC disabled, Data cache writealloc
[    0.000000] Tegra SKU: 8 Rev: A03 CPU Process: 1 Core Process: 1 Speedo ID: 1
[    0.000000] Tegra Revision: A03 prime SKU: 0x8 CPU Process: 1 Core Process: 1
[    0.000000] L310 cache controller enabled
[    0.000000] l2x0: 8 ways, CACHE_ID 0x410000c4, AUX_CTRL 0x7e080001, Cache size: 1048576 B
[    0.000000] PERCPU: Embedded 8 pages/cpu @c0cf6000 s10336 r8192 d14240 u32768
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 90904
[    0.000000] Kernel command line: vmalloc=128M usb_high_speed=1 user_debug=30 mtdparts=tegra_nand:2m(u-boot)ro,1m(u-boot-env),1m(cfgblock)ro,-(ubi) ip=192.168.1.79:192.168.1.69:192.168.1.2:colibri-t20:eth0:off nfsroot=192.168.1.69:/rootfs,tcp,nolock,nfsvers=4 root=/dev/nfs rw asix_mac=00:0e:c6:87:72:01 consoleblank=0 no_console_suspend=1 console=tty1 console=ttyS0,115200n8 debug_uartport=lsport,0 mem=372M@0M fbmem=12M@372M nvmem=128M@384M video=tegrafb0:640x480-16@60
......................
[    6.343259] registered taskstats version 1
[    6.350231] regulator_init_complete: REG-LDO_9: incomplete constraints, leaving on
[    6.365050] input: gpio-keys as /devices/platform/gpio-keys.0/input/input1
[    6.374735] rtc-ds1307 0-0068: hctosys: unable to read the hardware clock
[  113.549744] VFS: Unable to mount root fs via NFS, trying floppy.
[  113.562112] VFS: Cannot open root device "nfs" or unknown-block(2,0)
[  113.573656] Please append a correct "root=" boot option; here are the available partitions:
[  113.592092] 1f00            2048 mtdblock0  (driver?)
[  113.602517] 1f01            1024 mtdblock1  (driver?)
[  113.612959] 1f02            1024 mtdblock2  (driver?)
[  113.623338] 1f03         1044480 mtdblock3  (driver?)
[  113.633722] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
[  113.653135] [] (unwind_backtrace+0x0/0xe8) from [] (dump_stack+0x20/0x24)
[  113.673974] [] (dump_stack+0x20/0x24) from [] (panic+0x7c/0x198)
[  113.695232] [] (panic+0x7c/0x198) from [] (mount_block_root+0x1e0/0x220)
[  113.718266] [] (mount_block_root+0x1e0/0x220) from [] (mount_root+0xf0/0x114)
[  113.742674] [] (mount_root+0xf0/0x114) from [] (prepare_namespace+0x134/0x194)
[  113.767860] [] (prepare_namespace+0x134/0x194) from [] (kernel_init+0x100/0x130)
[  113.793576] [] (kernel_init+0x100/0x130) from [] (kernel_thread_exit+0x0/0x8)
[  113.818971] CPU1: stopping
[  113.829789] [] (unwind_backtrace+0x0/0xe8) from [] (dump_stack+0x20/0x24)
[  113.854723] [] (dump_stack+0x20/0x24) from [] (do_IPI+0xf0/0x1b0)
[  113.879174] [] (do_IPI+0xf0/0x1b0) from [] (__irq_svc+0x38/0xd0)
[  113.904546] Exception stack(0xd60abf18 to 0xd60abf60)
[  113.918845] bf00:                                                       00000006 00001f40
[  113.944993] bf20: 00000000 00000000 6abdcbf8 0000001a cd837410 00000000 0000406a cd837400
[  113.970882] bf40: c085e5a4 d60abf8c 00001498 d60abf60 c0052a48 c0035308 20000013 ffffffff
[  113.996800] [] (__irq_svc+0x38/0xd0) from [] (tegra_idle_enter_lp3+0xe0/0xfc)
[  114.023620] [] (tegra_idle_enter_lp3+0xe0/0xfc) from [] (cpuidle_idle_call+0x148/0x324)
[  114.051347] [] (cpuidle_idle_call+0x148/0x324) from [] (cpu_idle+0x94/0x104)
[  114.077920] [] (cpu_idle+0x94/0x104) from [] (secondary_start_kernel+0x130/0x14c)
[  114.104857] [] (secondary_start_kernel+0x130/0x14c) from [<00548414>] (0x548414)

Any further suggestions ?

I trust on you.

Thank you for your attention.

N.B. maybe if you could send me your .config may spare some pains…

I really appreciate your prompt and accurate support. I adapted your U-boot entries to my network configuration, tried changing many options and servers, but after a successful kernel TFTP load, no NFS Root File System is mounted on the target: the kernel hangs for a while, then crashes.

Yes, it just does not find the rootfs on your NFS server as you did not heed my advice on how to having to specify resp. path to the server.

The zImage image I was using was obtained through https://developer.toradex.com/knowledge-base/how-to-set-up-qt-creator-to-cross-compile-for-embedded-linux and I gave for granted that NFS client support was enabled… I had no way to retrieve the kernel configuration options for such build coming from bitbake. To my error I found that on a target updated with such image, UBI boot showed that /dev/nfs was absent !

I really don’t think your understanding thereof is accurate. At least in all of our regular default configurations NFS is and has always been enabled properly.

Then I compiled from sources a brand new 2.8b2 BSP kernel, git clone -b tegra git://git.toradex.com/linux-toradex.git making sure that NFS client 3 and 4 were enabled… But the TFTP/NFS boot failed again with similar results:

By the way in printouts I find the warnings:

Filename ‘tegra20-colibri-eval-v3.dtb’. Load address: 0x2000000 Loading: * TFTP error: ‘File not found’ (1) Not retrying…

I cannot figure out what tegra20-colibri-eval-v3.dtb is and and is located.

Our U-Boot configuration is prepared for device tree loading which would be required to run mainline Linux kernels however the downstream Linux kernel our official BSP is using does not make use of any device tree and this message may be ignored.

Any further suggestions ?

Yes, instead of nfsroot=${serverip}:/rootfs,tcp,nolock,nfsvers=4 please do use nfsroot=${serverip}:rootfs,v4,tcp,clientaddr=0.0.0.0 like I previously suggested.

I trust on you.

Then trust me that it does have to be specified exactly as I suggested, no slashes and that clientaddr is important as well.

If you keep having issues then please do attach the full textual serial console output, no excerpts, no shady screenshots just the full truth and nothing but the truth!

Thank you for your attention.

You are very welcome.

N.B. maybe if you could send me your .config may spare some pains…

I really used our regular BSP 2.8b1 kernel compiled with the following regular default configuration which does enable all that is needed. The same would apply for mainline if sticking to the following configuration.

T20 EVM TFTP/NFS boot works fine at last… as you described.

The problem (my fault) was omitting by mistake in setupnfsargs the ${netmask}: field …
My correct setup is:

setupnfsargs=setenv nfsargs ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:colibri-t20:eth0:off root=/dev/nfs rw nfsroot=${serverip}:/rootfs,tcp,nolock,nfsvers=3

nfsvers=3 is actually required for compliance to Fedora27 NFS.

Sorry for the mess, and thanks for your patience,

T20 EVM TFTP/NFS boot works fine at last… as you described.

The problem (my fault) was omitting by mistake in setupnfsargs the ${netmask}: field … My correct setup is:

setupnfsargs=setenv nfsargs ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:colibri-t20:eth0:off root=/dev/nfs rw nfsroot=${serverip}:/rootfs,tcp,nolock,nfsvers=3

nfsvers=3 is actually required for compliance to Fedora27 NFS.

Strange as I am on Fedora 27 as well. What exact NFS server configuration/flavour are you using?

[user@host ~]$ cat /etc/redhat-release 
Fedora release 27 (Twenty Seven)

[user@host ~]$ cat /etc/exports
/srv/nfs 192.168.10.1/24(no_root_squash,no_subtree_check,rw,fsid=root)

[user@host ~]$ systemctl status nfs-server
● nfs-server.service - NFS server and services
   Loaded: loaded (/usr/lib/systemd/system/nfs-server.service; enabled; vendor p
  Drop-In: /run/systemd/generator/nfs-server.service.d
           └─order-with-mounts.conf
   Active: active (exited) since Tue 2018-04-03 09:16:33 CEST; 4h 41min ago
  Process: 4018 ExecStart=/bin/sh -c if systemctl -q is-active gssproxy; then sy
  Process: 4001 ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS (code=exited, status=0
  Process: 3999 ExecStartPre=/usr/sbin/exportfs -r (code=exited, status=0/SUCCES
 Main PID: 4018 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/nfs-server.service

Apr 03 09:16:33 localhost.localdomain systemd[1]: Starting NFS server and servic
Apr 03 09:16:33 localhost.localdomain systemd[1]: Started NFS server and service

Sorry for the mess, and thanks for your patience,

You are very welcome.