The DRBD build system contains a facility to build Debian packages
directly out of the DRBD source tree. For building Debian packages,
Section 4.3.1, “Checking build prerequisites” applies essentially in the same way as for building
and installing with make
, except that you of course also need the
dpkg-dev
package containing the Debian packaging tools, and
fakeroot
if you want to build DRBD as a non-root
user (highly
recommended).
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 DRBD source tree includes a debian
subdirectory containing the
required files for Debian packaging. That subdirectory, however, is
not included in the DRBD source tarballs — instead, you will
need to create a Git checkout of a tag
associated with a specific DRBD release.
Once you have created your checkout in this fashion, you can issue the following commands to build DRBD Debian packages:
$ dpkg-buildpackage -rfakeroot -b -uc
![]() | Note |
---|---|
This (example) |
This build process will create two Debian packages:
drbd8-utils_x.y.z-BUILD_ARCH.deb
;
module-assistant
named
drbd8-module-source_x.y.z-BUILD_all.deb
.
After you have created these packages, you can install, upgrade, and uninstall them as you would any other Debian package in your system.
Building and installing the actual kernel module from the installed
module source package is easily accomplished via Debian’s
module-assistant
facility:
# module-assistant auto-install drbd8
You may also use the shorthand form of the above command:
# m-a a-i drbd8
Note that any kernel upgrade will require you to rebuild the kernel
module (with module-assistant
, as just described) to match the new
kernel. The drbd8-utils
and drbd8-module-source
packages, in
contrast, only need to 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.