fuel-plugin-odl: Patch leveldb before jetty.xml
[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 Rebase for Fuel Newton.
20
21 [1] https://bugs.opendaylight.org/show_bug.cgi?id=3973
22 [2] https://jira.opnfv.org/browse/ARMBAND-114
23
24 Change-Id: Ia7abf375ffd122ff0ac7b12422f64526ff2c78fd
25 Signed-off-by: Florin Dumitrascu <florin.dumitrascu@enea.com>
26 Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
27 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
28 ---
29  .../puppet/modules/opendaylight/manifests/init.pp  |  8 +++++++
30  .../modules/opendaylight/manifests/install.pp      |  7 ++++++
31  .../modules/opendaylight/manifests/leveldbjni.pp   | 25 ++++++++++++++++++++++
32  3 files changed, 40 insertions(+)
33  create mode 100644 deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp
34
35 diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp
36 index 69cc23a..791ceba 100644
37 --- a/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp
38 +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/init.pp
39 @@ -9,4 +9,12 @@ class opendaylight {
40    $odl_mgmt_ips = values($odl_mgmt_ips_hash)
41    $odl_nodes_names = keys($odl_mgmt_ips_hash)
42    $node_internal_address = $odl_mgmt_ips_hash["node-${node_uid}"]
43 +
44 +  $arch = $::architecture ? {
45 +    'aarch64' => $::osfamily ? {
46 +      'Debian' => 'arm64',
47 +      default  => 'aarch64',
48 +    },
49 +    default => $::architecture,
50 +  }
51  }
52 diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp
53 index 2c3d776..673ccb3 100644
54 --- a/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp
55 +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/install.pp
56 @@ -20,6 +20,12 @@ class opendaylight::install (
57      ensure  => $odl_package,
58    }
59
60 +  if ($::osfamily == 'Debian' and $::opendaylight::arch == 'arm64') {
61 +    class { 'opendaylight::leveldbjni':
62 +      require => Package['opendaylight'],
63 +    }
64 +  }
65 +
66    #Temporary solution until number of allowed open files
67    #will be fixed in main systemd service file
68    file {'/etc/systemd/system/opendaylight.service.d':
69 @@ -88,6 +94,7 @@ class opendaylight::install (
70    Package['opendaylight'] ->
71    Ini_setting <||> ->
72    Firewall <||> ->
73 +  Class['opendaylight::leveldbjni'] ->
74    File <||> ~>
75    Service['opendaylight']
76  }
77 diff --git a/deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp b/deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp
78 new file mode 100644
79 index 0000000..0a20fa3
80 --- /dev/null
81 +++ b/deployment_scripts/puppet/modules/opendaylight/manifests/leveldbjni.pp
82 @@ -0,0 +1,25 @@
83 +# == Class opendaylight::leveldbjni
84 +#
85 +# Manages patching of JNI for leveldb on arm64.
86 +#
87 +# It fetches a prebuilt DEB package containing leveldbjni,
88 +# patched so that it's properly detected by maven on arm64 systems.
89 +#
90 +# DEB: http://linux.enea.com/mos-repos/ubuntu/9.0/ \
91 +#      pool/main/a/armband-odl-leveldb-fix/
92 +# JIRA: https://jira.opnfv.org/browse/ARMBAND-114
93 +#
94 +class opendaylight::leveldbjni {
95 +  case $::osfamily {
96 +    'Debian', 'Ubuntu': {}
97 +    default: {
98 +      fail('Not supported on OS other than Debian based.')
99 +    }
100 +  }
101 +
102 +  if ! defined(Package['armband-odl-leveldb-fix']) {
103 +    package { 'armband-odl-leveldb-fix':
104 +      ensure => 'present',
105 +    }
106 +  }
107 +}