Skip to content

Commit fad8f5c

Browse files
committed
[BoxInfo] force "kernel" with revision from /proc/version
This ensures the kernel revision matches the revision found in the package names of the ipk's on the feeds
1 parent 7081f11 commit fad8f5c

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

lib/python/Components/About.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77
from time import time
88

99

10+
def getKernelVersionString(): # output from this function may not match kernel version from enigma.info (BoxInfo). This version is more accurate.
11+
try:
12+
return open("/proc/version").read().split(" ", 3)[2].split("-", 1)[0]
13+
except:
14+
return _("unknown")
15+
16+
1017
def getCPUArch(MODEL):
1118
if MODEL.startswith("osmio4k"):
1219
CPUArch = "ARM V7"

lib/python/Components/SystemInfo.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from re import split
66
from enigma import Misc_Options, eDVBCIInterfaces, eDVBResourceManager
77

8+
from Components.About import getKernelVersionString
89
from Components.RcModel import rc_model
910
from Tools.Directories import fileCheck, fileExists, fileHas, pathExists, resolveFilename, SCOPE_LIBDIR, SCOPE_SKIN, fileReadLine, fileReadLines
1011
from Tools.HardwareInfo import HardwareInfo
@@ -70,6 +71,13 @@ def deleteItem(self, item):
7071

7172
BoxInfo = BoxInformation()
7273

74+
# "kernel" from enigma.info may not be faithful with what is expected. e.g. osmio4k should be "5.15.0"
75+
# but enigma.info shows "5.15" which reflects "PREFERRED_VERSION_linux-edision". But we want the version
76+
# to refect that found in "${STAGING_KERNEL_BUILDDIR}/kernel-abiversion" which is the version used in the
77+
# package names from the feeds. Therefore we will force the output of BoxInfo.getItem("kernel") to the
78+
# value from "/proc/version" which is the same.
79+
BoxInfo.boxInfo["kernel"] = getKernelVersionString().strip() # force kernel revision
80+
7381
# This line makes the BoxInfo backwards compatible with SystemInfo without duplicating the dictionary.
7482
SystemInfo = BoxInfo.boxInfo
7583

0 commit comments

Comments
 (0)