cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
6,021 Views
Registered: ‎03-21-2010

Petalinux 2017.4/2018.1 boot by using NFS fail.

I want to quickly update the content of root file system so I use NFS to boot zynq embedded system.

I follow UG1144 to select NFS as RootFS, locate the NFS root directory and fill in NFS server's IP as shown below:

petalinux_configure_nfs_settings.jpg

I used this command to extract rootfs.cpio to /home/RootFS

cd /home/RootFS

pax -r -c -f /path/rootfs.cpio

 

After running petalinux_package, I copied boot.bin and image.ub to sd card and boot zedboard.

Then I get kernel panic message.

 

----------------------error messagestart----------------------------------------

ALSA device list:
�random: fast init done
VFS: Unable to mount root fs via NFS, trying floppy.
List of all partitions:
0100 16384 ram0 (driver?)
0101 16384 ram1 (104 16384 ram4 (driver?)
0105 16384 ram5 (driver?)
0106 16384 ram6 (driver?)
0107 16384 ram7 (driver9 16384 ram9 (driver?)
010a 16384 ram10 (driver?)
010b 16384 ram11 (driver?)
010c 16384 ram12 (drive 16384 ram14 (driver?)
010f 16384 ram15 (driver?)
1f00 5120 mtdblock0 (driver?)
1f01 128 mtdblock1 (driv16768 mtdblock3 (driver?)
b300 7761920 mmcblk0 driver: mmcblk
b301 7760896 mmcblk0p1 1302a8b3-01
No filesystem could mount to mount root fs on unknown-block(2,0)
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-xilinx-v2017.4 #3
Hardware name: Xilinx Zy(show_stack+0x10/0x14)
[<c010a4a4>] (show_stack) from [<c02dc2d0>] (dump_stack+0x80/0x9c)
[<c02dc2d0>] (dump_stack) from [<c010c9f8>] (ipi_cpu_stoto 0xc0a01f80)
1f20: 00000000 00000017
1f40: 1e28e000 debcf9c0 3b0ae596 00000017 debcee40 04b1890 c04b18b4 60000013 ffffffff
[<c010ae8c>] (__irq_svc) from [<c04b18b4>] (cpuidle_enter_state+0xe4/0x1b0)
[<c04b18b4>] (cpuidle_enter_state) 9c)
[<c014c834>] (cpu_startup_entry) from [<c0900bb4>] (start_kernel+0x2f8/0x358)
[<c0900bb4>] (start_kernel) from [<0000807c>] (0x807c)
---[ ent fs on unknown-block(2,0)

-------------------------error message end-----------------------------------------------------

 

I had made sure that network is ok and DHCP server gave an IP to zedboard(IP:10.8.2.220).

I think zedboard tried to mount RootFS through NFS because zedboard's IP was shown with executing showmount on NFS server:

petalinux_configure_nfs_showmount.jpg

 

I can boot zedboard successfully when root filesystem type is INITRAMFS. And mounting NFS RootFS has no problem when an option "nolock" is used. Here is the command:

 mount -t nfs -o nolock 10.8.2.10:/home/RootFS ddd

 

I don't know why I need to use the option "nolock" and I put it into bootargs in file system-conf.dtsi. No work.

 

bootargs = "console=ttyPS0,115200 earlyprintk proto=tcp,nolock root=/dev/nfs nfsroot=10.8.2.10:/home/RootFS,tcp ip=dhcp rw";

 

I had referred many posts. No one has information I need.

 

Please help me to figure out the problem.

 

-----------------------Zedboard boot meessage  start-------------------------------------------------

 

## Loading kernel from FIT Image at 10000000 ...
Using 'conf@2' configuration
Verifying Hash Intx00008000
Hash algo: sha1
Hash value: 4d8e9e92ee507a68495027bcdaf33add98d78fd5
Verifying Hash Integrity ... sha1+ OK
## Loading fdt from FIT Image at 10000000 ...
Using 'conf@2' configuration
Trying 'fdt@0' fdt subimage
Description: Flattenefdt blob at 0x10393030
Loading Kernel Image ... OK
Loading Device Tree to 07ff9000, end 07fffa3b ... OK

Starting kernel ...

Uncompressing Linux. done, booting the kernel.
Booting Linux on physical CPU 0x0
Linux version 4.9.0-xilinx-v2017.4 (jerry@xTool) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-P
2
free_area_init_node: node 0, pgdat c0a31400, node_mem_map debef000 離線 Normal zone: 1024 pages used for memmap
Norrouping on. Total pages: 130048
Kernel command line: console=ttyPS0,115200n8 ip=dhcp root=/dev/nfs rootfstype=nfs nfsroot=10.)
Virtual kernel memory laxbfe00000 ( 14 MB)
.text : 0xc0008000 - 0xc0700000 (7136 kB)
.init : 0xc0900000 - 0xc0a00000 (1024 kB)
.data : 0xc0a0000 Adjusting geometry for rcu_fanout_leaf=32, nr_cpu_ids=2
NR_IRQS:16 nr_irqs:16 16
efuse mapped to e0800000
slcr mapped to e0802000
L2C: platfor310 ID prefetch enabled, offset 1 lines
L2C-310 dynamic clock gating enabled, standby mode enabled
L2C-310 cache controller enabled, 8 ways, 512 k 0x4ce07af025, max_idle_ns: 440795209040 ns
Switching to timer-based delay loop, resolution 3ns
clocksource: ttc_clocksource: mask: 0xffff max_cyce hash table entries: 1024 (order: 0, 4096 )
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer cohe: initialized
VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 4
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xfffffand 1 watchpoint registers.
hw-breakpoint: maximum watchpoint size is 4 bytes.
zynq-ocm f800c000.ocmc: ZYNQ OCM pool: 256 KiB @ 0xe0840000
zynqGPIO IRQ not connected
XGpio: /amba_pl/gpio@41200000: registered, base is 1016
vgaarb: loaded
SCSI subsystem initialized
usbcore: registered gistered
pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
PTP clock support registered
EDAC MC: Ver: 3.0NET: Registered protocol family 2
TCP established hash table entries: 4096 (order: 2, 16384 bytes)
TCP bind hash table entries: 4096 (order: 3, gistered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
PCI: CLS 0 bytes, 2.2. (NAND) (SUMMARY) �© 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered
io scheduler cfq registered (de[drm] Initialized
brd: module loaded
loop: module loaded
m25p80 spi0.0: found s25fl256s1, expected n25q512a
m25p80 spi0.0: s25fl256s1 (32768 K
4 ofpart partitions found on MTD device spi0.0
Creating 4 MTD partitions on "spi0.0":
0x000000000000-0x000000500000 : "boot"
0x000000500000-0x0libphy: MACB_mii_bus: probed
macb e000b000.ethernet eth0: Cadence GEM rev 0x00020118 at 0xe000b000 irq 27 (00:0a:35:00:1e:)
Marvell 88E1510 e000b000.etherne:00: attached Prface driver usb-storage
mousedev: PS/2 mouse device common for all mice
i2c /dev entries driver
cdns-wdt f8005000.watchdog: Xilinx Watchdog Time and OF driver helper
mmc0: SDHCI controller on e0100000.sdhci [e0100000.sdhci] using ADMA
ledtrig-cpu: registered to indicate activity on CPUs
usbcore: registered nsit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
NET: Registered protocol family 17
can: controller area network core (rev 20120528 abi 9)
ew SDHC card at address e624
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
mmcblk0: mmc0:e624 SU08G 7.40 GiB
mmcblk0: p1
macb e000b000.ethernet eth0: link up (100/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 10.8.2.1, my address is 10.8.2.220
IP-Config: Complete:
device=eth0, hwaddr=00:0a:35:00:1e:53, ipaddr=10.8.0.19
ALSA device list:
�random: fast init done
VFS: Unable to mount root fs via NFS, trying floppy.
List of all partitions:
0100 16384 ram0 (driver?)
0101 16384 ram1 (104 16384 ram4 (driver?)
0105 16384 ram5 (driver?)
0106 16384 ram6 (driver?)
0107 16384 ram7 (driver9 16384 ram9 (driver?)
010a 16384 ram10 (driver?)
010b 16384 ram11 (driver?)
010c 16384 ram12 (drive 16384 ram14 (driver?)
010f 16384 ram15 (driver?)
1f00 5120 mtdblock0 (driver?)
1f01 128 mtdblock1 (driv16768 mtdblock3 (driver?)
b300 7761920 mmcblk0 driver: mmcblk
b301 7760896 mmcblk0p1 1302a8b3-01
No filesystem could mount to mount root fs on unknown-block(2,0)
CPU0: stopping
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-xilinx-v2017.4 #3
Hardware name: Xilinx Zy(show_stack+0x10/0x14)
[<c010a4a4>] (show_stack) from [<c02dc2d0>] (dump_stack+0x80/0x9c)
[<c02dc2d0>] (dump_stack) from [<c010c9f8>] (ipi_cpu_stoto 0xc0a01f80)
1f20: 00000000 00000017
1f40: 1e28e000 debcf9c0 3b0ae596 00000017 debcee40 04b1890 c04b18b4 60000013 ffffffff
[<c010ae8c>] (__irq_svc) from [<c04b18b4>] (cpuidle_enter_state+0xe4/0x1b0)
[<c04b18b4>] (cpuidle_enter_state) 9c)
[<c014c834>] (cpu_startup_entry) from [<c0900bb4>] (start_kernel+0x2f8/0x358)
[<c0900bb4>] (start_kernel) from [<0000807c>] (0x807c)
---[ ent fs on unknown-block(2,0)

 

0 Kudos
13 Replies
Highlighted
Teacher
Teacher
6,012 Views
Registered: ‎06-16-2013

Hi @jerry.yau

 

I don't have any answer about your question.

 

> I want to quickly update the content of root file system so I use NFS to boot zynq embedded system.

 

However, if you want to quickly update the content of root file system for debugging, I suggest to use tftp boot.

I think that it is useful for you and I'm not sure but Xilinx already prepared the document to support tftp boot.

 

Best regards,

 

0 Kudos
Highlighted
Adventurer
Adventurer
6,006 Views
Registered: ‎03-21-2010

Hi, @watari.

  Thanks for your reply. Sorry, I had to use NFS. My customer doesn't allow tftp server.

Thanks

B/R

Jerry Yau

0 Kudos
Highlighted
Teacher
Teacher
6,005 Views
Registered: ‎06-16-2013

Hi @jerry.yau

 

Got it.

 

Generally, it need writable attribute on linux root file system.

Would you make sure whether NFS has writable attribute or not ?

 

If linux root file system is read only, linux kernel hang up.

 

Best regards,

 

0 Kudos
Highlighted
Adventurer
Adventurer
5,993 Views
Registered: ‎03-21-2010

Hi @watari.

  Two commands I used:

chmod 777 /home

chmod 777 /home/RootFS.

 

And NFS with attribute rw in bootargs.

 

Kernel is still panic.

 

Thanks

B/R

Jerry Yau

0 Kudos
Highlighted
Teacher
Teacher
5,985 Views
Registered: ‎06-16-2013

Hi @jerry.yau

 

Would you make sure export setting on NFS server ?

Even if you already made writable attribute, nfs server can change the attribute from w/r to r/o by NFS server setting.

 

Best regards,

0 Kudos
Highlighted
Adventurer
Adventurer
5,973 Views
Registered: ‎03-21-2010

Hi @watari.

  Here is my NFS setting:

[root@xTool home]# more /etc/exports
/home/Xilinx 10.8.0.0/16(rw,async,no_root_squash)
/ap/Xilinx 10.8.0.0/16(rw,async,no_root_squash)
/home/jerry/RootFS 10.8.0.0/16(rw,async,no_root_squash)
/home/RootFS 10.8.0.0/16(rw,async,no_root_squash)
[root@xTool home]#

 

all exported folds are rw.

 

Thanks

B/R

Jerry Yau

0 Kudos
Highlighted
Teacher
Teacher
5,966 Views
Registered: ‎06-16-2013

Hi @jerry.yau

 

Could you tell me how do you mount / (root) and where do you mount from NFS server ?

 

Best regards,

0 Kudos
Highlighted
Adventurer
Adventurer
5,939 Views
Registered: ‎03-21-2010

 Hi, @watari.

  Sorry, I do not completely understand your question. Here is my answer:

 

1. I want to let kernel use NFS as root filesystem so kernel mounts NFS root filesystem by itself.  I don't know how it does. I just know I have put arguments in bootargs.

 

2. I made another embedded linux with initramfs by using petalinux. Embedded system can be booted.

The if I use below command to mount NFS, I got the error message:

 

mount -t nfs 10..2.8.10:/home/RootFS ddd

-----------------error message start---------------------

svc: failed to register lockdv1 RPC service (errno 111).
lockd_up: makesock failed, error=-111
mount: mounting 10.8.2.10:/home/RootFS on ddd failed: Connection refused

-----------------error message end----------------------

 

I need to add -o nolock to command mount. Then embedded system mount NFS successfully.

Here is the final command:

mount -t nfs -o nolock 10.8.2.10:/home/RootFS ddd

 

Thanks

B/R
Jerry Yau

0 Kudos
Highlighted
Adventurer
Adventurer
5,936 Views
Registered: ‎03-21-2010

Hi, @watari.

  If you know Chinese, you can refer this post wrote by me. It shows the way I set up a NFS server. Maybe I miss somethings.

 

https://goo.gl/9v6C35

 

Thanks

B/R
Jerry Yau

0 Kudos
Highlighted
Teacher
Teacher
5,365 Views
Registered: ‎06-16-2013

Hi @jerry.yau

 

Sorry for my late reply.

It's traditional Chinese.

First of all, Linux kernel should boot with writable rootfs.
Because of, at least, Linux kernel mounts special device (ex. /dev/ /proc /tmp).

I guess, in your case, I suspect rootfs(/), which is on NFS or ramdisk, is not writable and it's route cause.

Even if you already set "777" by chmod on local disk (export disk), it occurs like this problem. If root directory on embedded linux is not writable.

Would you make sure it ?

Best regards,

0 Kudos
Highlighted
Adventurer
Adventurer
5,339 Views
Registered: ‎03-21-2010

Hi, @watari.

  I am sorry for late due to I have a trip these days.

 

I use another centos 7 machine to mount exported rootfs by the superuser. It work and I can create a fold. All steps are shown below:

So I think the exported rootfs is writable.

NFS_Create_a_fold.jpg

I show you the settings of NFS server:

 

[root@xTool jerry]# more /etc/exports
/home/Xilinx 10.8.0.0/16(rw,async,no_root_squash)
/ap/Xilinx 10.8.0.0/16(rw,async,no_root_squash)
/home/jerry/RootFS 10.8.0.0/16(rw,async,no_root_squash)
/home/RootFS 10.8.0.0/16(rw,async,no_root_squash)

 

Here are the steps to enable my NFS service.

1. Install NFS utils

yum -y install nfs-utils

 

2. create a fold for rootfs on NFS server

     mdkir /home/RootFS

 

3. Add created fold into  /etc/exports

vim /etc/exports
/home/RootFS 10.8.0.0/16(rw,async,no_root_squash)

 

4. Start NFS server

systemctl start nfs-server.service

 

5. Start RPC server

systemctl start rpcbind.service

 

6. launch NFS and RPC when rebooting

systemctl enable nfs-server.service
systemctl enable rpcbind.service

 

7. Change firewall rule for NFS server

firewall-cmd –permanent –zone public –add-service rpc-bind
firewall-cmd –permanent –zone public –add-service mountd
firewall-cmd –permanent –zone public –add-service=nfs
firewall-cmd –reload

 

PS: SElinux is disabled. 

 

Please tell me what I miss.

Thanks
B/R

Jerry Yau

 

 

0 Kudos
Highlighted
Adventurer
Adventurer
5,186 Views
Registered: ‎03-21-2010

Hi, @watari.

I had some update.

I changed bootargs in u-boot to

console=ttyPS0,115200n8 ip=dhcp root=/dev/nfs rootfstype=nfs nfsroot=10.8.2.10:/home/jerry/RootFS,port=2049,tcp,nolock,nfsvers=3 rw

 

The NFS Root filesystem can be mounted. But the connection is very unstable with blow messages. No idea to solve this problem.

 

nfs: server 10.8.2.10 not responding, still trying
nfs: server 10.8.2.10 not responding, still trying
nfs: server 10.8.2.10 not responding, still trying
nfs: server 10.8.2.10 not responding, till trying
nfs: server 10.8.2.10 not responding, still trying
nfs: server 10.8.2.10 not responding, still trying
nfs: server 10.8.2.10 not respon.2.10 not responding, still trying
nfs: server 10.8.2.10 OK
nfs: server 10.8.2.10 OK
nfs: server 10.8.2.10 OK
nfs: server 10.8.2.10 OK
nfs: server 10.8.2.10 OK
nfs: server 10.8.2.10 OK
nfs: server 10.8.2.10 OK
nfs: server 10.8.2.10 OK
nfs: server 10.8.2.10 OK
INIT: version 2.88 booting

 

0 Kudos
Highlighted
Visitor
Visitor
5,181 Views
Registered: ‎07-30-2018

Could you tell me where you took root fs ? Thank you.

0 Kudos