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