PacktPublishing / Mastering-Embedded-Linux-Programming-Third-Edition

Mastering Embedded Linux Programming Third Edition, published by Packt
MIT License
506 stars 151 forks source link

Trouble mounting rootfs using NFS on BBB #69

Closed qsvui closed 8 months ago

qsvui commented 8 months ago

Hello, I'm at the section "Testing with the BeagleBone Black" on page 156 and my BeagleBone can't seem to connect to the NFS server. I'm sure that the server itself is working since I ran the previous QEMU test just fine. The added wrinkle here is that I'm using Windows 10 and the NFS server is running in WSL.

Here are the U-Boot commands I entered:

=> setenv serverip 192.168.1.1
=> setenv ipaddr 192.168.1.101
=> setenv npath /home/qsvui/projects/rootfs-bbb
=> setenv bootargs console=ttyO0,115200 root=/dev/nfs rw nfsroot=${serverip}:${npath},v3 ip=${ipaddr}
=> fatload mmc 0:1 0x80200000 zImage
9081344 bytes read in 584 ms (14.8 MiB/s)
=> fatload mmc 0:1 0x80f00000 am335x-boneblack.dtb
58300 bytes read in 6 ms (9.3 MiB/s)
=> bootz 0x80200000 - 0x80f00000
## Flattened Device Tree blob at 80f00000
   Booting using the fdt blob at 0x80f00000
   Loading Device Tree to 8ffee000, end 8ffff3bb ... OK

Note that I did insert the v3 as stated in the errata.

Here's the following kernel start messages:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.50 (qsvui@gjaio-PC) (gcc version 8.5.0 (crosstool-NG 1.25.0)) #1 SMP Fri Oct 6 22:53:01 PDT 2023
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black
[    0.000000] Memory policy: Data cache writeback
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 64 MiB at 0x9b800000
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] percpu: Embedded 20 pages/cpu s49228 r8192 d24500 u81920
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129540
[    0.000000] Kernel command line: console=ttyO0,115200 root=/dev/nfs rw nfsroot=192.168.1.1:/home/qsvui/projects/rootfs-bbb,v3 ip=192.168.1.101
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 429224K/522240K available (12288K kernel code, 1657K rwdata, 5204K rodata, 2048K init, 393K bss, 27480K reserved, 65536K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=16 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
[    0.000000] random: get_random_bytes called from start_kernel+0x314/0x4b4 with crng_init=0
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000018] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000037] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000047] OMAP clocksource: timer1 at 24000000 Hz
[    0.006345] timer_probe: no matching timers found
[    0.006545] Console: colour dummy device 80x30
[    0.006574] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.006580] This ensures that you still see kernel messages. Please
[    0.006586] update your kernel commandline.
[    0.006627] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
[    0.089093] pid_max: default: 32768 minimum: 301
[    0.089273] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.089287] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.090022] CPU: Testing write buffer coherency: ok
[    0.090090] CPU0: Spectre v2: using BPIALL workaround
[    0.090455] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.091083] Setting up static identity map for 0x80300000 - 0x803000ac
[    0.093159] rcu: Hierarchical SRCU implementation.
[    0.097256] EFI services will not be available.
[    0.097437] smp: Bringing up secondary CPUs ...
[    0.097450] smp: Brought up 1 node, 1 CPU
[    0.097458] SMP: Total of 1 processors activated (996.14 BogoMIPS).
[    0.097466] CPU: All CPU(s) started in SVC mode.
[    0.098014] devtmpfs: initialized
[    0.108488] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.108799] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.108830] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.112918] pinctrl core: initialized pinctrl subsystem
[    0.115365] DMI not present or invalid.
[    0.115898] NET: Registered protocol family 16
[    0.118310] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.146404] l3-aon-clkctrl:0000:0: failed to disable
[    0.150159] cpuidle: using governor menu
[    0.176993] No ATAGs?
[    0.177003] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.185014] Serial: AMBA PL011 UART driver
[    0.207467] edma 49000000.edma: TI EDMA DMA engine driver
[    0.208571] AT91: Could not find identification node
[    0.212315] iommu: Default domain type: Translated 
[    0.212766] vgaarb: loaded
[    0.213781] SCSI subsystem initialized
[    0.214398] usbcore: registered new interface driver usbfs
[    0.214454] usbcore: registered new interface driver hub
[    0.214515] usbcore: registered new device driver usb
[    0.216223] pps_core: LinuxPPS API ver. 1 registered
[    0.216235] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.216257] PTP clock support registered
[    0.216474] EDAC MC: Ver: 3.0.0
[    0.220281] clocksource: Switched to clocksource timer1
[    0.711333] thermal_sys: Registered thermal governor 'step_wise'
[    0.711905] NET: Registered protocol family 2
[    0.712565] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.712595] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.712638] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.712696] TCP: Hash tables configured (established 4096 bind 4096)
[    0.712805] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.712828] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.712988] NET: Registered protocol family 1
[    0.713690] RPC: Registered named UNIX socket transport module.
[    0.713704] RPC: Registered udp transport module.
[    0.713710] RPC: Registered tcp transport module.
[    0.713716] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.713730] PCI: CLS 0 bytes, default 64
[    0.714926] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.716408] Initialise system trusted keyrings
[    0.716740] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.724070] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.725070] NFS: Registering the id_resolver key type
[    0.725115] Key type id_resolver registered
[    0.725122] Key type id_legacy registered
[    0.725166] ntfs: driver 2.1.32 [Flags: R/O].
[    0.725839] Key type asymmetric registered
[    0.725852] Asymmetric key parser 'x509' registered
[    0.725910] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.725920] io scheduler mq-deadline registered
[    0.725928] io scheduler kyber registered
[    0.734873] OMAP GPIO hardware version 0.1
[    0.807018] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    0.890358] Serial: 8250/16550 driver, 5 ports, IRQ sharing enabled
[    0.895382] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 29, base_baud = 3000000) is a 8250
[    1.518118] printk: console [ttyS0] enabled
[    1.524870] SuperH (H)SCI(F) driver initialized
[    1.531244] msm_serial: driver initialized
[    1.535692] STMicroelectronics ASC driver initialized
[    1.543215] STM32 USART driver initialized
[    1.549597] omap_rng 48310000.rng: Random Number Generator ver. 20
[    1.566415] random: fast init done
[    1.569950] random: crng init done
[    1.583688] brd: module loaded
[    1.594470] loop: module loaded
[    1.613722] libphy: Fixed MDIO Bus: probed
[    1.619003] CAN device driver interface
[    1.624769] bgmac_bcma: Broadcom 47xx GBit MAC driver loaded
[    1.632447] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    1.638308] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.644384] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k
[    1.651403] igb: Copyright (c) 2007-2014 Intel Corporation.
[    1.720291] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    1.728008] libphy: 4a101000.mdio: probed
[    1.733616] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    1.742981] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    1.749366] cpsw 4a100000.ethernet: ALE Table size 1024
[    1.754821] cpsw 4a100000.ethernet: Detected MACID = 64:8c:bb:f0:52:32
[    1.763396] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[    1.771032] usbcore: registered new interface driver pegasus
[    1.776765] usbcore: registered new interface driver asix
[    1.782283] usbcore: registered new interface driver ax88179_178a
[    1.788432] usbcore: registered new interface driver cdc_ether
[    1.794362] usbcore: registered new interface driver smsc75xx
[    1.800171] usbcore: registered new interface driver smsc95xx
[    1.805992] usbcore: registered new interface driver net1080
[    1.811725] usbcore: registered new interface driver cdc_subset
[    1.817700] usbcore: registered new interface driver zaurus
[    1.823367] usbcore: registered new interface driver cdc_ncm
[    1.833296] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.839866] ehci-pci: EHCI PCI platform driver
[    1.844468] ehci-platform: EHCI generic platform driver
[    1.850120] ehci-orion: EHCI orion driver
[    1.854556] SPEAr-ehci: EHCI SPEAr driver
[    1.858855] ehci-st: EHCI STMicroelectronics driver
[    1.864081] ehci-exynos: EHCI EXYNOS driver
[    1.868523] ehci-atmel: EHCI Atmel driver
[    1.872848] tegra-ehci: Tegra EHCI driver
[    1.877145] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.883440] ohci-pci: OHCI PCI platform driver
[    1.887974] ohci-platform: OHCI generic platform driver
[    1.893628] SPEAr-ohci: OHCI SPEAr driver
[    1.897923] ohci-st: OHCI STMicroelectronics driver
[    1.903136] ohci-atmel: OHCI Atmel driver
[    1.908424] usbcore: registered new interface driver usb-storage
[    1.924144] i2c /dev entries driver
[    1.951332] sdhci: Secure Digital Host Controller Interface driver
[    1.957558] sdhci: Copyright(c) Pierre Ossman
[    1.964035] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22)
[    1.972866] omap_hsmmc 48060000.mmc: Got CD GPIO
[    2.029051] omap_hsmmc 47810000.mmc: RX DMA channel request failed
[    2.038398] Synopsys Designware Multimedia Card Interface Driver
[    2.047053] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.058860] ledtrig-cpu: registered to indicate activity on CPUs
[    2.067030] usbcore: registered new interface driver usbhid
[    2.072723] usbhid: USB HID core driver
[    2.083253] drop_monitor: Initializing network drop monitor service
[    2.090625] NET: Registered protocol family 10
[    2.096568] Segment Routing with IPv6
[    2.100427] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.107099] NET: Registered protocol family 17
[    2.111645] can: controller area network core (rev 20170425 abi 9)
[    2.117944] NET: Registered protocol family 29
[    2.122441] can: raw protocol (rev 20170425)
[    2.126730] can: broadcast manager protocol (rev 20170425 t)
[    2.132448] can: netlink gateway (rev 20190810) max_hops=1
[    2.138713] Key type dns_resolver registered
[    2.143260] ThumbEE CPU extension supported.
[    2.147568] Registering SWP/SWPB emulation handler
[    2.152423] omap_voltage_late_init: Voltage driver support not added
[    2.160557] Loading compiled-in X.509 certificates
[    2.185849] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.196574] mmc0: new high speed SDHC card at address 5048
[    2.202951] mmcblk0: mmc0:5048 SK32G 29.7 GiB 
[    2.210691]  mmcblk0: p1 p2
[    2.231912] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    2.238311] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    2.245797] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    2.270649] mmc1: new high speed MMC card at address 0001
[    2.276871] mmcblk1: mmc1:0001 MK2704 3.53 GiB 
[    2.281778] mmcblk1boot0: mmc1:0001 MK2704 partition 1 2.00 MiB
[    2.287976] mmcblk1boot1: mmc1:0001 MK2704 partition 2 2.00 MiB
[    2.294359] mmcblk1rpmb: mmc1:0001 MK2704 partition 3 512 KiB, chardev (235:0)
[    2.303545]  mmcblk1: p1
[    2.392955] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    2.399746] hctosys: unable to open rtc device (rtc0)
[    2.406391] cpsw 4a100000.ethernet: initializing cpsw version 1.12 (0)
[    2.511155] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[    5.680954] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[    5.700302] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    5.730420] IP-Config: Guessing netmask 255.255.255.0
[    5.735497] IP-Config: Complete:
[    5.738740]      device=eth0, hwaddr=64:8c:bb:f0:52:32, ipaddr=192.168.1.101, mask=255.255.255.0, gw=255.255.255.255
[    5.749335]      host=192.168.1.101, domain=, nis-domain=(none)
[    5.755295]      bootserver=255.255.255.255, rootserver=192.168.1.1, rootpath=
[   41.440291] rpcbind: server 192.168.1.1 not responding, timed out

Note the last message saying the server is not responding.

My /etc/exports should be fine:

# /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)
#
/home/qsvui/projects/rootfs-bbb *(rw,sync,no_subtree_check,no_root_squash)

Do you have any thoughts on what the issue might be?

fvasquez commented 8 months ago

@qsvui looks like you're very close. The BBB is obtaining an IP address of 192.168.1.101.

Thank you for reading the errata before opening an issue.

I noticed in the console output that the rootpath kernel command-line param is empty but I don't think that's the problem.

Don't forget to update the run-qemu-nfsroot.sh and uEnv.txt scripts from Chatper05:

Replace host IP, target IP, and path to staging directory with their actual values. Note that these same placeholder values also need to be updated in the run-qemu-nfsroot.sh and uEnv.txt scripts for Chapter05.

Let me know if you're still stuck on this.

qsvui commented 8 months ago

Do I need to run run-qemu-nfsroot.sh for using the BBB? I already updated it for my environment when running the QEMU test and it worked.

You can see in my initial post that I manually entered the U-Boot commands listed in uEnv.txt. I didn't want to put the file in the SD card until I was sure it would work.

Could there be an issue with my network configuration? My router, PC, and the BBB are connected to an unmanaged switch. I also mentioned that I'm using WSL for going through the examples in the book. Would there have to be any extra configuration on Windows or WSL to let NFS traffic flow between the BBB and WSL?

fvasquez commented 8 months ago

Do I need to run run-qemu-nfsroot.sh for using the BBB? I already updated it for my environment when running the QEMU test and it worked.

You're right. run-qemu-nfsroot.sh is only intended for QEMU and everything in uEnv.txt can be entered manually at the U-Boot prompt.

Would there have to be any extra configuration on Windows or WSL to let NFS traffic flow between the BBB and WSL?

That's a good question. I've never tried to connect to WSL from another machine so I don't know offhand.

I watched this YouTube video which you may have already seen and found some interesting information about port mapping and firewall rules to enable outside access to WSL.

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

Jump to 4:11 for port mapping and 5:01 for firewall rules. Let me know if those instructions work.

qsvui commented 8 months ago

Sorry, still having no luck. I'll list what I've tried but unless you have more suggestions, I'll probably give up on this.

First, my WSL network information:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether XX:XX:XX:XX:XX:XX brd ff:ff:ff:ff:ff:ff
    inet 172.25.136.250/20 brd 172.25.143.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fed8:2d9f/64 scope link
       valid_lft forever preferred_lft forever

The video you linked also suggested using the insecure option for the exports file, which I've added:

$ 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)
#
/home/qsvui/projects/rootfs-bbb *(rw,sync,no_subtree_check,no_root_squash,insecure)

In addition to the ports mentioned in the video, this Stack Overflow answer also suggested forwarding the portmapper and mountd ports:

$ rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100005    1   udp  33333  mountd
    100005    1   tcp  33333  mountd
    100005    2   udp  33333  mountd
    100005    2   tcp  33333  mountd
    100005    3   udp  33333  mountd
    100005    3   tcp  33333  mountd
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    3   tcp   2049
    100003    3   udp   2049  nfs
    100227    3   udp   2049
    100021    1   udp  48335  nlockmgr
    100021    3   udp  48335  nlockmgr
    100021    4   udp  48335  nlockmgr
    100021    1   tcp  35929  nlockmgr
    100021    3   tcp  35929  nlockmgr
    100021    4   tcp  35929  nlockmgr

I followed the instructions in the linked answer to set a static mountd port of 33333, making sure to restart the NFS server so that the changes took effect.

I then followed the instructions in the video to actually forward the ports. Here are the results:

> netsh interface portproxy show v4tov4

Listen on ipv4:             Connect to ipv4:

Address         Port        Address         Port
--------------- ----------  --------------- ----------
0.0.0.0         443         172.25.136.250  443
0.0.0.0         2049        172.25.136.250  2049
0.0.0.0         111         172.25.136.250  111
0.0.0.0         33333       172.25.136.250  33333

I also added the Windows Firewall rules to allow these ports, as mentioned in the video.

Finally, I updated the IP addresses for U-Boot to use the WSL network info:

=> setenv ipaddr 172.25.136.249
=> setenv serverip 172.25.136.250
=> setenv npath /home/qsvui/projects/rootfs-bbb
=> setenv bootargs console=ttyO0,115200 root=/dev/nfs rw nfsroot=${serverip}:${npath},v3 ip=${ipaddr}
=> fatload mmc 0:1 0x80200000 zImage
9081344 bytes read in 583 ms (14.9 MiB/s)
=> fatload mmc 0:1 0x80f00000 am335x-boneblack.dtb
58300 bytes read in 6 ms (9.3 MiB/s)
=> bootz 0x80200000 - 0x80f00000
## Flattened Device Tree blob at 80f00000
   Booting using the fdt blob at 0x80f00000
   Loading Device Tree to 8ffee000, end 8ffff3bb ... OK

However, the connection still timed out:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.4.50 (qsvui@gjaio-PC) (gcc version 8.5.0 (crosstool-NG 1.25.0)) #1 SMP Fri Oct 6 22:53:01 PDT 2023
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] OF: fdt: Machine model: TI AM335x BeagleBone Black
[    0.000000] Memory policy: Data cache writeback
[    0.000000] efi: Getting EFI parameters from FDT:
[    0.000000] efi: UEFI not found.
[    0.000000] cma: Reserved 64 MiB at 0x9b800000
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] AM335X ES2.1 (sgx neon)
[    0.000000] percpu: Embedded 20 pages/cpu s49228 r8192 d24500 u81920
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 129540
[    0.000000] Kernel command line: console=ttyO0,115200 root=/dev/nfs rw nfsroot=172.25.136.250:/home/qsvui/projects/rootfs-bbb,v3 ip=172.25.136.249
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 429224K/522240K available (12288K kernel code, 1657K rwdata, 5204K rodata, 2048K init, 393K bss, 27480K reserved, 65536K cma-reserved, 0K highmem)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu:     RCU event tracing is enabled.
[    0.000000] rcu:     RCU restricting CPUs from NR_CPUS=16 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] IRQ: Found an INTC at 0x(ptrval) (revision 5.0) with 128 interrupts
[    0.000000] random: get_random_bytes called from start_kernel+0x314/0x4b4 with crng_init=0
[    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
[    0.000017] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 89478484971ns
[    0.000036] clocksource: timer1: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 79635851949 ns
[    0.000047] OMAP clocksource: timer1 at 24000000 Hz
[    0.006356] timer_probe: no matching timers found
[    0.006554] Console: colour dummy device 80x30
[    0.006581] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
[    0.006587] This ensures that you still see kernel messages. Please
[    0.006593] update your kernel commandline.
[    0.006635] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
[    0.089096] pid_max: default: 32768 minimum: 301
[    0.089278] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.089291] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
[    0.090030] CPU: Testing write buffer coherency: ok
[    0.090100] CPU0: Spectre v2: using BPIALL workaround
[    0.090470] CPU0: thread -1, cpu 0, socket -1, mpidr 0
[    0.091101] Setting up static identity map for 0x80300000 - 0x803000ac
[    0.093196] rcu: Hierarchical SRCU implementation.
[    0.097310] EFI services will not be available.
[    0.097489] smp: Bringing up secondary CPUs ...
[    0.097501] smp: Brought up 1 node, 1 CPU
[    0.097509] SMP: Total of 1 processors activated (996.14 BogoMIPS).
[    0.097517] CPU: All CPU(s) started in SVC mode.
[    0.098066] devtmpfs: initialized
[    0.108536] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
[    0.108847] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.108878] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.112953] pinctrl core: initialized pinctrl subsystem
[    0.115403] DMI not present or invalid.
[    0.115937] NET: Registered protocol family 16
[    0.118354] DMA: preallocated 256 KiB pool for atomic coherent allocations
[    0.146464] l3-aon-clkctrl:0000:0: failed to disable
[    0.150214] cpuidle: using governor menu
[    0.176981] No ATAGs?
[    0.176991] hw-breakpoint: debug architecture 0x4 unsupported.
[    0.184997] Serial: AMBA PL011 UART driver
[    0.207449] edma 49000000.edma: TI EDMA DMA engine driver
[    0.208556] AT91: Could not find identification node
[    0.212315] iommu: Default domain type: Translated 
[    0.212766] vgaarb: loaded
[    0.213801] SCSI subsystem initialized
[    0.214419] usbcore: registered new interface driver usbfs
[    0.214475] usbcore: registered new interface driver hub
[    0.214535] usbcore: registered new device driver usb
[    0.216230] pps_core: LinuxPPS API ver. 1 registered
[    0.216240] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.216261] PTP clock support registered
[    0.216476] EDAC MC: Ver: 3.0.0
[    0.220271] clocksource: Switched to clocksource timer1
[    0.711305] thermal_sys: Registered thermal governor 'step_wise'
[    0.711877] NET: Registered protocol family 2
[    0.712542] tcp_listen_portaddr_hash hash table entries: 512 (order: 0, 6144 bytes, linear)
[    0.712571] TCP established hash table entries: 4096 (order: 2, 16384 bytes, linear)
[    0.712614] TCP bind hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.712673] TCP: Hash tables configured (established 4096 bind 4096)
[    0.712780] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.712802] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.712966] NET: Registered protocol family 1
[    0.713664] RPC: Registered named UNIX socket transport module.
[    0.713679] RPC: Registered udp transport module.
[    0.713685] RPC: Registered tcp transport module.
[    0.713690] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.713704] PCI: CLS 0 bytes, default 64
[    0.714898] hw perfevents: enabled with armv7_cortex_a8 PMU driver, 5 counters available
[    0.716382] Initialise system trusted keyrings
[    0.716724] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    0.724046] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.725059] NFS: Registering the id_resolver key type
[    0.725106] Key type id_resolver registered
[    0.725114] Key type id_legacy registered
[    0.725163] ntfs: driver 2.1.32 [Flags: R/O].
[    0.725842] Key type asymmetric registered
[    0.725855] Asymmetric key parser 'x509' registered
[    0.725910] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 247)
[    0.725920] io scheduler mq-deadline registered
[    0.725928] io scheduler kyber registered
[    0.734835] OMAP GPIO hardware version 0.1
[    0.806922] pinctrl-single 44e10800.pinmux: 142 pins, size 568
[    0.890071] Serial: 8250/16550 driver, 5 ports, IRQ sharing enabled
[    0.895188] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 29, base_baud = 3000000) is a 8250
[    1.518264] printk: console [ttyS0] enabled
[    1.525005] SuperH (H)SCI(F) driver initialized
[    1.531362] msm_serial: driver initialized
[    1.535807] STMicroelectronics ASC driver initialized
[    1.543315] STM32 USART driver initialized
[    1.549685] omap_rng 48310000.rng: Random Number Generator ver. 20
[    1.566493] random: fast init done
[    1.570029] random: crng init done
[    1.583777] brd: module loaded
[    1.594597] loop: module loaded
[    1.613853] libphy: Fixed MDIO Bus: probed
[    1.619132] CAN device driver interface
[    1.624897] bgmac_bcma: Broadcom 47xx GBit MAC driver loaded
[    1.632587] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    1.638451] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.644530] igb: Intel(R) Gigabit Ethernet Network Driver - version 5.6.0-k
[    1.651548] igb: Copyright (c) 2007-2014 Intel Corporation.
[    1.720285] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6, bus freq 1000000
[    1.728002] libphy: 4a101000.mdio: probed
[    1.733623] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
[    1.742994] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[    1.749378] cpsw 4a100000.ethernet: ALE Table size 1024
[    1.754836] cpsw 4a100000.ethernet: Detected MACID = 64:8c:bb:f0:52:32
[    1.763413] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[    1.771052] usbcore: registered new interface driver pegasus
[    1.776790] usbcore: registered new interface driver asix
[    1.782311] usbcore: registered new interface driver ax88179_178a
[    1.788460] usbcore: registered new interface driver cdc_ether
[    1.794388] usbcore: registered new interface driver smsc75xx
[    1.800197] usbcore: registered new interface driver smsc95xx
[    1.806019] usbcore: registered new interface driver net1080
[    1.811751] usbcore: registered new interface driver cdc_subset
[    1.817729] usbcore: registered new interface driver zaurus
[    1.823395] usbcore: registered new interface driver cdc_ncm
[    1.833275] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.839843] ehci-pci: EHCI PCI platform driver
[    1.844443] ehci-platform: EHCI generic platform driver
[    1.850092] ehci-orion: EHCI orion driver
[    1.854524] SPEAr-ehci: EHCI SPEAr driver
[    1.858824] ehci-st: EHCI STMicroelectronics driver
[    1.864042] ehci-exynos: EHCI EXYNOS driver
[    1.868486] ehci-atmel: EHCI Atmel driver
[    1.872806] tegra-ehci: Tegra EHCI driver
[    1.877105] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.883401] ohci-pci: OHCI PCI platform driver
[    1.887935] ohci-platform: OHCI generic platform driver
[    1.893593] SPEAr-ohci: OHCI SPEAr driver
[    1.897891] ohci-st: OHCI STMicroelectronics driver
[    1.903116] ohci-atmel: OHCI Atmel driver
[    1.908418] usbcore: registered new interface driver usb-storage
[    1.924108] i2c /dev entries driver
[    1.951416] sdhci: Secure Digital Host Controller Interface driver
[    1.957642] sdhci: Copyright(c) Pierre Ossman
[    1.964101] omap_gpio 44e07000.gpio: Could not set line 6 debounce to 200000 microseconds (-22)
[    1.972928] omap_hsmmc 48060000.mmc: Got CD GPIO
[    2.029046] omap_hsmmc 47810000.mmc: RX DMA channel request failed
[    2.038388] Synopsys Designware Multimedia Card Interface Driver
[    2.047030] sdhci-pltfm: SDHCI platform and OF driver helper
[    2.058787] ledtrig-cpu: registered to indicate activity on CPUs
[    2.066943] usbcore: registered new interface driver usbhid
[    2.072634] usbhid: USB HID core driver
[    2.083165] drop_monitor: Initializing network drop monitor service
[    2.090536] NET: Registered protocol family 10
[    2.096481] Segment Routing with IPv6
[    2.100356] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    2.107020] NET: Registered protocol family 17
[    2.111568] can: controller area network core (rev 20170425 abi 9)
[    2.117868] NET: Registered protocol family 29
[    2.122368] can: raw protocol (rev 20170425)
[    2.126656] can: broadcast manager protocol (rev 20170425 t)
[    2.132371] can: netlink gateway (rev 20190810) max_hops=1
[    2.138638] Key type dns_resolver registered
[    2.143187] ThumbEE CPU extension supported.
[    2.147491] Registering SWP/SWPB emulation handler
[    2.152350] omap_voltage_late_init: Voltage driver support not added
[    2.160492] Loading compiled-in X.509 certificates
[    2.185798] mmc0: host does not support reading read-only switch, assuming write-enable
[    2.196518] mmc0: new high speed SDHC card at address 5048
[    2.202904] mmcblk0: mmc0:5048 SK32G 29.7 GiB 
[    2.210153]  mmcblk0: p1 p2
[    2.231445] tps65217 0-0024: TPS65217 ID 0xe version 1.2
[    2.237832] at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
[    2.245313] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
[    2.288451] mmc1: new high speed MMC card at address 0001
[    2.294894] mmcblk1: mmc1:0001 MK2704 3.53 GiB 
[    2.299746] mmcblk1boot0: mmc1:0001 MK2704 partition 1 2.00 MiB
[    2.306020] mmcblk1boot1: mmc1:0001 MK2704 partition 2 2.00 MiB
[    2.312419] mmcblk1rpmb: mmc1:0001 MK2704 partition 3 512 KiB, chardev (235:0)
[    2.322783]  mmcblk1: p1
[    2.382228] omap_i2c 4819c000.i2c: bus 2 rev0.11 at 100 kHz
[    2.389018] hctosys: unable to open rtc device (rtc0)
[    2.395666] cpsw 4a100000.ethernet: initializing cpsw version 1.12 (0)
[    2.501149] SMSC LAN8710/LAN8720 4a101000.mdio:00: attached PHY driver [SMSC LAN8710/LAN8720] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[    5.680933] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[    5.690288] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[    5.720387] IP-Config: Guessing netmask 255.255.0.0
[    5.725295] IP-Config: Complete:
[    5.728538]      device=eth0, hwaddr=64:8c:bb:f0:52:32, ipaddr=172.25.136.249, mask=255.255.0.0, gw=255.255.255.255
[    5.739048]      host=172.25.136.249, domain=, nis-domain=(none)
[    5.745094]      bootserver=255.255.255.255, rootserver=172.25.136.250, rootpath=
[   41.440283] rpcbind: server 172.25.136.250 not responding, timed out

I also tried the 192 IP addresses that I used in my first post, but that also timed out.

qsvui commented 8 months ago

Ok, so I finally managed to get this working. First of all, I should have been using my PC's actual IP, not the one for WSL or the example value in the book. Also, I needed to add the tcp option to the nfsroot bootarg. Lastly for convenience, I used DHCP to set up the IP for the BBB.

Putting everything together, the U-Boot commands look like this:

=> setenv serverip 192.168.0.11
=> setenv npath /home/qsvui/projects/rootfs-bbb
=> setenv bootargs console=ttyO0,115200 root=/dev/nfs rw nfsroot=${serverip}:${npath},v3,tcp ip=dhcp
=> fatload mmc 0:1 0x80f00000 am335x-boneblack.dtb
58300 bytes read in 6 ms (9.3 MiB/s)
=> fatload mmc 0:1 0x80200000 zImage
9081344 bytes read in 584 ms (14.8 MiB/s)
=> bootz 0x80200000 - 0x80f00000

Now, I'm able to successfully boot over NFS. Thanks for your help!

fvasquez commented 8 months ago

Now, I'm able to successfully boot over NFS. Thanks for your help!

Glad you were able to figure this out. I'm sure you're not the only reader out there using WSL.

I'll add the missing tcp option to the nfsroot bootarg in the errata.

qsvui commented 8 months ago

I think the tcp option was only needed because WSL only allows forwarding of TCP ports at the moment (see issue). I'm guessing U-Boot uses UDP by default for NFS.