Adding your own networkcard device drivers inside the PXE-boot process. ----------------------------------------------------------------------- We used the new VIA EPIA C3 800MHz mini-ITX motherboard as an example. This board has several important functions onboard, where the F12 networkboot is one of them. Although a great thing to have ( onboard 10/100 Mbit LAN + netboot functionality) the problem is the rather unknown network card used . Its a : VIA RHINE VT6103 FastEthernet PHY 10/100 Mbit. So we tested a F12 netboot pxe install according to this document : "Configuring a Preboot eXecution Environment (PXE) using Red Hat 7.2" http://www.compaq.com.hk/events/program/ \ ProLiantClub2002/training/presentation/402.pdf However when initrd.img (linux.2) is loaded a set of networkcard drivers is presented, but the via-rhine.o module is absent. This document describes what to do in such a case, in the form of a commands logging. Make sure that kernel-BOOT-2.4.18-3.i386.rpm is installed. # rpm -Uhv /mnt/cdrom/RedHat/RPMS/kernel-BOOT-2.4.18-3.i386.rpm we copy initrd.img from the 1st redhat 7.3 installation cdrom to /tmp : # cp /mnt/cdrom/images/pxeboot/initrd.img /tmp # cd /tmp # file initrd.img initrd.img: gzip compressed data, deflated, last modified: Fri Apr 19 20:38:53 2002, max compression, os: Unix # mv initrd.img initrd.img.gz # gunzip initrd.img.gz # losetup /dev/loop0 /tmp/initrd.img # mount /dev/loop0 /mnt/floppy # mount /dev/loop0 on /mnt/floppy type ext2 (rw) # cd /mnt/floppy # ls -l total 19 lrwxrwxrwx 1 root root 4 Apr 19 20:38 bin -> sbin/ drwxr-xr-x 4 root root 1024 Apr 19 20:38 dev/ drwxr-xr-x 3 root root 1024 Apr 19 20:38 etc/ lrwxrwxrwx 1 root root 10 Apr 19 20:38 linuxrc -> /sbin/init* drwx------ 2 root root 12288 Apr 19 20:38 lost+found/ drwxr-xr-x 2 root root 1024 Sep 25 00:39 modules/ drwxr-xr-x 2 root root 1024 Apr 19 20:38 proc/ drwxr-xr-x 2 root root 1024 Apr 19 20:38 sbin/ drwxr-xr-x 2 root root 1024 Apr 19 20:38 tmp/ drwxr-xr-x 3 root root 1024 Apr 19 20:38 var/ # cd modules # ls -l total 240 -rw-r--r-- 1 root root 281 Apr 19 20:38 module-info -rw-r--r-- 1 root root 234497 Apr 19 20:38 modules.cgz -rw-r--r-- 1 root root 95 Apr 19 20:38 modules.dep -rw-r--r-- 1 root root 7134 Apr 19 20:38 pcitable # cp modules.cgz /tmp # cd /tmp # mv modules.cgz modules.cgz.gz # gunzip modules.cgz.gz # mv modules.cgz modules.foo # file modules.foo modules.foo: ASCII cpio archive (SVR4 with CRC) # cpio -idv < modules.foo 2.4.18-3BOOT/3c59x.o 2.4.18-3BOOT/8139too.o 2.4.18-3BOOT/8390.o 2.4.18-3BOOT/eepro100.o 2.4.18-3BOOT/lockd.o 2.4.18-3BOOT/mii.o 2.4.18-3BOOT/ne2k-pci.o 2.4.18-3BOOT/nfs.o 2.4.18-3BOOT/pcnet32.o 2.4.18-3BOOT/scsi_mod.o 2.4.18-3BOOT/sunrpc.o 2.4.18-3BOOT/tulip.o 2.4.18-3BOOT/usb-storage.o 1095 blocks # cd /lib/modules/2.4.18-3BOOT/kernel/drivers/net # cp via-rhine.o /tmp/2.4.18-3BOOT # cd /tmp # find 2.4.18-3BOOT | cpio -H crc -ov > modules.new 2.4.18-3BOOT 2.4.18-3BOOT/3c59x.o 2.4.18-3BOOT/8139too.o 2.4.18-3BOOT/8390.o 2.4.18-3BOOT/eepro100.o 2.4.18-3BOOT/lockd.o 2.4.18-3BOOT/mii.o 2.4.18-3BOOT/ne2k-pci.o 2.4.18-3BOOT/nfs.o 2.4.18-3BOOT/pcnet32.o 2.4.18-3BOOT/scsi_mod.o 2.4.18-3BOOT/sunrpc.o 2.4.18-3BOOT/tulip.o 2.4.18-3BOOT/usb-storage.o 2.4.18-3BOOT/via-rhine.o 1134 blocks # file modules.* modules.foo: ASCII cpio archive (SVR4 with CRC) modules.new: ASCII cpio archive (SVR4 with CRC) # mv modules.new modules.cpio # gzip modules.cpio # mv modules.cpio.gz modules.cgz # cp modules.cgz /mnt/floppy/modules/modules.cgz # cd /mnt/floppy/modules/ # vi modules.dep Add the following : via-rhine: mii This can be checked according to /lib/modules/2.4.18-3BOOT/modules.dep # ll total 250 -rw-r--r-- 1 root root 281 Apr 19 20:38 module-info -rw-r--r-- 1 root root 244989 Sep 25 01:21 modules.cgz -rw-r--r-- 1 root root 110 Sep 25 01:22 modules.dep -rw-r--r-- 1 root root 7134 Apr 19 20:38 pcitable # vi module-info append the following : via-rhine eth "VIA Rhine PCI Fast Ethernet" # grep via-rhine /usr/share/hwdata/pcitable 0x1106 0x3043 "via-rhine" "VIA Technologies|VT3043 [Rhine]" 0x1106 0x3065 "via-rhine" "VIA Technologies|VT6102 [Rhine-II]" 0x1106 0x6100 "via-rhine" "VIA Technologies|VT85C100A [Rhine II]" # # vi pcitable Add the result of the grep command to pcitable file. and inside vim do a :% !sort on the 1st column. We have now updated the modules section. We are ready umount the /dev/loop0 loop filesystem of initrd.img and can gzip compress its again. And place the updates image back inplace as : # sync # sync # sync # umount /mnt/floppy # sync # sync # losetup -d /dev/loop0 # cp /tmp/initrd.img /tftpboot/X86PC/UNDI/linux-install/linux.2 ----------------------------------------------------------------------------- Robert M. Stockmann Sat Oct 26 17:57:51 CEST 2002 (removed some typo's from the command logging)