aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-06-02 18:37:10 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-06-02 18:39:08 +0200
commit1cd256dbaf85e4abaf8fb4250e0cb029be43e89a (patch)
treee338a25a17092329c3096b162e88c07755f89e11
parent531f18918366d02a8a1c86576556e02eee59e8c9 (diff)
nailgun-agent: AArch64: Allow platform bus storage
While at it, transform all Armband patche for fuel-nailgun-agent into Debian patches. Change-Id: I3147ea151244158d2a4bef875008ef2fa0e49377 Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-rw-r--r--patches/fuel-nailgun-agent/0001-ohai-Support-reading-L1-info-from-ethtool.patch6
-rw-r--r--patches/fuel-nailgun-agent/0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch69
-rw-r--r--patches/fuel-nailgun-agent/0003-AArch64-Add-CPU-details-detection.patch254
-rw-r--r--patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch71
-rw-r--r--patches/fuel-nailgun-agent/0005-AArch64-Allow-removable-storage-on-platform-bus.patch77
5 files changed, 329 insertions, 148 deletions
diff --git a/patches/fuel-nailgun-agent/0001-ohai-Support-reading-L1-info-from-ethtool.patch b/patches/fuel-nailgun-agent/0001-ohai-Support-reading-L1-info-from-ethtool.patch
index 7067a97..7183102 100644
--- a/patches/fuel-nailgun-agent/0001-ohai-Support-reading-L1-info-from-ethtool.patch
+++ b/patches/fuel-nailgun-agent/0001-ohai-Support-reading-L1-info-from-ethtool.patch
@@ -51,7 +51,7 @@ index 0000000..8ae8c49
+index c764a68..978131f 100755
+--- a/agent
++++ b/agent
-+@@ -316,7 +316,11 @@ class NodeAgent
++@@ -602,7 +602,11 @@ class NodeAgent
+ int_meta[:current_speed] = int_info.current_mode.speed
+ end
+ rescue
@@ -62,8 +62,8 @@ index 0000000..8ae8c49
++ int_meta[:current_speed] = nil
++ end
+ end
-+ elsif (addrinfo[:family] rescue nil) =~ /^inet$/
-+ int_meta[:ip] = addr
++
++ unless int_meta[:driver]
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b221a98
diff --git a/patches/fuel-nailgun-agent/0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch b/patches/fuel-nailgun-agent/0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
index e2ab3f6..4fa8a3b 100644
--- a/patches/fuel-nailgun-agent/0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
+++ b/patches/fuel-nailgun-agent/0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
@@ -7,7 +7,7 @@
: http://www.apache.org/licenses/LICENSE-2.0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Thu, 7 Jul 2016 13:58:34 +0200
+Date: Fri, 19 May 2017 20:36:24 +0200
Subject: [PATCH] Temporary: SR-IOV: Fix VNICs broken filter.
Some blades have VNICs (VFs on a PCI device), which are not
@@ -25,19 +25,56 @@ FIXME: Revert this patch once upstream closes bug [1].
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
- agent | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ ...-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch | 35 ++++++++++++++++++++++
+ debian/patches/series | 1 +
+ 2 files changed, 36 insertions(+)
+ create mode 100644 debian/patches/0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
-diff --git a/agent b/agent
-index 89ab60f..eb2bfb4 100755
---- a/agent
-+++ b/agent
-@@ -406,7 +406,7 @@ class NodeAgent
- next if File.exist?("/sys/class/net/#{int}/phy80211") ||
- File.exist?("/sys/class/net/#{int}/wireless")
- # Skip virtual functions
-- next if File.exists?("/sys/class/net/#{int}/device/physfn")
-+ next if File.exists?("/sys/class/net/#{int}/device/physfn/net")
- int_meta = {:name => int}
- int_meta[:interface_properties] = {}
- int_meta[:state] = intinfo[:state]
+diff --git a/debian/patches/0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch b/debian/patches/0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
+new file mode 100644
+index 0000000..87cdffc
+--- /dev/null
++++ b/debian/patches/0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
+@@ -0,0 +1,35 @@
++From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++Date: Thu, 7 Jul 2016 13:58:34 +0200
++Subject: [PATCH 1/4] Temporary: SR-IOV: Fix VNICs broken filter.
++
++Some blades have VNICs (VFs on a PCI device), which are not
++SR-IOV VFs.
++
++Bug report: "VNICs ignored due to SR-IOV filtering" [1]
++
++HACK: Instead of checking for "physfn", we now rely on testing
++for "physfn/net" subdir to determine whether current eth is
++a SR-IOV VF or something else (thus keeping VNICs).
++
++FIXME: Revert this patch once upstream closes bug [1].
++
++[1] https://bugs.launchpad.net/fuel/+bug/1597775
++
++Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++---
++ agent | 2 +-
++ 1 file changed, 1 insertion(+), 1 deletion(-)
++
++diff --git a/agent b/agent
++index e0251be..2c041ec 100755
++--- a/agent
+++++ b/agent
++@@ -581,7 +581,7 @@ class NodeAgent
++ next if File.exist?("/sys/class/net/#{int}/phy80211") ||
++ File.exist?("/sys/class/net/#{int}/wireless")
++ # Skip virtual functions
++- next if File.exists?("/sys/class/net/#{int}/device/physfn")
+++ next if File.exists?("/sys/class/net/#{int}/device/physfn/net")
++ int_meta = {:name => int}
++ int_meta[:interface_properties] = {}
++ int_meta[:state] = intinfo[:state]
+diff --git a/debian/patches/series b/debian/patches/series
+index b221a98..3980c60 100644
+--- a/debian/patches/series
++++ b/debian/patches/series
+@@ -1 +1,2 @@
+ 0001-ohai-Support-reading-L1-info-from-ethtool.patch
++0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
diff --git a/patches/fuel-nailgun-agent/0003-AArch64-Add-CPU-details-detection.patch b/patches/fuel-nailgun-agent/0003-AArch64-Add-CPU-details-detection.patch
index 0463023..d1691d0 100644
--- a/patches/fuel-nailgun-agent/0003-AArch64-Add-CPU-details-detection.patch
+++ b/patches/fuel-nailgun-agent/0003-AArch64-Add-CPU-details-detection.patch
@@ -7,7 +7,7 @@
: http://www.apache.org/licenses/LICENSE-2.0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Sun, 15 Jan 2017 08:09:10 +0100
+Date: Fri, 19 May 2017 20:37:13 +0200
Subject: [PATCH] AArch64: Add CPU details detection
[ Alexandru Avadanii ]
@@ -25,114 +25,152 @@ arm64 CPU, it is just a suggestion.
Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
- agent | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 1 file changed, 90 insertions(+)
+ .../0003-AArch64-Add-CPU-details-detection.patch | 130 +++++++++++++++++++++
+ debian/patches/series | 1 +
+ 2 files changed, 131 insertions(+)
+ create mode 100644 debian/patches/0003-AArch64-Add-CPU-details-detection.patch
-diff --git a/agent b/agent
-index 0c56264..eeb4d26 100755
---- a/agent
-+++ b/agent
-@@ -340,6 +340,15 @@ class NodeAgent
- end
-
- def _get_detailed_cpuinfo
-+ case `uname -m`
-+ when /aarch64.*/
-+ _get_detailed_cpuinfo_for_arm64
-+ else # default to x86
-+ _get_detailed_cpuinfo_for_x86
-+ end
-+ end
+diff --git a/debian/patches/0003-AArch64-Add-CPU-details-detection.patch b/debian/patches/0003-AArch64-Add-CPU-details-detection.patch
+new file mode 100644
+index 0000000..b9f41f7
+--- /dev/null
++++ b/debian/patches/0003-AArch64-Add-CPU-details-detection.patch
+@@ -0,0 +1,130 @@
++From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++Date: Sun, 15 Jan 2017 08:09:10 +0100
++Subject: [PATCH 2/4] AArch64: Add CPU details detection
+
-+ def _get_detailed_cpuinfo_for_x86
- real = {}
- info = {}
- info[:total] = 0
-@@ -371,6 +380,87 @@ class NodeAgent
- info
- end
-
-+ def _get_detailed_cpuinfo_for_arm64
-+ cpu_implementers = {
-+ "0x41" => "ARM",
-+ "0x53" => "Samsung",
-+ "0x51" => "Qualcom",
-+ "0x43" => "Cavium",
-+ "0x50" => "APM"
-+ }
-+ core_models = {
-+ "0xd04" => "cortex-a35",
-+ "0xd03" => "cortex-a53",
-+ "0xd07" => "cortex-a57",
-+ "0xd08" => "cortex-a72",
-+ "0x001" => "exynos-m1",
-+ "0x800" => "qdf24xx",
-+ "0x0a1" => "thunderx",
-+ "0x000" => "xgene1",
-+ "0xd07.0xd03" => "cortex-a57.cortex-a53",
-+ "0xd08.0xd03" => "cortex-a72.cortex-a53"
-+ }
-+ cpuinfo = {}
-+ real_cpus = {}
-+ cpu_number = -1
-+ current_cpu = nil
-+ `dmidecode -t 4 -q`.each_line do |line|
-+ case line
-+ when /Processor Information/
-+ cpu_number +=1
-+ real_cpus[cpu_number] = {}
-+ when /\s*Manufacturer:\s(.+)/
-+ real_cpus[cpu_number][:vendor_id] = $1
-+ when /\s*Family:\s(.+)/
-+ real_cpus[cpu_number][:family] = $1
-+ when /\s*Max Speed:\s(.+)\s*MHz/
-+ real_cpus[cpu_number][:mhz] = $1.strip
-+ when /\s*Core Enabled:\s(.+)/
-+ real_cpus[cpu_number][:cores] = $1
-+ end
-+ end
++[ Alexandru Avadanii ]
++Based on Stan's previous patch for ohai, extend fuel-nailgun-agent
++to properly support AArch64 CPUs.
++
++[ Stanislaw Kardach ]
++There is currently little human readable detail in /proc/cpuinfo on
++arm64 so this patch tries to enchance this information by parsing the
++DMI data (using `dmidecode`) and fail gracefully to empty strings
++if no information could not be read from there. By no means this
++parsing is to be taken as a standardised way of discovering an
++arm64 CPU, it is just a suggestion.
++
++Signed-off-by: Stanislaw Kardach <stanislaw.kardach@cavium.com>
++Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++---
++ agent | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
++ 1 file changed, 90 insertions(+)
++
++diff --git a/agent b/agent
++index 2c041ec..c3f5d28 100755
++--- a/agent
+++++ b/agent
++@@ -288,6 +288,15 @@ class NodeAgent
++ end
+
-+ cpu_number = 0
-+ File.open("/proc/cpuinfo").each do |line|
-+ case line
-+ when /processor\s+:\s(.+)/
-+ cpuinfo[$1] = {}
-+ current_cpu = $1
-+ cpu_number += 1
-+ phys_id = File.read(
-+ "/sys/devices/system/cpu/cpu%d/topology/physical_package_id" %
-+ $1).strip
-+ i = phys_id.to_i
-+ cpuinfo[$1][:core_id] =
-+ File.read("/sys/devices/system/cpu/cpu%d/topology/core_id" %
-+ $1).strip rescue ""
-+ cpuinfo[$1][:physical_id] = phys_id if not phys_id.empty?
-+ if real_cpus[i].nil?
-+ i = 0
-+ end
-+ if not real_cpus[i].nil?
-+ cpuinfo[$1][:family] = real_cpus[i][:family] rescue ""
-+ cpuinfo[$1][:cores] = real_cpus[i][:cores] rescue ""
-+ cpuinfo[$1][:mhz] = real_cpus[i][:mhz] rescue ""
-+ end
-+ when /CPU implementer\s+:\s(.+)/
-+ cpuinfo[current_cpu][:vendor_id] = cpu_implementers[$1]
-+ cpuinfo[current_cpu][:vendor_id] ||= real_cpus[cpuinfo[current_cpu][:physical_id].to_i][:vendor_id] rescue nil
-+ cpuinfo[current_cpu][:vendor_id] ||= real_cpus[0][:vendor_id] rescue nil
-+ cpuinfo[current_cpu][:vendor_id] ||= $1
-+ when /CPU part\s+:\s(.+)/
-+ cpuinfo[current_cpu][:model] = $1
-+ cpuinfo[current_cpu][:model_name] = core_models[$1]
-+ cpuinfo[current_cpu][:model_name] ||= ""
-+ when /Features\s+:\s(.+)/
-+ cpuinfo[current_cpu][:flags] = $1.split(' ')
-+ end
-+ end
-+ cpuinfo[:total] = cpu_number
-+ cpuinfo[:real] = real_cpus.keys.length
-+ cpuinfo
-+ end
++ def _get_detailed_cpuinfo
+++ case `uname -m`
+++ when /aarch64.*/
+++ _get_detailed_cpuinfo_for_arm64
+++ else # default to x86
+++ _get_detailed_cpuinfo_for_x86
+++ end
+++ end
+++
+++ def _get_detailed_cpuinfo_for_x86
++ real = {}
++ info = {}
++ info[:total] = 0
++@@ -319,6 +328,87 @@ class NodeAgent
++ info
++ end
+
- def _get_blkdev_info
- info = {}
- if File.directory?('/sys/block/')
+++ def _get_detailed_cpuinfo_for_arm64
+++ cpu_implementers = {
+++ "0x41" => "ARM",
+++ "0x53" => "Samsung",
+++ "0x51" => "Qualcom",
+++ "0x43" => "Cavium",
+++ "0x50" => "APM"
+++ }
+++ core_models = {
+++ "0xd04" => "cortex-a35",
+++ "0xd03" => "cortex-a53",
+++ "0xd07" => "cortex-a57",
+++ "0xd08" => "cortex-a72",
+++ "0x001" => "exynos-m1",
+++ "0x800" => "qdf24xx",
+++ "0x0a1" => "thunderx",
+++ "0x000" => "xgene1",
+++ "0xd07.0xd03" => "cortex-a57.cortex-a53",
+++ "0xd08.0xd03" => "cortex-a72.cortex-a53"
+++ }
+++ cpuinfo = {}
+++ real_cpus = {}
+++ cpu_number = -1
+++ current_cpu = nil
+++ `dmidecode -t 4 -q`.each_line do |line|
+++ case line
+++ when /Processor Information/
+++ cpu_number +=1
+++ real_cpus[cpu_number] = {}
+++ when /\s*Manufacturer:\s(.+)/
+++ real_cpus[cpu_number][:vendor_id] = $1
+++ when /\s*Family:\s(.+)/
+++ real_cpus[cpu_number][:family] = $1
+++ when /\s*Max Speed:\s(.+)\s*MHz/
+++ real_cpus[cpu_number][:mhz] = $1.strip
+++ when /\s*Core Enabled:\s(.+)/
+++ real_cpus[cpu_number][:cores] = $1
+++ end
+++ end
+++
+++ cpu_number = 0
+++ File.open("/proc/cpuinfo").each do |line|
+++ case line
+++ when /processor\s+:\s(.+)/
+++ cpuinfo[$1] = {}
+++ current_cpu = $1
+++ cpu_number += 1
+++ phys_id = File.read(
+++ "/sys/devices/system/cpu/cpu%d/topology/physical_package_id" %
+++ $1).strip
+++ i = phys_id.to_i
+++ cpuinfo[$1][:core_id] =
+++ File.read("/sys/devices/system/cpu/cpu%d/topology/core_id" %
+++ $1).strip rescue ""
+++ cpuinfo[$1][:physical_id] = phys_id if not phys_id.empty?
+++ if real_cpus[i].nil?
+++ i = 0
+++ end
+++ if not real_cpus[i].nil?
+++ cpuinfo[$1][:family] = real_cpus[i][:family] rescue ""
+++ cpuinfo[$1][:cores] = real_cpus[i][:cores] rescue ""
+++ cpuinfo[$1][:mhz] = real_cpus[i][:mhz] rescue ""
+++ end
+++ when /CPU implementer\s+:\s(.+)/
+++ cpuinfo[current_cpu][:vendor_id] = cpu_implementers[$1]
+++ cpuinfo[current_cpu][:vendor_id] ||= real_cpus[cpuinfo[current_cpu][:physical_id].to_i][:vendor_id] rescue nil
+++ cpuinfo[current_cpu][:vendor_id] ||= real_cpus[0][:vendor_id] rescue nil
+++ cpuinfo[current_cpu][:vendor_id] ||= $1
+++ when /CPU part\s+:\s(.+)/
+++ cpuinfo[current_cpu][:model] = $1
+++ cpuinfo[current_cpu][:model_name] = core_models[$1]
+++ cpuinfo[current_cpu][:model_name] ||= ""
+++ when /Features\s+:\s(.+)/
+++ cpuinfo[current_cpu][:flags] = $1.split(' ')
+++ end
+++ end
+++ cpuinfo[:total] = cpu_number
+++ cpuinfo[:real] = real_cpus.keys.length
+++ cpuinfo
+++ end
+++
++ def _get_blkdev_info
++ info = {}
++ if File.directory?('/sys/block/')
+diff --git a/debian/patches/series b/debian/patches/series
+index 3980c60..fa57b98 100644
+--- a/debian/patches/series
++++ b/debian/patches/series
+@@ -1,2 +1,3 @@
+ 0001-ohai-Support-reading-L1-info-from-ethtool.patch
+ 0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
++0003-AArch64-Add-CPU-details-detection.patch
diff --git a/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch b/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
index 384dafc..8a51c35 100644
--- a/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
+++ b/patches/fuel-nailgun-agent/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
@@ -7,7 +7,7 @@
: http://www.apache.org/licenses/LICENSE-2.0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
-Date: Sun, 15 Jan 2017 08:14:12 +0100
+Date: Fri, 19 May 2017 20:38:01 +0200
Subject: [PATCH] AArch64: Read hugepage size from /proc/meminfo
This method should be arch-indepedent, provided /proc/meminfo
@@ -15,24 +15,53 @@ reports the correct information.
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
- agent | 7 +++++++
- 1 file changed, 7 insertions(+)
-
-diff --git a/agent b/agent
-index eeb4d26..d514de6 100755
---- a/agent
-+++ b/agent
-@@ -1399,6 +1399,13 @@ class NodeAgent
- def supported_hugepages
- return [2048, 1048576] if _get_detailed_cpuinfo['0'][:flags].include?('pdpe1gb')
- return [2048] if _get_detailed_cpuinfo['0'][:flags].include?('pse')
-+ # AArch64 does not expose CPU flags, but we can rely on /proc/meminfo
-+ File.open('/proc/meminfo').each do |l|
-+ case l.strip
-+ when /Hugepagesize:\s+(\d+)\s+kB/
-+ return [$1.to_i()]
-+ end
-+ end
- []
- end
+ ...ch64-Read-hugepage-size-from-proc-meminfo.patch | 30 ++++++++++++++++++++++
+ debian/patches/series | 1 +
+ 2 files changed, 31 insertions(+)
+ create mode 100644 debian/patches/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
+diff --git a/debian/patches/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch b/debian/patches/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
+new file mode 100644
+index 0000000..16d78b5
+--- /dev/null
++++ b/debian/patches/0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
+@@ -0,0 +1,30 @@
++From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++Date: Sun, 15 Jan 2017 08:14:12 +0100
++Subject: [PATCH 3/4] AArch64: Read hugepage size from /proc/meminfo
++
++This method should be arch-indepedent, provided /proc/meminfo
++reports the correct information.
++
++Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++---
++ agent | 7 +++++++
++ 1 file changed, 7 insertions(+)
++
++diff --git a/agent b/agent
++index c3f5d28..01c17fe 100755
++--- a/agent
+++++ b/agent
++@@ -1379,6 +1379,13 @@ class NodeAgent
++ def supported_hugepages
++ return [2048, 1048576] if _get_detailed_cpuinfo['0'][:flags].include?('pdpe1gb')
++ return [2048] if _get_detailed_cpuinfo['0'][:flags].include?('pse')
+++ # AArch64 does not expose CPU flags, but we can rely on /proc/meminfo
+++ File.open('/proc/meminfo').each do |l|
+++ case l.strip
+++ when /Hugepagesize:\s+(\d+)\s+kB/
+++ return [$1.to_i()]
+++ end
+++ end
++ []
++ end
++
+diff --git a/debian/patches/series b/debian/patches/series
+index fa57b98..93ef079 100644
+--- a/debian/patches/series
++++ b/debian/patches/series
+@@ -1,3 +1,4 @@
+ 0001-ohai-Support-reading-L1-info-from-ethtool.patch
+ 0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
+ 0003-AArch64-Add-CPU-details-detection.patch
++0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
diff --git a/patches/fuel-nailgun-agent/0005-AArch64-Allow-removable-storage-on-platform-bus.patch b/patches/fuel-nailgun-agent/0005-AArch64-Allow-removable-storage-on-platform-bus.patch
new file mode 100644
index 0000000..e426e71
--- /dev/null
+++ b/patches/fuel-nailgun-agent/0005-AArch64-Allow-removable-storage-on-platform-bus.patch
@@ -0,0 +1,77 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2017 Enea AB and others.
+:
+: All rights reserved. This program and the accompanying materials
+: are made available under the terms of the Apache License, Version 2.0
+: which accompanies this distribution, and is available at
+: http://www.apache.org/licenses/LICENSE-2.0
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Fri, 19 May 2017 20:39:12 +0200
+Subject: [PATCH] AArch64: Allow removable storage on platform bus
+
+Some devices might have removable storage directly on the AArch64
+specific "platform" bus, which is currently filtered-out by
+nailgun-agent.
+
+Allow such devices to be considered as valid storage.
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ ...4-Allow-removable-storage-on-platform-bus.patch | 38 ++++++++++++++++++++++
+ debian/patches/series | 1 +
+ 2 files changed, 39 insertions(+)
+ create mode 100644 debian/patches/0005-AArch64-Allow-removable-storage-on-platform-bus.patch
+
+diff --git a/debian/patches/0005-AArch64-Allow-removable-storage-on-platform-bus.patch b/debian/patches/0005-AArch64-Allow-removable-storage-on-platform-bus.patch
+new file mode 100644
+index 0000000..7417b8b
+--- /dev/null
++++ b/debian/patches/0005-AArch64-Allow-removable-storage-on-platform-bus.patch
+@@ -0,0 +1,37 @@
++From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++Date: Fri, 19 May 2017 20:30:43 +0200
++Subject: [PATCH 4/4] AArch64: Allow removable storage on platform bus
++
++Some devices might have removable storage directly on the AArch64
++specific "platform" bus, which is currently filtered-out by
++nailgun-agent.
++
++Allow such devices to be considered as valid storage.
++
++Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
++---
++ agent | 11 ++++++++++-
++ 1 file changed, 10 insertions(+), 1 deletion(-)
++
++diff --git a/agent b/agent
++index 01c17fe..1249746 100755
++--- a/agent
+++++ b/agent
++@@ -938,7 +938,16 @@ class NodeAgent
++ # For the example given above, vendor ID should be found as '0x10b5'.
++ # Next ID of '0x8086' belongs to PCIe slot to which PCIe RAID disk adapter is inserted.
++ devpath = Hash[udevadm_walk.select { |k, v| v['SUBSYSTEMS'] == 'pci' }].keys.max
++- udevadm_walk[devpath]['ATTRS{vendor}']
+++ if devpath
+++ udevadm_walk[devpath]['ATTRS{vendor}']
+++ elsif Hash[udevadm_walk.select { |k, v| v['SUBSYSTEMS'] == 'platform' }]
+++ # NOTE(armband): AArch64 targets might have removable storage on the
+++ # "platform" bus, which should be filtered-in as valid storage.
+++
+++ # TODO(armband): Rewrite this as separate functionality instead of
+++ # hijacking PCI filtering and masquerading as a removable PCI ID.
+++ REMOVABLE_PCI_VENDORS[0]
+++ end
++ end
++ rescue => e
++ @logger.error("Error '#{e.message}' in obtaining PCI vendor ID: #{e.backtrace}")
+diff --git a/debian/patches/series b/debian/patches/series
+index 93ef079..33c8326 100644
+--- a/debian/patches/series
++++ b/debian/patches/series
+@@ -2,3 +2,4 @@
+ 0002-Temporary-SR-IOV-Fix-VNICs-broken-filter.patch
+ 0003-AArch64-Add-CPU-details-detection.patch
+ 0004-AArch64-Read-hugepage-size-from-proc-meminfo.patch
++0005-AArch64-Allow-removable-storage-on-platform-bus.patch