Difference between revisions of "Build procedures"

From VyOS Wiki
Jump to: navigation, search
Line 50: Line 50:
sudo ./install.pl -k 4.14.65 --build-only --without-dkms --kernel-only --kernel-sources ~/vyos-kernel-source -vvv
sudo ./install.pl -k 4.14.65-amd64-vyos --build-only --without-dkms --kernel-only --kernel-sources ~/vyos-kernel-source -vvv

Revision as of 13:37, 29 October 2018

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 https://github.com/vyos/vyos-kernel. Another option is to find matching linux-source-${version} package in http://dev.packages.vyos.net/repositories/current/vyos/pool/main/l/.

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 http://www.mellanox.com/page/products_dyn?product_family=26
  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 ./install.pl -k 4.14.65-amd64-vyos --build-only --without-dkms --kernel-only --kernel-sources ~/vyos-kernel-source -vvv


  1. The install.pl 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 github.com/FRRouting/frr.

Debian package is one of the targets natively supported by its build scripts, so the procedure is simple. FRR source includes a script for building a Debian package in one step:

Warning: this procedure does not take RPKI into account yet

WANT_SNMP=1 EXTRA_VERSION="-vyos" WANT_SNMP=1 ./tools/build-debian-package.sh