fireinfo: Import latest patches

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2018-07-20 12:06:11 +00:00
parent 413149f80d
commit 011204d963
3 changed files with 62 additions and 0 deletions

View 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)

View File

@@ -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

View File

@@ -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