1 From 810fe43289f5b003cbf80ebb1d9a79f52a767cdb Mon Sep 17 00:00:00 2001
2 From: Michael Tremer <michael.tremer@ipfire.org>
3 Date: Mon, 15 Dec 2014 22:48:26 +0100
4 Subject: [PATCH 3/3] Revert vendor/model for ARM to old behaviour
7 src/fireinfo/system.py | 33 +++++++++++++++++++++++++++++----
8 1 file changed, 29 insertions(+), 4 deletions(-)
10 diff --git a/src/fireinfo/system.py b/src/fireinfo/system.py
11 index 195832e9f7eb..ce33837af747 100644
12 --- a/src/fireinfo/system.py
13 +++ b/src/fireinfo/system.py
14 @@ -304,6 +304,27 @@ class System(object):
16 return read_from_file("/sys/class/dmi/id/bios_vendor")
18 + def vendor_model_tuple(self):
20 + s = self.__cpuinfo["Hardware"]
24 + if s.startswith("ARM-Versatile"):
28 + v, m = s.split(" ", 1)
30 + if s.startswith("BCM"):
42 @@ -316,10 +337,10 @@ class System(object):
47 - return self.__cpuinfo["Hardware"]
50 + if os.path.exists("/proc/device-tree"):
51 + ret = self.__cpuinfo.get("Hardware", None)
53 + ret, m = self.vendor_model_tuple()
57 @@ -340,6 +361,10 @@ class System(object):
58 # replace the NULL byte with which the DT string ends
59 ret = ret.replace(u"\u0000", "")
61 + # Fall back to read /proc/cpuinfo
63 + v, ret = self.vendor_model_tuple()