Problem of kernel and DTB from TFTP and rootfs from NFS

I load the kernel and DTB from a network (via TFTP),and boot the target device from NFS Root on the Linux Host.
but the serial console show errors below:
[0009.927] I> Our IP: 192.168.1.123
[0009.928] TFTP Client: Init
[0009.928] TFTP Client: Server IP: 192.168.1.100
[0009.928] TFTP Client: Send RRQ, file: tegra194-p2888-0001-p2822-0000.dtb
[0014.935] TFTP Client: Connection failed
[0014.945] TFTP Client: Send RRQ, file: tegra194-p2888-0001-p2822-0000.dtb
[0019.947] TFTP Client: Connection failed
[0019.957] TFTP Client: Send RRQ, file: tegra194-p2888-0001-p2822-0000.dtb
[0024.958] TFTP Client: Connection failed
[0024.968] TFTP Client: Send RRQ, file: tegra194-p2888-0001-p2822-0000.dtb
[0029.969] TFTP Client: Connection failed
[0029.979] TFTP Client: Send RRQ, file: tegra194-p2888-0001-p2822-0000.dtb
[0034.980] TFTP Client: Connection failed
[0034.990] E> Failed to send RRQ of tegra194-p2888-0001-p2822-0000.dtb within ms
[0034.991] I> netif status changed 192.168.1.123
[0034.992] E> Error (518) network load failed for kernel & kernel-dtb


[ 10.029735] EXT4-fs (mmcblk0p1): re-mounted. Opts: (null)
[ 10.322889] systemd-journald[2425]: Received request to flush runtime journa1
[ 10.395605] nvgpu: 17000000.gv11b nvgpu_nvhost_syncpt_init:291 [IN0
[ 10.395605]
[ 10.799610] using random self ethernet address
[ 10.799745] using random host ethernet address
[ 10.819467] using random self ethernet address
[ 10.819585] using random host ethernet address
[ 11.013223] random: crng init done
[ 11.013330] random: 7 urandom warning(s) missed due to ratelimiting
[ 12.956414] Please complete system configuration setup on /dev/ttyGS0 to pro.

What is your method to setup kernel and dtb from tftp?

$ cd /Linux_for_Tegra/bootloader/

/dts-v1/;

/ {
compatible = “nvidia,cboot-options-v1”;
boot-configuration {
boot-order = “sd”, “usb”, “net”, “emmc”;
tftp-server-ip = /bits/ 8 <10 1 2 3>;
static-ip = /bits/ 8 <10 1 2 2>;
ip-netmask = /bits/ 8 <255 255 255 0>;
ip-gateway = /bits/ 8 <10 1 2 1>;
};
};

dtc -I dts -O dtb -o cbo.dtb cbo.dts
cd …
sudo ./flash.sh -k CPUBL-CFG jetson-xavier mmcblk0p1
sudo apt-get install xinetd tftpd tftp
sudo vim /etc/xinetd.d/tftp

service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = nobody
server = /usr/sbin/in.tftpd
server_args = ~/tftpboot
disable = no
}

mkdir ~/tftpboot
cp /Linux_for_Tegra/bootloader/boot_sigheader.img.encrypt ~/tftpboot/boot.img cp /Linux_for_Tegra/bootloader/tegra194-p2888-0001-p2822-0000_sigheader.dtb.encrypt ~/tftpboot/jetson.dtb
$ sudo service xinetd restart

is that right?

Can you use the absolute path?

server_args = ~/tftpboot

1 Like

thank you ,i used the absolute path and then:

[0009.773] I> Our IP: 192.168.1.123
[0009.773] TFTP Client: Init
[0009.774] TFTP Client: Server IP: 192.168.1.100
[0009.774] TFTP Client: Send RRQ, file: tegra194-p2888-0001-p2822-0000.dtb

[0009.827] TFTP Client: Last packet received
[0009.827] TFTP Client: Send RRQ, file: boot.img
################################################################################
################################################################################
################################################################################
######################################################################
[0013.519] TFTP Client: Last packet received
[0013.520] I> netif status changed 192.168.1.123
[0013.521] I> T19x: Authenticate kernel (bin_type: 37), max size 0x4000000
[0013.891] I> T19x: Authenticate kernel-dtb (bin_type: 38), max size 0x400000
[0013.895] I> Kernel hdr @0xa42d0000
[0013.896] I> Kernel dtb @0x90000000
[0013.896] I> Checking boot.img header magic … [0013.896] I> [OK]
[0013.896] I> Valid boot.img @ 0xa42d0000
[0013.897] I> decompressor handler not found
[0013.897] I> Copying kernel image (34113544 bytes) from 0xa42d0800 to 0x80080000 … [0013.908] I> Done
[0013.908] I> Move ramdisk (len: 5564673) from 0xa6359800 to 0x91000000
[0013.912] I> Updated bpmp info to DTB
[0013.914] I> Ramdisk: Base: 0x91000000; Size: 0x54e901
[0013.918] I> Updated initrd info to DTB
[0013.922] W> WARN: Fail to override “console=none” in commandline
[0013.928] E> tegrabl_linuxboot_add_disp_param, du 0 failed to get display params
[0013.935] E> tegrabl_linuxboot_add_disp_param, du 0 failed to get display params
[0013.942] E> tegrabl_linuxboot_add_disp_param, du 0 failed to get display params
[0013.949] W> No valid slot number is found in scratch register
[0013.955] W> Return default slot: _a
[0013.959] I> Active slot suffix:
[0013.962] I> add_boot_slot_suffix: slot_suffix =
[0013.966] I> Linux Cmdline: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 video=teg
[0014.001] I> Updated bootarg info to DTB

1、Whether the above information indicates the success of Boot Kernel and DTB via TFTP?

2、why My NFS still fails to mount ,the console’s final message is shown below:

[ 10.368511] Root device found: mmcblk0p1
[ 10.369939] Found dev node: /dev/mmcblk0p1
[ 10.443394] EXT4-fs (mmcblk0p1): recovery complete
[ 10.444335] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: (null)
[ 10.445479] Rootfs mounted over mmcblk0p1
[ 10.463513] Switching from initrd to actual rootfs
[ 10.548347] systemd[1]: System time before build time, advancing clock.
[ 10.574217] ip_tables: © 2000-2006 Netfilter Core Team
[ 10.576935] cgroup: cgroup2: unknown option “nsdelegate”
[ 10.583898] systemd[1]: systemd 237 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ)
[ 10.584928] systemd[1]: Detected architecture arm64.
[ 10.592851] systemd[1]: Set hostname to .
[ 10.656832] systemd[1]: File /lib/systemd/system/systemd-journald.service:36 configures an IP firewall (IPAddressDeny=any), but the local system does not support B.
[ 10.657165] systemd[1]: Proceeding WITHOUT firewalling in effect! (This warning is only shown for the first loaded unit using IP firewalling.)
[ 10.785296] random: systemd: uninitialized urandom read (16 bytes read)
[ 10.785935] systemd[1]: Set up automount Arbitrary Executable File Formats File System Automount Point.
[ 10.786451] random: systemd: uninitialized urandom read (16 bytes read)
[ 10.789624] systemd[1]: Created slice System Slice.
[ 10.790008] random: systemd: uninitialized urandom read (16 bytes read)
[ 10.790432] systemd[1]: Listening on RPCbind Server Activation Socket.
[ 10.790760] systemd[1]: Reached target Slices.
[ 10.791213] systemd[1]: Listening on udev Kernel Socket.
[ 10.816641] gpio tegra-gpio wake44 for gpio=192(Y:0)
[ 10.819754] EXT4-fs (mmcblk0p1): re-mounted. Opts: (null)
[ 11.051289] systemd-journald[2390]: Received request to flush runtime journal from PID 1
[ 11.246329] nvgpu: 17000000.gv11b nvgpu_nvhost_syncpt_init:291 [INFO] syncpt_unit_base 60000000 syncpt_unit_size 400000 size 1000
[ 11.246329]
[ 11.503218] using random self ethernet address
[ 11.503343] using random host ethernet address
[ 11.524104] using random self ethernet address
[ 11.524221] using random host ethernet address
[ 11.771281] random: crng init done
[ 11.771384] random: 7 urandom warning(s) missed due to ratelimiting
[ 13.655340] Please complete system configuration setup on /dev/ttyGS0 to proceed…

Linux Cmdline: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 video=teg

I find the cmdline is wrong,root is not nfs

  1. 0013.519] TFTP Client: Last packet received
    [0013.520] I> netif status changed 192.168.1.123
    [0013.521] I> T19x: Authenticate kernel (bin_type: 37), max size 0x4000000
    [0013.891] I> T19x: Authenticate kernel-dtb (bin_type: 38), max size 0x400000
    [0013.895] I> Kernel hdr @0xa42d0000
    [0013.896] I> Kernel dtb @0x90000000

Yes, your kernel and dtb is now from tftp.

[ 19.879044] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 19.899008] Sending DHCP requests … timed out!
[ 100.793764] IP-Config: Retrying forever (NFS root)…
[ 100.863920] gpio tegra-gpio wake20 for gpio=52(G:4)
[ 100.866433] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 103.891061] eqos 2490000.ether_qos eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 103.899008] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 103.918997] Sending DHCP requests …[ 172.499246] random: crng init done
[ 182.614983] timed out!
[ 182.633915] IP-Config: Retrying forever (NFS root)…
[ 182.703920] gpio tegra-gpio wake20 for gpio=52(G:4)
[ 182.706424] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 186.176983] eqos 2490000.ether_qos eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 186.183015] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 186.202991] Sending DHCP requests …

nfs is error

Hi hong.wang,

Please follow below steps to boot rootfs from NFS:
[Host side]

  1. sudo apt-get install nfs-kernel-server
  2. Add rootfs path in “/etc/exports”:
    example:/home/nvidia/nvidia_sdk/JetPack_4.4_Linux_Xavier/Linux_for_Tegra/rootfs *(rw,sync,no_subtree_check,no_root_squash)
  3. sudo /etc/init.d/nfs-kernel-server restart
  4. Flash:
    $ sudo ./flash.sh -N [host ip address]:/home/nvidia/nvidia_sdk/JetPack_4.4_Linux_Xavier/Linux_for_Tegra/rootfs jetson-xavier eth0

why The parameters after Flash -n only set the IP of PC, not the IP of Xavier?

Because you want to put the roofs on NFS, the NFS rootfs is on the host. That is why you need to tell tegra your host IP.

I followed your steps,but timeout as below:
[ 266.908580] IP-Config: Retrying forever (NFS root)…
[ 266.990661] gpio tegra-gpio wake20 for gpio=52(G:4)
[ 266.994653] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 269.999484] eqos 2490000.ether_qos eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 270.005775] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 270.025774] Sending DHCP requests … timed out!

Did you set upt the nfs server on your host already?

yes,I verified that everything on the host system is configured properly by executing the following step on a booted target board through USB/SD/internal eMMC. It should be possible to mount the host NFS root point on the target device:

mkdir rootfs sudo mount -v -o nfsvers=3 :/home/red/nfsroot rootfs

$ mkdir rootfs
$ sudo mount -v -o nfsvers=3 <IP-ADDR>:/home/red/nfsroot rootfs

Hi hong.wang,

Are you add rootfs path in “/etc/exports” on your host machine?
*example:/home/nvidia/nvidia_sdk/JetPack_4.4_Linux_Xavier/Linux_for_Tegra/rootfs (rw,sync,no_subtree_check,no_root_squash)

yes,/home/red/nfsroot *(rw,sync,no_subtree_check,no_root_squash)

I saw the nfs use DHCP,but tftp use static-ip , dose it mater?and how can nfs use static-ip on xavier

I used sudo ./flash.sh -N 192.168.1.100:/home/red/nfsroot --rcm-boot jetson-xavier eth0 ,am I right?