Page MenuHomeVyOS Platform

building all including kernel 4.14 from source
Closed, ResolvedPublic

Description

Trying to build everything including the 4.14.26 kernel with

(cd packages/vyos-kernel; git checkout linux-vyos-4.14.y)

The directions at https://wiki.vyos.net/wiki/Rebuild_VyOS_kernel_Step#VyOS_1.2.x try to build a kernel_manual package, but that fails. It does not seem to be needed. Removing that, and using:

rev=4.14.26-1+vyos1+current1
LOCALVERSION="" make-kpkg --rootcmd fakeroot --initrd \
                    --append_to_version -amd64-vyos --revision=$rev      \
                    kernel_source kernel_headers kernel_image

builds the kernel. But later, building the ISO with:

# needed by open-vm-tools-dkms to build a kernel module
echo "libelf-dev" >>data/live-build-config/package-lists/vyos-utils.list.chroot
./configure
make iso

it seems that the vm tools dkms tries to build a kernel package, which fails:

DKMS make.log for open-vm-tools-10.0.5 for kernel 4.14.26-amd64-vyos (x86_64)
Tue May  1 00:04:50 UTC 2018
make: Entering directory '/var/lib/dkms/open-vm-tools/10.0.5/build/vmxnet'
Using kernel build system.
make -C /lib/modules/4.14.26-amd64-vyos/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR=/var/lib/dkms/open-vm-tools/10.0.5/build modules
make[1]: Entering directory '/usr/src/linux-headers-4.14.26-amd64-vyos'
make[2]: *** No rule to make target 'tools/objtool/objtool', needed by '/var/lib/dkms/open-vm-tools/10.0.5/build/vmxnet/vmxnet.o'.  Stop.
Makefile:1508: recipe for target '_module_/var/lib/dkms/open-vm-tools/10.0.5/build/vmxnet' failed
make[1]: *** [_module_/var/lib/dkms/open-vm-tools/10.0.5/build/vmxnet] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.14.26-amd64-vyos'
Makefile:120: recipe for target 'vmxnet.ko' failed
make: *** [vmxnet.ko] Error 2
make: Leaving directory '/var/lib/dkms/open-vm-tools/10.0.5/build/vmxnet'

I am not sure how to fix that. Is tools/objtool/objtool built by kernel_debug or something else?

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close

Event Timeline

carl.byington created this object in space S1 VyOS Public.
carl.byington created this object with visibility "Public (No Login Required)".

@carl.byington I'm using this snipped as foo.sh to build the kernel:

#!/bin/bash
cd vyos-kernel
GIT_BRANCH="origin/linux-vyos-4.14.y"
RELEASE=`echo $GIT_BRANCH | sed 's/origin\//* /g' |sed -n 's/^\* \(.*\)$/\1/p'`

if [ "${RELEASE}" = "helium" ]; then
    rm -f ../*.deb
    make -f debian/rules clean
    make -f debian/rules source-all
    dpkg-buildpackage -b -us -uc
else
    # newer Kernel versions come with a "# SPDX-License-Identifier: GPL-2.0" identifier
    # as the first line in the file - use compatible approach with grep rather then sed
    VERSION=$(grep "^VERSION" Makefile | grep -Eo '[0-9]{1,4}')
    PATCHLEVEL=$(grep "^PATCHLEVEL" Makefile | grep -Eo '[0-9]{1,4}')
    SUBLEVEL=$(grep "^SUBLEVEL" Makefile | grep -Eo '[0-9]{1,4}')
    ARCH=$(dpkg --print-architecture)
    rm -f ../*.deb

    case "$ARCH" in
        amd64)
            make x86_64_vyos_defconfig
            TARGETS="kernel_source kernel_debug kernel_headers kernel_image"
            # the following targets are not supported for Linux Kernels > 4.14 as
            # they have been removed from the Makefile (commits 18afab8c1d3c2 &
            # 22cba31bae9dc).
            if [ ${PATCHLEVEL} -lt 14 ]; then
                TARGETS+=" kernel_manual kernel_doc"
            fi
            LOCALVERSION="" make-kpkg --rootcmd fakeroot --initrd --append_to_version -amd64-vyos --revision=$VERSION.$PATCHLEVEL.$SUBLEVEL-1+vyos1+current1 ${TARGETS}
        ;;

        armhf)
            make armhf_vyos_defconfig
        ;;
  esac
fi

In regards to open-vm-tools, those are taken from the upstream debian repository. No need to build them.

There is a vyos-open-vm-tools git repo. The 'make iso' installs that package. In the process of building the iso (Setting up open-vm-tools-dkms) it tries to rebuild a kernel module. If we don't rebuild that there are two issues:

  1. It could be fetched from some outside repo, but then we are not rebuilding *all* the vyos source.
  1. There is also a chance that the version in the outside repo does not actually match the kernel that we built.

For VyOS 1.2 please see T582. We use Debians upstream open-vm-tools package as of this change.

From a 1.2 build last night:

Get:1 http://dev.packages.vyos.net/repositories/current/vyos/ current/main mlnx-ofed-kernel-utils amd64 4.3-OFED.4.3.1.0.1.1.g8509e41.kver.4.4.113-amd64-vyos [76.6 kB]
Get:6 http://dev.packages.vyos.net/repositories/current/vyos/ current/main mlnx-ofed-kernel-modules all 4.3-OFED.4.3.1.0.1.1.g8509e41.kver.4.4.113-amd64-vyos [16.2 MB]
Get:14 http://dev.packages.vyos.net/repositories/current/vyos/ current/main iser-modules all 4.0-OFED.4.3.1.0.1.1.g8509e41.kver.4.4.113-amd64-vyos [20.0 kB]
Get:18 http://dev.packages.vyos.net/repositories/current/vyos/ current/main ofed-scripts amd64 4.3-OFED.4.3.1.0.1 [35.0 kB]
Get:22 http://dev.packages.vyos.net/repositories/current/vyos/ current/main open-vm-tools amd64 2:10.0.5-3227872-1+vyos2+current1 [532 kB]

The 'make iso' still picks up a vyos specific version of open-vm-tools from dev.packages.vyos.net rather than deb.debian.org.

Trying to build everything from source, I am still missing

iser-modules
mlnx-ofed-kernel-modules
mlnx-ofed-kernel-utils
ofed-scripts

Binary versions of those get picked up by 'make iso', but I have not found the corresponding source on github.

syncer triaged this task as Normal priority.May 27 2018, 9:56 AM
syncer claimed this task.
syncer moved this task from In Progress to Finished on the VyOS 1.2 Crux board.