mirror of
https://github.com/gutosie/neoboot.git
synced 2025-12-20 07:19:43 +01:00
Update stbbranding.py
This commit is contained in:
@@ -1186,6 +1186,19 @@ def getNandWrite():
|
|||||||
|
|
||||||
return NandWrite
|
return NandWrite
|
||||||
|
|
||||||
|
def getLocationHDDdir():
|
||||||
|
hdd_dir = 'UNKNOWN'
|
||||||
|
if os.path.exists('/proc/mounts'):
|
||||||
|
with open('/proc/mounts', 'r') as f:
|
||||||
|
lines = f.read()
|
||||||
|
f.close()
|
||||||
|
if lines.find('/dev/sda1 /media/hdd') != -1:
|
||||||
|
hdd_dir = '/dev/sda1'
|
||||||
|
elif lines.find('/dev/sdb1 /media/hdd') != -1:
|
||||||
|
hdd_dir = '/dev/sdb1'
|
||||||
|
|
||||||
|
return hdd_dir
|
||||||
|
|
||||||
def getMyUUID():
|
def getMyUUID():
|
||||||
#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" % (getLocationMultiboot()))
|
os.system("tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.myuuid" % (getLocationMultiboot()))
|
||||||
@@ -1197,6 +1210,16 @@ def getMyUUID():
|
|||||||
|
|
||||||
return _('unavailable')
|
return _('unavailable')
|
||||||
|
|
||||||
|
def getUUIDmy():
|
||||||
|
os.system("tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.my_uuid" % (getLocationHDDdir()))
|
||||||
|
try:
|
||||||
|
if os.path.isfile('/tmp/.my_uuid'):
|
||||||
|
return open('/tmp/.my_uuid').read().strip().upper()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
return _('unavailable')
|
||||||
|
|
||||||
def getImageBootNow():
|
def getImageBootNow():
|
||||||
imagefile = 'UNKNOWN'
|
imagefile = 'UNKNOWN'
|
||||||
if os.path.exists('/.multinfo'):
|
if os.path.exists('/.multinfo'):
|
||||||
|
|||||||
Reference in New Issue
Block a user