mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-19 07:23:03 +02:00
fireinfo: Import latest patches
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user