The DRBD build system contains a facility to build RPM packages
directly out of the DRBD source tree. For building RPMs,
Section 4.3.1, “Checking build prerequisites” applies essentially in the same way as for building
and installing with make
, except that you also need the RPM build
tools, of course.
Also, see Section 4.3.2, “Preparing the kernel source tree” if you are not building against a running kernel with precompiled headers available.
The build system offers two approaches for building RPMs. The simpler
approach is to simply invoke the rpm
target in the top-level
Makefile:
$ ./configure $ make rpm $ make km-rpm
This approach will auto-generate spec files from pre-defined templates, and then use those spec files to build binary RPM packages.
The make rpm
approach generates a number of RPM packages:
Table 4.2. DRBD userland RPM packages
Package name | Description | Dependencies | Remarks |
---|---|---|---|
| DRBD meta-package | All other | Top-level virtual package. When installed, this pulls in all other userland packages as dependencies. |
| Binary administration utilities | Required for any DRBD enabled host | |
| udev integration facility |
| Enables udev to manage user-friendly symlinks to DRBD devices |
| Xen DRBD helper scripts |
| Enables xend to auto-manage DRBD resources |
| DRBD Heartbeat integration scripts |
| Enables DRBD management by legacy v1-style Heartbeat clusters |
| DRBD Pacemaker integration scripts |
| Enables DRBD management by Pacemaker clusters |
| DRBD Red Hat Cluster Suite integration scripts |
| Enables DRBD management by rgmanager, the Red Hat Cluster Suite resource manager |
| Progammable bash completion |
| Enables Programmable bash completion for the |
The other, more flexible approach is to have configure
generate the
spec file, make any changes you deem necessary, and then use the
rpmbuild
command:
$ ./configure --enable-spec $ make tgz $ cp drbd*.tar.gz `rpm -E _sourcedir` $ rpmbuild -bb drbd.spec
If you are about to build RPMs for both the DRBD userspace utilities and the kernel module, use:
$ ./configure --enable-spec --with-km $ make tgz $ cp drbd*.tar.gz `rpm -E _sourcedir` $ rpmbuild -bb drbd.spec $ rpmbuild -bb drbd-kernel.spec
The RPMs will be created wherever your system RPM configuration (or
your personal ~/.rpmmacros
configuration) dictates.
After you have created these packages, you can install, upgrade, and uninstall them as you would any other RPM package in your system.
Note that any kernel upgrade will require you to generate a new
drbd-km
package to match the new kernel.
The DRBD userland packages, in contrast, need only be recreated when upgrading to a new DRBD version. If at any time you upgrade to a new kernel and new DRBD version, you will need to upgrade both packages.