![]() | Note |
|---|---|
The information in this section applies to DRBD 8.3.6 and above. Up until release 8.3.5, DRBD used a different RPM build approach. |
The DRBD build system contains a facility to build RPM packages directly out of the DRBD source tree. For building RPMs, the section called “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 the section called “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 | DRBD meta-package | All other drbd-* packages | Top-level virtual package. When installed, this pulls in all other userland packages as dependencies. |
drbd-utils | Binary administration utilities | Required for any DRBD enabled host | |
drbd-udev | udev integration facility | drbd-utils, udev | Enables udev to manage user-friendly symlinks to DRBD devices |
drbd-xen | Xen DRBD helper scripts | drbd-utils, xen | Enables xend to auto-manage DRBD resources |
drbd-heartbeat | DRBD Heartbeat integration scripts | drbd-utils, heartbeat | Enables DRBD management by legacy v1-style Heartbeat clusters |
drbd-pacemaker | DRBD Pacemaker integration scripts | drbd-utils, pacemaker | Enables DRBD management by Pacemaker clusters |
drbd-rgmanager | DRBD Red Hat Cluster Suite integration scripts | drbd-utils, rgmanager | Enables DRBD management by rgmanager, the Red Hat Cluster Suite resource manager |
drbd-bashcompletion | Progammable bash completion | drbd-utils,
bash-completion | Enables Programmable bash completion for the drbdadm utility |
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-km.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.