1

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

guiverc
  • 28,623
  • 5
  • 46
  • 74

1 Answers1

0

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

Andrew Lowther
  • 5,811
  • 1
  • 15
  • 23