Building DHCP over IPoIB
1/11/11

This directory contains the source RPMs and patches for RHEL 5.4,
RHEL 5.5 (two src rpms), RHEL6 Beta, SLES11, and SLES11 SP1 as follows:
RHEL5.4: dhcp-3.0.5-21.el5.src.rpm
RHEL5.5: dhcp-3.0.5-23.el5_5.2.src.rpm, dhcp-3.0.5-23.el5.src.rpm
(based on which dhcp rpm version is being used with RHEL5.5)
RHEL6 Beta: dhcp-4.1.0p1-15.el6.src.rpm
SLES11: dhcp-3.1.1-7.12.src.rpm
SLES11 SP1: dhcp-3.1.3.ESV-0.3.38.src.rpm

It also contains the patches for the (production) dhcp sources for 4.2.0 and
4.1.1-P1.


Building from SRPM

The directory also contains 4 patches per source RPM:
1. Basic LPF based IB patch for dhcp-<version> (along the lines of
Sbastien Dugue (<sebastien.dugue@bull.net>) 
patch: http://lists.openfabrics.org/pipermail/ewg/2010-May/015266.html) -
a few bug fixes and also stripped out default client ID for IB for dhclient

dhcp-3.0.5-lpf-ib.patch
dhcp-4.1.0p1-lpf-ib.patch
dhcp-3.1.1-lpf-ib.dif

2. Better transaction ID support for dhclient which is important for IB
(trivial change from Matthieu Hattreux 
<matthieu.hautreux@cea.fr>: https://lists.isc.org/mailman/htdig/dhcp-hackers/2009-January/001773.html)

dhcp-3.0.5-improved-xid.patch
dhcp-4.1.0p1-improved-xid.patch
dhcp-3.1.1-improved-xid.dif

3. gpxe style default client ID for dhclient (needed for anaconda
builds; optional for normal builds)

dhcp-3.0.5-gpxe-cid.patch
dhcp-4.1.0p1-gpxe-cid.patch
dhcp-3.1.1-gpxe-cid.dif

4. Source RPM patch to dhcp.spec

For normal builds:
dhcp-3.0.5-rhel54.patch
dhcp-3.0.5-rhel55-2.patch
dhcp-3.0.5-rhel55.patch
dhcp-4.1.0p1-rhel6.patch
dhcp-3.1.1-sles11.dif
dhcp-3.1.3-sles11sp1.dif

For anaconda builds:
dhcp-3.0.5-rhel54-gpxe.patch
dhcp-3.0.5-rhel55-2-gpxe.patch
dhcp-3.0.5-rhel55-gpxe.patch
dhcp-4.1.0p1-rhel6-gpxe.patch
dhcp-3.1.1-sles11-gpxe.dif
dhcp-3.1.3-sles11sp1-gpxe.dif


Build Procedure:

1. Have the rpmbuild command use another directory (e.g. /home/your_userid/rpm)

2. Create the following subdirectories in that directory: 

cd /home/your_userid/rpm
mkdir SOURCES SPECS BUILD SRPMS
mkdir -p RPMS/i386 RPMS/i486 RPMS/i586 RPMS/i686 RPMS/x86_64 RPMS/noarch

3. Install the .src.rpm file this way: 

rpm -i dhcp-<ver>.src.rpm

This will create files in the SOURCES directory of your RPM building directory tree, and a .spec file in the SPECS directory. 

4. Copy the lpf-ib.[patch or dif], improved-xid.[patch or dif], and 
gxpe-cid.[patch or dif] for the appropriate version to
/home/your_userid/rpm/SOURCES

5. Copy dhcp.spec patch for the appropriate version to /home/your_userid/rpm/SPECS and apply to dhcp.spec via patch command (patch <dhcp-<version>.patch)

6. Go the SPECS directory and give the command to build the RPM: 

cd /home/your_userid/rpm/SPECS
rpmbuild --define '%_topdir /home/your_userid/rpm' -bb dhcp.spec

NOTE: The build should be performed on a machine with the appropriate distro.
With SLES(11), the build will not succeed without doing this.

7. Install rpms from RPMS/<arch>
or alternatively executables are:
BUILD/dhcp-3.0.5/work.linux-2.2/server/dhcpd
BUILD/dhcp-3.0.5/work.linux-2.2/client/dhclient
or
BUILD/dhcp-4.1.0p1/server/dhcpd
BUILD/dhcp-4.1.0p1/client/dhclient
or
BUILD/dhcp-3.1.1/work.linux-2.2/server/dhcpd
BUILD/dhcp-3.1.1/work.linux-2.2/client/dhclient
or
BUILD/dhcp-3.1-ESV/work.linux-2.2/server/dhcpd
BUILD/dhcp-3.1-ESV/work.linux-2.2/client/dhclient
depending on version


Building from DHCP Source

There are 5 patches for the two supported versions of the DHCP source.
They are:
dhcp-<version>-xen-checksum.patch
dhcp-<version>-options.patch
dhcp-<version>-lpf-ib.patch
dhcp-<version>-improved-xid.patch
dhcp-<version>-gpxe-cid.patch
The first two are variants of the RedHat supplied patches in the srpms.

1. Download and install the DHCP source from http://ftp.isc.org/isc/dhcp/

2. Apply patches in order listed above

3. Follow build and install instructions in dhcp README
