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 | 30 ++++++++++++++++++++++
18 debian/patches/series | 1 +
19 2 files changed, 31 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..8ae8c49
27 +++ b/debian/patches/0001-ohai-Support-reading-L1-info-from-ethtool.patch
29 +From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
30 +Date: Sat, 2 Apr 2016 22:54:27 +0200
31 +Subject: [PATCH] ohai: Support reading L1 info from ethtool.
33 +Upstream ohai [1] introduces support for reading layer one information
34 +from ethtool. Allow nailgun-agent to use that info if present.
36 +[1] https://github.com/chef/ohai/commit/
37 + afd42e9122f057ab00dd24357c28dc2ad6806434
40 + 1 file changed, 5 insertions(+), 1 deletion(-)
42 +diff --git a/agent b/agent
43 +index c764a68..978131f 100755
46 +@@ -316,7 +316,11 @@ class NodeAgent
47 + int_meta[:current_speed] = int_info.current_mode.speed
50 +- int_meta[:current_speed] = nil
51 ++ if intinfo.has_key?(:link_speed) && 0 < intinfo[:link_speed]
52 ++ int_meta[:current_speed] = intinfo[:link_speed]
54 ++ int_meta[:current_speed] = nil
57 + elsif (addrinfo[:family] rescue nil) =~ /^inet$/
58 + int_meta[:ip] = addr
59 diff --git a/debian/patches/series b/debian/patches/series
61 index 0000000..b221a98
63 +++ b/debian/patches/series
65 +0001-ohai-Support-reading-L1-info-from-ethtool.patch