This section describes how to add a device driver to the installation environment (initrd.img-7.0-<arch>). This enables the installation environment to use the new driver as well as installing the device driver into the running environment (that is, after the node has installed).
This feature is enabled by ddiskit which is maintained by Jon Masters at Red Hat.
Set up a build environment:
# cd /export # mkdir src # git clone http://git.rocksclusters.org/git/core/kernel/.git # cd kernel # git checkout -b ROCKS_<major_version>_<minor_version>
Go to the directory which holds the device driver code:
# cd src/rocks-boot/enterprise/5/images/drivers
In this directory, you'll see some example drivers. Let's look at the e1000 driver:
# cd e1000
If you want to supply a new version of the driver, you'll have to download the e1000 source tarball and copy the *.c and *.h files from the tarball to this directory. Make sure all the *.c and *.h files are listed at the top of the Makefile:
MODULES := e1000 SOURCES := e1000_main.c e1000_hw.c e1000_ethtool.c e1000_param.c HEADERS := e1000.h e1000_hw.h e1000_osdep.h
You'll need to make sure the proper PCI ids are in the file pcitable. For example, to test on one of our Dell SC1425's, we added the line:
0x8086 0x1076 "e1000" "Intel|82541GI/PI Gigabit Ethernet Controller (rev 05)"
Now we'll need to specify to the device driver building code that the e1000 driver should be built. To do this, edit the file subdirs:
# cd .. # vi subdirs
Change the section from:
# # put a list of all the driver directories that you'd like to build. # # for example, to build the 'e1000' driver, uncomment the line below: #e1000
# # put a list of all the driver directories that you'd like to build. # # for example, to build the 'e1000' driver, uncomment the line below: e1000
Build the rocks-boot package:
# cd /export/kernel/src/rocks-boot # make rpm
When this completes, copy the binary RPMs into a directory where the distribution building utility (rocks-dist) will find and include them:
# cp /export/kernel/RPMS/x86_64/rocks-boot* \ /export/rocks/install/contrib/7.0/x86_64/RPMS/
If you are building on an i386 system, change the above x86_64 references to i386.
Rebuild the distro:
# cd /export/rocks/install # rocks create distro
Install the newly created initrd.img-7.0-<arch> and its matching kernel vmlinuz-7.0-<arch> so PXE booted nodes will get the new device drivers:
# cd /export/rocks/install # rpm -Uvh --force rocks-dist/x86_64/RedHat/RPMS/rocks-boot-5*.rpm # cp /boot/kickstart/default/initrd.img-7.0-<arch> /tftpboot/pxelinux/ # cp /boot/kickstart/default/vmlinuz-7.0-<arch> /tftpboot/pxelinux/
Now PXE boot a node. This node will load your new driver and will install this driver into the running environment.
If the name of your device driver you wish to add is not one of the example device drivers (e.g., ata_piix, cciss, e1000, sk98lin, or tg3), then you'll need to create a new directory and populate it with the appropriate files.
For help on how to populate your new driver directory, see: /export/kernel/src/rocks-boot/enterprise/5/images/drivers/INSTALL.
The rest of the build process follows the same procedure as above starting at step 6 where you'll have to add the name of your new driver to the file subdirs.