aboutsummaryrefslogtreecommitdiffstats
path: root/patches/fuel-plugin-opendaylight/0002-opnfv-quagga-Build-for-UBUNTU_ARCH.patch
blob: e6e7716f77aee8590f4716acfb6b647b9080bc4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Mon, 4 Jul 2016 20:44:49 +0200
Subject: [PATCH] opnfv-quagga: Build for UBUNTU_ARCH.

ODL itself is mostly arch-indep, but its deps (e.g. opnfv-quagga
and friends) are not.

Introduce opnfv-quagga building/packing for multiple archs, listed
in UBUNTU_ARCH, which holds a space-separated list of target
arch(s), represented in `dpkg --print-architecture` format.
Only applicable when "BUILD_FOR=ubuntu".

FIXME(armband): For now, only native building and prebuilt debs
are supported (no cross-building).

Due to the design of opnfv-packaging repo, it is easier to:
- patch upstream sources to support native arm64 builds (see [1]);
- add prebuilt arm64 binaries to output dir in git repo (like amd64),
submitted as pull request upstream [2];

Until above OPNFV-QUAGGA changes land upstream and/or are refactored,
rely on forked repository that contains above patches [3] on
branch "stable/colorado", including prebuilt binaries (DEBs) for:
- amd64 (also available in upstream repo);
- arm64 (submitted upstream in [3]);

[1] https://github.com/nikolas-hermanns/opnfv-quagga-packaging/pull/1
[2] https://github.com/nikolas-hermanns/opnfv-quagga-packaging/pull/2
[3] https://github.com/alexandruavadanii/opnfv-quagga-packaging

Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 pre_build_hook | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/pre_build_hook b/pre_build_hook
index 0296821..a6d55e9 100755
--- a/pre_build_hook
+++ b/pre_build_hook
@@ -53,9 +53,17 @@ NETWORKING_ODL_BRANCH=${NETWORKING_ODL_BRANCH:-stable/mitaka}
 OPNFV_QUAGGE_PACKAGING_REPO=${OPNFV_QUAGGE_PACKAGING_REPO:-https://github.com/nikolas-hermanns/opnfv-quagga-packaging}
 OPNFV_QUAGGE_PACKAGING_BRANCH=stable/colorado

-# For which systems odl package should be build
+# For which systems odl package should be built
 BUILD_FOR=${BUILD_FOR:-ubuntu}

+# For which architecture(s) package should be built
+# Only applicable when "BUILD_FOR=ubuntu"
+# ODL itself is mostly arch-indep, but its deps are not
+# 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!
+UBUNTU_ARCH=${UBUNTU_ARCH:-$(dpkg --print-architecture)}
+
 DIR="$(dirname `readlink -f $0`)"
 TMP_DIR="${DIR}/tmp"
 MODULES="${DIR}/deployment_scripts/puppet/modules"
@@ -86,7 +94,10 @@ function add_opnfv_quagga {
                 sudo apt-get -y install `cat requirements.txt`
                 make -j6
             fi
-            cp debian_package/* $path
+            # Filter only requested archs, bail on missing DEBs
+            for ARCH in ${UBUNTU_ARCH}; do
+                cp debian_package/*_${ARCH}.deb $path
+            done
         popd
     popd