The DRBD build system contains a facility to build Debian
packages directly out of the DRBD source tree. For building
Debian packages, the section called “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 the section called “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,
so you can simply issue the following commands to build DRBD
Debian packages:
cd /usr/src/drbd-x.y.z dpkg-buildpackage -rfakeroot -b -uc
![]() | Note |
|---|---|
This (example) drbd-buildpackage
invocation enables a binary-only build ( |
This build process will create two Debian packages:
A package containing the DRBD userspace tools, named
drbd8-utils_x.y.z-BUILD_ARCH.deb;
A module source package suitable for
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.