mirror of
https://mojerepo.cf/NeoBoot/NeoBoot-9.git
synced 2025-12-21 00:09:40 +01:00
vip
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
#from __future__ import print_function
|
|
||||||
#from Plugins.Extensions.NeoBoot.__init__ import _ , Log, PluginPath
|
from Plugins.Extensions.NeoBoot.__init__ import _
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
@@ -18,6 +18,44 @@ def getNeoLocation():
|
|||||||
f.close()
|
f.close()
|
||||||
return locatino
|
return locatino
|
||||||
|
|
||||||
|
|
||||||
|
#check ext
|
||||||
|
def getFormat():
|
||||||
|
neoformat='UNKNOWN'
|
||||||
|
if os.path.exists('/proc/mounts'):
|
||||||
|
with open('/proc/mounts', 'r') as f:
|
||||||
|
lines = f.read()
|
||||||
|
f.close()
|
||||||
|
if lines.find('ext2') != -1:
|
||||||
|
neoformat='ext2'
|
||||||
|
elif lines.find('ext3') != -1:
|
||||||
|
neoformat='ext3'
|
||||||
|
elif lines.find('ext4') != -1:
|
||||||
|
neoformat='ext4'
|
||||||
|
elif lines.find('nfs') != -1:
|
||||||
|
neoformat='nfs'
|
||||||
|
|
||||||
|
return neoformat
|
||||||
|
|
||||||
|
|
||||||
|
def getNEO_filesystems():
|
||||||
|
neo_filesystems='UNKNOWN'
|
||||||
|
if os.path.exists('/tmp/.neo_format'):
|
||||||
|
with open('/tmp/.neo_format', 'r') as f:
|
||||||
|
lines = f.read()
|
||||||
|
f.close()
|
||||||
|
if lines.find('ext2') != -1:
|
||||||
|
neo_filesystems='1'
|
||||||
|
elif lines.find('ext3') != -1:
|
||||||
|
neo_filesystems='1'
|
||||||
|
elif lines.find('ext4') != -1:
|
||||||
|
neo_filesystems='1'
|
||||||
|
elif lines.find('nfs') != -1:
|
||||||
|
neo_filesystems='1'
|
||||||
|
|
||||||
|
return neo_filesystems
|
||||||
|
|
||||||
|
|
||||||
def Log(param = ''):
|
def Log(param = ''):
|
||||||
global LogFileObj
|
global LogFileObj
|
||||||
#first close object if exists
|
#first close object if exists
|
||||||
@@ -208,7 +246,6 @@ def getNeoMount2():
|
|||||||
elif lines.find('/dev/sdf1 /media/usb2') != -1:
|
elif lines.find('/dev/sdf1 /media/usb2') != -1:
|
||||||
neo='usb_install_/dev/sdf1'
|
neo='usb_install_/dev/sdf1'
|
||||||
|
|
||||||
|
|
||||||
return neo
|
return neo
|
||||||
|
|
||||||
def getNeoMount3():
|
def getNeoMount3():
|
||||||
@@ -295,7 +332,7 @@ def getVuModel():
|
|||||||
f = open("/proc/stb/info/vumodel",'r')
|
f = open("/proc/stb/info/vumodel",'r')
|
||||||
procmodel = f.readline().strip()
|
procmodel = f.readline().strip()
|
||||||
f.close()
|
f.close()
|
||||||
model = procmodel.title().replace("olose", "olo SE").replace("olo2se", "olo2 SE").replace("2", "²")
|
model = procmodel.title().replace("olose", "olo SE").replace("olo2se", "olo2 SE").replace("2", "²")
|
||||||
return model
|
return model
|
||||||
|
|
||||||
#zwraca nazwe stb z pliku hostname
|
#zwraca nazwe stb z pliku hostname
|
||||||
@@ -349,22 +386,57 @@ def runCMDS(cmdsList):
|
|||||||
ret = os.system(myCMD)
|
ret = os.system(myCMD)
|
||||||
return rett
|
return rett
|
||||||
|
|
||||||
#####################################
|
|
||||||
|
|
||||||
def getImageDistro():
|
def getImageDistroN():
|
||||||
if fileExists('/etc/issue.net'):
|
image='Internal storage'
|
||||||
try:
|
|
||||||
obraz = open('/etc/issue.net', 'r').readlines()
|
if fileExists('/.multinfo') and fileExists ('%sImageBoot/.imagedistro' % getNeoLocation() ):
|
||||||
imagetype = obraz[0][:-1]
|
with open('%sImageBoot/.imagedistro' % getNeoLocation() , 'r') as f:
|
||||||
image = imagetype[0:-2]
|
image = f.readline().strip()
|
||||||
return image
|
f.close()
|
||||||
except:
|
|
||||||
False
|
elif not fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'):
|
||||||
|
f = open("/etc/vtiversion.info",'r')
|
||||||
elif fileExists('/etc/vtiversion.info'):
|
imagever = f.readline().strip().replace("Release ", " ")
|
||||||
image = 'VTI'
|
f.close()
|
||||||
|
image = imagever
|
||||||
|
|
||||||
|
elif not fileExists('/.multinfo') and fileExists('/etc/bhversion'):
|
||||||
|
f = open("/etc/bhversion",'r')
|
||||||
|
imagever = f.readline().strip()
|
||||||
|
f.close()
|
||||||
|
image = imagever
|
||||||
|
|
||||||
|
# elif not fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'):
|
||||||
|
# image = 'VTI Team Image '
|
||||||
|
|
||||||
|
elif fileExists('/.multinfo') and fileExists('/etc/bhversion'):
|
||||||
|
image = 'Flash ' + ' ' + getBoxHostName()
|
||||||
|
|
||||||
|
elif fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'):
|
||||||
|
image = 'Flash ' + ' ' + getBoxHostName()
|
||||||
|
|
||||||
|
|
||||||
|
elif fileExists('/usr/lib/enigma2/python/boxbranding.so') and not fileExists('/.multinfo'):
|
||||||
|
from boxbranding import getImageDistro
|
||||||
|
image = getImageDistro()
|
||||||
|
|
||||||
|
elif fileExists('/media/InternalFlash/etc/issue.net') and fileExists('/.multinfo') and not fileExists('%sImageBoot/.imagedistro' % getNeoLocation() ):
|
||||||
|
obraz = open('/media/InternalFlash/etc/issue.net', 'r').readlines()
|
||||||
|
imagetype = obraz[0][:-3]
|
||||||
|
image = imagetype
|
||||||
|
|
||||||
|
elif fileExists('/etc/issue.net') and not fileExists('/.multinfo'):
|
||||||
|
obraz = open('/etc/issue.net', 'r').readlines()
|
||||||
|
imagetype = obraz[0][:-3]
|
||||||
|
image = imagetype
|
||||||
|
|
||||||
|
else:
|
||||||
|
image = 'Inernal Flash ' + ' ' + getBoxHostName()
|
||||||
|
|
||||||
return image
|
return image
|
||||||
|
|
||||||
|
|
||||||
def getKernelVersionString():
|
def getKernelVersionString():
|
||||||
try:
|
try:
|
||||||
result = popen('uname -r', 'r').read().strip('\n').split('-')
|
result = popen('uname -r', 'r').read().strip('\n').split('-')
|
||||||
@@ -622,3 +694,5 @@ def getMachineProcModel():
|
|||||||
|
|
||||||
boxbrand = sys.modules[__name__]
|
boxbrand = sys.modules[__name__]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user