Jump to content
  • 0

Petalinux booting via TFTP and NFS


cosmos

Question

Hi,

I'm trying to boot petalinux from TFTP server and NFS root based on Arty Z7-20 Petalinux BSP Project (https://github.com/Digilent/Petalinux-Arty-Z7-20)

Unfortunately, TFTP boot method is not included in the Project's README.md file.

I found several useful infromation and tried them to my Arty-z7-20 board.

https://www.youtube.com/watch?v=DHmcjkDDAlM

It was passed to access TFTP server on HOST PC (Ubuntu 18.04).

However, I failed to access NFS Root Filesystems on Host PC.

These were Host-PC settings

  • netplan
    • Static IP : 23.44.127.35/24
    • gateway4 : 24.44.127.1
  • /etc/exports
    • /srv/nfsroot 23.44.127.1(rw, sync, no_root_squash, no_subtree_check)
  • TFTP server
    • directory : /var/lib/tftpboot
    • files : BOOT.BIN, image.ub, zynq_fsbl.elf etc...
    • settings (/etc/default/tftpd-hpa)
      • TFTP_USERNAME="tftp"
      • TFTP_DIRECTORY="/var/lib/tftpboot"
      • TFTP_ADDRESS=":69"
      • TFTP_OPTIONS="--secure"
  • NFS Root
    • directory : /srv/nfsroot
    • files : root files extracted from rootfs.tar.gz

 

And, these were Petalinux settings

  • Ethernet Settings
    • Static IP address : 23.44.127.1
    • Static IP netmask : 255.255.255.0
    • Static IP gateway : 23.44.127.1
  • Image Packaing Configuration
    • Location of NFS root directory : /srv/nfsroot
    • NFS Server IP address : 23.44.127.35
    • tftpboot directory : /var/lib/tftpboot

 

I started TFTP and NFS servers on Host-PC

$ sudo service tftpd-hpa restart	
$ sudo service nfs-kernel-server restart		

 

After copying BOOT.BIN file to SD-card and inserting it to Arty-z7-20 board, I powered up the board and checked the status of server on Host-PC

Zynq> ping 23.44.127.35

Using ethernet@e000b000 device
host 23.44.127.35 is alive

 

Downloading "image.ub" file from TFTP sever is successful.

Zynq> tftpboot image.ub

Using ethernet@000b000 device
TFTP from server 23.44.127.35; out IP address is 23.44.127.1
Filename 'image.ub'.
Load address: 0x10000000
Loading: ##########################################
	 ##########################################
	 9 MiB/s
done
Bytes transferred = 3779188 (39aa74 hex)

 

I started netboot and got kernel panic error

Zynq> run netboot

...
ALSA device list:
  No soundcards found.
VFS: Cannot open root device "(null)" or unknown-block(0, 0): error -6
Please append a correct "root=" boot options; here are the available partitions:
...
---[end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)...

 

This is expected correct message from ref. [2]

image.png.8465b7c8a694a8f840f82401e137dabd.png

 

Could you help me find the problems?

 

Thank you!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Thank you for replay.

I have read the sections in ug1144 and tried again.

I have got same error. :

ALSA device list:
  No soundcards found.
VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
0100           16384 ram0  (driver?)
0101           16384 ram1  (driver?)
0102           16384 ram2  (driver?)
0103           16384 ram3  (driver?)
0104           16384 ram4  (driver?)
0105           16384 ram5  (driver?)
0106           16384 ram6  (driver?)
0107           16384 ram7  (driver?)
0108           16384 ram8  (driver?)
0109           16384 ram9  (driver?)
010a           16384 ram10  (driver?)
010b           16384 ram11  (driver?)
010c           16384 ram12  (driver?)
010d           16384 ram13  (driver?)
010e           16384 ram14  (driver?)
010f           16384 ram15  (driver?)
1f00            5120 mtdblock0  (driver?)
1f01             128 mtdblock1  (driver?)
1f02           10752 mtdblock2  (driver?)
1f03             384 mtdblock3  (driver?)
b300        15558144 mmcblk0  driver: mmcblk
  b301        15557120 mmcblk0p1 0038e34b-01
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

 

I found "plnx_arm-system.dts" instead of "plnx_aarch64-system.dts" which mentioned in Configuring NFS Boot section.

Also, this is boot arguments of "system-conf.dtsi" file in same directory.

chosen {
	bootargs = "console=ttyPS0,115200 earlyprintk root=/dev/nfs nfsroot=192.168.1.193:/home/cosmos/NFSshare,tcp ip=dhcp rw";
	stdout-path = "serial0:115200n8";
};

 

This is a Image Packing Configuration setting.

image.png.adfe3ec60308f32630debea17f28ebbf.png

 

These are Kernel configuration settings.

image.png.a90d90aa21bdad3984951f512e675dd7.png

 

image.png.dc281306919be62b977f786b3dcc49d6.png

 

Link to comment
Share on other sites

Problem is solved !

 

I set the U-Boot environment variables such as IP address and bootargs of target board in the terminal window.

"nfsvers=3" option [1] should be inclued in bootargs. Also, the type of ip option is described in [2]. "hard" option [3]  makes sure the stable connection.

Zynq>setenv ipaddr 23.44.127.10

Zynq>setenv bootargs console=ttyPS0,115200 earlyprintk root=/dev/nfs nfsroot=23.44.127.35:/srv/nfsroot,nfsvers=3,hard,tcp ip=23.44.127.10:23.44.127.35:23.44.127.1:255.255.255.0:arty rw

Zynq>run netboot

 

References

[1] https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2017-4-2018-1-boot-by-using-NFS-fail/m-p/854466

[2] https://github.com/Xilinx/linux-xlnx/blob/master/Documentation/filesystems/nfs/nfsroot.txt

[3] https://web.mit.edu/rhel-doc/5/RHEL-5-manual/Deployment_Guide-en-US/s1-nfs-client-config-options.html

Link to comment
Share on other sites

@cosmos

Can you brake it in steps?

1. TFTP: try with an image.ub that contains an INITRAMFS.

uEnv.txt:

fdn=z7020
bit_addr=0x10000000
img_addr=0x11400000

bit_name=system.bit
img_name=image.ub

serverip=1.2.3.4
tftp_fpga=tftpboot $bit_addr $bit_name && fpga loadb $fdn $bit_addr $filesize;
tftp_boot=tftpboot $img_addr $img_name && bootm $img_addr $bootargs;

To load bitstream into fpga over tftp run:
env run tftp_fpga; Necessary if you want to load a fresh .bit file into FPGA over tftp this can also be done for the device-tree.

To load and boot kernel over tftb run:
env run tftp_boot;

2. NFS

When the kernel is started look in output for line:

Kernel command line: console=ttyPS0,115200....

check if  `root=`  was set correctly

Also note that $bootargs need to be appended after bootm

Additionally you may want to skip the initramfs in image.ub
bootm $img_addr:kernel@1 - $img_addr:fdt@system-top.dtb $bootargs;

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...