View previous topic :: View next topic |
Author |
Message |
tenspd1370 Tux's lil' helper
Joined: 14 Dec 2017 Posts: 124
|
Posted: Wed Dec 05, 2018 2:43 am Post subject: Rockpro64 NFS root mount [solved] |
|
|
Hi all -
I made a kernel for a rockpro64 using the 4.20-r4 git sources. It seems that I can get it to look for an NFS root - but it doesn't find it:
Code: |
NFS: nfs mount opts='vers=2,udp,rsize=4096,wsize=4096,vers=4.1,tcp,nolock,addr=10.10.0.1'
NFS: parsing nfs mount option 'vers=2'
NFS: parsing nfs mount option 'udp'
NFS: parsing nfs mount option 'rsize=4096'
NFS: parsing nfs mount option 'wsize=4096'
NFS: parsing nfs mount option 'vers=4.1'
NFS: parsing nfs mount option 'tcp'
NFS: parsing nfs mount option 'nolock'
NFS: parsing nfs mount option 'addr=10.10.0.1'
NFS: MNTPATH: '/export/sysroot'
--> nfs4_try_mount()
<-- nfs4_try_mount() = -101 [error]
|
Here are my kernel parameters:
Code: |
console=ttyS2,1500000 earlycon=uart8250,mmio32,0xff1a0000 root=/dev/nfs rw nfsroot=10.10.0.1:/export/sysroot,vers=4.1,tcp ip=:::::eth0:dhcp raid=noautodetect nfsrootdebug
|
and my dhcp server setup:
Code: |
allow bootp;
subnet 10.10.0.0 netmask 255.255.255.0 {
range 10.10.0.2 10.10.0.20;
option routers 10.0.0.1;
group{
host rock64{
hardware ethernet ca:74:d0:12:d1:91;
fixed-address 10.10.0.2;
filename "rock.Image";
option root-path "/usr/aarch64-unknown-linux-gnu/boot";
}
}
}
|
I don't see anything confirming that my network interface is up - nothing along the lines of (from another example):
Code: |
IP-Config: Complete:
device=eth0, addr=192.168.1.100, mask=255.255.255.0, gw=255.255.255.255,
host=myboard, domain=, nis-domain=(none),
bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
|
but I also don't see anything saying it is failing to bring up eth0. I tried googling the -101 error, I can't find anything useful. I know NFS is working because I can mount my export on the server in my home dir without any problems. I have all the realtek/rockchip stuff checked in the kernel:
CONFIG_NET_VENDOR_REALTEK=y
CONFIG_REALTEK_PHY=y
CONFIG_ROCKCHIP_PHY=Y
and all the realtek ethernet driver options checked.
The way I have been booting this though is by using tftpboot:
(at u-boot prompt)
Code: |
TFTP from server 10.10.0.1; our IP address is 10.10.0.2
Filename 'Image.rock'.
Load address: 0x2000000
Loading: #################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
#################################################################
##############################################
4.3 MiB/s
done
Bytes transferred = 21666304 (14a9a00 hex)
=> tftpboot 0x20000000 rk3399-rockpro64.dtb
Speed: 100, full duplex
Using ethernet@fe300000 device
TFTP from server 10.10.0.1; our IP address is 10.10.0.2
Filename 'rk3399-rockpro64.dtb'.
Load address: 0x20000000
Loading: ####
3.9 MiB/s
done
Bytes transferred = 53179 (cfbb hex)
=> booti 0x2000000 - 0x20000000
## Flattened Device Tree blob at 20000000
Booting using the fdt blob at 0x20000000
Loading Device Tree to 00000000f5ef5000, end 00000000f5f04fba ... OK
Starting kernel ...
|
and I eventually get to:
Code: |
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0): error -6
Please append a correct "root=" boot option; here are the available partitions:
0100 4096 ram0
.....
.....CPU: 0 PID: 1 Comm: swapper/0 Tainted: G T 4.20.0-rc4 #14
Hardware name: Pine64 RockPro64 (DT)
Call trace:
dump_backtrace+0x0/0x148
show_stack+0x18/0x28
dump_stack+0x90/0xb4
panic+0x144/0x2a4
mount_block_root+0x370/0x428
mount_root+0x1bc/0x214
prepare_namespace+0x2c8/0x338
kernel_init_freeable+0x4fc/0x560
kernel_init+0x10/0x100
ret_from_fork+0x10/0x18
SMP: stopping secondary CPUs
Kernel Offset: disabled
CPU features: 0x2,21806008
Memory Limit: none
---[ end Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0) ]---
|
which is fine - it means I am getting something 1/4 of the way right.
I am running out of ideas - anyone have any suggestions? I'd just like it to mount the NFS root, from there, I'd like to be able to develop, but at this point, not sure what I am missing.
Thanks!
Last edited by tenspd1370 on Sun Dec 09, 2018 1:53 am; edited 1 time in total |
|
Back to top |
|
|
erm67 l33t
Joined: 01 Nov 2005 Posts: 653 Location: EU
|
Posted: Wed Dec 05, 2018 7:04 am Post subject: |
|
|
I don't think the kernel can use dhcp directly, do you use an initrd, dracut maybe? _________________ Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia
My fediverse account: @erm67@erm67.dynu.net |
|
Back to top |
|
|
tenspd1370 Tux's lil' helper
Joined: 14 Dec 2017 Posts: 124
|
Posted: Wed Dec 05, 2018 7:58 am Post subject: |
|
|
No, not right now. Figuring that out was kind of my next thought. My (naive) understanding has always been if you compile it in the kernel, you don't need an initrd. I need to read up on it again...
Ohhh, that makes sense. That would also give a place fir the jernel to mount the nfs root to, perhaps.... |
|
Back to top |
|
|
erm67 l33t
Joined: 01 Nov 2005 Posts: 653 Location: EU
|
Posted: Wed Dec 05, 2018 12:24 pm Post subject: |
|
|
No the kernel does use dhcp:
https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt
Quote: |
The <autoconf> parameter can appear alone as the value to the `ip'
parameter (without all the ':' characters before). If the value is
"ip=off" or "ip=none", no autoconfiguration will take place, otherwise
autoconfiguration will take place. The most common way to use this
is "ip=dhcp".
|
ip=dhcp is probably enough _________________ Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia
My fediverse account: @erm67@erm67.dynu.net |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54831 Location: 56N 3W
|
Posted: Wed Dec 05, 2018 12:30 pm Post subject: |
|
|
tenspd1370,
I've never been able to mount root from anything greater than NFS 3. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
tenspd1370 Tux's lil' helper
Joined: 14 Dec 2017 Posts: 124
|
Posted: Wed Dec 05, 2018 4:53 pm Post subject: |
|
|
Neddy -
Yes - I changed to vers=3. Still no luck, but I don't get the -101 error, so that is progress.
erm67 -
I went as far as trying static configuration as I am still using the u-boot prompt and just tftp to load and start the kernel. I am guessing networking is ok, since I see no errors, but I would feel better if I saw something confirming that networking is configured (following comes from other examples I have seen)
Code: |
IP-Config: Complete:
device=eth0, addr=192.168.1.100, mask=255.255.255.0, gw=255.255.255.255,
host=myboard, domain=, nis-domain=(none),
bootserver=255.255.255.255, rootserver=255.255.255.255, rootpath=
|
and maybe some output from /var/log/message after enabling
Code: |
rpcdebug -m nfsd -s all
rpcdebug -m rpc -s all
|
Seeing as how I am seeing nothing happen, I still question whether I have networking up and running. One thing I noticed is that on the patched kernel that a lot of people use ( https://github.com/ayufan-rock64/linux-kernel - 4.4) is that there is also a rockchip ethernet driver. I don't think I should need that though as the rockpro64 has an RTL8211F on it. I am using the 4.20 kernel specifically because i had rockpro64 support added in (from what I can tell).
I'll try some more stuff tonight. Thanks both for the input, all suggestions are appreciated! |
|
Back to top |
|
|
tenspd1370 Tux's lil' helper
Joined: 14 Dec 2017 Posts: 124
|
Posted: Thu Dec 06, 2018 5:19 am Post subject: |
|
|
Here is a bit more progress - now the error is:
Code: |
NFS: nfs mount opts='vers=2,udp,rsize=4096,wsize=4096,tcp,vers=3,nolock,addr=10.10.0.1'
NFS: parsing nfs mount option 'vers=2'
NFS: parsing nfs mount option 'udp'
NFS: parsing nfs mount option 'rsize=4096'
NFS: parsing nfs mount option 'wsize=4096'
NFS: parsing nfs mount option 'tcp'
NFS: parsing nfs mount option 'vers=3'
NFS: parsing nfs mount option 'nolock'
NFS: parsing nfs mount option 'addr=10.10.0.1'
NFS: MNTPATH: '/export/sysroot'
NFS: sending MNT request for 10.10.0.1:/export/sysroot
NFS: failed to create MNT RPC client, status=-101
NFS: unable to mount server 10.10.0.1, error -101
|
but my server has all the rpc stuff running as far as I can tell.
One thing that is bothering me is this:
nfs mount opts='vers=2,udp,rsize=4096,wsize=4096,tcp,vers=3,nolock,addr=10.10.0.1'
why is vers=2 and udp hardcoded in? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54831 Location: 56N 3W
|
Posted: Thu Dec 06, 2018 8:21 pm Post subject: |
|
|
tenspd1370,
Lets do a trivial test of your NFS setup.
On the server, NFS mount the share somewhere, so the server does both the export and the mount.
Once that works, try the mount across the network.
You may need to edit /etc/exports to allow that to happen.
At the moment we only want to check the functionality of NFS.
Once that works, back to root over nfs. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
tenspd1370 Tux's lil' helper
Joined: 14 Dec 2017 Posts: 124
|
Posted: Fri Dec 07, 2018 3:17 pm Post subject: |
|
|
sudo mount -t nfs -o vers=3 127.0.0.1:/export/sysroot tmp
works. As soon as I get a chance, I'll try a mount over the network and get back to you.
Thanks! |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54831 Location: 56N 3W
|
Posted: Fri Dec 07, 2018 6:22 pm Post subject: |
|
|
tenspd1370,
That shows the server end software in correct.
I would have used the real NIC IP address because that shows that the exports file allows the subnet you are trying to connect from for real.
I suppose you remembered the no_root_squash option? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
tenspd1370 Tux's lil' helper
Joined: 14 Dec 2017 Posts: 124
|
Posted: Sat Dec 08, 2018 1:51 am Post subject: |
|
|
I was able to put an "official" build from the rockpro website and mount nfs:
Code: |
mount -t nfs -o vers=3 10.10.0.1:/export/sysroot tmp
|
I did forget the no_root_squash option, so I added it:
Code: |
/export *(rw,sync,no_subtree_check,crossmnt,no_root_squash,fsid=0)
/export/sysroot *(rw,sync,no_subtree_check,no_root_squash)
|
I am going to try looking at this build and see if I can determine exactly what driver is being used for ethernet.
I'll be back later - thanks! |
|
Back to top |
|
|
tenspd1370 Tux's lil' helper
Joined: 14 Dec 2017 Posts: 124
|
Posted: Sat Dec 08, 2018 2:19 am Post subject: |
|
|
After booting up the board, I did the following:
readlink /sys/class/net/eth0/device/driver
../../../bus/platform/drivers/rk_gmac-dwmac
rock64@rockpro64:~$ grep DWMAC config
CONFIG_DWMAC_GENERIC=y
# CONFIG_DWMAC_IPQ806X is not set
# CONFIG_DWMAC_LPC18XX is not set
# CONFIG_DWMAC_MESON is not set
CONFIG_DWMAC_ROCKCHIP=y
# CONFIG_DWMAC_SOCFPGA is not set
# CONFIG_DWMAC_STI is not set
# CONFIG_DWMAC_SUNXI is not set
rock64@rockpro64:~$ grep DWMAC c
Those are present in the 4.20 kernel, but I haven't enabled them - you know, thinking I needed a Realtek driver. I'll try working with those.
Thanks again for your help - I'll report back when I find out more..... |
|
Back to top |
|
|
tenspd1370 Tux's lil' helper
Joined: 14 Dec 2017 Posts: 124
|
Posted: Sun Dec 09, 2018 1:53 am Post subject: |
|
|
I figured it out - since there is no "config" for this board in arch/arm64/configs, I was on my own. I hadn't included any of the power regulator support.
Now I can get to:
Code: |
rk_gmac-dwmac fe300000.ethernet: PTP uses main clock
rk_gmac-dwmac fe300000.ethernet: Looking up phy-supply from device tree
rk_gmac-dwmac fe300000.ethernet: Linked as a consumer to regulator.21
rk_gmac-dwmac fe300000.ethernet: clock input or output? (input).
rk_gmac-dwmac fe300000.ethernet: TX delay(0x28).
rk_gmac-dwmac fe300000.ethernet: RX delay(0x11).
rk_gmac-dwmac fe300000.ethernet: integrated PHY? (no).
rk_gmac-dwmac fe300000.ethernet: cannot get clock clk_mac_speed
rk_gmac-dwmac fe300000.ethernet: clock input from PHY
rk_gmac-dwmac fe300000.ethernet: init for RGMII
rk_gmac-dwmac fe300000.ethernet: User ID: 0x10, Synopsys ID: 0x35
rk_gmac-dwmac fe300000.ethernet: DWMAC1000
rk_gmac-dwmac fe300000.ethernet: DMA HW capability register supported
rk_gmac-dwmac fe300000.ethernet: RX Checksum Offload Engine supported
rk_gmac-dwmac fe300000.ethernet: COE Type 2
rk_gmac-dwmac fe300000.ethernet: TX Checksum insertion supported
rk_gmac-dwmac fe300000.ethernet: Wake-Up On Lan supported
rk_gmac-dwmac fe300000.ethernet: Normal descriptors
rk_gmac-dwmac fe300000.ethernet: Ring mode enabled
rk_gmac-dwmac fe300000.ethernet: Enable RX Mitigation via HW Watchdog Timer
libphy: stmmac: probed
RTL8211F Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:p)
RTL8211F Gigabit Ethernet stmmac-0:01: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:p)
printk: console [netcon0] enabled
netconsole: network logging started
gtp: GTP module loaded (pdp ctx size 104 bytes)
input: gpio-keys as /devices/platform/gpio-keys/input/input0
RTL8211F Gigabit Ethernet stmmac-0:00: attached PHY driver [RTL8211F Gigabit Ethernet] (mii_bus:p)
rk_gmac-dwmac fe300000.ethernet eth0: No Safety Features support found
rk_gmac-dwmac fe300000.ethernet eth0: PTP not supported by HW
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
rk_gmac-dwmac fe300000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
IP-Config: Complete:
device=eth0, hwaddr=ca:74:d0:12:d1:91, ipaddr=10.10.0.2, mask=255.255.255.0, gw=255.255.255.5
host=rockpro64, domain=, nis-domain=(none)
bootserver=10.10.0.1, rootserver=10.10.0.1, rootpath=
|
and it mounts
Code: |
Root-NFS: nfsroot=/export/sysroot,proto=tcp,vers=3
NFS: nfs mount opts='vers=2,udp,rsize=4096,wsize=4096,proto=tcp,vers=3,nolock,addr=10.10.0.1'
NFS: parsing nfs mount option 'vers=2'
NFS: parsing nfs mount option 'udp'
NFS: parsing nfs mount option 'rsize=4096'
NFS: parsing nfs mount option 'wsize=4096'
NFS: parsing nfs mount option 'proto=tcp'
NFS: parsing nfs mount option 'vers=3'
NFS: parsing nfs mount option 'nolock'
NFS: parsing nfs mount option 'addr=10.10.0.1'
NFS: MNTPATH: '/export/sysroot'
NFS: sending MNT request for 10.10.0.1:/export/sysroot
NFS: received 1 auth flavors
NFS: auth flavor[0]: 1
NFS: MNT request succeeded
NFS: attempting to use auth flavor 1
VFS: Mounted root (nfs filesystem) on device 0:16.
devtmpfs: mounted
Freeing unused kernel memory: 1728K
Run /sbin/init as init process
can't run '/etc/init.d/rcS': No such file or directory
|
which makes sense since I haven't fully figured out the root filesystem components yet.
Thanks for your help everyone! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|