diff options
-rw-r--r-- | data/defaults.json | 2 | ||||
-rw-r--r-- | data/live-build-config/includes.chroot/etc/modprobe.d/no-copybreak.conf | 60 | ||||
-rw-r--r-- | packages/iproute2/Jenkinsfile | 2 | ||||
-rwxr-xr-x | packages/iproute2/build.sh | 20 | ||||
-rw-r--r-- | packages/iproute2/patches/0001-erspan-erspan6-fix-JSON-output.patch | 56 | ||||
-rw-r--r-- | packages/linux-kernel/Jenkinsfile | 297 | ||||
-rw-r--r-- | packages/netfilter/Jenkinsfile | 2 | ||||
-rw-r--r-- | packages/wide-dhcpv6/Jenkinsfile | 2 | ||||
-rwxr-xr-x | packages/wide-dhcpv6/build.sh (renamed from packages/wide-dhcpv6/build-wide.sh) | 12 | ||||
-rwxr-xr-x | scripts/check-qemu-install | 3 | ||||
-rw-r--r-- | vars/cloneAndBuild.groovy | 14 |
11 files changed, 197 insertions, 273 deletions
diff --git a/data/defaults.json b/data/defaults.json index 6d72c135..33d57a13 100644 --- a/data/defaults.json +++ b/data/defaults.json @@ -5,7 +5,7 @@ "debian_distribution": "buster", "vyos_mirror": "http://dev.packages.vyos.net/repositories/current", "vyos_branch": "current", - "kernel_version": "5.10.28", + "kernel_version": "5.10.29", "kernel_flavor": "amd64-vyos", "release_train": "sagitta", "additional_repositories": [ diff --git a/data/live-build-config/includes.chroot/etc/modprobe.d/no-copybreak.conf b/data/live-build-config/includes.chroot/etc/modprobe.d/no-copybreak.conf new file mode 100644 index 00000000..1ff75c89 --- /dev/null +++ b/data/live-build-config/includes.chroot/etc/modprobe.d/no-copybreak.conf @@ -0,0 +1,60 @@ +# +# **** License **** +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# This code was originally developed by Vyatta, Inc. +# Portions created by Vyatta are Copyright (C) 2009 Vyatta, Inc. +# All Rights Reserved. +# **** End License **** +# +# Author: Bob Gilligan <gilligan@vyatta.com> +# +# Some network interface drivers employ a scheme known as "copybreak" +# in which they make a copy of a received skb if the size of the +# buffer is below a particular threshold, then return the original +# receive skb back to the pool. Since these drivers initially +# allocate a buffer size that is larger than the largest possible +# packet, this scheme returns that large buffer to the pool quickly, +# and uses a smaller one. +# +# The primary benefit of copybreak is better memory utilization. On +# systems where the data is ultimately going to be copied out to user +# space, the copybreak scheme is "low cost" because it has the side +# benefit of priming the cache for that later copy. But on a router +# that only touches the header fields of a received packet, the cost +# can be relatively higher. And on modern systems the memory savings +# is rarely an important consideration. +# +# Some of the drivers that employ copybreak make the feature +# configurable via a module parameter. This file disables copybreak +# in some of those drivers. Generally this results in an improvement +# in forwarding performance for traffic using these drivers. + +options 3c515 rx_copybreak=0 +options 3c59x rx_copybreak=0 +options bcm63xx copybreak=0 +options cxgb copybreak=0 +options e1000 copybreak=0 +options e1000e copybreak=0 +options epic100 rx_copybreak=0 +options fealnx rx_copybreak=0 +options hamachi rx_copybreak=0 +options ixgb copybreak=0 +options natsemi rx_copybreak=0 +options pch_gbe copybreak=0 +options pcnet32 rx_copybreak=0 +options sis190 rx_copybreak=0 +options sky2 copybreak=0 +options starfire rx_copybreak=0 +options sundance rx_copybreak=0 +options typhoon rx_copybreak=0 +options via-rhine rx_copybreak=0 +options via-velocity rx_copybreak=0 +options yellowfin rx_copybreak=0 diff --git a/packages/iproute2/Jenkinsfile b/packages/iproute2/Jenkinsfile index b5654439..20ec19c7 100644 --- a/packages/iproute2/Jenkinsfile +++ b/packages/iproute2/Jenkinsfile @@ -25,7 +25,7 @@ def pkgList = [ ['name': 'iproute2', 'scmCommit': 'debian/5.10.0-4_bpo10+1', 'scmUrl': 'https://salsa.debian.org/debian/iproute2', - 'buildCmd': 'dpkg-buildpackage -uc -us -tc -b -d'], + 'buildCmd': 'cd ..; ./build.sh'], ] // Start package build using library function from https://github.com/vyos/vyos-build diff --git a/packages/iproute2/build.sh b/packages/iproute2/build.sh new file mode 100755 index 00000000..09babb95 --- /dev/null +++ b/packages/iproute2/build.sh @@ -0,0 +1,20 @@ +#!/bin/sh +CWD=$(pwd) +set -e + +SRC=iproute2 +if [ ! -d ${SRC} ]; then + echo "Source directory does not exists, please 'git clone'" + exit 1 +fi + +cd ${SRC} +PATCH_DIR=${CWD}/patches +for patch in $(ls ${PATCH_DIR}) +do + echo "I: Apply patch: ${PATCH_DIR}/${patch}" + patch -p1 < ${PATCH_DIR}/${patch} +done + +echo "I: Build Debian Package" +dpkg-buildpackage -uc -us -tc -b -d diff --git a/packages/iproute2/patches/0001-erspan-erspan6-fix-JSON-output.patch b/packages/iproute2/patches/0001-erspan-erspan6-fix-JSON-output.patch new file mode 100644 index 00000000..e21c13c0 --- /dev/null +++ b/packages/iproute2/patches/0001-erspan-erspan6-fix-JSON-output.patch @@ -0,0 +1,56 @@ +From 50d6a22e0c1368bcc662bbfea75ce21378825b0d Mon Sep 17 00:00:00 2001 +From: Christian Poessinger <christian@poessinger.com> +Date: Fri, 9 Apr 2021 12:45:00 +0200 +Subject: [PATCH] erspan/erspan6: fix JSON output + +The format for erspan/erspan6 output is not valid JSON, as on version 2 a +valueless key was presented. The direction should be value and erspan_dir +should be the key. + +Fixes: 289763626721 ("erspan: add erspan version II support") +Cc: u9012063@gmail.com +Cc: Stephen Hemminger <stephen@networkplumber.org> +Reported-by: Christian Poessinger <christian@poessinger.com> +Signed-off-by: Christian Poessinger <christian@poessinger.com> +--- + ip/link_gre.c | 4 ++-- + ip/link_gre6.c | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ip/link_gre.c b/ip/link_gre.c +index 0461e5d0..6d4a8be8 100644 +--- a/ip/link_gre.c ++++ b/ip/link_gre.c +@@ -536,10 +536,10 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) + + if (erspan_dir == 0) + print_string(PRINT_ANY, "erspan_dir", +- "erspan_dir ingress ", NULL); ++ "erspan_dir %s ", "ingress"); + else + print_string(PRINT_ANY, "erspan_dir", +- "erspan_dir egress ", NULL); ++ "erspan_dir %s ", "egress"); + } + + if (tb[IFLA_GRE_ERSPAN_HWID]) { +diff --git a/ip/link_gre6.c b/ip/link_gre6.c +index 9d270f4b..f33598af 100644 +--- a/ip/link_gre6.c ++++ b/ip/link_gre6.c +@@ -594,10 +594,10 @@ static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[]) + + if (erspan_dir == 0) + print_string(PRINT_ANY, "erspan_dir", +- "erspan_dir ingress ", NULL); ++ "erspan_dir %s ", "ingress"); + else + print_string(PRINT_ANY, "erspan_dir", +- "erspan_dir egress ", NULL); ++ "erspan_dir %s ", "egress"); + } + + if (tb[IFLA_GRE_ERSPAN_HWID]) { +-- +2.20.1 + diff --git a/packages/linux-kernel/Jenkinsfile b/packages/linux-kernel/Jenkinsfile index 8c68aa1f..0cb0bc65 100644 --- a/packages/linux-kernel/Jenkinsfile +++ b/packages/linux-kernel/Jenkinsfile @@ -1,4 +1,4 @@ -// Copyright (C) 2019-2021 VyOS maintainers and contributors +// Copyright (C) 2020-2021 VyOS maintainers and contributors // // This program is free software; you can redistribute it and/or modify // in order to easy exprort images built to "external" world @@ -18,259 +18,44 @@ // is not a typo! You need this underscore if the line immediately after the // @Library annotation is not an import statement! @Library('vyos-build@current')_ -setDescription() -node('Docker') { - stage('Define Agent') { - script { - // create container name on demand - def branchName = getGitBranchName() - // Adjust PR target branch name so we can re-map it to the proper - // Docker image. CHANGE_ID is set only for pull requests, so it is - // safe to access the pullRequest global variable - if (env.CHANGE_ID) { - branchName = "${env.CHANGE_TARGET}".toLowerCase() - } - if (branchName.equals("master")) { - branchName = "current" - } - env.DOCKER_IMAGE = "vyos/vyos-build:" + branchName - } - } -} - -pipeline { - agent { - docker { - reuseNode true - args "--sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006" - image "${env.DOCKER_IMAGE}" - alwaysPull true - } - } - options { - disableConcurrentBuilds() - timeout(time: 120, unit: 'MINUTES') - timestamps() - buildDiscarder(logRotator(numToKeepStr: '5')) - } - environment { - DEBIAN_ARCH = sh(returnStdout: true, script: 'dpkg --print-architecture').trim() - BASE_DIR = getJenkinsfilePath() - CHANGESET_DIR = getChangeSetPath() - } - stages { - stage('Fetch') { - steps { - script { - checkout scm - } - } - } - stage('Git Clone - Components') { - parallel { - stage('Kernel') { - when { - beforeOptions true - beforeAgent true - anyOf { - changeset pattern: "${env.CHANGESET_DIR}" - changeset pattern: "**/data/defaults.json" - triggeredBy 'TimerTrigger' - triggeredBy cause: "UserIdCause" - } - } - steps { - script { - dir(env.BASE_DIR) { - sh ''' - KERNEL_VER=\$(cat ../../data/defaults.json | jq -r .kernel_version) - gpg2 --locate-keys torvalds@kernel.org gregkh@kernel.org - curl -OL https://www.kernel.org/pub/linux/kernel/v5.x/linux-${KERNEL_VER}.tar.xz - curl -OL https://www.kernel.org/pub/linux/kernel/v5.x/linux-${KERNEL_VER}.tar.sign - xz -cd linux-${KERNEL_VER}.tar.xz | gpg2 --verify linux-${KERNEL_VER}.tar.sign - - if [ $? -ne 0 ]; then - exit 1 - fi - tar xf linux-${KERNEL_VER}.tar.xz - ln -s linux-${KERNEL_VER} linux - ''' - } - } - } - } - stage('Kernel Firmware') { - when { - beforeOptions true - beforeAgent true - anyOf { - changeset pattern: "${env.CHANGESET_DIR}" - changeset pattern: "**/data/defaults.json" - triggeredBy 'TimerTrigger' - triggeredBy cause: "UserIdCause" - } - } - steps { - dir(env.BASE_DIR + '/linux-firmware') { - checkout([$class: 'GitSCM', - doGenerateSubmoduleConfigurations: false, - extensions: [[$class: 'CleanCheckout'], - [$class: 'CloneOption', depth: 1, noTags: false, reference: '', shallow: true]], - branches: [[name: '20201218' ]], - userRemoteConfigs: [[credentialsId: 'GitHub-vyosbot', url: 'https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git']]]) - } - } - } - stage('Accel-PPP') { - when { - beforeOptions true - beforeAgent true - anyOf { - changeset pattern: "${env.CHANGESET_DIR}" - changeset pattern: "**/data/defaults.json" - triggeredBy 'TimerTrigger' - triggeredBy cause: "UserIdCause" - } - } - steps { - dir(env.BASE_DIR + '/accel-ppp') { - checkout([$class: 'GitSCM', - doGenerateSubmoduleConfigurations: false, - extensions: [[$class: 'CleanCheckout']], - branches: [[name: '59f8e1bc3f199c8d0d985253e19a74ad87130179' ]], - userRemoteConfigs: [[credentialsId: 'GitHub-vyosbot', url: 'https://github.com/accel-ppp/accel-ppp.git']]]) - } - } - } - } - } - stage('Compile Kernel') { - when { - beforeOptions true - beforeAgent true - anyOf { - changeset pattern: "${env.CHANGESET_DIR}" - changeset pattern: "**/data/defaults.json" - triggeredBy 'TimerTrigger' - triggeredBy cause: "UserIdCause" - } - } - steps { - dir(env.BASE_DIR) { - sh "./build-kernel.sh" - } - } - } - - stage('Kernel Module(s)') { - parallel { - stage('Accel-PPP') { - when { - beforeOptions true - beforeAgent true - anyOf { - changeset pattern: "${env.CHANGESET_DIR}" - changeset pattern: "**/data/defaults.json" - triggeredBy 'TimerTrigger' - triggeredBy cause: "UserIdCause" - } - } - steps { - dir(env.BASE_DIR) { - sh "./build-accel-ppp.sh" - } - } - } - stage('Intel QuickAssist Technology') { - when { - beforeOptions true - beforeAgent true - anyOf { - changeset pattern: "${env.CHANGESET_DIR}" - changeset pattern: "**/data/defaults.json" - triggeredBy 'TimerTrigger' - triggeredBy cause: "UserIdCause" - } - } - steps { - dir(env.BASE_DIR) { - sh "./build-intel-qat.sh" - } - } - } - } - } - // This stage should not be run in the parallel section as it will call "make" - // again on the kernel source and this could confuse other build systems - // like generating Intel or Accel-PPP drivers. Better safe then sorry! - stage('Linux Firmware') { - when { - beforeOptions true - beforeAgent true - anyOf { - changeset pattern: "${env.CHANGESET_DIR}" - changeset pattern: "**/data/defaults.json" - triggeredBy 'TimerTrigger' - triggeredBy cause: "UserIdCause" - } - } - steps { - dir(env.BASE_DIR) { - sh "./build-linux-firmware.sh" - } - } - } - - } - post { - cleanup { - deleteDir() - } - success { - script { - dir(env.BASE_DIR) { - // archive *.deb artifact on custom builds, deploy to repo otherwise - if ( isCustomBuild()) { - archiveArtifacts artifacts: '*.deb', fingerprint: true - } else { - // publish build result, using SSH-dev.packages.vyos.net Jenkins Credentials - sshagent(['SSH-dev.packages.vyos.net']) { - // build up some fancy groovy variables so we do not need to write/copy - // every option over and over again! - def RELEASE = getGitBranchName() - if (getGitBranchName() == "master") - RELEASE = 'current' - - def VYOS_REPO_PATH = '/home/sentrium/web/dev.packages.vyos.net/public_html/repositories/' + RELEASE - if (getGitBranchName() == "crux") - VYOS_REPO_PATH += '/vyos' - - def SSH_OPTS = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=ERROR' - def SSH_REMOTE = env.DEV_PACKAGES_VYOS_NET_HOST // defined as global variable - def SSH_DIR = '~/VyOS/' + RELEASE - - files = findFiles(glob: '*.deb') - if (files) { - sh(script: "ssh ${SSH_OPTS} ${SSH_REMOTE} -t \"bash --login -c 'mkdir -p ${SSH_DIR}'\"") - echo "Uploading package(s) and updating package(s) in the repository ..." - files.each { FILE -> - // NOTE: Groovy is a pain in the ass and " quotes differ from ', so all shell code must use " in the beginning - def PACKAGE = sh(returnStdout: true, script: "dpkg-deb -f ${FILE} Package").trim() - def PACKAGE_ARCH = sh(returnStdout: true, script: "dpkg-deb -f ${FILE} Architecture").trim() - def ARCH = '' - if (PACKAGE_ARCH != 'all') - ARCH = '-A ' + PACKAGE_ARCH - - sh(script: "scp ${SSH_OPTS} ${FILE} ${SSH_REMOTE}:${SSH_DIR}") - sh(script: "ssh ${SSH_OPTS} ${SSH_REMOTE} -t \"uncron-add 'reprepro -v -b ${VYOS_REPO_PATH} ${ARCH} remove ${RELEASE} ${PACKAGE}'\"") - sh(script: "ssh ${SSH_OPTS} ${SSH_REMOTE} -t \"uncron-add 'reprepro -v -b ${VYOS_REPO_PATH} ${ARCH} includedeb ${RELEASE} ${SSH_DIR}/${FILE}'\"") - } - sh(script: "ssh ${SSH_OPTS} ${SSH_REMOTE} -t \"uncron-add 'reprepro -v -b ${VYOS_REPO_PATH} deleteunreferenced'\"") - } - } - } - } - } - } - } -} +def pkgList = [ + // The Linux Kernel + ['name': 'kernel', + 'buildCmd': ''' + # all scripts must be executed one level above ... + cd .. + + # read the required Kernel version + KERNEL_VER=\$(cat ../../data/defaults.json | jq -r .kernel_version) + gpg2 --locate-keys torvalds@kernel.org gregkh@kernel.org + curl -OL https://www.kernel.org/pub/linux/kernel/v5.x/linux-${KERNEL_VER}.tar.xz + curl -OL https://www.kernel.org/pub/linux/kernel/v5.x/linux-${KERNEL_VER}.tar.sign + xz -cd linux-${KERNEL_VER}.tar.xz | gpg2 --verify linux-${KERNEL_VER}.tar.sign - + if [ $? -ne 0 ]; then + exit 1 + fi + + # Unpack Kernel source + tar xf linux-${KERNEL_VER}.tar.xz + ln -s linux-${KERNEL_VER} linux + # ... Build Kernel + ./build-kernel.sh + '''], + + // Firmware + ['name': 'linux-firmware', 'scmCommit': '20201218', + 'scmUrl': 'https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git', + 'buildCmd': 'cd ..; ./build-linux-firmware.sh'], + + // Accel-PPP + ['name': 'accel-ppp', 'scmCommit': '59f8e1bc3f199c8d0d9', + 'scmUrl': 'https://github.com/accel-ppp/accel-ppp.git', + 'buildCmd': 'cd ..; pwd; ls -al; ./build-accel-ppp.sh'], + + // Intel-QAT + ['name': 'qat', 'buildCmd': 'cd ..; ./build-intel-qat.sh'], +] + +// Start package build using library function from https://github.com/vyos/vyos-build +buildPackage('Kernel', pkgList) diff --git a/packages/netfilter/Jenkinsfile b/packages/netfilter/Jenkinsfile index 4d53f949..e5579813 100644 --- a/packages/netfilter/Jenkinsfile +++ b/packages/netfilter/Jenkinsfile @@ -47,5 +47,5 @@ def pkgList = [ 'buildCmd': '''sudo dpkg -i ../libnetfilter*.deb && dpkg-buildpackage -uc -us -tc -b'''], ] -// Start package build using library function from https://github.com/c-po/vyos-build +// Start package build using library function from https://github.com/vyos/vyos-build buildPackage('Netfilter', pkgList, null, true) diff --git a/packages/wide-dhcpv6/Jenkinsfile b/packages/wide-dhcpv6/Jenkinsfile index fbb1b0a4..d4f9c7f6 100644 --- a/packages/wide-dhcpv6/Jenkinsfile +++ b/packages/wide-dhcpv6/Jenkinsfile @@ -23,7 +23,7 @@ def pkgList = [ ['name': 'wide-dhcpv6', 'scmCommit': 'debian/20080615-23', 'scmUrl': 'https://salsa.debian.org/debian/wide-dhcpv6', - 'buildCmd': '''cd ..; ./build-wide.sh'''], + 'buildCmd': '''cd ..; ./build.sh'''], ] // Start package build using library function from https://github.com/vyos/vyos-build diff --git a/packages/wide-dhcpv6/build-wide.sh b/packages/wide-dhcpv6/build.sh index 6da4534b..87cab92b 100755 --- a/packages/wide-dhcpv6/build-wide.sh +++ b/packages/wide-dhcpv6/build.sh @@ -2,24 +2,22 @@ CWD=$(pwd) set -e -WIDE_SRC=wide-dhcpv6 - -if [ ! -d ${WIDE_SRC} ]; then +SRC=wide-dhcpv6 +if [ ! -d ${SRC} ]; then echo "Source directory does not exists, please 'git clone'" exit 1 fi - PATCH_DIR=${CWD}/patches if [ -d $PATCH_DIR ]; then for patch in $(ls ${PATCH_DIR}) do echo "I: Apply patch: ${patch} to main repository" - cp ${PATCH_DIR}/${patch} ${WIDE_SRC}/debian/patches/ - echo ${patch} >> ${WIDE_SRC}/debian/patches/series + cp ${PATCH_DIR}/${patch} ${SRC}/debian/patches/ + echo ${patch} >> ${SRC}/debian/patches/series done fi -cd ${WIDE_SRC} +cd ${SRC} echo "I: Build Debian Package" dpkg-buildpackage -uc -us -tc -b diff --git a/scripts/check-qemu-install b/scripts/check-qemu-install index 90cc6017..1daaa6be 100755 --- a/scripts/check-qemu-install +++ b/scripts/check-qemu-install @@ -132,6 +132,9 @@ def get_qemu_cmd(name, enable_kvm, disk_img, iso_img=None): -netdev user,id=n2 -device virtio-net-pci,netdev=n2,mac={macbase}:02 \ -netdev user,id=n3 -device virtio-net-pci,netdev=n3,mac={macbase}:03 \ -netdev user,id=n4 -device virtio-net-pci,netdev=n4,mac={macbase}:04 \ + -netdev user,id=n5 -device virtio-net-pci,netdev=n5,mac={macbase}:05 \ + -netdev user,id=n6 -device virtio-net-pci,netdev=n6,mac={macbase}:06 \ + -netdev user,id=n7 -device virtio-net-pci,netdev=n7,mac={macbase}:07 \ -machine accel=kvm \ -nographic {cpu} {cdrom} {kvm} \ -drive format=raw,file={disk_img}' diff --git a/vars/cloneAndBuild.groovy b/vars/cloneAndBuild.groovy index f945ba75..0fc847f4 100644 --- a/vars/cloneAndBuild.groovy +++ b/vars/cloneAndBuild.groovy @@ -34,12 +34,14 @@ def call(description, architecture, pkgList, buildCmd) { // let us reuse this script for packages like vyos-1x which ship a Jenkinfile in
// their repositories root folder.
pkgList.each { pkg ->
- dir(env.BASE_DIR + pkg.name) {
- checkout([$class: 'GitSCM',
- doGenerateSubmoduleConfigurations: false,
- extensions: [[$class: 'CleanCheckout']],
- branches: [[name: pkg.scmCommit]],
- userRemoteConfigs: [[url: pkg.scmUrl]]])
+ if (pkg.scmUrl && pkg.scmCommit) {
+ dir(env.BASE_DIR + pkg.name) {
+ checkout([$class: 'GitSCM',
+ doGenerateSubmoduleConfigurations: false,
+ extensions: [[$class: 'CleanCheckout']],
+ branches: [[name: pkg.scmCommit]],
+ userRemoteConfigs: [[url: pkg.scmUrl]]])
+ }
}
}
}
|