Uplift Armband to Fuel Newton
[armband.git] / patches / fuel-plugin-opendaylight / 0001-ODL-leveldb-leveldbjni-Enable-arm64-support.patch
1 From: Florin Dumitrascu <florin.dumitrascu@enea.com>
2 Date: Thu, 17 Mar 2016 18:15:42 +0100
3 Subject: [PATCH] ODL leveldb, leveldbjni: Enable arm64 support.
4
5 ODL depends on a native library (leveldb).
6
7 ODL Beryllium and Boron versions are still using a native x86 version
8 of this library (wrapped in leveldbjni).
9
10 There is no upstream version of leveldbjni supporting arm64 leveldb,
11 so we need to compile it when deploying ODL.
12 This is done when running odl-install puppet manifest.
13
14 For more info about this ODL limitation, see [1].
15
16 [ Alexandru.Avadanii@enea.com ]
17 Remove JAVA8 changes after upstream rework.
18 Convert puppet patching to prebuilt DEB package, as part of [2].
19
20 [1] https://bugs.opendaylight.org/show_bug.cgi?id=3973
21 [2] https://jira.opnfv.org/browse/ARMBAND-114
22
23 Signed-off-by: Florin Dumitrascu <florin.dumitrascu@enea.com>
24 Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
25 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
26 ---
27  .../puppet/modules/opendaylight/manifests/init.pp  |  8 ++++++++
28  .../modules/opendaylight/manifests/install.pp      | 12 +++++++++--
29  .../modules/opendaylight/manifests/leveldbjni.pp   | 24 ++++++++++++++++++++++
30  3 files changed, 42 insertions(+), 2 deletions(-)
31  create mode 100644 deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp
32
33 diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp
34 index 69cc23a..791ceba 100644
35 --- a/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp
36 +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp
37 @@ -9,4 +9,12 @@ class opendaylight {
38    $odl_mgmt_ips = values($odl_mgmt_ips_hash)
39    $odl_nodes_names = keys($odl_mgmt_ips_hash)
40    $node_internal_address = $odl_mgmt_ips_hash["node-${node_uid}"]
41 +
42 +  $arch = $::architecture ? {
43 +    'aarch64' => $::osfamily ? {
44 +      'Debian' => 'arm64',
45 +      default  => 'aarch64',
46 +    },
47 +    default => $::architecture,
48 +  }
49  }
50 diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp
51 --- a/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp
52 +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp
53 @@ -15,3 +15,9 @@ class opendaylight::install (
54    package { 'opendaylight':
55      ensure  => $odl_package,
56 +  }
57 +
58 +  if ($::osfamily == 'Debian' and $::opendaylight::arch == 'arm64') {
59 +    class { 'opendaylight::leveldbjni':
60 +      require => Package['opendaylight'],
61 +    }
62    }
63 @@ -35,7 +41,8 @@ class opendaylight::install (
64
65    debug("Set odl rest api port to ${rest_port}")
66
67 -  file { "${conf_dir}/jetty.xml":
68 +  file { 'jetty.xml':
69 +    path    => "${conf_dir}/jetty.xml",
70      ensure  => file,
71      owner   => 'odl',
72      content => template('opendaylight/jetty.xml.erb')
73 @@ -71,5 +78,6 @@ class opendaylight::install (
74    Ini_setting <||> ->
75    Firewall <||> ->
76 -  File <||> ~>
77 +  File['jetty.xml'] ~>
78 +  Class['opendaylight::leveldbjni'] ~>
79    Service['opendaylight']
80  }
81 diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp
82 new file mode 100644
83 index 0000000..ed97c5d
84 --- /dev/null
85 +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp
86 @@ -0,0 +1,25 @@
87 +# == Class opendaylight::leveldbjni
88 +#
89 +# Manages patching of JNI for leveldb on arm64.
90 +#
91 +# It fetches a prebuilt DEB package containing leveldbjni,
92 +# patched so that it's properly detected by maven on arm64 systems.
93 +#
94 +# DEB: http://linux.enea.com/mos-repos/ubuntu/9.0/ \
95 +#      pool/main/a/armband-odl-leveldb-fix/
96 +# JIRA: https://jira.opnfv.org/browse/ARMBAND-114
97 +#
98 +class opendaylight::leveldbjni {
99 +  case $::osfamily {
100 +    'Debian', 'Ubuntu': {}
101 +    default: {
102 +      fail('Not supported on OS other than Debian based.')
103 +    }
104 +  }
105 +
106 +  if ! defined(Package['armband-odl-leveldb-fix']) {
107 +    package { 'armband-odl-leveldb-fix':
108 +      ensure => 'present',
109 +    }
110 +  }
111 +}