Live CD netboot cdc_ether not loaded

If none of the more specific forums is the right place to ask

Live CD netboot cdc_ether not loaded

Postby kovacsadam07 » 2018-08-03 17:58

Hi,

Currently I have a working pxe environment where I can boot Debian 9.5.0 with iPXE. Now I'm experimenting booting without a NIC using a Pi Zero W as cdc_ether device. The kernel and initramfs loads and starts booting but it can't find the cdc_ether device. I tried create a new initramfs within the Live CD adding usbnet and cdc_ether to /etc/modules and running /usr/sbin/update-initramfs.orig.initramfs-tools -u but it is not working. How can I add usbnet and cdc_ether to initramfs? Should I do anything else to make cdc_ether work at boot time?
kovacsadam07
 
Posts: 7
Joined: 2018-07-15 11:56

Re: Live CD netboot cdc_ether not loaded

Postby kovacsadam07 » 2018-08-21 16:37

Finally I did it… So the steps:

Boot a live cd and connect the usb ethernet device (in my case a Pi0 in gadget mode).
Get all modules with lsmod and copy them to /etc/update-initramfs/modules (not to the /etc/modules, this was the part I always did wrong) (you need only the first column of lsmod output!!)

After that you just have to /usr/sbin/update-initramfs.orig.initramfs-tools -u and you will get the new initramfs

Tips for beginners like me:
I don't know bash, I usually use PowerShell for scripting so here is a script to get the first column of lsmod:
Put the output of lsmod to 1.txt (on live debian as root: lsmod > 1.txt) copy the file to somewhere and cd there with PowerShell
$a = get-content .\1.txt | % {$_.Split(' ')[0]}
Set-Content 2.txt $a

Copy the content of 2.txt to /etc/update-initramfs/modules as stated above.
If you copied 1.txt to windows and 2.txt back to linux then you may have a lot of empty line. Before copying 2.txt back open it in notepad++ and convert it to UNIX encoding (in the statusbar).

If someone make this in bash, pls post here :)
kovacsadam07
 
Posts: 7
Joined: 2018-07-15 11:56


Return to General Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable