Thursday, May 05, 2005

Intel 82562 support in RedHat 7.3 Boot disk

I have a network install of RH7.3 boxes. Hardware changes have seen the mobo used have an Intel82562 ether chipset on board. The default network install disks don't contain a driver for this. The default installer disks have also been combined into one image and installed on USB key (I'm not going got cover that here its not that hard to do).

Intel provides code to build a driver for the Intel 82562 this code produces a module they call e100. I got the code for this off the CD that came with the mobo. Problem is the code must be compiled against the boot disk kernel not the kernel installed by the isntallation process. Here's how I've done it.

First build the module against BOOT kernel (this has to be performed on the RH7.3 box).
rpm -ivh kernel-BOOT-2.4.18-3.i386.rpm
(kernel source if required)
rpm -ivh kernel-source-2.4.18-3.i386.rpm
cp /usr/src/linux-2.4/configs/kernel-2.4.18-i386-BOOT.config /usr/src/linux-2.4/.config
cd /usr/src/linux-2.4
make oldconfig
make clean
make dep
(I've got the driver source in /tmp/e100-2.2.21)
cd /tmp/e100-2.2.21/src
make
(results in e100.o which is what we want)
I copied the e100.o my workstation but thats not strictly necessary.

Repackaged the boot disk image (boot.img)
mount boot.img /mnt/loop -o loop
cp /mnt/loop/initrd.img /tmp
umount /mnt/loop
cd /tmp
gzip -dc < initrd.img > initrd.ext2
mount initrd.ext2 /mnt/loop -o loop
mkdir /tmp/modules/
cp /mnt/loop/modules/modules.cgz /tmp/
cd /tmp/
gzip -dc < modules.cgz > modules.cpio
cd modules
cpio -idumv < ../modules.cpio
// This should create a directory under /tmp/modules called 2.4.18-3BOOT/

Now copy the module in
cp /tmp/e100.o /tmp/modules/2.4.18-3BOOT/
Also modify /mnt/loop/modules/module-info and /mnt/loop/modules/pcitable
module-info I added:
e100
eth
"Intel 82562"
And to pcitable I added (not at the end)
0x8086 0x1050 "e100" "Intel Corp. Ethernet do hickey 82562"
* Be careful with pcitable the format (esp at the EOF) seems to break easly if edited with vim *

After that we repackage everything.
cd /tmp/modules/
find 2.4.18-3BOOT/ -depth -print | cpio -H crc -ovF modules.cpio
file modules.cpio
modules.cpio: ASCII cpio archive (SVR4 with CRC)
gzip modules.cpio
cd /tmp
cp modules/modules.cpio.gz /mnt/loop/modules/modules.cgz
umount /mnt/loop/
gzip -c --best < initrd.ext2 > initrd.img
mount boot.img /mnt/loop -o loop
cp initrd.img /mnt/loop/
umount /mnt/loop/

Now put the boot.img onto the USB device or floppy and hope it all works.

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?