summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitmodules2
-rw-r--r--armband-fuel-config.mk4
-rw-r--r--patches/fuel-plugin-ovs/0000-Cleanup-Fix-debian-changelog-missing-date.patch77
-rw-r--r--patches/fuel-plugin-ovs/0001-AArch64-Add-support-for-downloading-prebuilt-DEBs.patch133
-rw-r--r--patches/fuel-plugin-ovs/0001-Cleanup-Use-dget-instead-of-wget-dpkg-source.patch48
-rw-r--r--patches/fuel-plugin-ovs/0002-Cleanup-Drop-git-dependency.patch99
-rw-r--r--patches/fuel-plugin-ovs/0002-deb-src-Enable-building-Debian-source-pkgs.patch179
-rw-r--r--patches/fuel-plugin-ovs/0003-build-apt-force-yes.patch87
-rw-r--r--patches/fuel-plugin-ovs/0003-build-docker-Use-host-s-network-stack.patch39
-rw-r--r--patches/fuel-plugin-ovs/0004-pre_build_hook-Introduce-USE_DOCKER-option.patch77
-rw-r--r--patches/fuel-plugin-ovs/0005-build-install-pre_build_hook-Prepare-multiarch.patch381
-rw-r--r--patches/fuel-plugin-ovs/0006-AArch64-Add-native-build-support.patch150
-rw-r--r--patches/fuel-plugin-ovs/0007-AArch64-Add-support-for-downloading-prebuilt-DEBs.patch145
-rw-r--r--patches/fuel-plugin-ovs/0008-build-docker-Use-host-s-network-stack.patch30
-rw-r--r--patches/fuel-plugin-ovs/0009-HACK-build-prebuilt-DEBs-src-bin-ver-mismatch.patch72
15 files changed, 354 insertions, 1169 deletions
diff --git a/.gitmodules b/.gitmodules
index b49fa711..f37e0c96 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -11,7 +11,7 @@
[submodule "fuel-plugin-ovs"]
path = upstream/fuel-plugin-ovs
url = https://github.com/openstack/fuel-plugin-ovs
- branch = stable/9.0
+ branch = master
ignore = all
[submodule "vswitchperf"]
path = upstream/vswitchperf
diff --git a/armband-fuel-config.mk b/armband-fuel-config.mk
index ba738628..ef5e42c6 100644
--- a/armband-fuel-config.mk
+++ b/armband-fuel-config.mk
@@ -23,8 +23,8 @@ ARMBAND_TRACK_REMOTES ?= yes
# Armband plugins, supported archs & specific info
# FIXME(alav): re-enable for D release after rebasing to Newton
-#export PLUGINS := f_ovs-nsh-dpdk-pluginbuild f_tacker-pluginbuild
-export PLUGINS := f_yardstick-pluginbuild f_congress-pluginbuild f_odlpluginbuild f_bgpvpn-pluginbuild
+#export PLUGINS := f_tacker-pluginbuild
+export PLUGINS := f_yardstick-pluginbuild f_congress-pluginbuild f_odlpluginbuild f_bgpvpn-pluginbuild f_ovs-nsh-dpdk-pluginbuild
export UBUNTU_ARCH := amd64 arm64
export PRODNO := OPNFV_A_FUEL
export MIRROR_MOS_UBUNTU := linux.enea.com
diff --git a/patches/fuel-plugin-ovs/0000-Cleanup-Fix-debian-changelog-missing-date.patch b/patches/fuel-plugin-ovs/0000-Cleanup-Fix-debian-changelog-missing-date.patch
deleted file mode 100644
index cb42f47a..00000000
--- a/patches/fuel-plugin-ovs/0000-Cleanup-Fix-debian-changelog-missing-date.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Sat, 3 Sep 2016 20:04:59 +0200
-Subject: [PATCH] Cleanup: Fix debian changelog missing date
-
-See [1] for debian/changelog format.
-Signature line should contain the date, separated with 2 spaces,
-in RFC 2822 format.
-
-[1] https://www.debian.org/doc/debian-policy/ch-source.html
-
-Change-Id: I1eb79b5f425a1e632588e309a2cc8b0781766131
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- ovs_build/build-ovs-nsh-dpdk.sh | 6 +++---
- ovs_build/dpdk_16.07/debian/changelog | 2 +-
- ovs_build/openvswitch-dpdk_2.5.90/debian/changelog | 2 +-
- ovs_build/openvswitch-nsh-dpdk_2.5.90/debian/changelog | 2 +-
- 4 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
-index 834409a..1b42df1 100755
---- a/ovs_build/build-ovs-nsh-dpdk.sh
-+++ b/ovs_build/build-ovs-nsh-dpdk.sh
-@@ -42,7 +42,7 @@ cd dpdk-2.2.0; rm -rf debian/patches/;
- cat << EOF > debian/changelog
- dpdk (2.2.0-1) unstable; urgency=low
- * DPDK 2.2.0
-- -- DPDK team <dev@dpdk.org>
-+ -- DPDK team <dev@dpdk.org> $(date --rfc-2822)
- EOF
- debian/rules build; fakeroot debian/rules binary
- cd ${BUILD_HOME}; sudo dpkg -i *.deb
-@@ -92,7 +92,7 @@ rm -rf debian/patches/ .git;
- cat << EOF > debian/changelog
- openvswitch-dpdk (${OVS_VER}-1.nsh) unstable; urgency=low
- * Support NSH
-- -- Open vSwitch team <dev@openvswitch.org>
-+ -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
- EOF
- debian/rules build; fakeroot debian/rules binary
-
-@@ -100,7 +100,7 @@ cd ${BUILD_HOME}/ovs
- cat << EOF > debian/changelog
- openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
- * Support NSH
-- -- Open vSwitch team <dev@openvswitch.org>
-+ -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
- EOF
- debian/rules build; fakeroot debian/rules binary
- cp ${BUILD_HOME}/*.deb ${BUILD_DEST}
-diff --git a/ovs_build/dpdk_16.07/debian/changelog b/ovs_build/dpdk_16.07/debian/changelog
-index 50a7491..dd30f27 100644
---- a/ovs_build/dpdk_16.07/debian/changelog
-+++ b/ovs_build/dpdk_16.07/debian/changelog
-@@ -1,3 +1,3 @@
- dpdk (16.07-1) unstable; urgency=low
- * DPDK 16.07
-- -- DPDK team <dev@dpdk.org>
-+ -- DPDK team <dev@dpdk.org> Sat, 03 Sep 2016 20:00:00 +0200
-diff --git a/ovs_build/openvswitch-dpdk_2.5.90/debian/changelog b/ovs_build/openvswitch-dpdk_2.5.90/debian/changelog
-index 7bcc564..796a6a1 100644
---- a/ovs_build/openvswitch-dpdk_2.5.90/debian/changelog
-+++ b/ovs_build/openvswitch-dpdk_2.5.90/debian/changelog
-@@ -1,3 +1,3 @@
- openvswitch-dpdk (2.5.90-1) unstable; urgency=low
- * New upstream version
-- -- Open vSwitch team <dev@openvswitch.org>
-+ -- Open vSwitch team <dev@openvswitch.org> Sat, 03 Sep 2016 20:00:00 +0200
-diff --git a/ovs_build/openvswitch-nsh-dpdk_2.5.90/debian/changelog b/ovs_build/openvswitch-nsh-dpdk_2.5.90/debian/changelog
-index 46d90d3..5c71403 100644
---- a/ovs_build/openvswitch-nsh-dpdk_2.5.90/debian/changelog
-+++ b/ovs_build/openvswitch-nsh-dpdk_2.5.90/debian/changelog
-@@ -1,3 +1,3 @@
- openvswitch-dpdk (2.5.90-1.nsh) unstable; urgency=low
- * Support NSH
-- -- Open vSwitch team <dev@openvswitch.org>
-+ -- Open vSwitch team <dev@openvswitch.org> Sat, 03 Sep 2016 20:00:00 +0200
diff --git a/patches/fuel-plugin-ovs/0001-AArch64-Add-support-for-downloading-prebuilt-DEBs.patch b/patches/fuel-plugin-ovs/0001-AArch64-Add-support-for-downloading-prebuilt-DEBs.patch
new file mode 100644
index 00000000..3b334992
--- /dev/null
+++ b/patches/fuel-plugin-ovs/0001-AArch64-Add-support-for-downloading-prebuilt-DEBs.patch
@@ -0,0 +1,133 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Mon, 12 Sep 2016 18:02:42 +0200
+Subject: [PATCH] AArch64: Add support for downloading prebuilt DEBs
+
+Change-Id: I6042f9f7bdde5a15e3cb5a94ab67a990faae0418
+Signed-off-by: Anders Roxell <anders.roxell@enea.com>
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ ovs_build/prebuilt-ovs-fetch.sh | 86 +++++++++++++++++++++++++++++++++++++++++
+ pre_build_hook | 10 +++++
+ 2 files changed, 96 insertions(+)
+ create mode 100755 ovs_build/prebuilt-ovs-fetch.sh
+
+diff --git a/ovs_build/prebuilt-ovs-fetch.sh b/ovs_build/prebuilt-ovs-fetch.sh
+new file mode 100755
+index 0000000..f8b88a3
+--- /dev/null
++++ b/ovs_build/prebuilt-ovs-fetch.sh
+@@ -0,0 +1,86 @@
++#!/bin/bash
++
++set -eux
++
++BUILD_DEST=${BUILD_DEST:-/deb}
++BUILD_HOME=${BUILD_HOME:-/tmp/ovs-dpdk}
++BUILD_ARCH=${BUILD_ARCH:-$(dpkg --print-architecture)}
++UBUNTU_ARCH=${UBUNTU_ARCH:-${BUILD_ARCH}}
++
++# armband_fetch will download all binaries for one debian source package
++#
++# Usage:
++# armband_fetch <src_deb_name> <src_deb_version> \
++# [<repo_base_url> \
++# [<repo_Sources_relative_url> \
++# [<repo_Packages_relative_url>]]] \
++#
++# e.g.:
++# armband_fetch dpdk 16.07-0ubuntu5~u1604+mos1 \
++# https://linux.enea.com/mos-repos/ubuntu/10.0 \
++# dists/mos10.0-fuel-plugin-ovs/main/source/Sources \
++# dists/mos10.0-fuel-plugin-ovs/main/binary-arm64/Packages
++function armband_fetch() {
++ local name=$1
++ local ver=${2//\+/\\\+}
++ local repo_base_url=${3:-http://linux.enea.com/mos-repos/ubuntu/10.0}
++ local repo_Sources_url=${4:-dists/mos10.0-fuel-plugin-ovs/main/source/Sources}
++ local repo_Packages_url=${5:-dists/mos10.0-fuel-plugin-ovs/main/binary-arm64/Packages}
++ local found=false
++
++ # Fetch Sources & Packages files if not already present
++ if [ ! -f Sources -o ! -f Packages ]; then
++ sudo apt-get -y --force-yes install wget
++ wget -c "${repo_base_url}/${repo_Sources_url}"
++ wget -c "${repo_base_url}/${repo_Packages_url}"
++ fi
++
++ L=$(grep -Pzo "(?<=Package: ${name}\nBinary: )(\N*?)(?=\nVersion: ${ver}\n)" \
++ Sources | tr -d ',')
++ for deb_binary in ${L}; do
++ D=$(grep -Po "(?<=Filename: )(.*?\/${deb_binary}_${ver}_.*?\.deb)" Packages) || true
++ if [ -n "${D}" ]; then
++ wget -c "${repo_base_url}/${D}" && found=true
++ fi
++ done
++ if [ ${found} = false ]; then
++ echo "ERROR: Could not find DEBs for pkg/ver: ${name}/${ver}"
++ exit 1
++ fi
++}
++
++for arch in ${UBUNTU_ARCH}; do
++ if [ "${arch}" = "${BUILD_ARCH}" ]; then
++ # Skip fetching native binaries
++ continue
++ fi
++
++ cd ${BUILD_DEST}; rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}
++ cd ${BUILD_HOME}
++
++ ARMBAND_BASE="http://linux.enea.com/mos-repos/ubuntu/10.0"
++ ARMBAND_SRCS="dists/mos10.0-fuel-plugin-ovs/main/source/Sources"
++ ARMBAND_BINS="dists/mos10.0-fuel-plugin-ovs/main/binary-${arch}/Packages"
++
++ # DPDK (common)
++ armband_fetch 'dpdk' '.*' \
++ "${ARMBAND_BASE}" "${ARMBAND_SRCS}" "${ARMBAND_BINS}"
++ mv *.deb ${BUILD_DEST}; rm -rf *
++
++ # OVS, OVS-DPDK (without NSH)
++ armband_fetch 'openvswitch' '(?:(?!nsh).)*' \
++ "${ARMBAND_BASE}" "${ARMBAND_SRCS}" "${ARMBAND_BINS}"
++ armband_fetch 'openvswitch-dpdk' '(?:(?!nsh).)*' \
++ "${ARMBAND_BASE}" "${ARMBAND_SRCS}" "${ARMBAND_BINS}"
++ mkdir -p ${BUILD_HOME}/deb; mv *.deb ${BUILD_HOME}/deb; cd ${BUILD_HOME}/deb
++ tar czvf ${BUILD_DEST}/ovs-dpdk_${arch}.tar.gz .;
++ cd ${BUILD_HOME}; rm -rf *
++
++ # OVS, OVS-DPDK (with NSH)
++ armband_fetch 'openvswitch' '.*nsh' \
++ "${ARMBAND_BASE}" "${ARMBAND_SRCS}" "${ARMBAND_BINS}"
++ armband_fetch 'openvswitch-dpdk' '.*nsh' \
++ "${ARMBAND_BASE}" "${ARMBAND_SRCS}" "${ARMBAND_BINS}"
++ mkdir -p ${BUILD_HOME}/deb; mv *.deb ${BUILD_HOME}/deb; cd ${BUILD_HOME}/deb
++ tar czvf ${BUILD_DEST}/ovs-nsh-dpdk_${arch}.tar.gz .;
++done
+diff --git a/pre_build_hook b/pre_build_hook
+index 194a7b9..0c27358 100755
+--- a/pre_build_hook
++++ b/pre_build_hook
+@@ -6,6 +6,11 @@ BUILD_FOR=${BUILD_FOR:-ubuntu}
+ BUILD_ARCH="$(dpkg --print-architecture)"
+ DIR="$(dirname `readlink -f $0`)"
+
++# Pass target arch(s) (UBUNTU_ARCH) to build scripts.
++# All archs should be represented in `dpkg --print-architecture` format
++# UBUNTU_ARCH holds a space-separated list of target arch(s)
++export UBUNTU_ARCH=${UBUNTU_ARCH:-$(dpkg --print-architecture)}
++
+ function build_pkg {
+ case ${BUILD_ARCH} in
+ arm64)
+@@ -27,6 +32,11 @@ function build_pkg {
+ rm -rf ${DEB_DIR}; mkdir -p ${DEB_DIR}; chmod 777 ${DEB_DIR};
+ sudo docker run -v ${DEB_DIR}:/deb -t ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
+ cp -r ${DEB_DIR}/* ${DIR}/repositories/ubuntu/
++
++ rm -rf ${DEB_DIR}; mkdir -p ${DEB_DIR}; chmod 777 ${DEB_DIR};
++ sudo docker run -e "UBUNTU_ARCH=${UBUNTU_ARCH}" -e "BUILD_ARCH=${BUILD_ARCH}" \
++ -v ${DEB_DIR}:/deb -t ovs_build /ovs_build/prebuilt-ovs-fetch.sh
++ cp -r ${DEB_DIR}/* ${DIR}/repositories/ubuntu/
+ rm -rf ${DEB_DIR}
+
+ ;;
diff --git a/patches/fuel-plugin-ovs/0001-Cleanup-Use-dget-instead-of-wget-dpkg-source.patch b/patches/fuel-plugin-ovs/0001-Cleanup-Use-dget-instead-of-wget-dpkg-source.patch
deleted file mode 100644
index 4c2283f4..00000000
--- a/patches/fuel-plugin-ovs/0001-Cleanup-Use-dget-instead-of-wget-dpkg-source.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Fri, 24 Jun 2016 16:51:41 +0200
-Subject: [PATCH] Cleanup: Use dget instead of wget+dpkg-source.
-
-We already install devscripts, which provides dget.
-
-See [1] for using `dget -x -u` to accelerate/simplify code dev.
-
-FIXME: Remove `-u` when we add Ubuntu signing keys to builder
-docker keyring.
-
-[1] https://debian-administration.org/article/
- 504/Downloading_Debian_source_packages_easily
-
-Change-Id: Ifbcac2a14c7b34216894adb7c5c4e921bf556e33
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- ovs_build/build-ovs-nsh-dpdk.sh | 10 ++--------
- 1 file changed, 2 insertions(+), 8 deletions(-)
-
-diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
-index 1b42df1..3d7edea 100755
---- a/ovs_build/build-ovs-nsh-dpdk.sh
-+++ b/ovs_build/build-ovs-nsh-dpdk.sh
-@@ -17,10 +17,7 @@ sudo apt-get -y install devscripts dpkg-dev git wget
- rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}
-
- cd ${BUILD_HOME}
--wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
--wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0.orig.tar.gz
--wget -c https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.debian.tar.xz
--dpkg-source -x dpdk_2.2.0-0ubuntu8.dsc
-+dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
-
- # copy from debian/control
- sudo apt-get install -y debhelper \
-@@ -49,10 +46,7 @@ cd ${BUILD_HOME}; sudo dpkg -i *.deb
- apt-get download libxenstore3.0
-
- cd ${BUILD_HOME}
--wget -c https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0.orig.tar.gz
--wget -c https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
--wget -c https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.debian.tar.xz
--dpkg-source -x openvswitch-dpdk_2.4.0-0ubuntu1.dsc
-+dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
-
- # copy from debian/control
- sudo apt-get install -y autoconf \
diff --git a/patches/fuel-plugin-ovs/0002-Cleanup-Drop-git-dependency.patch b/patches/fuel-plugin-ovs/0002-Cleanup-Drop-git-dependency.patch
deleted file mode 100644
index 22aa570e..00000000
--- a/patches/fuel-plugin-ovs/0002-Cleanup-Drop-git-dependency.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Sat, 3 Sep 2016 20:42:06 +0200
-Subject: [PATCH] Cleanup: Drop git dependency
-
-We only use git to fetch upstream contents, this can be achieved
-with a simple wget.
-
-Change-Id: I07f681e44253cc1f390943eb121a694bf2c9d95f
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- ovs_build/build-ovs-dpdk.sh | 10 +++++-----
- ovs_build/build-ovs-nsh-dpdk.sh | 12 ++++++------
- 2 files changed, 11 insertions(+), 11 deletions(-)
-
-diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
-index aeb5eb7..01ba032 100755
---- a/ovs_build/build-ovs-dpdk.sh
-+++ b/ovs_build/build-ovs-dpdk.sh
-@@ -3,14 +3,14 @@
- set -eux
-
- OVS_COMMIT=9f4ecd654dbcb88b15a424445184591fc887537e
--URL_OVS=https://github.com/openvswitch/ovs.git
-+URL_OVS_ARCHIVE=https://github.com/openvswitch/ovs/archive
- BUILD_DEB=${BUILD_DEB:-/deb}
- BUILD_SRC="$(dirname `readlink -f $0`)"
- BUILD_DEST=${BUILD_DEST:-/tmp/ovs-dpdk}
-
- export DEB_BUILD_OPTIONS='parallel=8 nocheck'
-
--sudo apt-get -y install devscripts dpkg-dev git wget
-+sudo apt-get -y install devscripts dpkg-dev wget
-
- rm -rf ${BUILD_DEST}; mkdir -p ${BUILD_DEST}
-
-@@ -62,9 +62,9 @@ sudo apt-get install -y autoconf \
- python-zopeinterface \
- python-six
-
--git clone https://github.com/openvswitch/ovs.git
--cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git
--cd ${BUILD_DEST}; cp -r ovs ovs-dpdk
-+wget -c ${URL_OVS_ARCHIVE}/${OVS_COMMIT}.tar.gz
-+tar xzf ${OVS_COMMIT}.tar.gz; mv ovs-${OVS_COMMIT} ovs
-+cp -r ovs ovs-dpdk
-
- cd ovs-dpdk
- cp -r ${BUILD_SRC}/openvswitch-dpdk_2.5.90/debian .
-diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
-index 3d7edea..25e4b6c 100755
---- a/ovs_build/build-ovs-nsh-dpdk.sh
-+++ b/ovs_build/build-ovs-nsh-dpdk.sh
-@@ -3,7 +3,7 @@
- set -eux
-
- OVS_COMMIT=7d433ae57ebb90cd68e8fa948a096f619ac4e2d8
--URL_OVS=https://github.com/openvswitch/ovs.git
-+URL_OVS_ARCHIVE=https://github.com/openvswitch/ovs/archive
- OVS_VER=${OVS_VER:-2.5.90}
- BUILD_HOME=$HOME/nsh
- BUILD_DEST=${BUILD_DEST:-/deb}
-@@ -12,7 +12,7 @@ DIR="$(dirname `readlink -f $0`)"
- export DEB_BUILD_OPTIONS='parallel=8 nocheck'
-
- sudo apt-get build-dep openvswitch -y
--sudo apt-get -y install devscripts dpkg-dev git wget
-+sudo apt-get -y install devscripts dpkg-dev wget
-
- rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}
-
-@@ -35,7 +35,7 @@ sudo apt-get install -y debhelper \
- texlive-fonts-recommended \
- texlive-latex-extra
-
--cd dpdk-2.2.0; rm -rf debian/patches/;
-+cd dpdk-2.2.0; rm -rf debian/patches/
- cat << EOF > debian/changelog
- dpdk (2.2.0-1) unstable; urgency=low
- * DPDK 2.2.0
-@@ -68,8 +68,8 @@ sudo apt-get install -y autoconf \
- python-zopeinterface \
- python-six
-
--git clone https://github.com/openvswitch/ovs.git
--cd ovs; git checkout ${OVS_COMMIT}
-+wget -c ${URL_OVS_ARCHIVE}/${OVS_COMMIT}.tar.gz
-+tar xzf ${OVS_COMMIT}.tar.gz; mv ovs-${OVS_COMMIT} ovs
- PATCHES=$(cd ${DIR}/patches; echo *patch)
- for patch in ${PATCHES}
- do
-@@ -82,7 +82,7 @@ cd ../openvswitch-dpdk-${OVS_VER}
- sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
- sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
- autoreconf --install
--rm -rf debian/patches/ .git;
-+rm -rf debian/patches/
- cat << EOF > debian/changelog
- openvswitch-dpdk (${OVS_VER}-1.nsh) unstable; urgency=low
- * Support NSH
diff --git a/patches/fuel-plugin-ovs/0002-deb-src-Enable-building-Debian-source-pkgs.patch b/patches/fuel-plugin-ovs/0002-deb-src-Enable-building-Debian-source-pkgs.patch
new file mode 100644
index 00000000..c7b90a0d
--- /dev/null
+++ b/patches/fuel-plugin-ovs/0002-deb-src-Enable-building-Debian-source-pkgs.patch
@@ -0,0 +1,179 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Wed, 25 Jan 2017 22:11:44 +0100
+Subject: [PATCH] deb-src: Enable building Debian source pkgs
+
+Armband plans on shipping prebuilt binaries.
+Opensource rules dictate they should be accompanied by the
+corresponding source packages.
+
+So, add the possibility to also build Debian sources when a
+dummy "ovs_build/build_debian_source" file exists (to avoid
+passing an useless env var to each docker run).
+
+Change-Id: I4e308d84c2eb01af043ed73440c46fc692c30d12
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ ovs_build/build-ovs-dpdk.sh | 28 ++++++++++++++----
+ ovs_build/build-ovs-nsh-dpdk.sh | 34 +++++++++++++++++-----
+ .../debian/patches/series | 1 -
+ 3 files changed, 49 insertions(+), 14 deletions(-)
+ delete mode 100644 ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series
+
+diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
+index 7ce2a62..8dd7430 100755
+--- a/ovs_build/build-ovs-dpdk.sh
++++ b/ovs_build/build-ovs-dpdk.sh
+@@ -11,14 +11,30 @@ DEB_ARCH="$(dpkg --print-architecture)"
+
+ export DEB_BUILD_OPTIONS='parallel=8 nocheck'
+
++function debian_build() {
++ if [ -f "${BUILD_SRC}/build_debian_source" ]; then
++ dpkg-source -b .
++ cp -f ../*.{dsc,xz} ${BUILD_HOME}/deb
++ fi
++ debian/rules build; fakeroot debian/rules binary
++}
++
++function debian_src_prepare_ovs() {
++ if [ -f "${BUILD_SRC}/build_debian_source" ]; then
++ suffix="${OVS_VER}.orig.tar.xz"
++ tar cJf ../openvswitch_${suffix} --exclude='./debian' .
++ cd ..; ln -sf openvswitch_${suffix} openvswitch-dpdk_${suffix}; cd -
++ fi
++}
++
+ sudo apt-get update
+ sudo apt-get -y --force-yes install devscripts dpkg-dev git wget dkms
+
+ rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}/deb
+
+ cd ${BUILD_HOME}
+-wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
+-xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
++wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz -O dpdk_16.07.orig.tar.xz
++tar xJvf dpdk_16.07.orig.tar.xz
+ cd dpdk-16.07
+ cp -r ${BUILD_SRC}/dpdk_16.07.fuel/debian .
+ cat << EOF > debian/changelog
+@@ -45,7 +61,7 @@ sudo apt-get install -y --force-yes debhelper \
+ python-sphinx \
+ texlive-fonts-recommended \
+ texlive-latex-extra
+-debian/rules build; fakeroot debian/rules binary
++debian_build
+
+ cd ${BUILD_HOME}
+ sudo apt-get install -y --force-yes hwdata
+@@ -73,7 +89,7 @@ sudo apt-get install -y --force-yes autoconf \
+ python-six
+
+ git clone https://github.com/openvswitch/ovs.git
+-cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git
++cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git; debian_src_prepare_ovs
+ cd ${BUILD_HOME}; cp -r ovs ovs-dpdk
+
+ cd ovs-dpdk
+@@ -86,10 +102,10 @@ openvswitch-dpdk (${OVS_VER}-1) unstable; urgency=low
+ -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
+ EOF
+
+-debian/rules build; fakeroot debian/rules binary
++debian_build
+
+ cd ${BUILD_HOME}/ovs
+-debian/rules build; fakeroot debian/rules binary
++debian_build
+
+ cp -r ${BUILD_HOME}/*.deb ${BUILD_HOME}/deb
+ cd ${BUILD_HOME}/deb
+diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
+index e6f8faf..03b494c 100755
+--- a/ovs_build/build-ovs-nsh-dpdk.sh
++++ b/ovs_build/build-ovs-nsh-dpdk.sh
+@@ -11,14 +11,30 @@ DEB_ARCH="$(dpkg --print-architecture)"
+
+ export DEB_BUILD_OPTIONS='parallel=8 nocheck'
+
++function debian_build() {
++ if [ -f "${BUILD_SRC}/build_debian_source" ]; then
++ dpkg-source -b .
++ cp -f ../*.{dsc,xz} ${BUILD_HOME}/deb
++ fi
++ debian/rules build; fakeroot debian/rules binary
++}
++
++function debian_src_prepare_ovs() {
++ if [ -f "${BUILD_SRC}/build_debian_source" ]; then
++ suffix="${OVS_VER}.orig.tar.xz"
++ tar cJf ../openvswitch_${suffix} --exclude='./debian' .
++ cd ..; ln -sf openvswitch_${suffix} openvswitch-dpdk_${suffix}; cd -
++ fi
++}
++
+ sudo apt-get update
+ sudo apt-get -y --force-yes install devscripts dpkg-dev git wget dkms
+
+ rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}/deb
+
+ cd ${BUILD_HOME}
+-wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
+-xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
++wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz -O dpdk_16.07.orig.tar.xz
++tar xJvf dpdk_16.07.orig.tar.xz
+ cd dpdk-16.07
+ cp -r ${BUILD_SRC}/dpdk_16.07.fuel/debian .
+ cat << EOF > debian/changelog
+@@ -45,7 +61,7 @@ sudo apt-get install -y --force-yes debhelper \
+ python-sphinx \
+ texlive-fonts-recommended \
+ texlive-latex-extra
+-debian/rules build; fakeroot debian/rules binary
++debian_build
+
+ cd ${BUILD_HOME}
+ sudo apt-get install -y --force-yes hwdata
+@@ -73,12 +89,16 @@ sudo apt-get install -y --force-yes autoconf \
+ python-six
+
+ git clone https://github.com/openvswitch/ovs.git
+-cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git
++cd ovs; git checkout ${OVS_COMMIT}; rm -rf .git; debian_src_prepare_ovs
++mkdir -p debian/patches; mkdir -p .pc
+ PATCHES=$(cd ${BUILD_SRC}/ovs_nsh_patches/v2.6.1/; echo *patch)
+ for patch in ${PATCHES}
+ do
+- patch -p1 < ${BUILD_SRC}/ovs_nsh_patches/v2.6.1/${patch}
++ echo "${patch}" >> debian/patches/series
++ cp ${BUILD_SRC}/ovs_nsh_patches/v2.6.1/${patch} debian/patches/
++ patch -p1 < debian/patches/${patch}
+ done
++cp debian/patches/series .pc/applied-patches
+ cd ${BUILD_HOME}; cp -r ovs ovs-dpdk
+
+ cd ovs-dpdk
+@@ -91,7 +111,7 @@ openvswitch-dpdk (${OVS_VER}-1.nsh) unstable; urgency=low
+ -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
+ EOF
+
+-debian/rules build; fakeroot debian/rules binary
++debian_build
+
+ cd ${BUILD_HOME}/ovs
+ cat << EOF > debian/changelog
+@@ -101,7 +121,7 @@ openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
+
+ -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
+ EOF
+-debian/rules build; fakeroot debian/rules binary
++debian_build
+
+ cp -r ${BUILD_HOME}/*.deb ${BUILD_HOME}/deb
+ cd ${BUILD_HOME}/deb
+diff --git a/ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series b/ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series
+deleted file mode 100644
+index 8b13789..0000000
+--- a/ovs_build/openvswitch_2.6-dpdk_16.07/debian/patches/series
++++ /dev/null
+@@ -1 +0,0 @@
+-
diff --git a/patches/fuel-plugin-ovs/0003-build-apt-force-yes.patch b/patches/fuel-plugin-ovs/0003-build-apt-force-yes.patch
deleted file mode 100644
index 9ec04cd2..00000000
--- a/patches/fuel-plugin-ovs/0003-build-apt-force-yes.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Sat, 3 Sep 2016 20:52:05 +0200
-Subject: [PATCH] build: apt: --force-yes.
-
-For arm64 builds, some packages are fetched from linux.enea.com,
-leading to package version being reported as "older", although in
-fact it is newer (dpkg version comparison is not that great with
-suffixes). Also, since we don't explicitly add the GPG key of
-the linux.enea.com repo yet, apt is complaining about unverified
-package sources.
-
-Bypass the above by using "--force-yes", next to "-y".
-
-Change-Id: I4899fe62aaad9a13f8b2f9ffbdf2f3631ecba164
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- ovs_build/build-ovs-dpdk.sh | 8 ++++----
- ovs_build/build-ovs-nsh-dpdk.sh | 8 ++++----
- 2 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
-index 01ba032..dd9c6ff 100755
---- a/ovs_build/build-ovs-dpdk.sh
-+++ b/ovs_build/build-ovs-dpdk.sh
-@@ -10,7 +10,7 @@ BUILD_DEST=${BUILD_DEST:-/tmp/ovs-dpdk}
-
- export DEB_BUILD_OPTIONS='parallel=8 nocheck'
-
--sudo apt-get -y install devscripts dpkg-dev wget
-+sudo apt-get -y --force-yes install devscripts dpkg-dev wget
-
- rm -rf ${BUILD_DEST}; mkdir -p ${BUILD_DEST}
-
-@@ -21,7 +21,7 @@ cd dpdk-16.07
- cp -r ${BUILD_SRC}/dpdk_16.07/debian .
-
- # copy from debian/control
--sudo apt-get install -y debhelper \
-+sudo apt-get install -y --force-yes debhelper \
- dh-python \
- dh-systemd \
- doxygen \
-@@ -41,9 +41,9 @@ cd ${BUILD_DEST}
- sudo dpkg -i *.deb
- apt-get download libxenstore3.0
-
--sudo apt-get build-dep openvswitch -y
-+sudo apt-get build-dep openvswitch -y --force-yes
- # copy from debian/control
--sudo apt-get install -y autoconf \
-+sudo apt-get install -y --force-yes autoconf \
- automake \
- bzip2 \
- debhelper \
-diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
-index 25e4b6c..3751c02 100755
---- a/ovs_build/build-ovs-nsh-dpdk.sh
-+++ b/ovs_build/build-ovs-nsh-dpdk.sh
-@@ -11,8 +11,8 @@ DIR="$(dirname `readlink -f $0`)"
-
- export DEB_BUILD_OPTIONS='parallel=8 nocheck'
-
--sudo apt-get build-dep openvswitch -y
--sudo apt-get -y install devscripts dpkg-dev wget
-+sudo apt-get build-dep openvswitch -y --force-yes
-+sudo apt-get -y --force-yes install devscripts dpkg-dev wget
-
- rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}
-
-@@ -20,7 +20,7 @@ cd ${BUILD_HOME}
- dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
-
- # copy from debian/control
--sudo apt-get install -y debhelper \
-+sudo apt-get install -y --force-yes debhelper \
- dh-python \
- dh-systemd \
- doxygen \
-@@ -49,7 +49,7 @@ cd ${BUILD_HOME}
- dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
-
- # copy from debian/control
--sudo apt-get install -y autoconf \
-+sudo apt-get install -y --force-yes autoconf \
- automake \
- bzip2 \
- debhelper \
diff --git a/patches/fuel-plugin-ovs/0003-build-docker-Use-host-s-network-stack.patch b/patches/fuel-plugin-ovs/0003-build-docker-Use-host-s-network-stack.patch
new file mode 100644
index 00000000..ea81a7b0
--- /dev/null
+++ b/patches/fuel-plugin-ovs/0003-build-docker-Use-host-s-network-stack.patch
@@ -0,0 +1,39 @@
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Thu, 15 Sep 2016 19:16:34 +0200
+Subject: [PATCH] build: docker: Use host's network stack
+
+Similar to Fuel@OPNFV build process, we want to mount /etc/hosts
+in the builder container to be able to use local mirror caches.
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ pre_build_hook | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/pre_build_hook b/pre_build_hook
+index 0c27358..30ca109 100755
+--- a/pre_build_hook
++++ b/pre_build_hook
+@@ -26,16 +26,19 @@ function build_pkg {
+
+ DEB_DIR=${DIR}/deb-ovs-dpdk
+ rm -rf ${DEB_DIR}; mkdir -p ${DEB_DIR}; chmod 777 ${DEB_DIR};
+- sudo docker run -v ${DEB_DIR}:/deb -t ovs_build /ovs_build/build-ovs-dpdk.sh
++ sudo docker run -v ${DEB_DIR}:/deb -v /etc/hosts:/etc/hosts \
++ -t ovs_build /ovs_build/build-ovs-dpdk.sh
+ cp -r ${DEB_DIR}/* ${DIR}/repositories/ubuntu/
+
+ rm -rf ${DEB_DIR}; mkdir -p ${DEB_DIR}; chmod 777 ${DEB_DIR};
+- sudo docker run -v ${DEB_DIR}:/deb -t ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
++ sudo docker run -v ${DEB_DIR}:/deb -v /etc/hosts:/etc/hosts \
++ -t ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
+ cp -r ${DEB_DIR}/* ${DIR}/repositories/ubuntu/
+
+ rm -rf ${DEB_DIR}; mkdir -p ${DEB_DIR}; chmod 777 ${DEB_DIR};
+ sudo docker run -e "UBUNTU_ARCH=${UBUNTU_ARCH}" -e "BUILD_ARCH=${BUILD_ARCH}" \
+- -v ${DEB_DIR}:/deb -t ovs_build /ovs_build/prebuilt-ovs-fetch.sh
++ -v ${DEB_DIR}:/deb -v /etc/hosts:/etc/hosts \
++ -t ovs_build /ovs_build/prebuilt-ovs-fetch.sh
+ cp -r ${DEB_DIR}/* ${DIR}/repositories/ubuntu/
+ rm -rf ${DEB_DIR}
+
diff --git a/patches/fuel-plugin-ovs/0004-pre_build_hook-Introduce-USE_DOCKER-option.patch b/patches/fuel-plugin-ovs/0004-pre_build_hook-Introduce-USE_DOCKER-option.patch
deleted file mode 100644
index 7df0c5f6..00000000
--- a/patches/fuel-plugin-ovs/0004-pre_build_hook-Introduce-USE_DOCKER-option.patch
+++ /dev/null
@@ -1,77 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Sun, 26 Jun 2016 20:00:22 +0200
-Subject: [PATCH] pre_build_hook: Introduce USE_DOCKER option
-
-The build system uses Ubuntu Trusty, which is not properly supported
-by Docker on AArch64 architecture.
-Introduce a new environment variable for enabling/disabling build
-containerization, and disable by default said variable for AArch64.
-
-This requires a slight rework of the pre_build_hook script.
-
-NOTE: Setting USE_DOCKER to false will build the packages on the host
-machine directly.
-
-AArch64 WARNING: This build will install packages automatically!
-
-Change-Id: Ib1294949ecc1767f12631a82e2c7099c45fcb615
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- pre_build_hook | 33 +++++++++++++++++++++++----------
- 1 file changed, 23 insertions(+), 10 deletions(-)
-
-diff --git a/pre_build_hook b/pre_build_hook
-index 63cf7b4..b9ae6bb 100755
---- a/pre_build_hook
-+++ b/pre_build_hook
-@@ -3,27 +3,40 @@
- set -eux
-
- BUILD_FOR=${BUILD_FOR:-ubuntu}
-+USE_DOCKER=${USE_DOCKER:-true}
- DIR="$(dirname `readlink -f $0`)"
-
-+if [ `uname -m` = 'aarch64' ]; then
-+ USE_DOCKER=false
-+fi
-+
- function build_pkg {
- case $1 in
- ubuntu)
-- rm -rf ${DIR}/repositories/ubuntu; mkdir -p ${DIR}/repositories/ubuntu
-+ DEB_DIR=${DIR}/deb-ovs-dpdk
-+ DEB_DIR_NSH=${DIR}/deb-ovs-nsh-dpdk
-+
-+ rm -rf ${DIR}/repositories/ubuntu ${DEB_DIR} ${DEB_DIR_NSH}
-+ mkdir -p ${DIR}/repositories/ubuntu ${DEB_DIR} ${DEB_DIR_NSH}
-+ sudo chmod -R 777 ${DEB_DIR} ${DEB_DIR_NSH}
-
- cd ${DIR}/ovs_build
-- sudo docker build -t ovs_build .
-+ if [ "${USE_DOCKER}" = true ]; then
-+ sudo docker build -t ovs_build .
-+ sudo docker run -v ${DEB_DIR}:/deb -t ovs_build /ovs_build/build-ovs-dpdk.sh
-+ sudo docker run -v ${DEB_DIR_NSH}:/deb -t ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
-+ else
-+ rm -rf /tmp/ovs-build-{,nsh-}dpdk; mkdir -p /tmp/ovs-build-{,nsh-}dpdk
-+ BUILD_HOME=/tmp/ovs-build-dpdk BUILD_DEB=${DEB_DIR} ./build-ovs-dpdk.sh
-+ BUILD_HOME=/tmp/ovs-build-nsh-dpdk BUILD_DEST=${DEB_DIR_NSH} ./build-ovs-nsh-dpdk.sh
-+ rm -rf /tmp/ovs-build-{,nsh-}dpdk
-+ fi
-
-- DEB_DIR=${DIR}/deb-ovs-dpdk
-- rm -rf ${DEB_DIR}; mkdir -p ${DEB_DIR}; chmod 777 ${DEB_DIR};
-- sudo docker run -v ${DEB_DIR}:/deb -t ovs_build /ovs_build/build-ovs-dpdk.sh
- cd ${DEB_DIR}; tar czvf ../repositories/ubuntu/ovs-dpdk.tar.gz .;
- cd ..; rm -rf ${DEB_DIR}
-
-- DEB_DIR=${DIR}/deb-ovs-nsh-dpdk
-- rm -rf ${DEB_DIR}; mkdir -p ${DEB_DIR}; chmod 777 ${DEB_DIR};
-- sudo docker run -v ${DEB_DIR}:/deb -t ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
-- cd ${DEB_DIR}; tar czvf ../repositories/ubuntu/ovs-nsh-dpdk.tar.gz .;
-- cd ..; rm -rf ${DEB_DIR}
-+ cd ${DEB_DIR_NSH}; tar czvf ../repositories/ubuntu/ovs-nsh-dpdk.tar.gz .;
-+ cd ..; rm -rf ${DEB_DIR_NSH}
-
- ;;
- *) echo "Not supported system"; exit 1;;
diff --git a/patches/fuel-plugin-ovs/0005-build-install-pre_build_hook-Prepare-multiarch.patch b/patches/fuel-plugin-ovs/0005-build-install-pre_build_hook-Prepare-multiarch.patch
deleted file mode 100644
index da71d8e6..00000000
--- a/patches/fuel-plugin-ovs/0005-build-install-pre_build_hook-Prepare-multiarch.patch
+++ /dev/null
@@ -1,381 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Sun, 26 Jun 2016 20:17:59 +0200
-Subject: [PATCH] build, install, pre_build_hook: Prepare multiarch
-
-install.sh: Factor out dpkg arch into var, read it from dpkg.
-install.sh: Relax DPDK/OVS/OVS-DPDK version hardcodes
-
-Instead of putting all debs in one archive, and possibly wasting
-bandwidth / space with unused foreign packages, split plugin
-archive(s) into arch-specific archives, with <_${arch}> suffix.
-E.g. <ovs-dpdk.tar.gz> for <amd64> becomes <ovs-dpdk_amd64.tar.gz>
-
-Since only one (DPDK/OVS/OVS-DPDK) set of packages is shipped per
-archive, we can safely wildcard the installed version of libdpdk,
-which previously hardcoded 2.2.0 and 16.04 for NSH/non-NSH.
-
-This is helpful for arm64, which has a custom deb subversion
-for DPDK16.07 and also requires DPDK16.07 for OVS-DPDK-NSH, instead
-of 2.2.0.
-
-Pass UBUNTU_ARCH from pre_build_hook and make install.sh more
-arch-independant.
-
-CHANGE:
- UBUNTU_ARCH specifies the complete list of supported architectures
- of the resulting RPM, in `dpkg --print-architecture` format.
- e.g. UBUNTU_ARCH='arm64 amd64' will result in x86 + AArch64 support
-
-Change-Id: I04ac0a78319b460270545708efc4b53f02f7dd05
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- deployment_scripts/install.sh | 51 +++++++++++-----------
- ovs_build/build-ovs-dpdk.sh | 64 ++++++++++++++++------------
- ovs_build/build-ovs-nsh-dpdk.sh | 93 ++++++++++++++++++++++++-----------------
- pre_build_hook | 24 +++++++----
- 4 files changed, 136 insertions(+), 96 deletions(-)
-
-diff --git a/deployment_scripts/install.sh b/deployment_scripts/install.sh
-index efbed72..46d74bb 100644
---- a/deployment_scripts/install.sh
-+++ b/deployment_scripts/install.sh
-@@ -9,34 +9,33 @@ host=$1
- nsh=$2
- dpdk=$3
- dpdk_socket_mem=${4:-''}
-+arch=$(dpkg --print-architecture)
-+ovs="ovs-dpdk_${arch}.tar.gz"
-
--if [ $nsh = 'true' ]
--then
-- curl http://$host:8080/plugins/fuel-plugin-ovs-0.9/repositories/ubuntu/ovs-nsh-dpdk.tar.gz | tar -xzv
-- dpkg -i openvswitch-datapath-dkms_2.5.90-1.nsh_all.deb
-- dpkg -i openvswitch-common_2.5.90-1.nsh_amd64.deb
-- dpkg -i openvswitch-switch_2.5.90-1.nsh_amd64.deb
-- dpkg -i python-openvswitch_2.5.90-1.nsh_all.deb
-- if [ $dpdk = 'true' ]
-- then
-+if [ $nsh = 'true' ]; then
-+ ovs="ovs-nsh-dpdk_${arch}.tar.gz"
-+fi
-+
-+curl http://$host:8080/plugins/fuel-plugin-ovs-0.9/repositories/ubuntu/${ovs} | tar -xzv
-+dpkg -i openvswitch-datapath-dkms_*.deb
-+dpkg -i openvswitch-common_*.deb
-+dpkg -i openvswitch-switch_*.deb
-+dpkg -i python-openvswitch_*.deb
-+if [ $dpdk = 'true' ]; then
-+ if [ $nsh = 'true' -o -n $dpdk_socket_mem ]; then
- dpkg -i libxenstore3.0*.deb
-- dpkg -i libdpdk0_2.2.0-1_amd64.deb
-- dpkg -i dpdk_2.2.0-1_amd64.deb
-- dpkg -i openvswitch-switch-dpdk_2.5.90-1.nsh_amd64.deb
-+ if [ $arch = 'arm64' ]; then
-+ # FIXME(armband): arm64 DPDK ships individual libs, install them all
-+ dpdk_deb_name=$(ls dpdk_*)
-+ dpdk_deb_suffix=${dpdk_deb_name#dpdk_}
-+ dpkg -i *${dpdk_deb_suffix%_*}*.deb
-+ else
-+ dpkg -i libdpdk0_*.deb
-+ dpkg -i dpdk_*.deb
-+ fi
-+ dpkg -i openvswitch-switch-dpdk_*.deb
- fi
--else
-- curl http://$host:8080/plugins/fuel-plugin-ovs-0.9/repositories/ubuntu/ovs-dpdk.tar.gz | tar -xzv
-- dpkg -i openvswitch-datapath-dkms_2.5.90-1_all.deb
-- dpkg -i openvswitch-common_2.5.90-1_amd64.deb
-- dpkg -i openvswitch-switch_2.5.90-1_amd64.deb
-- dpkg -i python-openvswitch_2.5.90-1_all.deb
-- if [[ $dpdk = 'true' && -n $dpdk_socket_mem ]]
-- then
-- dpkg -i libxenstore3.0*.deb
-- dpkg -i libdpdk0_16.07-1_amd64.deb
-- dpkg -i dpdk_16.07-1_amd64.deb
-- dpkg -i openvswitch-switch-dpdk_2.5.90-1_amd64.deb
--
-+ if ! [ $nsh = 'true' -a -n $dpdk_socket_mem ]; then
- #Set to 0, dpdk init script mount hugepages but don't change current allocation
- sed -i "s/[# ]*\(NR_2M_PAGES=\).*/\10/" /etc/dpdk/dpdk.conf
- service dpdk start
-@@ -47,3 +46,5 @@ else
- service openvswitch-switch restart
- fi
- fi
-+
-+rm -rf $INSTALL_HOME
-diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
-index dd9c6ff..a14f5fd 100755
---- a/ovs_build/build-ovs-dpdk.sh
-+++ b/ovs_build/build-ovs-dpdk.sh
-@@ -10,18 +10,27 @@ BUILD_DEST=${BUILD_DEST:-/tmp/ovs-dpdk}
-
- export DEB_BUILD_OPTIONS='parallel=8 nocheck'
-
--sudo apt-get -y --force-yes install devscripts dpkg-dev wget
-+# Keep track of native arch (BUILD_ARCH) and target arch(s) (UBUNTU_ARCH)
-+# All archs should be represented in `dpkg --print-architecture` format
-+# UBUNTU_ARCH holds a space-separated list of target arch(s)
-+# FIXME(armband): For now, only native building is supported!
-+BUILD_ARCH=$(dpkg --print-architecture)
-+UBUNTU_ARCH=${UBUNTU_ARCH:-${BUILD_ARCH}}
-
--rm -rf ${BUILD_DEST}; mkdir -p ${BUILD_DEST}
-+# Build and/or fetch precompiled packages for all arch(s) in UBUNTU_ARCH
-+for ARCH in ${UBUNTU_ARCH}; do
-+ rm -rf ${BUILD_DEST}; mkdir -p ${BUILD_DEST}; cd ${BUILD_DEST}
-+ if [ ${ARCH} = ${BUILD_ARCH} ]; then
-+ # Native building for: DPDK, OVS-DPDK, OVS
-+ sudo apt-get -y --force-yes install devscripts dpkg-dev wget
-
--cd ${BUILD_DEST}
--wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
--xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
--cd dpdk-16.07
--cp -r ${BUILD_SRC}/dpdk_16.07/debian .
-+ wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
-+ xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
-+ cd dpdk-16.07
-+ cp -r ${BUILD_SRC}/dpdk_16.07/debian .
-
--# copy from debian/control
--sudo apt-get install -y --force-yes debhelper \
-+ # DPDK build-dep install: copy from debian/control
-+ sudo apt-get install -y --force-yes debhelper \
- dh-python \
- dh-systemd \
- doxygen \
-@@ -35,15 +44,15 @@ sudo apt-get install -y --force-yes debhelper \
- python-sphinx \
- texlive-fonts-recommended \
- texlive-latex-extra
--debian/rules build; fakeroot debian/rules binary
-+ debian/rules build; fakeroot debian/rules binary
-
--cd ${BUILD_DEST}
--sudo dpkg -i *.deb
--apt-get download libxenstore3.0
-+ cd ${BUILD_DEST}
-+ sudo dpkg -i *.deb
-+ apt-get download libxenstore3.0
-
--sudo apt-get build-dep openvswitch -y --force-yes
--# copy from debian/control
--sudo apt-get install -y --force-yes autoconf \
-+ sudo apt-get build-dep openvswitch -y --force-yes
-+ # OVS-DPDK build-dep install: copy from debian/control
-+ sudo apt-get install -y --force-yes autoconf \
- automake \
- bzip2 \
- debhelper \
-@@ -62,16 +71,19 @@ sudo apt-get install -y --force-yes autoconf \
- python-zopeinterface \
- python-six
-
--wget -c ${URL_OVS_ARCHIVE}/${OVS_COMMIT}.tar.gz
--tar xzf ${OVS_COMMIT}.tar.gz; mv ovs-${OVS_COMMIT} ovs
--cp -r ovs ovs-dpdk
-+ wget -c ${URL_OVS_ARCHIVE}/${OVS_COMMIT}.tar.gz
-+ tar xzf ${OVS_COMMIT}.tar.gz; mv ovs-${OVS_COMMIT} ovs
-+ cp -r ovs ovs-dpdk
-
--cd ovs-dpdk
--cp -r ${BUILD_SRC}/openvswitch-dpdk_2.5.90/debian .
--debian/rules build; fakeroot debian/rules binary
-+ cd ovs-dpdk
-+ cp -r ${BUILD_SRC}/openvswitch-dpdk_2.5.90/debian .
-+ debian/rules build; fakeroot debian/rules binary
-
--cd ${BUILD_DEST}/ovs
--debian/rules build; fakeroot debian/rules binary
-+ cd ${BUILD_DEST}/ovs
-+ debian/rules build; fakeroot debian/rules binary
-+ fi
-
--cp -r ${BUILD_DEST}/*.deb ${BUILD_DEB}
--rm -rf ${BUILD_DEST}
-+ # Store DEBs in <${BUILD_DEB}/${ARCH}/> dir and cleanup
-+ rm -rf ${BUILD_DEB}/${ARCH}; mkdir -p ${BUILD_DEB}/${ARCH}; cd ${BUILD_DEB}/${ARCH}
-+ cp ${BUILD_DEST}/*.deb .; rm -rf ${BUILD_DEST}
-+done
-diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
-index 3751c02..a65a2bb 100755
---- a/ovs_build/build-ovs-nsh-dpdk.sh
-+++ b/ovs_build/build-ovs-nsh-dpdk.sh
-@@ -11,16 +11,24 @@ DIR="$(dirname `readlink -f $0`)"
-
- export DEB_BUILD_OPTIONS='parallel=8 nocheck'
-
--sudo apt-get build-dep openvswitch -y --force-yes
--sudo apt-get -y --force-yes install devscripts dpkg-dev wget
-+# Keep track of native arch (BUILD_ARCH) and target arch(s) (UBUNTU_ARCH)
-+# All archs should be represented in `dpkg --print-architecture` format
-+# UBUNTU_ARCH holds a space-separated list of target arch(s)
-+# FIXME(armband): For now, only native building is supported!
-+BUILD_ARCH=$(dpkg --print-architecture)
-+UBUNTU_ARCH=${UBUNTU_ARCH:-${BUILD_ARCH}}
-
--rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}
-+# Build and/or fetch precompiled packages for all arch(s) in UBUNTU_ARCH
-+for ARCH in ${UBUNTU_ARCH}; do
-+ rm -rf ${BUILD_HOME}; mkdir -p ${BUILD_HOME}; cd ${BUILD_HOME}
-+ if [ ${ARCH} = ${BUILD_ARCH} ]; then
-+ # Native building for: DPDK, OVS-DPDK, OVS
-+ sudo apt-get build-dep openvswitch -y --force-yes
-+ sudo apt-get -y --force-yes install devscripts dpkg-dev wget
-+ dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
-
--cd ${BUILD_HOME}
--dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
--
--# copy from debian/control
--sudo apt-get install -y --force-yes debhelper \
-+ # DPDK build-dep install: copy from debian/control
-+ sudo apt-get install -y --force-yes debhelper \
- dh-python \
- dh-systemd \
- doxygen \
-@@ -35,21 +43,22 @@ sudo apt-get install -y --force-yes debhelper \
- texlive-fonts-recommended \
- texlive-latex-extra
-
--cd dpdk-2.2.0; rm -rf debian/patches/
--cat << EOF > debian/changelog
-+ cd dpdk-2.2.0; rm -rf debian/patches/
-+ cat << EOF > debian/changelog
- dpdk (2.2.0-1) unstable; urgency=low
- * DPDK 2.2.0
- -- DPDK team <dev@dpdk.org> $(date --rfc-2822)
- EOF
--debian/rules build; fakeroot debian/rules binary
--cd ${BUILD_HOME}; sudo dpkg -i *.deb
--apt-get download libxenstore3.0
-+ # DPDK build & install (required for following native build of OVS-NSH)
-+ debian/rules build; fakeroot debian/rules binary
-+ cd ${BUILD_HOME}; sudo dpkg -i *.deb
-+ apt-get download libxenstore3.0
-
--cd ${BUILD_HOME}
--dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
-+ cd ${BUILD_HOME}
-+ dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
-
--# copy from debian/control
--sudo apt-get install -y --force-yes autoconf \
-+ # OVS-NSH build-dep install: copy from debian/control
-+ sudo apt-get install -y --force-yes autoconf \
- automake \
- bzip2 \
- debhelper \
-@@ -68,33 +77,41 @@ sudo apt-get install -y --force-yes autoconf \
- python-zopeinterface \
- python-six
-
--wget -c ${URL_OVS_ARCHIVE}/${OVS_COMMIT}.tar.gz
--tar xzf ${OVS_COMMIT}.tar.gz; mv ovs-${OVS_COMMIT} ovs
--PATCHES=$(cd ${DIR}/patches; echo *patch)
--for patch in ${PATCHES}
--do
-- patch -p1 < ${DIR}/patches/${patch}
--done
--cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs
--rm -rf openvswitch-dpdk-${OVS_VER}*
--cd openvswitch-dpdk-2.4.0; uupdate -v ${OVS_VER} ../ovs.tar.gz
--cd ../openvswitch-dpdk-${OVS_VER}
--sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
--sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
--autoreconf --install
--rm -rf debian/patches/
--cat << EOF > debian/changelog
-+ # OVS-NSH build preparations: download sources, patch if needed
-+ wget -c ${URL_OVS_ARCHIVE}/${OVS_COMMIT}.tar.gz
-+ tar xzf ${OVS_COMMIT}.tar.gz; mv ovs-${OVS_COMMIT} ovs; cd ovs
-+
-+ # Apply OVS-NSH patches, create a new orig tar archive
-+ PATCHES=$(cd ${DIR}/patches; echo *patch)
-+ for patch in ${PATCHES}
-+ do
-+ patch -p1 < ${DIR}/patches/${patch}
-+ done
-+ cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs
-+ rm -rf openvswitch-dpdk-${OVS_VER}*
-+ cd openvswitch-dpdk-2.4.0; uupdate -v ${OVS_VER} ../ovs.tar.gz
-+ cd ../openvswitch-dpdk-${OVS_VER}
-+ sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
-+ sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
-+ autoreconf --install
-+ rm -rf debian/patches/
-+ cat << EOF > debian/changelog
- openvswitch-dpdk (${OVS_VER}-1.nsh) unstable; urgency=low
- * Support NSH
- -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
- EOF
--debian/rules build; fakeroot debian/rules binary
-+ debian/rules build; fakeroot debian/rules binary
-
--cd ${BUILD_HOME}/ovs
--cat << EOF > debian/changelog
-+ cd ${BUILD_HOME}/ovs
-+ cat << EOF > debian/changelog
- openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
- * Support NSH
- -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
- EOF
--debian/rules build; fakeroot debian/rules binary
--cp ${BUILD_HOME}/*.deb ${BUILD_DEST}
-+ debian/rules build; fakeroot debian/rules binary
-+ fi
-+
-+ # Store DEBs in <${BUILD_DEST}/${ARCH}/> dir and cleanup
-+ rm -rf ${BUILD_DEST}/${ARCH}; mkdir -p ${BUILD_DEST}/${ARCH}; cd ${BUILD_DEST}/${ARCH}
-+ cp ${BUILD_HOME}/*.deb .
-+done
-diff --git a/pre_build_hook b/pre_build_hook
-index b9ae6bb..3e46a37 100755
---- a/pre_build_hook
-+++ b/pre_build_hook
-@@ -10,6 +10,11 @@ if [ `uname -m` = 'aarch64' ]; then
- USE_DOCKER=false
- fi
-
-+# Pass target arch(s) (UBUNTU_ARCH) to build scripts.
-+# All archs should be represented in `dpkg --print-architecture` format
-+# UBUNTU_ARCH holds a space-separated list of target arch(s)
-+export UBUNTU_ARCH=${UBUNTU_ARCH:-$(dpkg --print-architecture)}
-+
- function build_pkg {
- case $1 in
- ubuntu)
-@@ -23,8 +28,10 @@ function build_pkg {
- cd ${DIR}/ovs_build
- if [ "${USE_DOCKER}" = true ]; then
- sudo docker build -t ovs_build .
-- sudo docker run -v ${DEB_DIR}:/deb -t ovs_build /ovs_build/build-ovs-dpdk.sh
-- sudo docker run -v ${DEB_DIR_NSH}:/deb -t ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
-+ sudo docker run -e "UBUNTU_ARCH=${UBUNTU_ARCH}" -v ${DEB_DIR}:/deb \
-+ -t ovs_build /ovs_build/build-ovs-dpdk.sh
-+ sudo docker run -e "UBUNTU_ARCH=${UBUNTU_ARCH}" -v ${DEB_DIR_NSH}:/deb \
-+ -t ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
- else
- rm -rf /tmp/ovs-build-{,nsh-}dpdk; mkdir -p /tmp/ovs-build-{,nsh-}dpdk
- BUILD_HOME=/tmp/ovs-build-dpdk BUILD_DEB=${DEB_DIR} ./build-ovs-dpdk.sh
-@@ -32,11 +39,14 @@ function build_pkg {
- rm -rf /tmp/ovs-build-{,nsh-}dpdk
- fi
-
-- cd ${DEB_DIR}; tar czvf ../repositories/ubuntu/ovs-dpdk.tar.gz .;
-- cd ..; rm -rf ${DEB_DIR}
--
-- cd ${DEB_DIR_NSH}; tar czvf ../repositories/ubuntu/ovs-nsh-dpdk.tar.gz .;
-- cd ..; rm -rf ${DEB_DIR_NSH}
-+ # Gather packages for each arch(s) in UBUNTU_ARCH in a separate archive
-+ for ARCH in ${UBUNTU_ARCH}; do
-+ cd ${DEB_DIR}/${ARCH}
-+ tar czvf ../../repositories/ubuntu/ovs-dpdk_${ARCH}.tar.gz .
-+ cd ${DEB_DIR_NSH}/${ARCH}
-+ tar czvf ../../repositories/ubuntu/ovs-nsh-dpdk_${ARCH}.tar.gz .
-+ done
-+ cd ${DIR}; sudo rm -rf ${DEB_DIR} ${DEB_DIR_NSH}
-
- ;;
- *) echo "Not supported system"; exit 1;;
diff --git a/patches/fuel-plugin-ovs/0006-AArch64-Add-native-build-support.patch b/patches/fuel-plugin-ovs/0006-AArch64-Add-native-build-support.patch
deleted file mode 100644
index b4ca8841..00000000
--- a/patches/fuel-plugin-ovs/0006-AArch64-Add-native-build-support.patch
+++ /dev/null
@@ -1,150 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Mon, 5 Sep 2016 18:56:46 +0200
-Subject: [PATCH] AArch64: Add native build support
-
-FIXME: OVS-NSH-DPDK is not yet supported on arm64, see [1].
-
-[1] https://jira.opnfv.org/browse/ARMBAND-86
-
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- ovs_build/build-ovs-dpdk.sh | 19 ++++++++--
- ovs_build/build-ovs-nsh-dpdk.sh | 48 ++++++++++++++----------
- ovs_build/openvswitch-dpdk_2.5.90/debian/control | 2 +-
- 3 files changed, 45 insertions(+), 24 deletions(-)
-
-diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
-index a14f5fd..a0c50e3 100755
---- a/ovs_build/build-ovs-dpdk.sh
-+++ b/ovs_build/build-ovs-dpdk.sh
-@@ -10,6 +10,10 @@ BUILD_DEST=${BUILD_DEST:-/tmp/ovs-dpdk}
-
- export DEB_BUILD_OPTIONS='parallel=8 nocheck'
-
-+# AArch64 specifics, repository base URL, debian build versions
-+AARCH64_REPO=${AARCH64_REPO:-'https://linux.enea.com/mos-repos/ubuntu/9.0'}
-+AARCH64_DPDK_DEBV=${AARCH64_DPDK_DEBV:-'0~u14.04+mos1+mos9.0+amos1'}
-+
- # Keep track of native arch (BUILD_ARCH) and target arch(s) (UBUNTU_ARCH)
- # All archs should be represented in `dpkg --print-architecture` format
- # UBUNTU_ARCH holds a space-separated list of target arch(s)
-@@ -24,10 +28,17 @@ for ARCH in ${UBUNTU_ARCH}; do
- # Native building for: DPDK, OVS-DPDK, OVS
- sudo apt-get -y --force-yes install devscripts dpkg-dev wget
-
-- wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
-- xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
-- cd dpdk-16.07
-- cp -r ${BUILD_SRC}/dpdk_16.07/debian .
-+ if [ ${ARCH} = 'arm64' ]; then
-+ # Armband: arm64 already has debian control archive for DPDK 16.07
-+ dget -x -u ${AARCH64_REPO}/pool/main/d/dpdk/dpdk_16.07-${AARCH64_DPDK_DEBV}.dsc
-+ cd dpdk-16.07
-+ else
-+ # Other archs will use the debian control archive in this repo
-+ wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
-+ xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
-+ cd dpdk-16.07
-+ cp -r ${BUILD_SRC}/dpdk_16.07/debian .
-+ fi
-
- # DPDK build-dep install: copy from debian/control
- sudo apt-get install -y --force-yes debhelper \
-diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
-index a65a2bb..59d8a79 100755
---- a/ovs_build/build-ovs-nsh-dpdk.sh
-+++ b/ovs_build/build-ovs-nsh-dpdk.sh
-@@ -25,10 +25,12 @@ for ARCH in ${UBUNTU_ARCH}; do
- # Native building for: DPDK, OVS-DPDK, OVS
- sudo apt-get build-dep openvswitch -y --force-yes
- sudo apt-get -y --force-yes install devscripts dpkg-dev wget
-- dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
-
-+ # FIXME(armband): OVS-NSH-DPDK is not yet supported on arm64
- # DPDK build-dep install: copy from debian/control
-- sudo apt-get install -y --force-yes debhelper \
-+ if [ ! ${ARCH} = 'arm64' ]; then
-+ dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
-+ sudo apt-get install -y --force-yes debhelper \
- dh-python \
- dh-systemd \
- doxygen \
-@@ -43,19 +45,20 @@ for ARCH in ${UBUNTU_ARCH}; do
- texlive-fonts-recommended \
- texlive-latex-extra
-
-- cd dpdk-2.2.0; rm -rf debian/patches/
-- cat << EOF > debian/changelog
-+ cd dpdk-2.2.0; rm -rf debian/patches/
-+ cat << EOF > debian/changelog
- dpdk (2.2.0-1) unstable; urgency=low
- * DPDK 2.2.0
- -- DPDK team <dev@dpdk.org> $(date --rfc-2822)
- EOF
-- # DPDK build & install (required for following native build of OVS-NSH)
-- debian/rules build; fakeroot debian/rules binary
-- cd ${BUILD_HOME}; sudo dpkg -i *.deb
-- apt-get download libxenstore3.0
-+ # DPDK build & install (required for following native build of OVS-NSH)
-+ debian/rules build; fakeroot debian/rules binary
-+ cd ${BUILD_HOME}; sudo dpkg -i *.deb
-+ apt-get download libxenstore3.0
-
-- cd ${BUILD_HOME}
-- dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
-+ # OVS-NSH-DPDK build preparations: download sources, patch if needed
-+ dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
-+ fi
-
- # OVS-NSH build-dep install: copy from debian/control
- sudo apt-get install -y --force-yes autoconf \
-@@ -88,20 +91,27 @@ EOF
- patch -p1 < ${DIR}/patches/${patch}
- done
- cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs
-- rm -rf openvswitch-dpdk-${OVS_VER}*
-- cd openvswitch-dpdk-2.4.0; uupdate -v ${OVS_VER} ../ovs.tar.gz
-- cd ../openvswitch-dpdk-${OVS_VER}
-- sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
-- sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
-- autoreconf --install
-- rm -rf debian/patches/
-- cat << EOF > debian/changelog
-+
-+ # FIXME(armband): OVS-NSH-DPDK is not yet supported on arm64
-+ if [ ! ${ARCH} = 'arm64' ]; then
-+ rm -rf openvswitch-dpdk-${OVS_VER}{,.orig*}
-+ cd openvswitch-dpdk-2.4.0
-+ uupdate -v ${OVS_VER} ../ovs.tar.gz
-+ cd ${BUILD_HOME}/openvswitch-dpdk-${OVS_VER}
-+ sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
-+ sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
-+ rm -rf debian/patches/
-+ autoreconf --install
-+ # OVS-NSH-DPDK build
-+ cat << EOF > debian/changelog
- openvswitch-dpdk (${OVS_VER}-1.nsh) unstable; urgency=low
- * Support NSH
- -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
- EOF
-- debian/rules build; fakeroot debian/rules binary
-+ debian/rules build; fakeroot debian/rules binary
-+ fi
-
-+ # OVS-NSH build
- cd ${BUILD_HOME}/ovs
- cat << EOF > debian/changelog
- openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
-diff --git a/ovs_build/openvswitch-dpdk_2.5.90/debian/control b/ovs_build/openvswitch-dpdk_2.5.90/debian/control
-index e7171b9..e0c27c5 100644
---- a/ovs_build/openvswitch-dpdk_2.5.90/debian/control
-+++ b/ovs_build/openvswitch-dpdk_2.5.90/debian/control
-@@ -27,7 +27,7 @@ Homepage: http://openvswitch.org/
- XS-Testsuite: autopkgtest
-
- Package: openvswitch-switch-dpdk
--Architecture: i386 amd64
-+Architecture: i386 amd64 arm64
- Depends: dpdk,
- openvswitch-switch (>= 2.4.0),
- ${misc:Depends},
diff --git a/patches/fuel-plugin-ovs/0007-AArch64-Add-support-for-downloading-prebuilt-DEBs.patch b/patches/fuel-plugin-ovs/0007-AArch64-Add-support-for-downloading-prebuilt-DEBs.patch
deleted file mode 100644
index deeba655..00000000
--- a/patches/fuel-plugin-ovs/0007-AArch64-Add-support-for-downloading-prebuilt-DEBs.patch
+++ /dev/null
@@ -1,145 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Mon, 12 Sep 2016 18:02:42 +0200
-Subject: [PATCH] AArch64: Add support for downloading prebuilt DEBs
-
-[ anders.roxell@enea.com ]
-ovs_build/build-ovs-dpdk: libxenstore3.0: version bump
-+Yet another version bump.
-+ovs_build/build-ovs-dpdk: libxenstore3.0: version bump to 3.0_4.4.2-0ubuntu0.14.04.9
-
-Signed-off-by: Anders Roxell <anders.roxell@enea.com>
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- ovs_build/build-ovs-armband-fetch.sh | 45 ++++++++++++++++++++++++++++++++++++
- ovs_build/build-ovs-dpdk.sh | 18 ++++++++++++++-
- ovs_build/build-ovs-nsh-dpdk.sh | 15 +++++++++++-
- 3 files changed, 76 insertions(+), 2 deletions(-)
- create mode 100755 ovs_build/build-ovs-armband-fetch.sh
-
-diff --git a/ovs_build/build-ovs-armband-fetch.sh b/ovs_build/build-ovs-armband-fetch.sh
-new file mode 100755
-index 0000000..a810b93
---- /dev/null
-+++ b/ovs_build/build-ovs-armband-fetch.sh
-@@ -0,0 +1,45 @@
-+#!/bin/bash
-+
-+set -eux
-+
-+# armband_fetch will download all binaries for one debian source package
-+#
-+# Usage:
-+# armband_fetch <src_deb_name> <src_deb_version> \
-+# [<repo_base_url> \
-+# [<repo_Sources_relative_url> \
-+# [<repo_Packages_relative_url>]]] \
-+#
-+# e.g.:
-+# armband_fetch dpdk 16.07-0~u14.04+mos1+mos9.0+amos1 \
-+# https://linux.enea.com/mos-repos/ubuntu/9.0 \
-+# dists/mos9.0-fuel-plugin-ovs/main/source/Sources \
-+# dists/mos9.0-fuel-plugin-ovs/main/binary-arm64/Packages
-+function armband_fetch() {
-+ local name=$1
-+ local ver=${2//\+/\\\+}
-+ local repo_base_url=${3:-http://linux.enea.com/mos-repos/ubuntu/9.0}
-+ local repo_Sources_url=${4:-dists/mos9.0-fuel-plugin-ovs/main/source/Sources}
-+ local repo_Packages_url=${5:-dists/mos9.0-fuel-plugin-ovs/main/binary-arm64/Packages}
-+ local found=false
-+
-+ # Fetch Sources & Packages files if not already present
-+ if [ ! -f Sources -o ! -f Packages ]; then
-+ sudo apt-get -y --force-yes install wget
-+ wget -c "${repo_base_url}/${repo_Sources_url}"
-+ wget -c "${repo_base_url}/${repo_Packages_url}"
-+ fi
-+
-+ L=$(grep -Pzo "(?s)(?<=^Package: ${name}\n^Binary: )(\N*?)(?=\n^Version: ${ver})" \
-+ Sources | tr -d ',')
-+ for deb_binary in ${L}; do
-+ D=$(grep -Po "(?<=^Filename: )(.*?\/${deb_binary}_${ver}_.*?\.deb)" Packages) || true
-+ if [ -n "${D}" ]; then
-+ wget -c "${repo_base_url}/${D}" && found=true
-+ fi
-+ done
-+ if [ ${found} = false ]; then
-+ echo "ERROR: Could not find DEBs for pkg/ver: ${name}/${ver}"
-+ exit 1
-+ fi
-+}
-diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
-index a0c50e3..8d70265 100755
---- a/ovs_build/build-ovs-dpdk.sh
-+++ b/ovs_build/build-ovs-dpdk.sh
-@@ -13,11 +13,13 @@ export DEB_BUILD_OPTIONS='parallel=8 nocheck'
- # AArch64 specifics, repository base URL, debian build versions
- AARCH64_REPO=${AARCH64_REPO:-'https://linux.enea.com/mos-repos/ubuntu/9.0'}
- AARCH64_DPDK_DEBV=${AARCH64_DPDK_DEBV:-'0~u14.04+mos1+mos9.0+amos1'}
-+AARCH64_OVS_DEBV=${AARCH64_OVS_DEBV:-'2.5.90-1'}
-
- # Keep track of native arch (BUILD_ARCH) and target arch(s) (UBUNTU_ARCH)
- # All archs should be represented in `dpkg --print-architecture` format
- # UBUNTU_ARCH holds a space-separated list of target arch(s)
--# FIXME(armband): For now, only native building is supported!
-+# FIXME(armband): For now, only native building and/or downloading prebuilt
-+# debian binaries is supported!
- BUILD_ARCH=$(dpkg --print-architecture)
- UBUNTU_ARCH=${UBUNTU_ARCH:-${BUILD_ARCH}}
-
-@@ -92,6 +94,20 @@ for ARCH in ${UBUNTU_ARCH}; do
-
- cd ${BUILD_DEST}/ovs
- debian/rules build; fakeroot debian/rules binary
-+ else
-+ # FIXME(armband): No cross-build support yet, download prebuilt DEBs
-+ if [ ${ARCH} = 'arm64' ]; then
-+ source ${BUILD_SRC}/build-ovs-armband-fetch.sh
-+ # Fetch Sources/Packages from Armband and construct list of packages to download
-+ armband_fetch 'dpdk' "16.07-${AARCH64_DPDK_DEBV}"
-+ armband_fetch 'openvswitch-dpdk' "${AARCH64_OVS_DEBV}"
-+ armband_fetch 'openvswitch' "${AARCH64_OVS_DEBV}"
-+ # libxenstore (equivalent to `apt-get download` for native build)
-+ AARCH64_LIBXENSTORE='libxenstore3.0_4.4.2-0ubuntu0.14.04.9_arm64.deb'
-+ wget -c "http://ports.ubuntu.com/pool/main/x/xen/${AARCH64_LIBXENSTORE}"
-+ else
-+ echo "WARNING: Architecture [${ARCH}] does not provide precompiled DEBs, skipping!"
-+ fi
- fi
-
- # Store DEBs in <${BUILD_DEB}/${ARCH}/> dir and cleanup
-diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
-index 59d8a79..9d8a837 100755
---- a/ovs_build/build-ovs-nsh-dpdk.sh
-+++ b/ovs_build/build-ovs-nsh-dpdk.sh
-@@ -11,10 +11,14 @@ DIR="$(dirname `readlink -f $0`)"
-
- export DEB_BUILD_OPTIONS='parallel=8 nocheck'
-
-+# AArch64 specifics, repository base URL, debian build versions
-+AARCH64_OVS_NSH_DEBV=${AARCH64_OVS_NSH_DEBV:-'2.5.90-1.nsh'}
-+
- # Keep track of native arch (BUILD_ARCH) and target arch(s) (UBUNTU_ARCH)
- # All archs should be represented in `dpkg --print-architecture` format
- # UBUNTU_ARCH holds a space-separated list of target arch(s)
--# FIXME(armband): For now, only native building is supported!
-+# FIXME(armband): For now, only native building and/or downloading prebuilt
-+# debian binaries is supported!
- BUILD_ARCH=$(dpkg --print-architecture)
- UBUNTU_ARCH=${UBUNTU_ARCH:-${BUILD_ARCH}}
-
-@@ -119,6 +123,15 @@ openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
- -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
- EOF
- debian/rules build; fakeroot debian/rules binary
-+ else
-+ # FIXME(armband): No cross-build support yet, download prebuilt DEBs
-+ if [ ${ARCH} = 'arm64' ]; then
-+ source ${DIR}/build-ovs-armband-fetch.sh
-+ # FIXME(armband): https://jira.opnfv.org/browse/ARMBAND-86
-+ armband_fetch 'openvswitch' "${AARCH64_OVS_NSH_DEBV}"
-+ else
-+ echo "WARNING: Architecture [${ARCH}] does not provide precompiled DEBs, skipping!"
-+ fi
- fi
-
- # Store DEBs in <${BUILD_DEST}/${ARCH}/> dir and cleanup
diff --git a/patches/fuel-plugin-ovs/0008-build-docker-Use-host-s-network-stack.patch b/patches/fuel-plugin-ovs/0008-build-docker-Use-host-s-network-stack.patch
deleted file mode 100644
index e0606819..00000000
--- a/patches/fuel-plugin-ovs/0008-build-docker-Use-host-s-network-stack.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Thu, 15 Sep 2016 19:16:34 +0200
-Subject: [PATCH] build: docker: Use host's network stack
-
-Similar to Fuel@OPNFV build process, we want to mount /etc/hosts
-in the builder container to be able to use local mirror caches.
-
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- pre_build_hook | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/pre_build_hook b/pre_build_hook
-index 3e46a37..4866219 100755
---- a/pre_build_hook
-+++ b/pre_build_hook
-@@ -28,9 +28,11 @@ function build_pkg {
- cd ${DIR}/ovs_build
- if [ "${USE_DOCKER}" = true ]; then
- sudo docker build -t ovs_build .
-- sudo docker run -e "UBUNTU_ARCH=${UBUNTU_ARCH}" -v ${DEB_DIR}:/deb \
-+ sudo docker run -e "UBUNTU_ARCH=${UBUNTU_ARCH}" \
-+ -v ${DEB_DIR}:/deb -v /etc/hosts:/etc/hosts \
- -t ovs_build /ovs_build/build-ovs-dpdk.sh
-- sudo docker run -e "UBUNTU_ARCH=${UBUNTU_ARCH}" -v ${DEB_DIR_NSH}:/deb \
-+ sudo docker run -e "UBUNTU_ARCH=${UBUNTU_ARCH}" \
-+ -v ${DEB_DIR_NSH}:/deb -v /etc/hosts:/etc/hosts \
- -t ovs_build /ovs_build/build-ovs-nsh-dpdk.sh
- else
- rm -rf /tmp/ovs-build-{,nsh-}dpdk; mkdir -p /tmp/ovs-build-{,nsh-}dpdk
diff --git a/patches/fuel-plugin-ovs/0009-HACK-build-prebuilt-DEBs-src-bin-ver-mismatch.patch b/patches/fuel-plugin-ovs/0009-HACK-build-prebuilt-DEBs-src-bin-ver-mismatch.patch
deleted file mode 100644
index bea8a059..00000000
--- a/patches/fuel-plugin-ovs/0009-HACK-build-prebuilt-DEBs-src-bin-ver-mismatch.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Thu, 15 Sep 2016 19:41:58 +0200
-Subject: [PATCH] HACK: build: prebuilt DEBs: src/bin ver mismatch
-
-Our debian source version is not always in sync with the debian
-binaries versions, see related bug for a complete description of
-this issue.
-
-This is a temporary chance which should be dropped once the package
-versions are aligned.
-
-Related-bug: ARMBAND-89
-Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
----
- ovs_build/build-ovs-armband-fetch.sh | 16 ++++++++++++----
- ovs_build/build-ovs-nsh-dpdk.sh | 2 +-
- 2 files changed, 13 insertions(+), 5 deletions(-)
-
-diff --git a/ovs_build/build-ovs-armband-fetch.sh b/ovs_build/build-ovs-armband-fetch.sh
-index a810b93..8ab22cc 100755
---- a/ovs_build/build-ovs-armband-fetch.sh
-+++ b/ovs_build/build-ovs-armband-fetch.sh
-@@ -17,7 +17,7 @@ set -eux
- # dists/mos9.0-fuel-plugin-ovs/main/binary-arm64/Packages
- function armband_fetch() {
- local name=$1
-- local ver=${2//\+/\\\+}
-+ local src_ver=${2//\+/\\\+}
- local repo_base_url=${3:-http://linux.enea.com/mos-repos/ubuntu/9.0}
- local repo_Sources_url=${4:-dists/mos9.0-fuel-plugin-ovs/main/source/Sources}
- local repo_Packages_url=${5:-dists/mos9.0-fuel-plugin-ovs/main/binary-arm64/Packages}
-@@ -30,16 +30,24 @@ function armband_fetch() {
- wget -c "${repo_base_url}/${repo_Packages_url}"
- fi
-
-- L=$(grep -Pzo "(?s)(?<=^Package: ${name}\n^Binary: )(\N*?)(?=\n^Version: ${ver})" \
-+ L=$(grep -Pzo "(?s)(?<=^Package: ${name}\n^Binary: )(\N*?)(?=\n^Version: ${src_ver})" \
- Sources | tr -d ',')
- for deb_binary in ${L}; do
-- D=$(grep -Po "(?<=^Filename: )(.*?\/${deb_binary}_${ver}_.*?\.deb)" Packages) || true
-+ # FIXME(armband): https://jira.opnfv.org/browse/ARMBAND-89
-+ # Until we align source and binaries versions for nsh, convert on the fly
-+ # e.g.: debian source 2.5.90~04.05-1.nsh+amos2 => debian binary 2.5.90-1.nsh
-+ deb_ver=${src_ver}
-+ if [[ ${deb_ver} == *~*-* ]]; then
-+ deb_ver=${deb_ver//~*-/-}
-+ deb_ver=${deb_ver%\\\+*}
-+ fi
-+ D=$(grep -Po "(?<=^Filename: )(.*?\/${deb_binary}_${deb_ver}_.*?\.deb)" Packages) || true
- if [ -n "${D}" ]; then
- wget -c "${repo_base_url}/${D}" && found=true
- fi
- done
- if [ ${found} = false ]; then
-- echo "ERROR: Could not find DEBs for pkg/ver: ${name}/${ver}"
-+ echo "ERROR: Could not find DEBs for pkg|src_ver|deb_ver: ${name}|${src_ver}|${deb_ver}"
- exit 1
- fi
- }
-diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
-index 9d8a837..aebcb94 100755
---- a/ovs_build/build-ovs-nsh-dpdk.sh
-+++ b/ovs_build/build-ovs-nsh-dpdk.sh
-@@ -12,7 +12,7 @@ DIR="$(dirname `readlink -f $0`)"
- export DEB_BUILD_OPTIONS='parallel=8 nocheck'
-
- # AArch64 specifics, repository base URL, debian build versions
--AARCH64_OVS_NSH_DEBV=${AARCH64_OVS_NSH_DEBV:-'2.5.90-1.nsh'}
-+AARCH64_OVS_NSH_DEBV=${AARCH64_OVS_NSH_DEBV:-'2.5.90~04.05-1.nsh+amos2'}
-
- # Keep track of native arch (BUILD_ARCH) and target arch(s) (UBUNTU_ARCH)
- # All archs should be represented in `dpkg --print-architecture` format