def reinstallneoboot(self, answer): if answer is True: cmd0 = "echo -e '\n\nPrzywracanie ustawie\xc5\x84.....'" cmd = "echo -e '\n%s '" % _('Czekaj usuwam...') cmd1 = 'rm /sbin/multinit; sleep 2' cmd1a = "echo -e '\nNeoBoot usuwanie mened\xc5\xbcera rozruchu....'" cmd2 = 'rm /sbin/init; sleep 2' cmd3 = 'ln -sfn /sbin/init.sysvinit /sbin/init' cmd4 = 'chmod 777 /sbin/init; sleep 2' cmd4a = "echo -e '\nNeoBoot restoring media mounts....'" cmd6 = 'rm ' + getNeoLocation() + 'ImageBoot/.neonextboot;rm /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location; sleep 2' cmd7 = 'rm ' + getNeoLocation() + 'ImageBoot/.Flash; rm ' + getNeoLocation() + 'ImageBoot/.version' cmd7a = "echo -e '\n\nOdinstalowywanie neoboota...'" cmd8 = "echo -e '\n\nPrzywracanie montowania.'" cmd9 = "echo -e '\n\nNeoBoot odinstalowany, mozesz zrobic reinstalacje.'" self.session.openWithCallback(self.close, Console, _('NeoBoot is reinstall...'), [cmd0, cmd, cmd1, cmd1a, cmd2, cmd3, cmd4, cmd4a, cmd6, cmd7, cmd7a, cmd8, cmd9]) self.close()
def updateInfo(self): self.activityTimer.stop() f2 = open('' + getNeoLocation() + 'ImageBoot/.neonextboot', 'r') mypath2 = f2.readline().strip() f2.close() if mypath2 != 'Flash': self.myClose(_('Sorry, NeoBoot can installed or upgraded only when booted from Flash.')) self.close() else: os.system('mv /etc/enigma2 /etc/enigma2.tmp') os.system('mkdir -p /etc/enigma2') os.system('cp -f /etc/enigma2.tmp/*.tv /etc/enigma2') os.system('cp -f /etc/enigma2.tmp/*.radio /etc/enigma2') os.system('cp -f /etc/enigma2.tmp/lamedb /etc/enigma2') for fn in listdir('' + getNeoLocation() + 'ImageBoot'): dirfile = '' + getNeoLocation() + 'ImageBoot/' + fn if isdir(dirfile): target = dirfile + '/etc/' cmd = 'cp -r -f /etc/enigma2 ' + target system(cmd) target1 = dirfile + '/etc/tuxbox' cmd = 'cp -r -f /etc/tuxbox/satellites.xml ' + target1 system(cmd) target2 = dirfile + '/etc/tuxbox' cmd = 'cp -r -f /etc/tuxbox/terrestrial.xml ' + target2 system(cmd) os.system('rm -f -R /etc/enigma2') os.system('mv /etc/enigma2.tmp /etc/enigma2/') self.myClose(_('NeoBoot successfully updated list tv.\nHave fun !!'))
def kernel_update(self): os.system('echo "Flash " > ' + getNeoLocation() + 'ImageBoot/.neonextboot') out = open('' + getNeoLocation() + 'ImagesUpload/.kernel/used_flash_kernel', 'w') out.write('Used Kernel: Flash') out.close() cmd1 = 'rm -f /home/root/*.ipk; opkg download kernel-image; sleep 2; opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade /home/root/*.ipk; opkg configure update-modules' self.session.open(Console, _('NeoBoot....'), [cmd1]) self.close()
def updateInfo(self): linesdevice = open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location', 'r').readlines() deviceneo = linesdevice[0][0:-1] device = deviceneo usfree = '0' devicelist = ['cf', 'CF', 'hdd', 'card', 'sd', 'SD', 'usb', 'USB', 'usb2'] for d in devicelist: test = '/media/' + d + '/ImageBoot/.neonextboot' if fileExists(test): device = device + d rc = system('df > /tmp/ninfo.tmp') f = open('/proc/mounts', 'r') for line in f.readlines(): if line.find('/hdd') != -1: self.backupdir = '' + getNeoLocation() + 'NeoBootImageBackup' elif line.find('/usb') != -1: self.backupdir = '' + getNeoLocation() + 'NeoBootImageBackup' f.close() if pathExists(self.backupdir) == 0 and createDir(self.backupdir): pass if fileExists('/tmp/ninfo.tmp'): f = open('/tmp/ninfo.tmp', 'r') for line in f.readlines(): line = line.replace('part1', ' ') parts = line.strip().split() totsp = len(parts) - 1 if parts[totsp] == device: if totsp == 5: usfree = parts[3] else: usfree = parts[2] break f.close() os_remove('/tmp/ninfo.tmp') self.availablespace = usfree[0:-3] strview = _('Kopie Zapasowe znajduj\xc4\x85 si\xc4\x99 w katalogu /' + getNeoLocation() + 'NeoBootImageBackup') self['lab1'].setText(strview) strview = _('Ilo\xc5\x9b\xc4\x87 wolnego miejsca w Superbocie: ') + self.availablespace + ' MB' self['lab2'].setText(strview) imageslist = [] for fn in listdir(self.backupdir): imageslist.append(fn) self['list'].list = imageslist
def updateInfo(self): self.activityTimer.stop() f2 = open('' + getNeoLocation() + 'ImageBoot/.neonextboot', 'r') mypath2 = f2.readline().strip() f2.close() if mypath2 != 'Flash': self.myClose(_('Sorry, NeoBoot can installed or upgraded only when booted from Flash.')) self.close() elif not fileExists('/usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer'): self.myClose(_('Sorry, IPTVPlayer not found.')) self.close() else: for fn in listdir('' + getNeoLocation() + 'ImageBoot'): dirfile = '' + getNeoLocation() + 'ImageBoot/' + fn if isdir(dirfile): target = dirfile + '/usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer' cmd = 'rm -r ' + target + ' > /dev/null 2>&1' system(cmd) cmd = 'cp -r /usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer ' + target system(cmd) self.myClose(_('NeoBoot successfully updated IPTVPlayer.\nHave fun !!'))
def updateInfo(self): self.activityTimer.stop() f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') mypath2 = f2.readline().strip() f2.close() if mypath2 != 'Flash': self.myClose(_('Sorry, NeoBoot can installed or upgraded only when booted from Flash STB')) self.close() else: for fn in listdir('%sImageBoot' % getNeoLocation() ): dirfile = '%sImageBoot/' % getNeoLocation() + fn if isdir(dirfile): target = dirfile + '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' cmd = 'rm -r ' + target + ' > /dev/null 2>&1' system(cmd) cmd = 'cp -r /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot ' + target system(cmd) out = open('%sImageBoot/.version' % getNeoLocation(), 'w') out.write(PLUGINVERSION) out.close() self.myClose(_('NeoBoot successfully updated. You can restart the plugin now.\nHave fun !!'))
def __init__(self, session): Screen.__init__(self, session) self['lab1'] = Label('') self['lab2'] = Label('') self['lab3'] = Label(_('Wybierz kopi\xc4\x99 kt\xc3\xb3r\xc4\x85 chcesz przywr\xc3\xb3ci\xc4\x87')) self['key_red'] = Label(_('Restore')) self['key_green'] = Label(_('Delete')) self['list'] = List([]) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, 'ok': self.restoreImage, 'red': self.restoreImage, 'green': self.deleteback}) self.backupdir = '' + getNeoLocation() + 'NeoBootImageBackup' self.availablespace = '0' self.onShow.append(self.updateInfo)
def pedeleup(self, answer): if answer is True: cmd = "echo -e '\n\n%s '" % _('Czekaj usuwam.....') cmd1 = 'rm -r ' + getNeoLocation() + 'ImagesUpload/*.zip' self.session.open(Console, _('Usuwanie pobranych obraz\xc3\xb3w....'), [cmd, cmd1]) self.close()
def reinstallMB(self): system('/bin/tar -xzvf ' + getNeoLocation() + 'NeoBoot_Backup.tar.gz -C /') self.close()
from Screens.Screen import Screen from Tools.LoadPixmap import LoadPixmap from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, fileExists, pathExists, createDir 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 enigma import eTimer from stbbranding import getNeoLocation, getImageNeoBoot, getKernelVersionString, getBoxHostName, getCPUtype import os import time import sys import struct, shutil LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' PLUGINVERSION = '8.01' neoboot = getNeoLocation() def getKernelVersion(): try: return open('/proc/version', 'r').read().split(' ', 4)[2].split('-', 2)[0] except: return _('unknown') def getCPUtype(): cpu='UNKNOWN' if os.path.exists('/proc/cpuinfo'): with open('/proc/cpuinfo', 'r') as f: lines = f.read() f.close() if lines.find('ARMv7') != -1: cpu='ARMv7'