]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Merge branch 'next' into efi
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Jul 2018 12:47:20 +0000 (12:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 20 Jul 2018 12:47:20 +0000 (12:47 +0000)
lfs/fireinfo
src/patches/fireinfo-Don-t-crash-when-proc-cpuinfo-doesn-t-have-any-infor.patch [new file with mode: 0644]
src/patches/fireinfo-Ignore-any-systems-with-ID-Default-string.patch [new file with mode: 0644]

index dec588705d8f59b822518b17928004d5ed00161b..784685029de409d892bc915bae7d68510a757669 100644 (file)
@@ -71,6 +71,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
        @$(PREBUILD)
        @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
 
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/fireinfo-Don-t-crash-when-proc-cpuinfo-doesn-t-have-any-infor.patch
+       cd $(DIR_APP) && patch -Np1 < $(DIR_SRC)/src/patches/fireinfo-Ignore-any-systems-with-ID-Default-string.patch
+
        cd $(DIR_APP) && [ -x "configure" ] || sh ./autogen.sh
        cd $(DIR_APP) && ./configure --prefix=/usr
        cd $(DIR_APP) && make $(MAKETUNING)
diff --git a/src/patches/fireinfo-Don-t-crash-when-proc-cpuinfo-doesn-t-have-any-infor.patch b/src/patches/fireinfo-Don-t-crash-when-proc-cpuinfo-doesn-t-have-any-infor.patch
new file mode 100644 (file)
index 0000000..a99c618
--- /dev/null
@@ -0,0 +1,34 @@
+From e2b6025dea547bf8de4bd2b8056f2a8227c635f5 Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Wed, 13 Jun 2018 20:56:41 +0200
+Subject: [PATCH 1/2] Don't crash when /proc/cpuinfo doesn't have any
+ information
+
+Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
+---
+ src/fireinfo/cpu.py | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/fireinfo/cpu.py b/src/fireinfo/cpu.py
+index 541575a..dc76caf 100644
+--- a/src/fireinfo/cpu.py
++++ b/src/fireinfo/cpu.py
+@@ -108,10 +108,11 @@ class CPU(object):
+               """
+                       Return the model string of this CPU.
+               """
+-              try:
+-                      return self.__cpuinfo["model_name"]
+-              except KeyError:
+-                      return self.__cpuinfo["Processor"]
++              for key in ("model_name", "Processor"):
++                      try:
++                              return self.__cpuinfo[key]
++                      except KeyError:
++                              pass
+       @property
+       def vendor(self):
+-- 
+2.12.2
+
diff --git a/src/patches/fireinfo-Ignore-any-systems-with-ID-Default-string.patch b/src/patches/fireinfo-Ignore-any-systems-with-ID-Default-string.patch
new file mode 100644 (file)
index 0000000..ace5d01
--- /dev/null
@@ -0,0 +1,25 @@
+From d1f6789178e141664895332af79dbe7aa9e5ab68 Mon Sep 17 00:00:00 2001
+From: Michael Tremer <michael.tremer@ipfire.org>
+Date: Wed, 13 Jun 2018 20:58:42 +0200
+Subject: [PATCH 2/2] Ignore any systems with ID "Default string"
+
+Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
+---
+ src/fireinfo/system.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/fireinfo/system.py b/src/fireinfo/system.py
+index e3295af..73c3882 100644
+--- a/src/fireinfo/system.py
++++ b/src/fireinfo/system.py
+@@ -42,6 +42,7 @@ INVALID_ID_STRINGS = (
+       "N/A", "n/a",
+       "12345", "54321", "202020",
+       "Chassis", "chassis",
++      "Default string",
+       "EVAL",
+       "Not Applicable",
+       "None", "empty",
+-- 
+2.12.2
+