Difference between revisions of "Build procedures"

From VyOS Wiki
Jump to: navigation, search
(Created page with "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 a...")
(No difference)

Revision as of 01:52, 28 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. Inside the directory, run:

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

Notes

  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