1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Mon, 5 Sep 2016 18:56:46 +0200
3 Subject: [PATCH] AArch64: Add native build support
5 FIXME: OVS-NSH-DPDK is not yet supported on arm64, see [1].
7 [1] https://jira.opnfv.org/browse/ARMBAND-86
9 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
11 ovs_build/build-ovs-dpdk.sh | 19 ++++++++--
12 ovs_build/build-ovs-nsh-dpdk.sh | 48 ++++++++++++++----------
13 ovs_build/openvswitch-dpdk_2.5.90/debian/control | 2 +-
14 3 files changed, 45 insertions(+), 24 deletions(-)
16 diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
17 index a14f5fd..a0c50e3 100755
18 --- a/ovs_build/build-ovs-dpdk.sh
19 +++ b/ovs_build/build-ovs-dpdk.sh
20 @@ -10,6 +10,10 @@ BUILD_DEST=${BUILD_DEST:-/tmp/ovs-dpdk}
22 export DEB_BUILD_OPTIONS='parallel=8 nocheck'
24 +# AArch64 specifics, repository base URL, debian build versions
25 +AARCH64_REPO=${AARCH64_REPO:-'https://linux.enea.com/mos-repos/ubuntu/9.0'}
26 +AARCH64_DPDK_DEBV=${AARCH64_DPDK_DEBV:-'0~u14.04+mos1+mos9.0+amos1'}
28 # Keep track of native arch (BUILD_ARCH) and target arch(s) (UBUNTU_ARCH)
29 # All archs should be represented in `dpkg --print-architecture` format
30 # UBUNTU_ARCH holds a space-separated list of target arch(s)
31 @@ -24,10 +28,17 @@ for ARCH in ${UBUNTU_ARCH}; do
32 # Native building for: DPDK, OVS-DPDK, OVS
33 sudo apt-get -y --force-yes install devscripts dpkg-dev wget
35 - wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
36 - xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
38 - cp -r ${BUILD_SRC}/dpdk_16.07/debian .
39 + if [ ${ARCH} = 'arm64' ]; then
40 + # Armband: arm64 already has debian control archive for DPDK 16.07
41 + dget -x -u ${AARCH64_REPO}/pool/main/d/dpdk/dpdk_16.07-${AARCH64_DPDK_DEBV}.dsc
44 + # Other archs will use the debian control archive in this repo
45 + wget -c http://fast.dpdk.org/rel/dpdk-16.07.tar.xz
46 + xz -d dpdk-16.07.tar.xz; tar xvf dpdk-16.07.tar
48 + cp -r ${BUILD_SRC}/dpdk_16.07/debian .
51 # DPDK build-dep install: copy from debian/control
52 sudo apt-get install -y --force-yes debhelper \
53 diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
54 index a65a2bb..59d8a79 100755
55 --- a/ovs_build/build-ovs-nsh-dpdk.sh
56 +++ b/ovs_build/build-ovs-nsh-dpdk.sh
57 @@ -25,10 +25,12 @@ for ARCH in ${UBUNTU_ARCH}; do
58 # Native building for: DPDK, OVS-DPDK, OVS
59 sudo apt-get build-dep openvswitch -y --force-yes
60 sudo apt-get -y --force-yes install devscripts dpkg-dev wget
61 - dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
63 + # FIXME(armband): OVS-NSH-DPDK is not yet supported on arm64
64 # DPDK build-dep install: copy from debian/control
65 - sudo apt-get install -y --force-yes debhelper \
66 + if [ ! ${ARCH} = 'arm64' ]; then
67 + dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/dpdk_2.2.0-0ubuntu8.dsc
68 + sudo apt-get install -y --force-yes debhelper \
72 @@ -43,19 +45,20 @@ for ARCH in ${UBUNTU_ARCH}; do
73 texlive-fonts-recommended \
76 - cd dpdk-2.2.0; rm -rf debian/patches/
77 - cat << EOF > debian/changelog
78 + cd dpdk-2.2.0; rm -rf debian/patches/
79 + cat << EOF > debian/changelog
80 dpdk (2.2.0-1) unstable; urgency=low
82 -- DPDK team <dev@dpdk.org> $(date --rfc-2822)
84 - # DPDK build & install (required for following native build of OVS-NSH)
85 - debian/rules build; fakeroot debian/rules binary
86 - cd ${BUILD_HOME}; sudo dpkg -i *.deb
87 - apt-get download libxenstore3.0
88 + # DPDK build & install (required for following native build of OVS-NSH)
89 + debian/rules build; fakeroot debian/rules binary
90 + cd ${BUILD_HOME}; sudo dpkg -i *.deb
91 + apt-get download libxenstore3.0
94 - dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
95 + # OVS-NSH-DPDK build preparations: download sources, patch if needed
96 + dget -x -u https://launchpad.net/ubuntu/+archive/primary/+files/openvswitch-dpdk_2.4.0-0ubuntu1.dsc
99 # OVS-NSH build-dep install: copy from debian/control
100 sudo apt-get install -y --force-yes autoconf \
101 @@ -88,20 +91,27 @@ EOF
102 patch -p1 < ${DIR}/patches/${patch}
104 cd ${BUILD_HOME}; tar czvf ovs.tar.gz ovs
105 - rm -rf openvswitch-dpdk-${OVS_VER}*
106 - cd openvswitch-dpdk-2.4.0; uupdate -v ${OVS_VER} ../ovs.tar.gz
107 - cd ../openvswitch-dpdk-${OVS_VER}
108 - sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
109 - sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
110 - autoreconf --install
111 - rm -rf debian/patches/
112 - cat << EOF > debian/changelog
114 + # FIXME(armband): OVS-NSH-DPDK is not yet supported on arm64
115 + if [ ! ${ARCH} = 'arm64' ]; then
116 + rm -rf openvswitch-dpdk-${OVS_VER}{,.orig*}
117 + cd openvswitch-dpdk-2.4.0
118 + uupdate -v ${OVS_VER} ../ovs.tar.gz
119 + cd ${BUILD_HOME}/openvswitch-dpdk-${OVS_VER}
120 + sed -i "s/include\/rte_config.h/include\/dpdk\/rte_config.h/" acinclude.m4
121 + sed -i 's/DPDK_INCLUDE=.*/DPDK_INCLUDE=$RTE_SDK\/include\/dpdk/' acinclude.m4
122 + rm -rf debian/patches/
123 + autoreconf --install
124 + # OVS-NSH-DPDK build
125 + cat << EOF > debian/changelog
126 openvswitch-dpdk (${OVS_VER}-1.nsh) unstable; urgency=low
128 -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
130 - debian/rules build; fakeroot debian/rules binary
131 + debian/rules build; fakeroot debian/rules binary
136 cat << EOF > debian/changelog
137 openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
138 diff --git a/ovs_build/openvswitch-dpdk_2.5.90/debian/control b/ovs_build/openvswitch-dpdk_2.5.90/debian/control
139 index e7171b9..e0c27c5 100644
140 --- a/ovs_build/openvswitch-dpdk_2.5.90/debian/control
141 +++ b/ovs_build/openvswitch-dpdk_2.5.90/debian/control
142 @@ -27,7 +27,7 @@ Homepage: http://openvswitch.org/
143 XS-Testsuite: autopkgtest
145 Package: openvswitch-switch-dpdk
146 -Architecture: i386 amd64
147 +Architecture: i386 amd64 arm64
149 openvswitch-switch (>= 2.4.0),