mirror of
https://github.com/gutosie/neoboot.git
synced 2025-12-16 21:39:53 +01:00
Update stbbranding.py
This commit is contained in:
@@ -99,6 +99,13 @@ def getFreespace(dev):
|
|||||||
|
|
||||||
#check install
|
#check install
|
||||||
|
|
||||||
|
def getDevNeoPoint():
|
||||||
|
devneopoint = 'UNKNOWN'
|
||||||
|
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install'):
|
||||||
|
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install' , 'r') as f:
|
||||||
|
devneopoint = f.readline().strip()
|
||||||
|
f.close()
|
||||||
|
return devneopoint
|
||||||
|
|
||||||
def getCheckInstal1():
|
def getCheckInstal1():
|
||||||
neocheckinstal = 'UNKNOWN'
|
neocheckinstal = 'UNKNOWN'
|
||||||
@@ -1203,11 +1210,12 @@ def getFind_hdd():
|
|||||||
|
|
||||||
if lines.find('0') != -1:
|
if lines.find('0') != -1:
|
||||||
hdd = device
|
hdd = device
|
||||||
os.system("echo %s > /tmp/1_MY_HDD" % hdd )
|
os.system("echo %s > /tmp/.my_hdd" % hdd )
|
||||||
break
|
break
|
||||||
|
|
||||||
return hdd
|
return hdd
|
||||||
|
|
||||||
|
|
||||||
def getFind_usb():
|
def getFind_usb():
|
||||||
usb = ''
|
usb = ''
|
||||||
usbs = ['sda',
|
usbs = ['sda',
|
||||||
@@ -1225,11 +1233,12 @@ def getFind_usb():
|
|||||||
|
|
||||||
if lines.find('1') != -1:
|
if lines.find('1') != -1:
|
||||||
usb = device
|
usb = device
|
||||||
os.system("echo %s >> /tmp/2_MY_USB" % usb )
|
os.system("echo %s > /tmp/.my_usb" % usb )
|
||||||
break
|
break
|
||||||
|
|
||||||
return usb
|
return usb
|
||||||
|
|
||||||
|
|
||||||
def getLocationHDDdir():
|
def getLocationHDDdir():
|
||||||
hdd_dir = 'UNKNOWN'
|
hdd_dir = 'UNKNOWN'
|
||||||
if os.path.exists('/proc/mounts'):
|
if os.path.exists('/proc/mounts'):
|
||||||
@@ -1242,36 +1251,44 @@ def getLocationHDDdir():
|
|||||||
hdd_dir = '/dev/sdb1'
|
hdd_dir = '/dev/sdb1'
|
||||||
|
|
||||||
return hdd_dir
|
return hdd_dir
|
||||||
|
|
||||||
def getDevNeoPoint():
|
|
||||||
devneopoint = 'UNKNOWN'
|
def getLocationUSBdir():
|
||||||
if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install'):
|
usb_dir = 'UNKNOWN'
|
||||||
with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install' , 'r') as f:
|
if os.path.exists('/proc/mounts'):
|
||||||
devneopoint = f.readline().strip()
|
with open('/proc/mounts', 'r') as f:
|
||||||
|
lines = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
return devneopoint
|
if lines.find('/dev/sda1 /media/usb') != -1:
|
||||||
|
usb_dir = '/dev/sda1'
|
||||||
|
elif lines.find('/dev/sdb1 /media/usb') != -1:
|
||||||
|
usb_dir = '/dev/sdb1'
|
||||||
|
|
||||||
|
return usb_dir
|
||||||
|
|
||||||
|
|
||||||
def getMyUUID():
|
def getMyUUIDusb():
|
||||||
#os.system("tune2fs -l /dev/sd?? | awk '/UUID/ {print $NF}' > /tmp/.myuuid")
|
#os.system("tune2fs -l /dev/sd?? | awk '/UUID/ {print $NF}' > /tmp/.myuuid")
|
||||||
os.system("tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.myuuid" % (getDevNeoPoint()))
|
os.system("tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.1myuuid" % (getLocationUSBdir()))
|
||||||
try:
|
try:
|
||||||
if os.path.isfile('/tmp/.myuuid'):
|
if os.path.isfile('/tmp/.1myuuid'):
|
||||||
return open('/tmp/.myuuid').read().strip().upper()
|
return open('/tmp/.1myuuid').read().strip().upper()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return _('unavailable')
|
return _('unavailable')
|
||||||
|
|
||||||
def getUUIDmy():
|
|
||||||
os.system("tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.my_uuid" % (getLocationHDDdir()))
|
def getMyUUIDhdd():
|
||||||
|
os.system("tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.2myuuid" % (getLocationHDDdir()))
|
||||||
try:
|
try:
|
||||||
if os.path.isfile('/tmp/.my_uuid'):
|
if os.path.isfile('/tmp/.2myuuid'):
|
||||||
return open('/tmp/.my_uuid').read().strip().upper()
|
return open('/tmp/.2myuuid').read().strip().upper()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
return _('unavailable')
|
return _('unavailable')
|
||||||
|
|
||||||
|
|
||||||
def getImageBootNow():
|
def getImageBootNow():
|
||||||
imagefile = 'UNKNOWN'
|
imagefile = 'UNKNOWN'
|
||||||
|
|||||||
Reference in New Issue
Block a user