Compiling Drivers for Altiris Linux PXE Image Part 2

In the previous part we have already setup the Ubuntu Virtual Machine and we did a build of the kernel image.

So now we can finally compile the driver, in my case I needed a driver for VMWare’s VMXNET3 Network Card.

VMXNET3 is VMWare’s paravirtualized network driver and offers better performance with less host processing power compared to the default e1000 driver.

First we need the source for the driver, we can obtain this from the VMWare Tools either from a running Linux VM or like I did by transferring the file linux.iso from /vmimages/tools-isomages from the vSphere server.

In the iso file is a single file, VMWARETO.TGZ and after unpacking we get a folder called vmware-tools-distrib.

In vmware-tools-distrib/lib/modules/source we find the vmxnet3.tar file that contains our sources. Copy the tar to the Virtual Machine and unpack it, then start a Terminal and cd to the directory where you unpacked the tar.

The first time I attempted a compile I received an error indicating that the file autoconf.h could not be found. After I found this bug report I was able to fix this by creating a link:

sudo ln -s /usr/src/linux-headers-2.6.35-22-generic/include/generated/autoconf.h /usr/src/linux-headers-2.6.35-22-generic/include/linux/autoconf.h

We can compile the driver with the make command, referencing the kernel image we created earlier

make -C /home/rweijnen/Documents/linux-2.6.27.7 SUBDIRS=$PWD SRCROOT=$PWD/. modules
image
After the compile we need to copy the .ko file, in my case vmxnet3.ko to the Altiris server, it needs to be placed in

eXpressBootwizplatforms<platform>DriversCUSTOMlibmodules_vr_kerneloptbdc:

image
And the final step is to rebuild the PXE Image, goto the PXE Configuration Manager and select Linux in the Regenerate Boot Images part and click Regenerate:
image
When the regeneration has been completed you must click Save and wait until all servers are updated:
image
In the Status tab you can check the Progress (this may take a while!):
image
And when it’s updated, boot the VM and check:
image

Was once an enthusiastic PepperByte employee but is now working elsewhere. His blogs are still valuable to us and we hope to you too.