This section describes how to add a device driver to the installation environment (initrd.img). 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 # hg clone http://fyp.rocksclusters.org/hg/rocks-5.1 |
Go to the directory which holds the device driver code:
# cd /export/rocks-5.1/rocks/src/roll/kernel/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 |
to:
# # 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/rocks-5.1/rocks/src/roll/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/rocks-5.1/rocks/src/roll/kernel/RPMS/x86_64/rocks-boot* \ /export/rocks/install/contrib/5.1/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 and its matching kernel vmlinuz 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 /tftpboot/pxelinux/ # cp /boot/kickstart/default/vmlinuz /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/rocks-5.1/rocks/src/roll/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.