1 From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
2 Date: Mon, 12 Sep 2016 18:02:42 +0200
3 Subject: [PATCH] AArch64: Add support for downloading prebuilt DEBs
5 [ anders.roxell@enea.com ]
6 ovs_build/build-ovs-dpdk: libxenstore3.0: version bump
8 Signed-off-by: Anders Roxell <anders.roxell@enea.com>
9 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
11 ovs_build/build-ovs-armband-fetch.sh | 45 ++++++++++++++++++++++++++++++++++++
12 ovs_build/build-ovs-dpdk.sh | 18 ++++++++++++++-
13 ovs_build/build-ovs-nsh-dpdk.sh | 15 +++++++++++-
14 3 files changed, 76 insertions(+), 2 deletions(-)
15 create mode 100755 ovs_build/build-ovs-armband-fetch.sh
17 diff --git a/ovs_build/build-ovs-armband-fetch.sh b/ovs_build/build-ovs-armband-fetch.sh
19 index 0000000..a810b93
21 +++ b/ovs_build/build-ovs-armband-fetch.sh
27 +# armband_fetch will download all binaries for one debian source package
30 +# armband_fetch <src_deb_name> <src_deb_version> \
32 +# [<repo_Sources_relative_url> \
33 +# [<repo_Packages_relative_url>]]] \
36 +# armband_fetch dpdk 16.07-0~u14.04+mos1+mos9.0+amos1 \
37 +# https://linux.enea.com/mos-repos/ubuntu/9.0 \
38 +# dists/mos9.0-fuel-plugin-ovs/main/source/Sources \
39 +# dists/mos9.0-fuel-plugin-ovs/main/binary-arm64/Packages
40 +function armband_fetch() {
42 + local ver=${2//\+/\\\+}
43 + local repo_base_url=${3:-http://linux.enea.com/mos-repos/ubuntu/9.0}
44 + local repo_Sources_url=${4:-dists/mos9.0-fuel-plugin-ovs/main/source/Sources}
45 + local repo_Packages_url=${5:-dists/mos9.0-fuel-plugin-ovs/main/binary-arm64/Packages}
48 + # Fetch Sources & Packages files if not already present
49 + if [ ! -f Sources -o ! -f Packages ]; then
50 + sudo apt-get -y --force-yes install wget
51 + wget -c "${repo_base_url}/${repo_Sources_url}"
52 + wget -c "${repo_base_url}/${repo_Packages_url}"
55 + L=$(grep -Pzo "(?s)(?<=^Package: ${name}\n^Binary: )(\N*?)(?=\n^Version: ${ver})" \
56 + Sources | tr -d ',')
57 + for deb_binary in ${L}; do
58 + D=$(grep -Po "(?<=^Filename: )(.*?\/${deb_binary}_${ver}_.*?\.deb)" Packages) || true
59 + if [ -n "${D}" ]; then
60 + wget -c "${repo_base_url}/${D}" && found=true
63 + if [ ${found} = false ]; then
64 + echo "ERROR: Could not find DEBs for pkg/ver: ${name}/${ver}"
68 diff --git a/ovs_build/build-ovs-dpdk.sh b/ovs_build/build-ovs-dpdk.sh
69 index a0c50e3..8d70265 100755
70 --- a/ovs_build/build-ovs-dpdk.sh
71 +++ b/ovs_build/build-ovs-dpdk.sh
72 @@ -13,11 +13,13 @@ export DEB_BUILD_OPTIONS='parallel=8 nocheck'
73 # AArch64 specifics, repository base URL, debian build versions
74 AARCH64_REPO=${AARCH64_REPO:-'https://linux.enea.com/mos-repos/ubuntu/9.0'}
75 AARCH64_DPDK_DEBV=${AARCH64_DPDK_DEBV:-'0~u14.04+mos1+mos9.0+amos1'}
76 +AARCH64_OVS_DEBV=${AARCH64_OVS_DEBV:-'2.5.90-1'}
78 # Keep track of native arch (BUILD_ARCH) and target arch(s) (UBUNTU_ARCH)
79 # All archs should be represented in `dpkg --print-architecture` format
80 # UBUNTU_ARCH holds a space-separated list of target arch(s)
81 -# FIXME(armband): For now, only native building is supported!
82 +# FIXME(armband): For now, only native building and/or downloading prebuilt
83 +# debian binaries is supported!
84 BUILD_ARCH=$(dpkg --print-architecture)
85 UBUNTU_ARCH=${UBUNTU_ARCH:-${BUILD_ARCH}}
87 @@ -92,6 +94,20 @@ for ARCH in ${UBUNTU_ARCH}; do
90 debian/rules build; fakeroot debian/rules binary
92 + # FIXME(armband): No cross-build support yet, download prebuilt DEBs
93 + if [ ${ARCH} = 'arm64' ]; then
94 + source ${BUILD_SRC}/build-ovs-armband-fetch.sh
95 + # Fetch Sources/Packages from Armband and construct list of packages to download
96 + armband_fetch 'dpdk' "16.07-${AARCH64_DPDK_DEBV}"
97 + armband_fetch 'openvswitch-dpdk' "${AARCH64_OVS_DEBV}"
98 + armband_fetch 'openvswitch' "${AARCH64_OVS_DEBV}"
99 + # libxenstore (equivalent to `apt-get download` for native build)
100 + AARCH64_LIBXENSTORE='libxenstore3.0_4.4.2-0ubuntu0.14.04.7_arm64.deb'
101 + wget -c "http://ports.ubuntu.com/pool/main/x/xen/${AARCH64_LIBXENSTORE}"
103 + echo "WARNING: Architecture [${ARCH}] does not provide precompiled DEBs, skipping!"
107 # Store DEBs in <${BUILD_DEB}/${ARCH}/> dir and cleanup
108 diff --git a/ovs_build/build-ovs-nsh-dpdk.sh b/ovs_build/build-ovs-nsh-dpdk.sh
109 index 59d8a79..9d8a837 100755
110 --- a/ovs_build/build-ovs-nsh-dpdk.sh
111 +++ b/ovs_build/build-ovs-nsh-dpdk.sh
112 @@ -11,10 +11,14 @@ DIR="$(dirname `readlink -f $0`)"
114 export DEB_BUILD_OPTIONS='parallel=8 nocheck'
116 +# AArch64 specifics, repository base URL, debian build versions
117 +AARCH64_OVS_NSH_DEBV=${AARCH64_OVS_NSH_DEBV:-'2.5.90-1.nsh'}
119 # Keep track of native arch (BUILD_ARCH) and target arch(s) (UBUNTU_ARCH)
120 # All archs should be represented in `dpkg --print-architecture` format
121 # UBUNTU_ARCH holds a space-separated list of target arch(s)
122 -# FIXME(armband): For now, only native building is supported!
123 +# FIXME(armband): For now, only native building and/or downloading prebuilt
124 +# debian binaries is supported!
125 BUILD_ARCH=$(dpkg --print-architecture)
126 UBUNTU_ARCH=${UBUNTU_ARCH:-${BUILD_ARCH}}
128 @@ -119,6 +123,15 @@ openvswitch (${OVS_VER}-1.nsh) unstable; urgency=low
129 -- Open vSwitch team <dev@openvswitch.org> $(date --rfc-2822)
131 debian/rules build; fakeroot debian/rules binary
133 + # FIXME(armband): No cross-build support yet, download prebuilt DEBs
134 + if [ ${ARCH} = 'arm64' ]; then
135 + source ${DIR}/build-ovs-armband-fetch.sh
136 + # FIXME(armband): https://jira.opnfv.org/browse/ARMBAND-86
137 + armband_fetch 'openvswitch' "${AARCH64_OVS_NSH_DEBV}"
139 + echo "WARNING: Architecture [${ARCH}] does not provide precompiled DEBs, skipping!"
143 # Store DEBs in <${BUILD_DEST}/${ARCH}/> dir and cleanup