Build procedures

From VyOS Wiki
Revision as of 01:53, 28 October 2018 by Dmbaturin (talk | contribs)
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. Inside the directory, run:

sudo ./ -k 4.14.65 --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