Update tools.py

This commit is contained in:
gutosie
2025-12-12 18:06:26 +02:00
committed by GitHub
parent 2381075ba3
commit 1f308c02f6

View File

@@ -36,7 +36,7 @@ from Tools.Testinout import getTestToTest
from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen
from os.path import dirname, isdir, isdir as os_isdir from os.path import dirname, isdir, isdir as os_isdir
from enigma import eTimer from enigma import eTimer
from Plugins.Extensions.NeoBoot.files.stbbranding import fileCheck, getMyUUID, getNeoLocation, getImageNeoBoot, getKernelVersionString, getBoxHostName, getCPUtype, getBoxVuModel, getTunerModel, getCPUSoC, getImageATv, getBoxModelVU, getBoxMacAddres, getMountDiskSTB, getCheckActivateVip, getBoxMacAddres, getChipSetString from Plugins.Extensions.NeoBoot.files.stbbranding import fileCheck, getMyUUID, getUUIDmy, getNeoLocation, getImageNeoBoot, getKernelVersionString, getBoxHostName, getCPUtype, getBoxVuModel, getTunerModel, getCPUSoC, getImageATv, getBoxModelVU, getBoxMacAddres, getMountDiskSTB, getCheckActivateVip, getBoxMacAddres, getChipSetString
from Components.Harddisk import harddiskmanager, getProcMounts from Components.Harddisk import harddiskmanager, getProcMounts
import os import os
import time import time
@@ -2191,8 +2191,8 @@ class DiskLabelSet(Screen):
def __init__(self, session): def __init__(self, session):
Screen.__init__(self, session) Screen.__init__(self, session)
self['lab1'] = Label(_('Label')) self['lab1'] = Label(_('set disk name and uuid number'))
self['key_red'] = Label(_('Set Label')) self['key_red'] = Label(_('press red to set...'))
self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close,
'red': self.SetLabelDisk}) 'red': self.SetLabelDisk})
@@ -2203,6 +2203,11 @@ class DiskLabelSet(Screen):
locatin_neo = '/media/hdd' locatin_neo = '/media/hdd'
elif os.path.exists('/media/usb/ImageBoot'): elif os.path.exists('/media/usb/ImageBoot'):
locatin_neo = '/media/usb' locatin_neo = '/media/usb'
if not os.path.exists('/media/hdd/ImageBoot'):
locatIN_hdd = '/media/hdd'
elif not os.path.exists('/media/usb/ImageBoot'):
locatIN_hdd = '/media/usb'
if os.path.exists('/proc/mounts'): if os.path.exists('/proc/mounts'):
with open('/proc/mounts', 'r') as f: with open('/proc/mounts', 'r') as f:
lines = f.read() lines = f.read()
@@ -2251,6 +2256,8 @@ class DiskLabelSet(Screen):
cmd3 = "echo -e '\n%s '" % _('UUID exists or neoboot not installed yet\nAfter installing the plugin, give uuid\n\nReboot...') cmd3 = "echo -e '\n%s '" % _('UUID exists or neoboot not installed yet\nAfter installing the plugin, give uuid\n\nReboot...')
else: else:
os.system('echo UUID=' + getMyUUID() + ' ' + locatin_neo + ' auto defaults 0 0 >> /etc/fstab') os.system('echo UUID=' + getMyUUID() + ' ' + locatin_neo + ' auto defaults 0 0 >> /etc/fstab')
os.system('echo UUID=' + getUUIDmy() + ' ' + locatIN_hdd + ' auto defaults 0 0 >> /etc/fstab')
cmd3 = "echo -e '\n%s '" % _('UUID set OK\n\nReboot...') cmd3 = "echo -e '\n%s '" % _('UUID set OK\n\nReboot...')
cmd4 = 'sleep 10; reboot -f' cmd4 = 'sleep 10; reboot -f'
self.session.open(Console, _('Disk Label...!'), [cmd, cmd1, cmd2,cmd3, cmd4]) self.session.open(Console, _('Disk Label...!'), [cmd, cmd1, cmd2,cmd3, cmd4])