1 From: Enea Armband Devops Team <armband@enea.com>
2 Date: Sat, 2 Apr 2016 22:57:59 +0200
3 Subject: [PATCH] ohai: Support reading L1 info from ethtool.
5 Traditional methods of reading the ethernet card speed rely on the
6 drivers populating the advertised and/or supported link speed lists.
8 This is not true for all drivers, especially for some Fibers
9 that only report the speed via ethtool when the link is up.
11 This patch adds support for reading L1 info from ohai, which
12 supports parsing ethtool speed starting with version amos2 [1].
14 [1] https://linux.enea.com/mos-repos/ubuntu/8.0/pool/main/o/
15 ohai/ohai_6.14.0-2~u14.04+mos1+mos8.0+amos2_all.deb
17 ...ohai-Support-reading-L1-info-from-ethtool.patch | 34 ++++++++++++++++++++++
18 debian/patches/series | 1 +
19 2 files changed, 35 insertions(+)
20 create mode 100644 debian/patches/0001-ohai-Support-reading-L1-info-from-ethtool.patch
21 create mode 100644 debian/patches/series
23 diff --git a/debian/patches/0001-ohai-Support-reading-L1-info-from-ethtool.patch b/debian/patches/0001-ohai-Support-reading-L1-info-from-ethtool.patch
25 index 0000000..aa50ea4
27 +++ b/debian/patches/0001-ohai-Support-reading-L1-info-from-ethtool.patch
29 +From 942c67f74c00b1097d1ad27ece79fe91b475190c Mon Sep 17 00:00:00 2001
30 +From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
31 +Date: Sat, 2 Apr 2016 22:54:27 +0200
32 +Subject: [PATCH] ohai: Support reading L1 info from ethtool.
34 +Upstream ohai [1] introduces support for reading layer one information
35 +from ethtool. Allow nailgun-agent to use that info if present.
37 +[1] https://github.com/chef/ohai/commit/
38 + afd42e9122f057ab00dd24357c28dc2ad6806434
41 + 1 file changed, 5 insertions(+), 1 deletion(-)
43 +diff --git a/agent b/agent
44 +index c764a68..978131f 100755
47 +@@ -316,7 +316,11 @@ class NodeAgent
48 + int_meta[:current_speed] = int_info.current_mode.speed
51 +- int_meta[:current_speed] = nil
52 ++ if intinfo.has_key?(:link_speed) && 0 < intinfo[:link_speed]
53 ++ int_meta[:current_speed] = intinfo[:link_speed]
55 ++ int_meta[:current_speed] = nil
58 + elsif (addrinfo[:family] rescue nil) =~ /^inet$/
59 + int_meta[:ip] = addr
63 diff --git a/debian/patches/series b/debian/patches/series
65 index 0000000..b221a98
67 +++ b/debian/patches/series
69 +0001-ohai-Support-reading-L1-info-from-ethtool.patch