Ssh and network in initrd on Raspberry Pi 4

I am trying to get ssh and network access to work in initrd on a Raspberry Pi 4. So far I have not been able to get network access working. Currently I have the following settings:

boot.initrd.network.enable = true;
boot.initrd.network.ssh.enable = true;

The description for boot.initrd.network.enable says:

Add network connectivity support to initrd. The network may be configured using the ip kernel parameter, as described in the kernel documentation. Otherwise, if networking.useDHCP is enabled, an IP address is acquired using DHCP. You should add the module(s) required for your network card to boot.initrd.availableKernelModules. lspci -v | grep -iA8 'network\|ethernet' will tell you which.

However, lspci -v | grep -iA8 'network\|ethernet' outputs nothing. Here is the output of lspci -v:

00:00.0 PCI bridge: Broadcom Inc. and subsidiaries Device 2711 (rev 10) (prog-if 00 [Normal decode])
	Flags: bus master, fast devsel, latency 0
	Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
	I/O behind bridge: 00000000-00000fff [size=4K]
	Memory behind bridge: f8000000-f80fffff [size=1M]
	Prefetchable memory behind bridge: [disabled]
	Capabilities: [48] Power Management version 3
	Capabilities: [ac] Express Root Port (Slot-), MSI 00
	Capabilities: [100] Advanced Error Reporting
	Capabilities: [180] Vendor Specific Information: ID=0000 Rev=0 Len=028 <?>
	Capabilities: [240] L1 PM Substates

01:00.0 USB controller: VIA Technologies, Inc. VL805 USB 3.0 Host Controller (rev 01) (prog-if 30 [XHCI])
	Subsystem: VIA Technologies, Inc. VL805 USB 3.0 Host Controller
	Flags: bus master, fast devsel, latency 0, IRQ 40
	Memory at 600000000 (64-bit, non-prefetchable) [size=4K]
	Capabilities: [80] Power Management version 3
	Capabilities: [90] MSI: Enable+ Count=1/4 Maskable- 64bit+
	Capabilities: [c4] Express Endpoint, MSI 00
	Capabilities: [100] Advanced Error Reporting
	Kernel driver in use: xhci_hcd

I have tried with boot.initrd.availableKernelModules = [ "xhci_hcd" ]; which did not help.

Any suggestions?

Try lshw | less and search for network. Once you’ve found your ethernet interface, you’ll see something like driver=foobar under configuration:.

@anders Did you manage to install the right drivers?

I found out the driver with

lshw | grep network -A10
  *-network
       description: Ethernet interface
       physical id: 6
       logical name: enabcm6e4ei0
       serial: d8:3a:dd:31:ff:16
       size: 1Gbit/s
       capacity: 1Gbit/s
       capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=bcmgenet driverversion=6.1.43 duplex=full ip=192.168.178.48 link=yes multicast=yes port=twisted pair speed=1Gbit/s

But

      availableKernelModules = [ "bcmgenet" ];

Gives me

modprobe: FATAL: Module bcmgenet not found in directory /nix/store/ivz8a9kphq7gw93mnv2gbgcb7sfflgmd-linux-6.1.43-modules/lib/modules/6.1.43

Edit: The name of the module is genet (https://elixir.bootlin.com/linux/v3.19/source/drivers/net/ethernet/broadcom/genet)

1 Like