Boot from a TFTP/NFS Server

Hi,

I have Apalis imx6q and Apalis eval board. In that, I am trying to boot the board from the TFTP server.

I am referring below article for that.

https://developer.toradex.com/linux-bsp/5.0/application-development/how-to-setup-networking-for-embedded-linux-application-development
https://developer.toradex.com/linux-bsp/5.0/os-development/boot/boot-from-a-tftpnfs-server/

Using the above article I am able to boot the dtb, kernel from the tftp server but in the end, it shows me kernel panic due to rootfs is not mounted.

Error :

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

For the Rootfs and Bootfs, I am building a Reference Image with Yocto Project/OpenEmbedded with the following refs/tags/5.7.2.

cat /etc/dhcp/dhcpd.conf

# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#
# Attention: If /etc/ltsp/dhcpd.conf exists, that will be used as
# configuration file instead of this file.
#

# option definitions common to all supported networks...
option domain-name "apalis.net";
option domain-name-servers ns1.example.org, ns2.example.org;

default-lease-time 600;
max-lease-time 7200;

# The ddns-updates-style parameter controls whether or not the server will
# attempt to do a DNS update when a lease is confirmed. We default to the
# behavior of the version 2 packages ('none', since DHCP v2 didn't
# have support for DDNS.)
ddns-update-style none;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
#authoritative;

# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7;

subnet 192.168.10.0 netmask 255.255.255.0 {
        default-lease-time              86400;
        max-lease-time                  86400;
        option broadcast-address        192.168.10.255;
        option domain-name              "apalis.net";
        option domain-name-servers      ns1.example.org;
        option ip-forwarding            off;
        option routers                  192.168.10.1;
        option subnet-mask              255.255.255.0;
        interface                       eno1;
        range                           192.168.10.32 192.168.10.254;
}


#MAC address dependent IP assignment, used for the toradex target device
host eval {
        filename                        "zImage";
        fixed-address                   192.168.10.2;
        hardware ethernet               00:14:2d:a3:0b:78;
        next-server                     192.168.10.1;
        option host-name                "apalis";
        option root-path                "192.168.10.1:/srv/nfs/rootfs,wsize=1024,rsize=1024,v3";
#        option root-path                "rootfs,v4,tcp,clientaddr=0.0.0.0";
}

cat /etc/exports

# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
#
# Example for NFSv2 and NFSv3:
# /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check)
#
# Example for NFSv4:
# /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
# /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
#

#root=192.168.10.2:/srv/nfs/rootfs

/srv/nfs/rootfs 192.168.10.2(no_root_squash,no_subtree_check,rw)
#/srv/nfs 192.168.10.1/24(no_root_squash,no_subtree_check,rw,fsid=root)

Thanks in Advance,
Vishvas

Hi @vishvas,

Kindly share complete hardware and software details like below
Hardware : Apalis iMX6Q 2GB IT V1.1D with Ixora 1.2A
Software : Linux BSP 5.4 / WinCE7 1.2

Additionally share full boot log and output of printenv command to further check.

Is it possible for you also try with BSP 5.7 or test with latest BSP 6?
Best Regards
Ritesh Kumar

Hi @RItesh

Thanks for Replying to me,

This is the Hardware and Software I am using.
Hardware : Apalis iMX6Q 1GB V1.1B with Apalis Eval Board V1.1A
Software: Linux BSP 6.1.0

Also please find the boot log and Printenv of uboot file.

printenv (5.5 KB)
Log (4.2 KB)

Thanks in Advance,
Vishvas

Hi @vishvas,

Seems like you have sent different file for log. Kindly check and share. Meanwhile please check similar post as below:

Best Regards
Ritesh Kumar

Hi @ritesh.tx

please find the log :
log.txt (34.5 KB)

Thanks,
Vishvas

Hi @ritesh.tx ,

I have gone through the post. and After several tries, I know that In uboot prompt there is an environment variable rootpath. By setting this like below I am able to boot the kernel.

Apalis iMX6 # printenv rootpath 
rootpath=192.168.3.192:/srv/nfs/rootfs,v3

But the kernel will stuck after the below line

nfs: server 192.168.3.192 not responding, still trying

Log :

Log (36.1 KB)

Thanks in advance,
Vishvas

Hi @vishvas ,
I am able to reproduce the behaviour at my end.
The network gets disconnected with the following logs due to which the server becomes unavailable

May 21 12:38:31 tdev-HP-ProBook-440-G4 kernel: [  232.472454] r8169 0000:01:00.0 enp1s0: Link is Down
May 21 12:38:37 tdev-HP-ProBook-440-G4 NetworkManager[1201]: <info>  [1684652917.3943] device (enp1s0): state change: activated -> unavailable (reason 'carrier-changed', sys-iface-state: 'managed')
May 21 12:38:37 tdev-HP-ProBook-440-G4 avahi-daemon[1963]: Withdrawing address record for 192.168.10.1 on enp1s0.
May 21 12:38:37 tdev-HP-ProBook-440-G4 avahi-daemon[1963]: Leaving mDNS multicast group on interface enp1s0.IPv4 with address 192.168.10.1.
May 21 12:38:37 tdev-HP-ProBook-440-G4 avahi-daemon[1963]: Interface enp1s0.IPv4 no longer relevant for mDNS.
May 21 12:38:37 tdev-HP-ProBook-440-G4 avahi-daemon[1963]: Withdrawing address record for fe80::e5de:620d:3f59:20d4 on enp1s0.
May 21 12:38:37 tdev-HP-ProBook-440-G4 avahi-daemon[1963]: Leaving mDNS multicast group on interface enp1s0.IPv6 with address fe80::e5de:620d:3f59:20d4.
May 21 12:38:37 tdev-HP-ProBook-440-G4 avahi-daemon[1963]: Interface enp1s0.IPv6 no longer relevant for mDNS.
May 21 12:38:37 tdev-HP-ProBook-440-G4 nm-dispatcher: req:1 'down' [enp1s0]: new request (1 scripts)
May 21 12:38:37 tdev-HP-ProBook-440-G4 nm-dispatcher: req:1 'down' [enp1s0]: start running ordered scripts...