[RESOLVED] Networking module at boot (initrd)

Did anyone get the networking module working on Linux in initrd? I want to be able to unlock my disk encryption remotely and needs to happen before everything is fully booted.

I suspect I’m not loading a kernel module, that would enable that, but no idea honestly what to load. Or maybe, i’d need to re-compile the kernel with some obscure option enabled? I read something about enabling CONFIG_USB_USBNET and CONFIG_USB_NET..., but that just led to me chasing my tail in research.

Would probably also interesting for the net-boot people.

Edit: Some hardware info. The realtek one is of course the module, wile the ASIX is a generic dongle. Any one of them working would be nice.

# Bus 002 Device 003: ID 0bda:8156 Realtek Semiconductor Corp. USB 10/100/1G/2.5G LAN
# description: Ethernet interface
# product: USB 10/100/1G/2.5G LAN
# physical id: a
# bus info: usb@2:3
# logical name: enp0s13f0u3
# serial: 9c:bf:0d:00:06:7b
# size: 1Gbit/s
# capacity: 2500Mbit/s
# capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd 2500bt-fd autonegotiation
# configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.12.13 duplex=full firmware=rtl8156b-2 v3 10/20/23 ip=192.168.1.17 link=yes multicast=yes port=MII speed=1Gbit/s
#
# Bus 002 Device 004: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet
# description: Ethernet interface
# product: AX88179A
# physical id: b
# bus info: usb@2:4.3
# logical name: enp0s13f0u4u3c2
# serial: f8:e4:3b:40:b7:01
# capabilities: ethernet physical
# configuration: autonegotiation=off broadcast=yes driver=cdc_ncm driverversion=6.6.1 duplex=half firmware=CDC NCM (NO ZLP) link=no multicast=yes port=twisted pair
#
# usb_cdc_ncm r8152

Got it working, tuns out, I had everything right quite early on, except that I needed to add a five second sleep before the lvm stage, otherwise the module wouldn’t be detected and I’d get a crypting “no such device”-like error (only more wrapped in kernel-speak). Guess it just needed a little longer to initialize. r8152 is the right initrd kernel module to load and lspci’s or lshw’s section called driver=... gives you the name of the correct kernel module to load.

There’s probably a better way to wait for the device, but I have a life to live.

1 Like

Thanks for updating the thread @confus ,
Quite a useful info as well. :slight_smile: