OpenWRT Network boot - RaspberryPI

Hi,

I have successfully setup a network boot using a RaspberryPI3 and raspbian lite image and now I try to do it with OpenWRT image.

Currently the Raspberry correctly receive DHCP parameters he download and run the boot partition.

But then the problems come, during the boot it tries to get the rootfs using NFS and it seems that it's not working:

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[    0.000000] Linux version 5.4.179 (builder@buildhost) (gcc version 8.4.0 (OpenWrt GCC 8.4.0 r16495-bf0c965af0)) #0 SMP Wed Feb 16 20:29:10 2022
[    0.000000] Machine model: Raspberry Pi 3 Model B Rev 1.2
[    0.000000] Reserved memory: created CMA memory pool at 0x0000000037400000, size 64 MiB
[    0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
[    0.000000] percpu: Embedded 21 pages/cpu s45336 r8192 d32488 u86016
[    0.000000] Detected VIPT I-cache on CPU0
[    0.000000] CPU features: detected: ARM erratum 843419
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 238896
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=ttyAMA0,115200 console=tty1 ip=192.168.50.2:192.168.50.1::255.255.255.0 root=/dev/nfs nfsroot=192.168.50.1:/nfsshare/root,vers=3 rw
[    0.000000] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes, linear)
[    0.000000] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 875276K/970752K available (6974K kernel code, 414K rwdata, 1112K rodata, 512K init, 537K bss, 29940K reserved, 65536K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	CONFIG_RCU_FANOUT set to non-default value of 32.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] random: get_random_bytes called from 0xffffffc010870b98 with crng_init=0
[    0.000000] arch_timer: cp15 timer(s) running at 19.20MHz (phys).
[    0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[    0.000006] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[    0.000171] Console: colour dummy device 80x25
[    0.000487] printk: console [tty1] enabled
[    0.000525] Calibrating delay loop (skipped), value calculated using timer frequency.. 38.40 BogoMIPS (lpj=76800)
[    0.000554] pid_max: default: 32768 minimum: 301
[    0.000755] Mount-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.000795] Mountpoint-cache hash table entries: 2048 (order: 2, 16384 bytes, linear)
[    0.001545] cgroup: Disabling memory control group subsystem
[    0.002535] ASID allocator initialised with 32768 entries
[    0.002651] rcu: Hierarchical SRCU implementation.
[    0.003314] smp: Bringing up secondary CPUs ...
[    0.003812] Detected VIPT I-cache on CPU1
[    0.003868] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[    0.004607] Detected VIPT I-cache on CPU2
[    0.004646] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[    0.005219] Detected VIPT I-cache on CPU3
[    0.005253] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[    0.005381] smp: Brought up 1 node, 4 CPUs
[    0.005438] SMP: Total of 4 processors activated.
[    0.005454] CPU features: detected: 32-bit EL0 Support
[    0.005471] CPU features: detected: CRC32 instructions
[    0.005533] CPU features: emulated: Privileged Access Never (PAN) using TTBR0_EL1 switching
[    0.005556] CPU: All CPU(s) started at EL2
[    0.005587] alternatives: patching kernel code
[    0.015717] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.015766] futex hash table entries: 1024 (order: 4, 65536 bytes, linear)
[    0.018780] pinctrl core: initialized pinctrl subsystem
[    0.019857] NET: Registered protocol family 16
[    0.025151] DMA: preallocated 1024 KiB pool for atomic allocations
[    0.025759] cpuidle: using governor ladder
[    0.025795] cpuidle: using governor menu
[    0.026228] Serial: AMBA PL011 UART driver
[    0.027482] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[    0.036123] raspberrypi-firmware soc:firmware: Attached to firmware from 2021-02-16 14:19, variant start
[    0.040120] raspberrypi-firmware soc:firmware: Firmware hash is d6d82cf99bcb3e9a166a34cfde53130957a36bd3
[    0.070083] bcm2835-dma 3f007000.dma: DMA legacy API manager, dmachans=0x1
[    0.072087] SCSI subsystem initialized
[    0.072353] usbcore: registered new interface driver usbfs
[    0.072413] usbcore: registered new interface driver hub
[    0.072465] usbcore: registered new device driver usb
[    0.073756] clocksource: Switched to clocksource arch_sys_counter
[    0.078891] thermal_sys: Registered thermal governor 'step_wise'
[    0.079208] NET: Registered protocol family 2
[    0.079482] IP idents hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.080821] tcp_listen_portaddr_hash hash table entries: 512 (order: 1, 8192 bytes, linear)
[    0.080876] TCP established hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.081002] TCP bind hash table entries: 8192 (order: 5, 131072 bytes, linear)
[    0.081205] TCP: Hash tables configured (established 8192 bind 8192)
[    0.081412] UDP hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.081469] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes, linear)
[    0.081672] NET: Registered protocol family 1
[    0.081715] PCI: CLS 0 bytes, default 64
[    0.083278] workingset: timestamp_bits=46 max_order=18 bucket_order=0
[    0.090076] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[    0.115990] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[    0.118362] bcm2708_fb soc:fb: FB found 1 display(s)
[    0.180758] Console: switching to colour frame buffer device 228x61
[    0.209973] bcm2708_fb soc:fb: Registered framebuffer for display 0, size 1824x984
[    0.212272] Serial: 8250/16550 driver, 1 ports, IRQ sharing enabled
[    0.213575] bcm2835-rng 3f104000.rng: hwrng registered
[    0.213960] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[    0.215016] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[    0.215623] cacheinfo: Unable to detect cache hierarchy for CPU 0
[    0.233482] brd: module loaded
[    0.240943] loop: module loaded
[    0.242368] Loading iSCSI transport class v2.0-870.
[    0.243946] usbcore: registered new interface driver lan78xx
[    0.244226] usbcore: registered new interface driver smsc95xx
[    0.244463] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[    0.972661] Core Release: 2.80a
[    0.972797] Setting default values for core params
[    0.973027] Finished setting default values for core params
[    1.028234] random: fast init done
[    1.028473] crng init done
[    1.173562] Using Buffer DMA mode
[    1.173664] Periodic Transfer Interrupt Enhancement - disabled
[    1.173832] Multiprocessor Interrupt Enhancement - disabled
[    1.173988] OTG VER PARAM: 0, OTG VER FLAG: 0
[    1.174115] Dedicated Tx FIFOs mode
[    1.174848] WARN::dwc_otg_hcd_init:1072: FIQ DMA bounce buffers: virt = ffffffc011415000 dma = 0x00000000f7510000 len=9024
[    1.175160] FIQ FSM acceleration enabled for :
[    1.175160] Non-periodic Split Transactions
[    1.175160] Periodic Split Transactions
[    1.175160] High-Speed Isochronous Endpoints
[    1.175160] Interrupt/Control Split Transaction hack enabled
[    1.175770] WARN::hcd_init_fiq:472: MPHI regs_base at ffffffc010065000
[    1.175993] dwc_otg 3f980000.usb: DWC OTG Controller
[    1.176162] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[    1.183697] dwc_otg 3f980000.usb: irq 9, io mem 0x00000000
[    1.191169] Init: Port Power? op_state=1
[    1.198627] Init: Power Port (0)
[    1.206236] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 5.04
[    1.213785] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    1.221375] usb usb1: Product: DWC OTG Controller
[    1.228814] usb usb1: Manufacturer: Linux 5.4.179 dwc_otg_hcd
[    1.236286] usb usb1: SerialNumber: 3f980000.usb
[    1.244022] hub 1-0:1.0: USB hub found
[    1.251324] hub 1-0:1.0: 1 port detected
[    1.259321] usbcore: registered new interface driver uas
[    1.266557] usbcore: registered new interface driver usb-storage
[    1.273651] mousedev: PS/2 mouse device common for all mice
[    1.281069] bcm2835-wdt bcm2835-wdt: Broadcom BCM2835 watchdog timer
[    1.289804] sdhci: Secure Digital Host Controller Interface driver
[    1.296732] sdhci: Copyright(c) Pierre Ossman
[    1.304002] mmc-bcm2835 3f300000.mmcnr: could not get clk, deferring probe
[    1.311341] sdhost-bcm2835 3f202000.mmc: could not get clk, deferring probe
[    1.315791] Error: Driver 'sdhost-bcm2835' is already registered, aborting...
[    1.319478] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.325209] vchiq: vchiq_init_state: slot_zero = 0000000008e92005
[    1.331171] NET: Registered protocol family 10
[    1.335570] Segment Routing with IPv6
[    1.339573] NET: Registered protocol family 17
[    1.343357] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if you need this.
[    1.347438] 8021q: 802.1Q VLAN Support v1.8
[    1.351912] Key type ._fscrypt registered
[    1.355903] Key type .fscrypt registered
[    1.364163] uart-pl011 3f201000.serial: cts_event_workaround enabled
[    1.368282] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 66, base_baud = 0) is a PL011 rev2
[    1.369887] Indeed it is in host mode hprt0 = 00021501
[    1.565754] usb 1-1: new high-speed USB device number 2 using dwc_otg
[    1.571153] printk: console [ttyAMA0] enabled
[    1.575662] Indeed it is in host mode hprt0 = 00001101
[    1.580601] bcm2835-power bcm2835-power: Broadcom BCM2835 power domains driver
[    1.793309] usb 1-1: New USB device found, idVendor=0424, idProduct=9514, bcdDevice= 2.00
[    1.799776] mmc-bcm2835 3f300000.mmcnr: mmc_debug:0 mmc_debug2:0
[    1.805235] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[    1.809588] mmc-bcm2835 3f300000.mmcnr: DMA channel allocated
[    1.825421] hub 1-1:1.0: USB hub found
[    1.858545] sdhost: log_buf @ 000000005b9f372f (f5695000)
[    1.864712] hub 1-1:1.0: 5 ports detected
[    1.925850] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[    2.269765] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[    2.278948] of_cfs_init
[    2.421114] of_cfs_init: OK
[    2.432922] VFS: Cannot open root device "nfs" or unknown-block(0,255): error -6
[    2.447835] Please append a correct "root=" boot option; here are the available partitions:
[    2.463708] 0100            4096 ram0 
[    2.463710]  (driver?)
[    2.484671] 0101            4096 ram1 
[    2.484674]  (driver?)
[    2.505487] 0102            4096 ram2 
[    2.505489]  (driver?)
[    2.526016] 0103            4096 ram3 
[    2.526018]  (driver?)
[    2.546293] 0104            4096 ram4 
[    2.546295]  (driver?)
[    2.566425] 0105            4096 ram5 
[    2.566427]  (driver?)
[    2.586257] 0106            4096 ram6 
[    2.586260]  (driver?)
[    2.605764] 0107            4096 ram7 
[    2.605766]  (driver?)
[    2.625100] 0108            4096 ram8 
[    2.625102]  (driver?)
[    2.644342] 0109            4096 ram9 
[    2.644344]  (driver?)
[    2.654733] mmc1: queuing unknown CIS tuple 0x80 (2 bytes)
[    2.663503] 010a            4096 ram10 
[    2.663510]  (driver?)
[    2.694564] 010b            4096 ram11 
[    2.694566]  (driver?)
[    2.705405] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.713291] 010c            4096 ram12 
[    2.713293]  (driver?)
[    2.743379] 010d            4096 ram13 
[    2.743382]  (driver?)
[    2.761501] 010e            4096 ram14 
[    2.761503]  (driver?)
[    2.779330] 010f            4096 ram15 
[    2.779332]  (driver?)
[    2.779346] mmc1: queuing unknown CIS tuple 0x80 (3 bytes)
[    2.788695] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,255)
[    2.821549] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.4.179 #0
[    2.833127] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT)
[    2.844510] Call trace:
[    2.852402]  0xffffffc01008e418
[    2.860892]  0xffffffc01008e54c
[    2.869339]  0xffffffc010743550
[    2.877618]  0xffffffc01073db9c
[    2.885788]  0xffffffc0108712e4
[    2.893780]  0xffffffc010871570
[    2.901665]  0xffffffc0108716c8
[    2.909413]  0xffffffc010870ed4
[    2.917070]  0xffffffc010743744
[    2.924642]  0xffffffc010084cbc
[    2.932121] SMP: stopping secondary CPUs
[    2.940380] Kernel Offset: disabled
[    2.948073] CPU features: 0x0002,24002000
[    2.956285] Memory Limit: none
[    2.963532] Rebooting in 1 seconds..

The NFS share is correctly accessible (I try to access it with nautilus)
I also try multiple boot parameters:

console=serial0,115200 console=tty1 ip=192.168.50.2:$server_ip::255.255.255.0 root=/dev/nfs nfsroot=$server_ip:/nfsshare/root,vers=3 rw

console=serial0,115200 console=tty1 ip=dhcp root=/dev/nfs rw nfsroot=192.168.50.1:/nfsshare/root,vers=3,tcp nfsrootdebug

console=serial0,115200 console=tty1 ip=dhcp root=/dev/nfs rw nfsroot=$server_ip:/nfsshare/root,vers=4,tcp  nfsrootdebug

console=serial0,115200 console=tty1 ip=dhcp root=/dev/nfs rw nfsroot=192.168.50.1:/nfsshare/root,nfsvers=3,tcp nfsrootdebug

I always get this error:

VFS: Cannot open root device "nfs" or unknown-block(0,255): error -6

I think this is because NFS is not enabled in this image: https://downloads.openwrt.org/releases/21.02.2/targets/bcm27xx/bcm2710/openwrt-21.02.2-bcm27xx-bcm2710-rpi-3-ext4-factory.img.gz

So I try to download the image builder, and make my own image with this command:

make image PROFILE="rpi-3" PACKAGES="nfs-utils kmod-fs-nfs kmod-fs-nfs-common kmod-fs-nfs-v3 kmod-fs-nfs-v4 block-mount kmod-fs-ext4 kmod-loop"

I get the same problem with this image.

Is it possible that the NFS modules are not enabled during the boot ?

Do you have any idea about what can cause the problem ?

Note that I search on the forum before posting and I don't find real solutions.

OpenWrt's way is to directly let the Linux kernel mount the rootfs -- other than in generic distributions there is no initramfs (which may contain additional kernel modules and user space code to mount the rootfs).

Hence, if you want to have rootfs mounted from NFS (which I think is an interesting thing to try, I never did with OpenWrt) you will need to build OpenWrt from source and change the kernel configuration to have everything needed for that built-into the kernel (as kernel modules can only be loaded after rootfs has already been mounted).

1 Like