Score:1

load drivers to initrd

ar flag

I have an issue with pxe deploy. I have mounted ubuntu-20.04.5-live-server and using the initrd and vmlinuz of it for the pxe.

I am at the point in the pxe deploy that the initrd and vmlinuz has downloaded and laptop is booting on the initrd, but it can not detect my network device which is an lan-usb-c dongle (r8152 module) is missing

I have extracted the contents of the initrd and noted first that the usb folder under main/lib/modules/5.4.0-125-generic/kernel/drivers/net/ is missing. (an Ubuntu 22.04 initrd has that folder)

so i create the /usb/ folder and then i chroot to the main folder, and there is were i get stuck, I have no main/lib/modules/5.4.0-125-generic/build/ folder and just a handfull of tools.. and there is no make.

how do you install a module to an ubuntu-20.04.5-live-server initrd file? the relevant module is r8152

David avatar
cn flag
Is it correct you are using Ubuntu Core? That is the only version that uses a single digit version number.
Pierre Den Gode avatar
ar flag
I am using ubuntu-20.04.5-live-server
Pierre Den Gode avatar
ar flag
I have updated my question to be clearer.
Score:0
jp flag

Steps I used on a 20.04 server with the /casper/initrd file from ubuntu-20.04.5-live-server-amd64.iso.

Expand the initrd initramfs file that was copied from the ISO.

mkdir expand
unmkinitramfs initrd expand/

Make sure the drivers for the specific kernel are available locally. The linux-modules-extra-... package contains the net/usb drivers.

apt-get -y install linux-modules-extra-5.4.0-125-generic

Copy the drivers from the local package. This copies the entire net/usb directory, but you could be more selective.

cp -r /usr/lib/modules/5.4.0-125-generic/kernel/drivers/net/usb/ expand/main/usr/lib/modules/5.4.0-125-generic/kernel/drivers/net/

Create a new initramfs file.

cd expand/
pushd early  && find . | cpio -o -H newc >  ../myinitrd && popd
pushd early2 && find . | cpio -o -H newc >> ../myinitrd && popd
pushd main   && find . | cpio -o -H newc | gzip >> ../myinitrd && popd

You will now have a myinitrd initramfs file that you can use with your PXE setup.

alternate way to download drivers

The deb package can be downloaded and extracted. This might be easier, particularly if you don't have a 20.04 install available.

wget http://mirrors.kernel.org/ubuntu/pool/main/l/linux/linux-modules-extra-5.4.0-125-generic_5.4.0-125.141_amd64.deb
mkdir extract
dpkg --extract linux-modules-extra-5.4.0-125-generic_5.4.0-125.141_amd64.deb extract/
cp -r extract/lib/modules/5.4.0-125-generic/kernel/drivers/net/usb/ expand/main/usr/lib/modules/5.4.0-125-generic/kernel/drivers/net/

notes/links

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.