Build procedures

From VyOS Wiki
Revision as of 01:32, 21 December 2018 by Dmbaturin (talk | contribs) (Expand the FRR build procedure)
Jump to: navigation, search

Some packages require special build procedures.

Drivers and kernel modules

Preparing the kernel source

VyOS does not use DKMS due to its image upgrade mechanism and drive space concerns. All drivers included in the image must come pre-compiled.

For building all drivers and other packages that depend on specific kernel version, you will need the kernel source and some preparation.

Generally, you will need the complete source code of the target kernel. Headers alone will not suffice, you need the complete source.

One option is to use the "Download ZIP" option in a specific branch of Another option is to find matching linux-source-${version} package in

The kernel source version must match the target kernel exactly. Suppose the target kernel is 4.14.65.

Unpack the kernel source, for example to ~/vyos-kernel-source Inside the kernel source dir, run:

# Copy the VyOS kernel build config
cp arch/x86/configs/x86_64_vyos_defconfig .config

make oldconfig && make prepare && make scripts

The "make scripts" part is where the genksyms utility is built, and this is required for building modules.

Mellanox OFED

Getting the source

  1. Visit
  2. Click on the "Download" tab
  3. Select the current version. Set the OS to Debian, version and architecture don't matter.
  4. Find the SOURCES package link, the tarball is named MLNX_OFED_SRC-debian-${version}
  5. Download the tarball. The link is direct and safe for wget

Building the package

Prepare the source code of the target kernel as described in the #Preparing the kernel source section. Trying to build it with raw source or headers will cause a build failure.

Building the Mellanox drivers

Unpack the MLNX_OFED_SRC-debian tarball.

Assuming the target kernel is 4.14.65, and the source is in ~/vyos-kernel-source. Inside the directory, run:

sudo ./ -k 4.14.65-amd64-vyos --build-only --without-dkms --kernel-only --kernel-sources ~/vyos-kernel-source -vvv


  1. The script must be run with root permissions. That's the way it is in the upstream.
  2. Build errors are not displayed in the console even with "-vvv"
  3. If a build error occurs, the script will tell you the location of the log file, that you must inspect to find the error

Userspace packages


FRR (Free Range Routing) is the routing stack that provides common RIB and routing protocols (OSPF, BGP etc.) implementations in VyOS.

FRR source is found at

Installing build dependencies

Some packages are needed right away to execute the ./configure successfully:

Packages that are available from Debian repos in both Jessie and Buster:

sudo apt-get install libpython3-dev libjson-c-dev libreadline-dev libc-ares-dev

FRR also needs libyang and librtr. On Buster, you can install both from the repos. On Jessie, you can take libyang from The source code of librtr can be found at, it includes debian packaging and builds nicely on Jessie.

Building the package

On Jessie, the following procedure can be executed verbatim:

./configure --with-pkg-extra-version="-vyos"
make dist

mv debianpkg debian
make -f debian/rules backports

mkdir frrpkg
cd frrpkg
tar xf ../frr_*.orig.tar.gz
cd frr*
. /etc/os-release
tar xf ../../frr_*${ID}${VERSION_ID}*.debian.tar.xz

debuild --no-lintian --set-envvar=WANT_SNMP=1 --set-envvar=WANT_RPKI=1 --set-envvar=WANT_CUMULUS_MODE=0 -b -uc -us

On Buster, the "tar xf" step does not work as is due to version missing from os-release file of a testing distro. You will need to specify the tarball (debian9+) manually.

At the debuild step you may be prompted to install additional build dependencies.