diff --git a/NeoBoot/plugin.py b/NeoBoot/plugin.py index 9634d8d..eb27bf3 100644 --- a/NeoBoot/plugin.py +++ b/NeoBoot/plugin.py @@ -1,18 +1,28 @@ #!/usr/bin/python # -*- coding: utf-8 -*- + ####################### _(-_-)_ gutosie _(-_-)_ ####################### - +# Copyright (c) , gutosie license +# +# Redystrybucja wersji programu i dokonywania modyfikacji JEST DOZWOLONE, pod warunkiem zachowania niniejszej informacji o prawach autorskich. +# Autor NIE ponosi JAKIEJKOLWIEK odpowiedzialnoĹ›ci za skutki uĹĽtkowania tego programu oraz za wykorzystanie zawartych tu informacji. +# Modyfikacje przeprowadzasz na wlasne ryzyko!!! +# O wszelkich zmianach prosze poinformować na http://all-forum.cba.pl w temacie pod nazwa -#[NEOBOOT]#- + +# This text/program is free document/software. Redistribution and use in +# source and binary forms, with or without modification, ARE PERMITTED provided +# save this copyright notice. This document/program is distributed WITHOUT any +# warranty, use at YOUR own risk. #neoboot modules -from __init__ import _ -from files.stbbranding import getLabelDisck, getINSTALLNeo, getNeoLocation, getLocationMultiboot, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getFSTAB, getFSTAB2, getKernelVersionString, getKernelImageVersion, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel + +#from __init__ import _ +from Plugins.Extensions.NeoBoot.__init__ import _ +from files.stbbranding import getLabelDisck, getINSTALLNeo, getNeoLocation, getLocationMultiboot, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getFSTAB, getFSTAB2, getKernelVersionString, getKernelImageVersion, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel, getImageDistroN, getFormat, getNEO_filesystems from files import Harddisk from Components.About import about -from enigma import getDesktop -from enigma import eTimer +from enigma import getDesktop, eTimer import urllib2, urllib from Screens.Screen import Screen -from Screens.Console import Console -#from files.nConsole import Console from Screens.MessageBox import MessageBox from Screens.ChoiceBox import ChoiceBox from Screens.VirtualKeyBoard import VirtualKeyBoard @@ -36,62 +46,60 @@ from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remov from os.path import dirname, isdir, isdir as os_isdir import os import time -LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' -# Copyright (c) , gutosie license -# -# Redystrybucja wersji programu i dokonywania modyfikacji JEST DOZWOLONE, pod warunkiem zachowania niniejszej informacji o prawach autorskich. -# Autor NIE ponosi JAKIEJKOLWIEK odpowiedzialności za skutki użtkowania tego programu oraz za wykorzystanie zawartych tu informacji. -# Modyfikacje przeprowadzasz na wlasne ryzyko!!! -# O wszelkich zmianach prosze poinformować na http://all-forum.cba.pl w temacie pod nazwa -#[NEOBOOT]#- +if fileExists('/etc/vtiversion.info') and fileExists('/.multinfo'): + from Screens.Console import Console +else: + from files.neoconsole import Console + +PLUGINVERSION = '9.00' +UPDATEVERSION = '9.00' +LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' -# This text/program is free document/software. Redistribution and use in -# source and binary forms, with or without modification, ARE PERMITTED provided -# save this copyright notice. This document/program is distributed WITHOUT any -# warranty, use at YOUR own risk. +try: + from enigma import addFont + font_osans = LinkNeoBoot + '/neoskins/osans.ttf' + font_sagoe = LinkNeoBoot + '/neoskins/sagoe.ttf' + addFont(font_osans, 'genel', 100, True) + addFont(font_sagoe, 'baslk', 100, True) + addFont(font_sagoe, 'tasat', 100, True) + addFont(font_sagoe, 'dugme', 90, True) +except: + print 'ERROR INSERTING FONT' + +def getDS(): + s = getDesktop(0).size() + return (s.width(), s.height()) -PLUGINVERSION = '8.02' -UPDATEVERSION = '8.25' +def isFHD(): + desktopSize = getDS() + return desktopSize[0] == 1920 + +def isHD(): + desktopSize = getDS() + return desktopSize[0] >= 1280 and desktopSize[0] < 1920 + +def isUHD(): + desktopSize = getDS() + return desktopSize[0] >= 1920 and desktopSize[0] < 3840 def Freespace(dev): statdev = os.statvfs(dev) space = statdev.f_bavail * statdev.f_frsize / 1024 print '[NeoBoot] Free space on %s = %i kilobytes' % (dev, space) return space - + + class MyUpgrade(Screen): - screenwidth = getDesktop(0).size().width() - if screenwidth and screenwidth == 1920: - skin = """ - - - \ - {"template": [MultiContentEntryText(pos = (90, 1), size = (920, 66), flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER, text = 0), - MultiContentEntryPixmapAlphaTest(pos = (8, 4), size = (66, 66), png = 1), - ], - "fonts": [gFont("Regular", 40)], - "itemHeight": 66 - } - - - - - """ + if isFHD(): + from Plugins.Extensions.NeoBoot.neoskins.default import MyUpgradeFULLHD + skin=MyUpgradeFULLHD + elif isUHD(): + from Plugins.Extensions.NeoBoot.neoskins.default import MyUpgradeUltraHD + skin=MyUpgradeUltraHD else: - skin = """ - - - - {"template": [MultiContentEntryText(pos = (90, 1), size = (920, 66), flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER, text = 0), - MultiContentEntryPixmapAlphaTest(pos = (8, 4), size = (66, 66), png = 1), - ], - "fonts": [gFont("Regular", 40)], - "itemHeight": 66 - } - - - - - """ + from Plugins.Extensions.NeoBoot.neoskins.default import MyUpgradeHD + skin=MyUpgradeHD + __module__ = __name__ def __init__(self, session): @@ -128,191 +136,58 @@ class MyUpgrade(Screen): self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] - if self.sel == 0 and self.session.open(MyUpgrade2): + if self.sel == 0 and self.goKeyOk(): pass self.close() + def goKeyOk(self): + from Plugins.Extensions.NeoBoot.files.tools import UpdateNeoBoot + self.session.open(UpdateNeoBoot) -class MyUpgrade2(Screen): - screenwidth = getDesktop(0).size().width() - if screenwidth and screenwidth == 1920: - skin = '' - else: - skin = '' - - def __init__(self, session): - Screen.__init__(self, session) - self['lab1'] = Label(_('NeoBoot: Upgrading in progress\nPlease wait...')) - self.activityTimer = eTimer() - self.activityTimer.timeout.get().append(self.updateInfo) - self.onShow.append(self.startShow) - - def startShow(self): - self.activityTimer.start(10) - - def updateInfo(self): - self.activityTimer.stop() - f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') - mypath2 = f2.readline().strip() - f2.close() - - if mypath2 != 'Flash' or fileExists('/.multinfo'): - 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 myClose(self, message): - ImageChoose = self.session.open(NeoBootImageChoose) - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close(ImageChoose) - - -class MyHelp(Screen): - screenwidth = getDesktop(0).size().width() - if screenwidth and screenwidth == 1920: - skin = """""" - else: - skin = """""" - - __module__ = __name__ - - def __init__(self, session): - Screen.__init__(self, session) - self['lab1'] = ScrollLabel('') - self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'DirectionActions'], {'back': self.close, - 'ok': self.close, - 'up': self['lab1'].pageUp, - 'left': self['lab1'].pageUp, - 'down': self['lab1'].pageDown, - 'right': self['lab1'].pageDown}) - self['lab1'].hide() - self.updatetext() - - def updatetext(self): - message = _('NeoBoot Ver. ' + PLUGINVERSION + ' Enigma2\n\nDuring the entire installation process does not restart the receiver !!!\n\n') - message += _('NeoBoot Ver. updates ' + UPDATEVERSION + ' \n\n') - message = _('For proper operation NeoBota type device is required USB stick or HDD, formatted on your system files Linux ext3 or ext4..\n\n') - message += _('1. If you do not have a media formatted with the ext3 or ext4 is open to the Device Manager , select the drive and format it.\n\n') - message += _('2. Go to the device manager and install correctly hdd and usb ...\n\n') - message += _('3. Install NeoBota on the selected device.\n\n') - message += _('4. Install the needed packages...\n\n') - message += _('5. For proper installation XenoBota receiver must be connected to the Internet.\n\n') - message += _('6. In the event of a problem with the installation cancel and inform the author of the plug of a problem.\n\n') - message += _('Have fun !!!') - message += _('Chcesz kupic tuner ? Polecam sklep : http://www.expert-tvsat.com/') - self['lab1'].show() - self['lab1'].setText(message) - - -class Opis(Screen): - screenwidth = getDesktop(0).size().width() - if screenwidth and screenwidth == 1920: - skin = """""" - else: - skin = """""" - __module__ = __name__ - def __init__(self, session): - Screen.__init__(self, session) - self['key_red'] = Label(_('Remove NeoBoot of STB')) - self['lab1'] = ScrollLabel('') - self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'DirectionActions'], {'back': self.close, - 'red': self.delete, - 'ok': self.close, - 'up': self['lab1'].pageUp, - 'left': self['lab1'].pageUp, - 'down': self['lab1'].pageDown, - 'right': self['lab1'].pageDown}) - self['lab1'].hide() - self.updatetext() - - def updatetext(self): - message = _('NeoBoot Ver. ' + PLUGINVERSION + '\n\n') - message += _('NeoBoot Ver. updates ' + UPDATEVERSION + '\n\n') - message += _('1. Requirements: For proper operation of the device NeoBota are required USB stick or HDD.\n\n') - message += _('2. NeoBot is fully automated\n\n') - message += _('3. To install a new image in MultiBocie should be sent by FTP software file compressed in ZIP or NIF to the folder: \n%sImagesUpload and remote control plugin NeoBoot use the green button \n\n') - message += _('4. For proper installation and operation of additional image multiboot, use only the image intended for your receiver. !!!\n\n') - message += _('5. By installing the multiboot images of a different type than for your model STB DOING THIS AT YOUR OWN RISK !!!\n\n') - message += _('6. The installed to multiboot images, it is not indicated update to a newer version.\n\n') - message += _('The authors plug NeoBot not liable for damage a receiver, NeoBoota incorrect use or installation of unauthorized additions or images.!!!\n\n') - message += _('Have fun !!!') - message += _('\nCompletely uninstall NeoBota: \nIf you think NeoBot not you need it, you can uninstall it.\nTo uninstall now press the red button on the remote control.\n\n') - self['lab1'].show() - self['lab1'].setText(message) - - def delete(self): - message = _('Are you sure you want to completely remove NeoBoota of your image?\n\nIf you choose so all directories NeoBoota will be removed.\nA restore the original image settings Flash.') - ybox = self.session.openWithCallback(self.mbdelete, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Removed successfully.')) - - def mbdelete(self, answer): - if answer is True: - if fileExists('/etc/fstab.org'): - system('rm -r /etc/fstab; mv /etc/fstab.org /etc/fstab') - if fileExists('/etc/init.d/volatile-media.sh.org'): - system(' mv /etc/init.d/volatile-media.sh.org /etc/init.d/volatile-media.sh; rm -r /etc/init.d/volatile-media.sh.org; chmod 755 /etc/init.d/volatile-media.sh ') - if os.path.isfile('%sImageBoot/.neonextboot' % getNeoLocation()): - os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.version; rm -f %sImageBoot/.Flash; ' % (getNeoLocation(), getNeoLocation(), getNeoLocation()) ) - if os.path.isfile('%sImagesUpload/.kernel ' % getNeoLocation()): - os.system('rm -r %sImagesUpload/.kernel' % getNeoLocation()) - cmd = "echo -e '\n\n%s '" % _('Recovering setting....\n') - cmd1 = 'rm -R ' + LinkNeoBoot + '' - cmd2 = 'rm -R /sbin/neoinit*' - cmd3 = 'ln -sfn /sbin/init.sysvinit /sbin/init' - cmd4 = 'opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade volatile-media; sleep 10; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Rebooting... "; reboot -d -f' - self.session.open(Console, _('NeoBot was removed !!! \nThe changes will be visible only after complete restart of the receiver.'), [cmd, - cmd1, - cmd2, - cmd3, - cmd4,]) - self.close() - - class NeoBootInstallation(Screen): - screenwidth = getDesktop(0).size().width() - if screenwidth and screenwidth == 1920: - skin = """""" + if isFHD(): + from Plugins.Extensions.NeoBoot.neoskins.default import NeoBootInstallationFULLHD + skin=NeoBootInstallationFULLHD + elif isUHD(): + from Plugins.Extensions.NeoBoot.neoskins.default import NeoBootInstallationUltraHD + skin=NeoBootInstallationUltraHD else: - skin = """\n \n \n \n \n \n \n \n \n """ + from Plugins.Extensions.NeoBoot.neoskins.default import NeoBootInstallationHD + skin=NeoBootInstallationHD + def __init__(self, session): Screen.__init__(self, session) self.list = [] self['config'] = MenuList(self.list) self['key_red'] = Label(_('Instruction')) self['key_green'] = Label(_('Installation')) -# self['key_yellow'] = Label(_('Info disc')) self['key_yellow'] = Label(_('SetDiskLabel')) self['key_blue'] = Label(_('Device Manager')) self['label1'] = Label(_('Welcome to NeoBoot %s Plugin installation.') % PLUGINVERSION) - self['label3'] = Label(_('WARNING !!! First, mount the device.')) + self['label3'] = Label(_('It is recommended to give a label to the disk.')) self['label2'] = Label(_('Here is the list of mounted devices in Your STB\nPlease choose a device where You would like to install NeoBoot')) self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'DirectionActions'], {'red': self.Instrukcja, 'green': self.checkinstall, -# 'yellow': self.datadrive, + 'ok': self.checkinstall, + 'key_menu': self.datadrive, 'yellow': self.SetDiskLabel, 'blue': self.devices, 'back': self.close}) self.updateList() + if fileExists('/etc/fstab'): + neoformat = getFormat() + writefile = open('/tmp/.neo_format' , 'w') + writefile.write(neoformat) + writefile.close() + def SetDiskLabel(self): from Plugins.Extensions.NeoBoot.files.devices import SetDiskLabel self.session.open(SetDiskLabel) def Instrukcja(self): - self.session.open(MyHelp) + from Plugins.Extensions.NeoBoot.files.tools import MyHelpNeo + self.session.open(MyHelpNeo) def datadrive(self): try: @@ -333,28 +208,87 @@ class NeoBootInstallation(Screen): pass def updateList(self): + mycf, myusb, myusb2, myusb3, mysd, mycard, myhdd, myssd = ('', '', '', '', '', '', '', '') + myoptions = [] if fileExists('/proc/mounts'): - with open('/proc/mounts', 'r') as f: - for line in f.readlines(): - if line.startswith('/dev/sd') and line.find('/media/neoboot') == -1 and (line.find('ext4') != -1 or line.find('ext3') != -1 or line.find('ext2') != -1): - try: self.list.append(line.split(' ')[1] + '/') - except Exception: pass # nie powinno sie zdarzyc, ale w razie czego - if len(self.list) == 0: - self['label2'].setText(_('Sorry it seems that there are not Linux formatted devices mounted on your STB. To install NeoBoot you need a Linux formatted part1 device. Click on the blue button to open Devices Panel')) - self['config'].setList(self.list) - + fileExists('/proc/mounts') + f = open('/proc/mounts', 'r') + for line in f.readlines(): + if line.find('/media/cf') != -1: + mycf = '/media/cf/' + continue + if line.find('/media/usb') != -1: + myusb = '/media/usb/' + continue + if line.find('/media/usb2') != -1: + myusb2 = '/media/usb2/' + continue + if line.find('/media/usb3') != -1: + myusb3 = '/media/usb3/' + continue + if line.find('/media/card') != -1: + mysd = '/media/card/' + continue + if line.find('/hdd') != -1: + myhdd = '/media/hdd/' + continue + if line.find('/ssd') != -1: + myhdd = '/media/ssd/' + continue + f.close() + else: + self['label2'].setText(_('Sorry it seems that there are not Linux formatted devices mounted on your STB. To install NeoBoot you need a Linux formatted part1 device. Click on the blue button to open Devices Panel')) + fileExists('/proc/mounts') + if mycf: + self.list.append(mycf) + else: + mycf + if myusb: + self.list.append(myusb) + else: + myusb + if myusb2: + self.list.append(myusb2) + else: + myusb2 + if myusb3: + self.list.append(myusb3) + else: + myusb3 + if mysd: + mysd + self.list.append(mysd) + else: + mysd + if mycard: + mycard + self.list.append(mycard) + else: + mycard + if myhdd: + myhdd + self.list.append(myhdd) + else: + myhdd + if myssd: + myssd + self.list.append(myssd) + else: + myssd + + self['config'].setList(self.list) + + def checkReadWriteDir(self, configele): - from Plugins.Extensions.NeoBoot.files import Harddisk - import os.path - import Plugins.Extensions.NeoBoot.files.Harddisk - supported_filesystems = frozenset(('ext4', 'ext3', 'ext2', 'ntfs', 'nfs', )) + supported_filesystems = frozenset(('ext4', 'ext3', 'ext2', 'nfs')) candidates = [] mounts = Harddisk.getProcMounts() + for partition in Harddisk.harddiskmanager.getMountedPartitions(False, mounts): if partition.filesystem(mounts) in supported_filesystems: candidates.append((partition.description, partition.mountpoint)) - + if candidates: locations = [] for validdevice in candidates: @@ -363,39 +297,22 @@ class NeoBootInstallation(Screen): if Harddisk.findMountPoint(os.path.realpath(configele)) + '/' in locations or Harddisk.findMountPoint(os.path.realpath(configele)) in locations: if fileExists(configele, 'w'): return True - else: - check = False - if check == False: - message = _('The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.') - message += _('Do you want install NeoBoot ?\n') - ybox = self.session.openWithCallback(self.install, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Install Manager')) - else: - dir = configele - self.session.open(MessageBox, _('The directory %s is not writable.\nMake sure you select a writable directory instead.') % dir, type=MessageBox.TYPE_ERROR) - return False - else: - check = False - if check == False: - message = _('The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.') - message += _('Do you want install NeoBoot ?\n') - ybox = self.session.openWithCallback(self.install, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Install Manager')) else: dir = configele - self.session.open(MessageBox, _('The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.') % dir, type=MessageBox.TYPE_ERROR) + self.session.open(MessageBox, _('The directory %s is not a ext2, ext3, ext4 or nfs partition.\nMake sure you select a valid partition type to install.') % dir, type=MessageBox.TYPE_ERROR) return False - else: - check = False - if check == False: - message = _('The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.') - message += _('Do you want install NeoBoot ?\n') - ybox = self.session.openWithCallback(self.install, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Install Manager')) + + elif getFormat() == 'ext4' or getFormat() == 'ext3' or getFormat() == 'ext2' or getFormat() == 'nfs' : + return True + else: dir = configele self.session.open(MessageBox, _('The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.') % dir, type=MessageBox.TYPE_ERROR) return False + else: + dir = configele + self.session.open(MessageBox, _('The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.\nIt may be helpful to restart the stb device completely.') % dir, type=MessageBox.TYPE_ERROR) + return False def devices(self): check = False @@ -407,25 +324,41 @@ class NeoBootInstallation(Screen): def device2(self, yesno): if yesno: - if fileExists('/usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager*/devicemanager.cfg'): - system('rm -f /usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager*/devicemanager.cfg; touch /usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager*/devicemanager.cfg') - if fileExists('/etc/devicemanager.cfg'): - system(' rm -f /etc/devicemanager.cfg; touch /etc/devicemanager.cfg ') +# if fileExists('/usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager*/devicemanager.cfg'): +# system('rm -f /usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager*/devicemanager.cfg; touch /usr/lib/enigma2/python/Plugins/SystemPlugins/DeviceManager*/devicemanager.cfg') +# if fileExists('/etc/devicemanager.cfg'): +# system(' rm -f /etc/devicemanager.cfg; touch /etc/devicemanager.cfg ') from Plugins.Extensions.NeoBoot.files.devices import ManagerDevice self.session.open(ManagerDevice) else: self.close() def checkinstall(self): + if fileExists('/.multinfo'): + mess = _('Sorry, Neoboot can be installed or upgraded only when booted from Flash') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + else: + self.checkinstall2() + + def checkinstall2(self): + if fileExists('/media/usb/ImageBoot/') and fileExists('/media/hdd/ImageBoot/'): + mess = _('An error was encountered, you have neoboot installed on usb and hdd.\nUninstall one directories from one drive.') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + + else: + self.checkinstall3() + + def checkinstall3(self): if checkInternet(): self.check_LabelDisck() else: - session.open(MessageBox, "Geen internet - Brak internetu", MessageBox.TYPE_INFO) + mess = _('Geen internet') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) def check_LabelDisck(self): system('blkid -c /dev/null /dev/sd* > ' + LinkNeoBoot + '/bin/reading_blkid; chmod 755 ' + LinkNeoBoot + '/bin/reading_blkid ') if getLabelDisck() != 'LABEL=': - message = _('NeoBot - First use yellow button and Set Disk Label !!!') + message = _('NeoBot - First use yellow button and Set Disk Label!\nWithout labeling disc neoboot may not work properly') ybox = self.session.openWithCallback(self.goSetDiskLabel, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Install Confirmation')) else: @@ -433,9 +366,10 @@ class NeoBootInstallation(Screen): def check_fstabUUID(self): if getFSTAB2() != 'UUID': - message = _('Disk UUID not found\n - Universally unique identifier (UUID) is not required.\nYou can proceed with further installation or give an ID to your disk.\nTo continue the installation neoboo, press OK or No to abort.') - ybox = self.session.openWithCallback(self.SetMountPointFSTAB, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Install Confirmation')) + message = (_('Disk UUID not found\n - Universally unique identifier (UUID) is not required.\nYou can proceed with further installation or give an ID to your disk.\nTo continue the installation neoboo, press OK or No to abort.')) + ybox = self.session.openWithCallback(self.SetMountPointFSTAB, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Install Confirmation')) + else: self.first_installation() @@ -460,29 +394,28 @@ class NeoBootInstallation(Screen): if yesno: self.first_installation() else: - self.myclose2(_('NeoBoot has not been installed ! :(' )) + self.myclose2(_('NeoBoot has not been installed ! :(' )) def first_installation(self): check = False if fileExists('/proc/mounts'): with open('/proc/mounts', 'r') as f: for line in f.readlines(): - if line.startswith('/dev/sd') and line.find('/media/neoboot') == -1 and (line.find('ext4') != -1 or line.find('ext3') != -1 or line.find('ext2') != -1): + if line.startswith('/dev/sd') and line.find('/media/hdd') or line.find('/media/usb') == -1 and (line.find('ext4') != -1 or line.find('ext3') != -1 or line.find('ext2') != -1): check = True break - + if check == False: self.session.open(MessageBox, _('Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to install NeoBoot!'), MessageBox.TYPE_INFO) else: self.mysel = self['config'].getCurrent() if self.checkReadWriteDir(self.mysel): - message = _('Do You really want to install NeoBoot in:\n ') + self.mysel + '?' + message = _('Do You really want to install NeoBoot in:\n ') + self.mysel + ' ?' ybox = self.session.openWithCallback(self.install2, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Install Confirmation')) else: self.close() -################# Next Install ################# def install2(self, yesno): print 'yesno:', yesno if yesno: @@ -490,9 +423,9 @@ class NeoBootInstallation(Screen): else: self.myclose2(_('NeoBoot has not been installed ! :(' )) - def first_installationNeoBoot(self): + def first_installationNeoBoot(self): self.mysel = self['config'].getCurrent() - system('cd ' + LinkNeoBoot + '/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./target/*.sh; chmod 0755 ./files/NeoBoot.sh; chmod 0755 ./files/userscript.sh; cp -rf ' + LinkNeoBoot + '/bin/neoini* /sbin cd;') + system('cd ' + LinkNeoBoot + '/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./tmpfiles/target/*.sh; chmod 0755 ./files/NeoBoot.sh; chmod 0755 ./files/userscript.sh; cp -rf ' + LinkNeoBoot + '/bin/neoini* /sbin cd;') cmd1 = 'mkdir ' + self.mysel + 'ImageBoot;mkdir ' + self.mysel + 'ImagesUpload' system(cmd1) cmd2 = 'mkdir ' + self.mysel + 'ImageBoot;mkdir ' + self.mysel + 'ImagesUpload/.kernel' @@ -504,10 +437,15 @@ class NeoBootInstallation(Screen): out.write(self.mysel) out.close() + if os.path.isfile('%sImageBoot/.neonextboot' % getNeoLocation()): + os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.version; rm -f %sImageBoot/.Flash; rm -f %sImageBoot/.imagedistro; rm -f %sImageBoot/.initneo.log; rm -f %sImageBoot/.updateversion' % ( getNeoLocation(), getNeoLocation(), getNeoLocation(), getNeoLocation(), getNeoLocation(), getNeoLocation()) ) + if os.path.isfile('%sImageBoot/.neonextboot' % getNeoLocation()): os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.version; rm -f %sImageBoot/.Flash; ' % (getNeoLocation(), getNeoLocation(), getNeoLocation()) ) - if os.path.isfile('%sImagesUpload/.kernel/zImage*.ipk or %sImagesUpload/.kernel/zImage*.bin' % ( getNeoLocation(),getNeoLocation()) ): + + if os.path.isfile('%sImagesUpload/.kernel/zImage*.ipk or %sImagesUpload/.kernel/zImage*.bin' % ( getNeoLocation(), getNeoLocation()) ): os.system('rm -f %sImagesUpload/.kernel/zImage*.ipk; rm -f %sImagesUpload/.kernel/zImage*.bin' % ( getNeoLocation(),getNeoLocation()) ) + if fileExists('/etc/issue.net'): try: lines = open('/etc/hostname', 'r').readlines() @@ -519,20 +457,49 @@ class NeoBootInstallation(Screen): out1 = open('%sImageBoot/.version' % getNeoLocation(), 'w') out1.write(PLUGINVERSION) - out1.close() - + out1.close() out2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w') out2.write('Flash ') out2.close() - out3 = open('' + LinkNeoBoot + '/.neo_info', 'w') out3.write('Kernel\n') out3.write('Kernel-Version: ' + about.getKernelVersionString() + '\n') out3.write('NeoBoot\n') out3.write('NeoBoot-Version: ' + PLUGINVERSION + '\n') out3.close() + out = open('%sImageBoot/.updateversion' % getNeoLocation(), 'w') + out.write(UPDATEVERSION) + out.close() - os.system('touch ' + LinkNeoBoot + '/files/%s' % getBoxHostName()) + if fileExists('/usr/lib/enigma2/python/boxbranding.so'): + from boxbranding import getImageDistro + imagedistro = getImageDistro() + writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') + writefile.write(imagedistro) + writefile.close() + elif fileExists('/usr/lib/enigma2/python/Plugins/PLi'): + obraz = open('/etc/issue.net', 'r').readlines() + imagetype = obraz[0][:-3] + image = imagetype + writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') + writefile.write(imagetype) + writefile.close() + elif fileExists('/etc/vtiversion.info'): + f = open("/etc/vtiversion.info",'r') + imagever = f.readline().strip().replace("Release ", " ") + f.close() + image = imagever + writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') + writefile.write(imagever) + writefile.close() + elif fileExists('/etc/bhversion'): + f = open("/etc/bhversion",'r') + imagever = f.readline().strip() + f.close() + image = imagever + writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') + writefile.write(imagever) + writefile.close() if os.system('opkg update; opkg list-installed | grep python-subprocess') != 0: os.system('opkg install python-subprocess') @@ -540,55 +507,56 @@ class NeoBootInstallation(Screen): os.system('opkg install python-argparse') if os.system('opkg list-installed | grep curl') != 0: os.system('opkg install curl') - if os.system('opkg list-installed | grep packagegroup-base-nfs') != 0: - os.system('opkg install packagegroup-base-nfs') - if os.system('opkg list-installed | grep ofgwrite') != 0: - os.system('opkg install ofgwrite') - if os.system('opkg list-installed | grep bzip2') != 0: - os.system('opkg install bzip2') - if os.system('opkg list-installed | grep mtd-utils') != 0: - os.system('opkg install mtd-utils') - if os.system('opkg list-installed | grep mtd-utils-ubifs') != 0: - os.system('opkg install mtd-utils-ubifs') - if os.system('opkg list-installed | grep mtd-utils-jffs2') != 0: + + if getCPUtype() == 'MIPS': + if os.system('opkg list-installed | grep kernel-module-nandsim') != 0: + os.system('opkg install kernel-module-nandsim') + if os.system('opkg list-installed | grep mtd-utils-jffs2') != 0: os.system('opkg install mtd-utils-jffs2') - if os.system('opkg list-installed | grep kernel-module-nandsim') != 0: - os.system('opkg install kernel-module-nandsim') - if os.system('opkg list-installed | grep lzo') != 0: + if os.system('opkg list-installed | grep lzo') != 0: os.system('opkg install lzo') - if os.system('opkg list-installed | grep python-setuptools') != 0: + if os.system('opkg list-installed | grep python-setuptools') != 0: os.system('opkg install python-setuptools') - if os.system('opkg list-installed | grep util-linux-sfdisk') != 0: + if os.system('opkg list-installed | grep util-linux-sfdisk') != 0: os.system('opkg install util-linux-sfdisk') - + if os.system('opkg list-installed | grep packagegroup-base-nfs') != 0: + os.system('opkg install packagegroup-base-nfs') + if os.system('opkg list-installed | grep ofgwrite') != 0: + os.system('opkg install ofgwrite') + if os.system('opkg list-installed | grep bzip2') != 0: + os.system('opkg install bzip2') + if os.system('opkg list-installed | grep mtd-utils') != 0: + os.system('opkg install mtd-utils') + if os.system('opkg list-installed | grep mtd-utils-ubifs') != 0: + os.system('opkg install mtd-utils-ubifs') + # ARM - OctagonSF4008 - DM900 - Zgemma h7S - Octagon sf 8008 - AX HD60 4K #gbquad4k arm , #osmio4k arm, #Zgemma h9 arm, #Zgemma h7S arm , #Octagon SF4008 - if getBoxHostName() == 'ax51' or getBoxHostName() == 'dm920' or getBoxHostName() == 'et1x000' or getBoxHostName() == 'ustym4kpro' or getTunerModel() == 'ustym4kpro' or getCPUSoC() == 'bcm7251' or getBoxHostName() == 'sf4008' or getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7' or getCPUSoC() == 'bcm7252s' or getBoxHostName() == 'gbquad4k' or getBoxHostName == 'osmio4k' or getBoxHostName() == 'zgemmah9s' or getBoxHostName() == 'h9combo' or getBoxHostName() == 'h10' or getBoxHostName() == 'ax60' or getBoxHostName() == 'sf8008' or getCPUSoC() == 'bcm7251' or getCPUSoC() == 'BCM97252SSFF' or getBoxHostName() == 'dm900': - os.system('cp -f ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv ' + LinkNeoBoot + '/target/arm_run.py ' + LinkNeoBoot + '/run.py; cd') + if getBoxHostName() == 'ax51' or getBoxHostName() == 'dm920' or getBoxHostName() == 'et1x000' or getCPUSoC() == 'bcm7251' or getBoxHostName() == 'sf4008' or getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7' or getCPUSoC() == 'bcm7252s' or getBoxHostName() == 'gbquad4k' or getBoxHostName == 'osmio4k' or getBoxHostName() == 'zgemmah9s' or getBoxHostName() == 'h9combo' or getBoxHostName() == 'h10' or getBoxHostName() == 'ax60' or getBoxHostName() == 'sf8008' or getCPUSoC() == 'bcm7251' or getCPUSoC() == 'BCM97252SSFF' or getBoxHostName() == 'dm900': + os.system('cp -f ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv ' + LinkNeoBoot + '/tmpfiles/runpy/arm_run.py ' + LinkNeoBoot + '/run.py; cd') #VUPLUS ARM elif getCPUtype() == 'ARMv7' and getBoxHostName() != 'ustym4kpro': if getCPUSoC() == '7278' or getBoxHostName() == 'vuduo4k': os.system('cd ' + LinkNeoBoot + '/' ) -# os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarmvu; mv ' + LinkNeoBoot + '/target/duo4k_run.py ' + LinkNeoBoot + '/run.py; cd') - os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv ' + LinkNeoBoot + '/target/duo4k_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv ' + LinkNeoBoot + '/tmpfiles/runpy/duo4k_run.py ' + LinkNeoBoot + '/run.py; cd') os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu') os.system('dd if=/dev/mmcblk0p6 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())) - os.system('mv ' + LinkNeoBoot + '/target/vuDuo4Kmmcblk0p6.sh ' + LinkNeoBoot + '/files/kernel.sh; cd') + os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vuDuo4Kmmcblk0p6.sh ' + LinkNeoBoot + '/files/kernel.sh; cd') - elif getCPUSoC() == '72604' or getBoxHostName() == 'vuzero4k': + elif getCPUSoC() == '72604' or getBoxHostName() == 'vuzero4k': os.system('cd ' + LinkNeoBoot + '/' ) os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarmvu; cd') os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu') os.system('dd if=/dev/mmcblk0p4 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())) - os.system('mv ' + LinkNeoBoot + '/target/vuZero4Kmmcblk0p4.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/target/zero4k_run.py ' + LinkNeoBoot + '/run.py; cd') - + os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vuZero4Kmmcblk0p4.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/tmpfiles/runpy/zero4k_run.py ' + LinkNeoBoot + '/run.py; cd') + #Zgemma h7S arm elif getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7': os.system('cd ' + LinkNeoBoot + '/' ) os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cd') os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarm') - os.system('python ' + LinkNeoBoot + '/target/findkerneldevice.py; dd if=/dev/kernel of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) ) - os.system('mv ' + LinkNeoBoot + '/target/h7s_kernel.sh ' + LinkNeoBoot + '/files/kernel.sh;mv ' + LinkNeoBoot + '/target/h7s_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('python ' + LinkNeoBoot + '/tmpfiles/runpy/findkerneldevice.py; dd if=/dev/kernel of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) ) + os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/h7s_kernel.sh ' + LinkNeoBoot + '/files/kernel.sh;mv ' + LinkNeoBoot + '/tmpfiles/runpy/h7s_run.py ' + LinkNeoBoot + '/run.py; cd') elif getCPUSoC() or getBoxHostName() == ['7444s', '7252s', @@ -601,8 +569,22 @@ class NeoBootInstallation(Screen): os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarmvu; cd') os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu') os.system('dd if=/dev/mmcblk0p1 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) ) - os.system('mv ' + LinkNeoBoot + '/target/vu_mmcblk0p1.sh ' + LinkNeoBoot + '/files/kernel.sh;mv ' + LinkNeoBoot + '/target/vu4k_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/vu_mmcblk0p1.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu4k_run.py ' + LinkNeoBoot + '/run.py; cd') + # ARM - ustym4kpro + # ARM - ustym4kpro + elif getBoxHostName() == 'ustym4kpro': + os.system('opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade kernel-image;cp -f /tmp/findkerneldevice.py ' + LinkNeoBoot + '/files/findkerneldevice.py; dd if=/dev/kernel of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) ) + if fileExists('/tmp/findkerneldevice.py'): + os.sytem('cp -fr /tmp/findkerneldevice.py ' + LinkNeoBoot + '/files/findkerneldevice.py; ') + else: + os.sytem('mv ' + LinkNeoBoot + '/tmpfiles/runpy/findustym.py ' + LinkNeoBoot + '/files/findkerneldevice.py') + os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm') + os.system('chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init') + os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cd') + os.system('mv ' + LinkNeoBoot + '/tmpfiles/target/ustym4kpro.sh ' + LinkNeoBoot + '/files/kernel.sh; mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/tmpfiles/runpy/target/ustym4kpro.py /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/run.py; cd') + + # MIPS elif getCPUtype() == 'MIPS': if getCPUSoC() or getBoxHostName() or getTunerModel() == ['7335', @@ -644,7 +626,7 @@ class NeoBootInstallation(Screen): os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd1 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz' ) elif not fileExists ('/usr/sbin/nanddump'): os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; ' + LinkNeoBoot + '/bin/nanddump_mips /dev/mtd1 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz' ) - os.system('cd ' + LinkNeoBoot + '/; rm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/target/vu_dev_mtd1.sh ' + LinkNeoBoot + '/files/kernel.sh;mv ' + LinkNeoBoot + '/target/vu_mtd1_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('cd ' + LinkNeoBoot + '/; rm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/tmpfiles/target/vu_dev_mtd1.sh ' + LinkNeoBoot + '/files/kernel.sh;mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu_mtd1_run.py ' + LinkNeoBoot + '/run.py; cd') #vuplus stb mtd2 elif getBoxHostName() == 'vusolo2' or getBoxHostName() == 'vuduo2' or getBoxHostName() == 'vusolose' or getBoxHostName() == 'vuzero': @@ -652,16 +634,16 @@ class NeoBootInstallation(Screen): os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd2 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz' ) elif not fileExists ('/usr/sbin/nanddump'): os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; ' + LinkNeoBoot + '/bin/nanddump_mips /dev/mtd2 > vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz' ) - os.system('cd ' + LinkNeoBoot + '/; rm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/target/vu_dev_mtd2.sh ' + LinkNeoBoot + '/files/kernel.sh;mv ' + LinkNeoBoot + '/target/vu_mtd2_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('cd ' + LinkNeoBoot + '/; rm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/tmpfiles/target/vu_dev_mtd2.sh ' + LinkNeoBoot + '/files/kernel.sh;mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu_mtd2_run.py ' + LinkNeoBoot + '/run.py; cd') # mbultra elif getCPUSoC() == 'bcm7424' or getBoxHostName == 'mbultra' or getTunerModel() == 'ini-8000sv': os.system('cd; cd /media/neoboot/ImagesUpload/.kernel; /usr/sbin/nanddump /dev/mtd2 -o > vmlinux.gz; mv /home/root/vmlinux.gz /media/neoboot/ImagesUpload/.kernel/') - os.system('cd ' + LinkNeoBoot + '/; rm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/target/vu_dev_mtd2.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/target/vu_mtd2_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('cd ' + LinkNeoBoot + '/; rm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/tmpfiles/target/vu_dev_mtd2.sh ' + LinkNeoBoot + '/files/kernel.sh; mv ' + LinkNeoBoot + '/tmpfiles/runpy/vu_mtd2_run.py ' + LinkNeoBoot + '/run.py; cd') #inne stb elif getCPUSoC() == 'bcm73625' or getCPUSoC() == 'bcm7358' or getCPUSoC() == 'bcm7362' or getCPUSoC() == 'BCM7362' or getCPUSoC() == 'bcm7356' or getCPUSoC() == 'bcm7241' or getCPUSoC() == 'bcm7362' or getBoxHostName() == 'formuler3' or getBoxHostName() == 'formuler4turbo' or getBoxHostName() == 'mbmini' or getBoxHostName() == 'osmini' or getTunerModel() == 'ini-1000sv' or getTunerModel() == 'h3': - os.system('cd ' + LinkNeoBoot + '/; mv ./bin/fontforneoboot.ttf /usr/share/fonts; mv ./bin/libpngneo /usr/lib; cp -f ./bin/neoinitmips /sbin/neoinitmips; cp -f ./bin/neoinitmipsvu /sbin/neoinitmipsvu; chmod 0755 /sbin/neoinit*; chmod 0755 ./bin/neobm; chmod 0755 /usr/lib/libpngneo; cd; chmod 0755 /sbin/neoinitmips; ln -sf /media/neoboot/ImageBoot/.neonextboot /etc/neoimage; mv ' + LinkNeoBoot + '/target/mips_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('cd ' + LinkNeoBoot + '/; mv ./bin/fontforneoboot.ttf /usr/share/fonts; mv ./bin/libpngneo /usr/lib; cp -f ./bin/neoinitmips /sbin/neoinitmips; cp -f ./bin/neoinitmipsvu /sbin/neoinitmipsvu; chmod 0755 /sbin/neoinit*; chmod 0755 ./bin/neobm; chmod 0755 /usr/lib/libpngneo; cd; chmod 0755 /sbin/neoinitmips; ln -sf /media/neoboot/ImageBoot/.neonextboot /etc/neoimage; mv ' + LinkNeoBoot + '/tmpfiles/runpy/mips_run.py ' + LinkNeoBoot + '/run.py; cd') os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmips; cp -Rf ' + LinkNeoBoot + '/bin/neoinitmipsvu /sbin/neoinitmipsvu') os.system('chmod 755 ' + LinkNeoBoot + '/bin/nfidump; chmod 0755 ' + LinkNeoBoot + '/bin/nanddump_mips; rm -r ' + LinkNeoBoot + '/bin/neoinitar*; cd') @@ -671,48 +653,54 @@ class NeoBootInstallation(Screen): os.system('mv -f /home/root/vmlinux.gz %sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName()) ) if getCPUtype() == 'ARMv7': - os.system('cd ' + LinkNeoBoot + '/; mv ./bin/fbcleararm ./bin/fbclear; rm -f ./bin/fbclearmips; mv ./ubi_reader_arm ./ubi_reader; rm -r ./ubi_reader_mips; rm ./bin/neoinitmips; rm ./bin/neoinitmipsvu; rm -r ./bin/nanddump_mips; rm ./bin/nfidump; rm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; cd') + os.system('cd ' + LinkNeoBoot + '/; mv ./bin/fbcleararm ./bin/fbclear; rm -f ./bin/fbclearmips; mv ./ubi_reader_arm ./ubi_reader; rm -r ./ubi_reader_arm; rm -r ./ubi_reader_mips; rm ./bin/neoinitmips; rm ./bin/neoinitmipsvu; rm -r ./bin/nanddump_mips; rm ./bin/nfidump; rm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; cd') elif getCPUtype() == 'MIPS': - os.system('cd ' + LinkNeoBoot + '/; mv ./bin/fbclearmips ./bin/fbclear; rm -f ./bin/fbcleararm; mv ./ubi_reader_mips ./ubi_reader; rm -r ./ubi_reader_arm; rm -f /bin/neoinitarm; rm -f /bin/neoinitarmvu; rm -r ./bin/nanddump_arm') + os.system('cd ' + LinkNeoBoot + '/; mv ./bin/fbclearmips ./bin/fbclear; rm -f ./bin/fbcleararm; mv ./ubi_reader_mips ./ubi_reader; rm -r ./ubi_reader_mips; rm -r ./ubi_reader_arm; rm -f /bin/neoinitarm; rm -f /bin/neoinitarmvu; rm -r ./bin/nanddump_arm') - os.system(' ln -sfn ' + getNeoLocation() + 'ImageBoot/.neonextboot /etc/neoimage; chmod 644 ' + getNeoLocation() + 'ImagesUpload/.kernel/*; ln -sfn ' + getNeoLocation() + 'ImageBoot /etc/imageboot; rm -r ' + LinkNeoBoot + '/target; chmod 0755 ' + LinkNeoBoot + '/files/kernel.sh ') - - os.system('chmod 0755 ' + LinkNeoBoot + '/files/neo_location') - + os.system(' ln -sfn ' + getNeoLocation() + 'ImageBoot/.neonextboot /etc/neoimage; chmod 644 ' + getNeoLocation() + 'ImagesUpload/.kernel/*; ln -sfn ' + getNeoLocation() + 'ImageBoot /etc/imageboot; rm -r ' + LinkNeoBoot + '/tmpfiles; chmod 0755 ' + LinkNeoBoot + '/files/kernel.sh ') + if os.path.isfile('' + LinkNeoBoot + '/.location'): if getLabelDisck() != 'LABEL=': - cmd = "echo -e '\n%s '" % _('NeoBoot has been installed succesfully !') - cmd1 = "echo -e '\n%s '" % _('NeoBoot has detected that the disks do not have a Label name.\nDo poprawnego dzialania neoboot prosze nadac dla dyskow nazwy !!! LABEL\nZalecany calkowity rstart tunera ' + getBoxHostName() + '\nNeoBoot zainstalowano w lokalizacji: ' + getNeoLocation() + '\n') + cmd = "echo -e '\n%s '" % _('NeoBoot has been installed succesfully!\nNeoBoot has detected that the disks do not have a label.\nFor correct neo boot operation, please give the disks the name LABEL\nRecommended total restart of the tuner.\n') elif getLabelDisck() == 'LABEL=': - cmd = "echo -e '\n%s '" % _('NeoBoot has been installed succesfully !') - cmd1 = "echo -e '\n%s '" % _('NeoBoot has detected that the disks have been labeled.\nZalecany calkowity rstart tunera ' + getBoxHostName() + '\nNeoBoot zainstalowano w lokalizacji: ' + getNeoLocation() + '\n') - else: + cmd = "echo -e '\n%s '" % _('Installed succesfully NEOBOOT!\nNeoBoot has detected that the disks have been marked.\nRecommended total restart of the tuner\n') + else: self.myclose2(_('NeoBoot has not been installed ! :(' )) - - self.session.open(Console, _('NeoBoot Install....'), [cmd, cmd1]) - self.close() - - if fileExists('/media/usb/ImageBoot/') and fileExists('/media/hdd/ImageBoot/'): - self.messagebox = self.session.open(MessageBox, _('[NeoBoot] \nError, you have neoboot installed on usb and hdd, \nUninstall one directories from one drive !!!\n'), MessageBox.TYPE_INFO, 8) - self.close() - else: - self.close() - + + closereboot = self.rebootSTBE2() + self.session.open(Console, _('NeoBoot Install....'), [cmd]) + self.close(closereboot) + + def myclose2(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + + + def rebootSTBE2(self): + restartbox = self.session.openWithCallback(self.RebootSTB, MessageBox, _('Reboot stb now ?'), MessageBox.TYPE_YESNO) + restartbox.setTitle(_('Reboot')) + + def RebootSTB(self, answer): + if answer is True: + os.system('sync && echo 3 > /proc/sys/vm/drop_caches; reboot -d -f') + else: + self.close() + class NeoBootImageChoose(Screen): - screenwidth = getDesktop(0).size().width() - if screenwidth and screenwidth == 1920: - skin = """ - """ + if isFHD(): + from usedskin import ImageChooseFULLHD + skin=ImageChooseFULLHD + elif isUHD(): + from Plugins.Extensions.NeoBoot.neoskins.default import ImageChooseULTRAHD + skin=ImageChooseULTRAHD else: - skin = """ - \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t Format:%A %e %B %Y \t\t\t""" + from Plugins.Extensions.NeoBoot.neoskins.default import ImageChooseHD + skin=ImageChooseHD def __init__(self, session): - Screen.__init__(self, session) + Screen.__init__(self, session) + if not fileExists('' + LinkNeoBoot + '/files/mountpoint.sh'): os.system('touch ' + LinkNeoBoot + '/files/mountpoint.sh; echo "#!/bin/sh\n#DESCRIPTION=This script by gutosie\n" >> ' + LinkNeoBoot + '/files/mountpoint.sh; chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh') if getNeoMount() == 'hdd_install_/dev/sda1': @@ -754,10 +742,6 @@ class NeoBootImageChoose(Screen): elif getNeoMount5() == 'mmc_install_/dev/sdb1': os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/mmc\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - - if not fileExists('' + LinkNeoBoot + '/files/neom'): - os.system('chmod 0755 ' + LinkNeoBoot + '/files/neo_location; ' + LinkNeoBoot + '/files/neo_location; chmod 0755 ' + LinkNeoBoot + '/files/neom') - if not fileExists('' + LinkNeoBoot + '/files/neo.sh'): system('' + LinkNeoBoot + '/files/mountpoint.sh') system('echo ' + getLocationMultiboot() + ' > ' + LinkNeoBoot + '/bin/install; chmod 0755 ' + LinkNeoBoot + '/bin/install') @@ -809,71 +793,13 @@ class NeoBootImageChoose(Screen): os.system('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh; rm -f /.control_boot_new_image; echo "Image uruchomione OK\nNie kasuj tego pliku. \n\nImage started OK\nDo not delete this file." > /.control_ok ') if not fileExists('/.control_boot_new_image'): os.system('echo "Image uruchomione OK\nNie kasuj tego pliku. \n\nImage started OK\nDo not delete this file." > /.control_ok') - #os.system('touch /.control_ok ') - - if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': - if os.path.exists('/proc/stb/info/boxtype'): - if getBoxHostName == 'sf4008': #getCPUSoC() == 'bcm7251' - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p4 /media/mmc') - - if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': - if os.path.exists('/proc/stb/info/boxtype'): - if getBoxHostName == 'et1x000': #getCPUSoC() == 'bcm7251' or - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p4 /media/mmc') - - if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': - if os.path.exists('/proc/stb/info/boxtype'): - if getBoxHostName == 'ax51': #getCPUSoC() == 'bcm7251s' or - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p4 /media/mmc') - - if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': - if os.path.exists('/proc/stb/info/boxtype'): - if getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p3 /media/mmc') - - if os.path.exists('/proc/stb/info/boxtype'): - if getBoxHostName() == 'zgemmah9s': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p7 /media/mmc') - -# if os.path.exists('/proc/stb/info/boxtype'): -# if getBoxHostName() == 'zgemmah9combo': -# os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p7 /media/mmc') - - if getBoxHostName == 'sf8008': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p13 /media/mmc') - - if getBoxHostName == 'ax60': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p21 /media/mmc') - - if getBoxHostName() == 'ustym4kpro' or getTunerModel() == 'ustym4kpro': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p13 /media/mmc') - - if os.path.exists('/proc/stb/info/model'): - if getTunerModel() == 'dm900' or getCPUSoC() == 'BCM97252SSFF': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p2 /media/mmc') - - if getBoxVuModel() == 'uno4kse' or getBoxVuModel() == 'uno4k' or getBoxVuModel() == 'ultimo4k' or getBoxVuModel() == 'solo4k': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p4 /media/mmc') - - if getBoxVuModel() == 'zero4k': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p7 /media/mmc') - - if getBoxVuModel() == 'duo4k': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p9 /media/mmc') - - if getCPUSoC() == 'bcm7252s' or getBoxHostName() == 'gbquad4k': - os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p5 /media/mmc') - - #if getBoxHostName == 'osmio4k': - #os.system('mkdir -p /media/mmc; mount /dev/mmcblk0p5 /media/mmc') - + self.list = [] self.setTitle(' NeoBoot %s - Menu' % PLUGINVERSION + ' ' + 'Ver. update: %s' % UPDATEVERSION) self['device_icon'] = Pixmap() self['progreso'] = ProgressBar() self['linea'] = ProgressBar() self['config'] = MenuList(self.list) -# self['key_red'] = Label(_('Boot Image')) self['key_red'] = Label(_('Download Image')) self['key_green'] = Label(_('Installation')) self['key_yellow'] = Label(_('Remove Image ')) @@ -881,7 +807,7 @@ class NeoBootImageChoose(Screen): self['key_menu'] = Label(_('More options')) self['key_1'] = Label(_('Update NeoBot')) self['key_2'] = Label(_('Reinstall NeoBoot')) - self['key_3'] = Label(_('Install Kernel')) + self['key_3'] = Label(_('Reinstall kernel')) self['label1'] = Label(_('Please choose an image to boot')) self['label2'] = Label(_('NeoBoot is running from:')) self['label3'] = Label('') @@ -889,34 +815,37 @@ class NeoBootImageChoose(Screen): self['label5'] = Label('') self['label6'] = Label('') self['label7'] = Label('') - self['label8'] = Label(_('Number of images installed:')) - self['label19'] = Label('') + self['label8'] = Label(_('Number of images installed:')) self['label9'] = Label('') self['label10'] = Label('') self['label11'] = Label('') self['label12'] = Label('') self['label13'] = Label(_('Version update: ')) self['label14'] = Label(_('NeoBoot version: ')) - self['label15'] = Label(_('Memory disc:')) + self['label15'] = Label(_('Memory disc:')) + self['label16'] = Label(_('Kernel')) + self['label17'] = Label('') + self['label18'] = Label('') + self['label19'] = Label('') + self['label20'] = Label('') + self['label21'] = Label('NEO VIP') self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'MenuActions', 'NumberActionMap', 'SetupActions', - 'number'], {'ok': self.boot, -# 'red': self.boot, + 'number'], {'ok': self.bootIMG, 'red': self.DownloadImageOnline, 'green': self.ImageInstall, - 'yellow': self.remove, + 'yellow': self.removeIMG, 'blue': self.pomoc, - 'ok': self.boot, 'menu': self.mytools, '1': self.neoboot_update, '2': self.ReinstallNeoBoot, '3': self.ReinstallKernel, '4': self.ReinstallKernel, - '5': self.boot, #hidden option - '9': self.boot, #hidden option + '5': self.bootIMG, #hidden option + '9': self.bootIMG, #hidden option 'back': self.close_exit}) if not fileExists('/etc/name'): os.system('touch /etc/name') @@ -924,9 +853,9 @@ class NeoBootImageChoose(Screen): def DownloadImageOnline(self): if not os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py'): - message = _('[NeoBoot] Image Downloader - download plugin not installed!\nZainstalowac wtyczke do pobierania nowych image ? \n---Continue ?--- ' ) + message = _('Plugin ImageDownloader not installed!\nInstall plugin to download new image? \and---Continue ?---' ) ybox = self.session.openWithCallback(self.InstallImageDownloader, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Installation with risk ')) + ybox.setTitle(_('Installation')) else: from Plugins.Extensions.ImageDownloader.main import STBmodelsScreen self.session.open(STBmodelsScreen) @@ -939,10 +868,10 @@ class NeoBootImageChoose(Screen): system(cmd1) cmd2 = 'opkg install --force-overwrite --force-reinstall --force-downgrade /tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk' system(cmd2) - self.session.open(MessageBox, _('Wtyczka zosta\xc5\x82a pomy\xc5\x9blnie zainstalowana.'), MessageBox.TYPE_INFO, 5) + self.session.open(MessageBox, _('The plug-in has been successfully installed.'), MessageBox.TYPE_INFO, 5) self.close() else: - mess = _('[NeoBoot] \nPlease upload the image files in .ZIP or .NFI formats to install. ' ) + mess = _('Upload image files in zip formats to the ImagesUpload location.' ) self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) @@ -951,21 +880,18 @@ class NeoBootImageChoose(Screen): ybox = self.session.openWithCallback(self.updatekernel, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Updating ... ')) def pomoc(self): - if fileExists('/.multinfo'): - mess = _('Information available only when running Flash.') - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) - else: + from Plugins.Extensions.NeoBoot.files.tools import Opis self.session.open(Opis) def ReinstallNeoBoot(self): INSTALLbox = self.session.openWithCallback(self.reinstallboot, MessageBox, _('Select Yes to reinstall the neoboot.\n NEOBOOT.'), MessageBox.TYPE_YESNO) - INSTALLbox.setTitle(_('Zainstalować ponownie neoboota ?')) + INSTALLbox.setTitle(_('Reinstall neoboot')) def reinstallboot(self, answer): if answer is True: try: cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Please reinstall NeoBoot....\nPlease wait, done...\nrestart systemu...') - cmd1 = 'cd ' + LinkNeoBoot + '/; rm ./bin/install; rm ./.location; rm ./files/mountpoint.sh; rm ./files/neom; rm ./files/neo.sh; sleep 5; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Restarting E2... "; init 4; sleep 1; init 3 ' + cmd1 = 'cd ' + LinkNeoBoot + '/; rm ./bin/install; rm ./.location; rm ./files/mountpoint.sh; rm ./files/neo.sh; sleep 5; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Restarting E2... "; init 4; sleep 1; init 3 ' except: False self.session.open(Console, _('NeoBoot ARM....'), [cmd, cmd1]) @@ -983,12 +909,10 @@ class NeoBootImageChoose(Screen): out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w' ) out.write('Flash') out.close() -# if fileExists('/media/sda1' or '/media/sdb1'): -# self.session.open(MessageBox, _('NeoBoot - Please restart the system !!!'), MessageBox.TYPE_INFO, 10) self.close() elif fileExists('/.multinfo'): - with open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r' ) as f: + with open('/.multinfo', 'r' ) as f: imagefile = f.readline().strip() f.close() out = open('%sImageBoot/.neonextboot'% getNeoLocation(), 'w' ) @@ -1004,11 +928,6 @@ class NeoBootImageChoose(Screen): def ReinstallKernel(self): from Plugins.Extensions.NeoBoot.files.tools import ReinstallKernel self.session.open(ReinstallKernel) - -##/////NA CZAS TESTU UPDATE ZATRZYMANE\\\\\#################################### -# def neoboot_update(self): -# self.messagebox = self.session.open(MessageBox, _('Updated unnecessary, you have the latest version. Please try again later.'), MessageBox.TYPE_INFO, 8) -# self.close() def neoboot_update(self): if fileExists('/.multinfo'): @@ -1033,9 +952,9 @@ class NeoBootImageChoose(Screen): self.session.open(MessageBox, _('Canceled update.'), MessageBox.TYPE_INFO, 7) def chackupdate3(self): - os.system('cd ' + LinkNeoBoot + ';curl -O --ftp-ssl https://raw.githubusercontent.com/gutosie/NeoBoot8/master/ver.txt;sleep 3;cd /') + os.system('cd ' + LinkNeoBoot + ';curl -O --ftp-ssl https://raw.githubusercontent.com/gutosie/NeoBoot-9/master/ver.txt;sleep 3;cd /') if not fileExists('' + LinkNeoBoot + '/ver.txt'): - os.system('cd ' + LinkNeoBoot + ';fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/NeoBoot8/master/ver.txt; sleep 3;cd /') + os.system('cd ' + LinkNeoBoot + ';fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/NeoBoot-9/master/ver.txt; sleep 3;cd /') if not fileExists('' + LinkNeoBoot + '/ver.txt'): self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 8) else: @@ -1055,18 +974,16 @@ class NeoBootImageChoose(Screen): if yesno: if fileExists('/tmp/*.zip'): os.system('rm /tmp/*.zip') - os.system('cd /tmp; curl -O --ftp-ssl https://codeload.github.com/gutosie/NeoBoot8/zip/master; mv /tmp/master /tmp/neoboot.zip; cd /') + os.system('cd /tmp; curl -O --ftp-ssl https://codeload.github.com/gutosie/NeoBoot-9/zip/master; mv /tmp/master /tmp/neoboot.zip; cd /') if not fileExists('/tmp/neoboot.zip'): - os.system('cd /tmp;fullwget --no-check-certificate https://codeload.github.com/gutosie/NeoBoot8/zip/master; mv /tmp/master /tmp/neoboot.zip; sleep 3;cd ') + os.system('cd /tmp;fullwget --no-check-certificate https://codeload.github.com/gutosie/NeoBoot-9/zip/master; mv /tmp/master /tmp/neoboot.zip; sleep 3;cd ') if not fileExists('/tmp/neoboot.zip'): self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 8) else: - os.system('cd /tmp/; unzip -qn ./neoboot.zip; rm -f ./neoboot.zip; cp -rf ./NeoBoot8-master/NeoBoot /usr/lib/enigma2/python/Plugins/Extensions; rm -rf /tmp/NeoBoot8-master; rm ' + LinkNeoBoot + '/ver.txt; cd ' + LinkNeoBoot + '/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./target/*; chmod 0755 ./files/NeoBoot.sh; chmod 0755 ./files/userscript.sh; cd') + os.system('cd /tmp/; unzip -qn ./neoboot.zip; rm -f ./neoboot.zip; cp -rf ./NeoBoot-9-master/NeoBoot /usr/lib/enigma2/python/Plugins/Extensions; rm -rf /tmp/NeoBoot-9-master; rm ' + LinkNeoBoot + '/ver.txt; cd ' + LinkNeoBoot + '/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./tmpfiles/target/*; chmod 0755 ./files/NeoBoot.sh; chmod 0755 ./files/userscript.sh; cd') if getCPUtype() == 'MIPS': - os.system('cd ' + LinkNeoBoot + '/; cp -rf ./bin/neoinitmipsvu /sbin; chmod 755 /sbin/neoinitmipsvu; cp -rf ./bin/neoinitmips /sbin; chmod 755 /sbin/neoinitmips; cd') - #elif getCPUtype() == 'ARMv7': - #os.system('') - os.system('cd ' + LinkNeoBoot + '/; rm ./bin/install; rm ./files/mountpoint.sh; rm ./files/neom; rm ./files/neo.sh') + os.system('cd ' + LinkNeoBoot + '/; cp -rf ./bin/neoinitmipsvu /sbin; chmod 755 /sbin/neoinitmipsvu; cp -rf ./bin/neoinitmips /sbin; chmod 755 /sbin/neoinitmips; cd') + os.system('cd ' + LinkNeoBoot + '/; rm ./bin/install; rm ./files/mountpoint.sh; rm ./files/neo.sh') restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _('Completed update NeoBoot. You need to restart the E2 !!!\nRestart now ?'), MessageBox.TYPE_YESNO) restartbox.setTitle(_('Restart GUI now ?')) else: @@ -1080,8 +997,6 @@ class NeoBootImageChoose(Screen): else: self.close() -##############@@@@@@@@@@@@@111 - def MBBackup(self): from Plugins.Extensions.NeoBoot.files.tools import MBBackup self.session.open(MBBackup) @@ -1090,15 +1005,6 @@ class NeoBootImageChoose(Screen): from Plugins.Extensions.NeoBoot.files.tools import MBRestore self.session.open(MBRestore) -# def updateList(self): -# if not fileExists('/.multinfo'): -# if not fileExists('' + LinkNeoBoot + '/.location'): # or not fileExists('' + LinkNeoBoot + '/files/kernel.sh'): -# self.session.open(NeoBootInstallation) -# else: -# self.updateListOK() -# else: -# self.updateListOK() - def updateList(self): self.list = [] pluginpath = '' + LinkNeoBoot + '' @@ -1114,12 +1020,16 @@ class NeoBootImageChoose(Screen): icon = 'dev_hdd.png' elif 'cf' in mypath: icon = 'dev_cf.png' + elif 'ssd' in mypath: + icon = 'dev_ssd.png' + icon = pluginpath + '/images/' + icon png = LoadPixmap(icon) self['device_icon'].instance.setPixmap(png) linesdevice = open('' + LinkNeoBoot + '/.location', 'r').readlines() deviceneo = linesdevice[0][0:-1] device = deviceneo + ustot = usfree = usperc = '' rc = system('df > /tmp/memoryinfo.tmp') if fileExists('/tmp/memoryinfo.tmp'): @@ -1159,15 +1069,23 @@ class NeoBootImageChoose(Screen): try: from skin import parseColor self['label13'].instance.setForegroundColor(parseColor(color)) - self['label14'].instance.setForegroundColor(parseColor(color)) self['label15'].instance.setForegroundColor(parseColor(color)) self['progreso'].instance.setForegroundColor(parseColor(color)) except: pass + self.availablespace = usfree[0:-3] + strview = _('Used: ') + usperc + _(' \n Available: ') + usfree[0:-3] + ' MB' self['label3'].setText(strview) + + strview2 = _('Free Space : ') + usfree[0:-3] + ' MB' + self['label11'].setText(strview2) + + strview1 = _('Capacity : ') + usperc + _(' Full') + self['label18'].setText(strview1) + try: f2 = open('%sImageBoot/.neonextboot', 'r' % getNeoLocation()) mypath2 = f2.readline().strip() @@ -1176,43 +1094,20 @@ class NeoBootImageChoose(Screen): mypath2 = 'Flash' if mypath2 == 'Flash': - image = getImageNeoBoot() - if not fileExists('/.multinfo'): - if fileExists('/etc/issue.net'): - try: - obraz = open('/etc/issue.net', 'r').readlines() - imagetype = obraz[0][:-3] - image = imagetype - open('%sImageBoot/.Flash', 'w' % getNeoLocation()).write(image) - except: - False - if fileExists('/.multinfo'): - if fileExists('/media/mmc/etc/issue.net'): - try: - obraz = open('/media/mmc/etc/issue.net', 'r').readlines() - imagetype = obraz[0][:-3] - image = imagetype - open('%sImageBoot/.Flash', 'w' % getNeoLocation()).write(image) - except: - False - elif fileExists('/etc/issue.net'): - try: - obraz = open('/etc/issue.net', 'r').readlines() - imagetype = obraz[0][:-1] - lines = open('/etc/hostname', 'r').readlines() - boxtype = lines[0][:-1] - image = imagetype[0:-2] + ' ' + boxtype - open('%sImageBoot/.Flash', 'w' % getNeoLocation()).write(image) - except: - False + image = getImageDistroN() + writefile = open('%sImageBoot/.Flash' % getNeoLocation(), 'w') + writefile.write(image) + writefile.close() elif fileExists('%sImageBoot/.Flash' % getNeoLocation()): f = open('%sImageBoot/.Flash', 'r' % getNeoLocation()) image = f.readline().strip() f.close() + image = ' [' + image + ']' self.list.append('Flash' + image) self['label5'].setText(mypath) + if fileExists('/.multinfo'): f2 = open('/.multinfo', 'r') mypath3 = f2.readline().strip() @@ -1231,10 +1126,17 @@ class NeoBootImageChoose(Screen): self['label7'].setText(str(len(self.list) - 1)) self['config'].setList(self.list) - KERNELVERSION = getKernelImageVersion() - strview = PLUGINVERSION + ' ' + 'Kernel %s' % KERNELVERSION + + strview = PLUGINVERSION self['label9'].setText(strview) + + KERNELVERSION = getKernelImageVersion() + strview = KERNELVERSION + self['label20'].setText(strview) + + self['label17'].setText(readline('/etc/hostname')) self['label19'].setText(readline('%sImagesUpload/.kernel/used_flash_kernel' % getNeoLocation() )) + strview = UPDATEVERSION self['label10'].setText(strview) @@ -1242,7 +1144,7 @@ class NeoBootImageChoose(Screen): from Plugins.Extensions.NeoBoot.files.tools import MBTools self.session.open(MBTools) - def remove(self): + def removeIMG(self): self.mysel = self['config'].getCurrent() if 'Flash' in self.mysel: self.mysel = 'Flash' @@ -1263,7 +1165,7 @@ class NeoBootImageChoose(Screen): out.write('Flash') out.close() message = _('Delete the selected image - ') + self.mysel + _('\nDelete ?') - ybox = self.session.openWithCallback(self.remove2, MessageBox, message, MessageBox.TYPE_YESNO) + ybox = self.session.openWithCallback(self.RemoveIMAGE, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Delete Confirmation')) except: print 'no image to remove' @@ -1284,7 +1186,7 @@ class NeoBootImageChoose(Screen): except: print ' ' - def remove2(self, yesno): + def RemoveIMAGE(self, yesno): if yesno: cmd = _("echo -e 'Deleting in progress...\n'") cmd1 = 'chattr -i %sImageBoot/' % getNeoLocation() + self.mysel @@ -1297,12 +1199,11 @@ class NeoBootImageChoose(Screen): if fileExists('/.multinfo'): message = _('Installing new neoboot software, only recommended from Flash!!!\n---Continue ?---') ybox = self.session.openWithCallback(self.installation_image, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Installation with risk ')) + ybox.setTitle(_('Installation')) else: message = _('Installation from Flash!!!\n---Continue ?---') ybox = self.session.openWithCallback(self.installation_image, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Installation new image. ')) -# self.installation_image() def installation_image(self, yesno): if yesno: @@ -1382,21 +1283,27 @@ class NeoBootImageChoose(Screen): else: images = False - if images == True: + if images == True and self.check_free_space(): from Plugins.Extensions.NeoBoot.unpack import InstallImage self.session.open(InstallImage) else: self.DownloaderImage() -# update 8.20 poczatek + def check_free_space(self): + if Freespace('%s' % getNeoLocation()) < 300000: + self.session.open(MessageBox, _('Not enough free space on /media/ !!\nYou need at least 300Mb free space.\n\nExit plugin.'), type=MessageBox.TYPE_ERROR) + return False + return True + + def DownloaderImage(self): if not os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py'): - message = _('[NeoBoot] The %sImagesUpload directory is EMPTY !!!\nZainstalowac wtyczke do pobierania nowych image ? \n---Continue ?--- ' % getNeoLocation() ) + message = (_('The %sImagesUpload directory is EMPTY!!!\nInstall the plugin to download new image online ?\n --- Continue? ---') % getNeoLocation() ) ybox = self.session.openWithCallback(self.ImageDownloader, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Installation with risk ')) + ybox.setTitle(_('Installation')) else: - message = _('[NeoBoot] The %sImagesUpload directory is EMPTY !!!\nPlease upload the image files in .ZIP or .NFI formats to install. ' % getNeoLocation() ) + message = (_('Catalog %sImagesUpload directory is empty\nPlease upload the image files in zip or nfi formats to install') % getNeoLocation() ) self.session.open(MessageBox, message, MessageBox.TYPE_INFO) def ImageDownloader(self, yesno): @@ -1407,25 +1314,13 @@ class NeoBootImageChoose(Screen): system(cmd1) cmd2 = 'opkg install --force-overwrite --force-reinstall --force-downgrade /tmp/enigma2-plugin-extensions-imagedownloader_2.6_all.ipk' system(cmd2) - self.session.open(MessageBox, _('Wtyczka zosta\xc5\x82a pomy\xc5\x9blnie zainstalowana.'), MessageBox.TYPE_INFO, 5) + self.session.open(MessageBox, _('The plug-in has been successfully installed.'), MessageBox.TYPE_INFO, 5) self.close() else: - mess = _('[NeoBoot] The %sImagesUpload directory is EMPTY !!!\nPlease upload the image files in .ZIP or .NFI formats to install. ' % getNeoLocation() ) + mess = (_('Directory %sImagesUpload is empty\nPlease upload the image files in zip or nfi formats to install') % getNeoLocation() ) self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) -#update 8.20 koniec - -# self.ImageSystem() - -# def ImageSystem(self): -# if fileExists('%sImageBoot/.neonextboot' % getNeoLocation()): -# self.messagebox = self.session.open(MessageBox, _('[NeoBoot] The %sImagesUpload directory is EMPTY !!!\nPlease upload the image files in .ZIP or .NFI formats to install.\n' % getNeoLocation() ), MessageBox.TYPE_INFO, 8) -# self.close() -# else: -# self.close() - - - def boot(self): + def bootIMG(self): self.mysel = self['config'].getCurrent() if 'Flash' in self.mysel: self.mysel = 'Flash' @@ -1433,15 +1328,30 @@ class NeoBootImageChoose(Screen): out = open('' + getNeoLocation() + 'ImageBoot/.neonextboot', 'w' ) out.write(self.mysel) out.close() + + if getImageNeoBoot() != 'Flash': + if not fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())): + message = _('After successful launch of the selected software\nyou must run the neoboot plugin\nif the software does not start or neoboot is not confirmed\nthe system will return to the internal flash memory\n\nPress OK or exit on the remote control to continue...' ) + ybox = self.session.openWithCallback(self.StartReboot, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('First start of software')) + else: + from run import StartImage + self.session.open(StartImage) + else: + from run import StartImage + self.session.open(StartImage) - from Plugins.Extensions.NeoBoot.run import StartImage + def StartReboot(self, yesno): + if yesno: + from run import StartImage self.session.open(StartImage) + else: + self.close() def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) self.close() - def readline(filename, iferror = ''): if iferror[:3] == 'or:': data = iferror[3:] @@ -1469,39 +1379,45 @@ def checkInternet(): else: return True + def checkimage(): mycheck = False - if fileExists('/proc/stb/info'): #vumodel'): ogranicza tylko dla vu+ - mycheck = True - else: + if not fileExists('/proc/stb/info') or not fileExists('' + LinkNeoBoot + '/neoskins/osans.ttf') or not fileExists('' + LinkNeoBoot + '/files/neoconsole.pyo') or not fileExists('' + LinkNeoBoot + '/usedskin.pyo') or not fileExists('' + LinkNeoBoot + '/neoskins/sagoe.ttf'): mycheck = False + else: + mycheck = True return mycheck -def main(session, **kwargs): - if not fileExists('' + LinkNeoBoot + '/.location'): - pass - else: - if not fileExists('%sImageBoot/.version' % getNeoLocation()): - if fileExists('' + LinkNeoBoot + '/files/mountpoint.sh'): - os.system('chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh; ' + LinkNeoBoot + '/files/mountpoint.sh') - version = 0 - if fileExists('%sImageBoot/.version' % getNeoLocation()): - f = open('%sImageBoot/.version' % getNeoLocation()) - version = float(f.read()) - f.close() - if fileExists('%sImageBoot/.neonextboot' % getNeoLocation()): - f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r' ) - mypath2 = f2.readline().strip() - f2.close() - if mypath2 != 'Flash' or mypath2 == 'Flash' and checkimage(): - if float(PLUGINVERSION) != version: - session.open(MyUpgrade) - else: - session.open(NeoBootImageChoose) +def main(session, **kwargs): + vip = checkimage() + if vip == 1: + if not fileExists('' + LinkNeoBoot + '/.location'): + pass else: - session.open(MessageBox, _('Sorry: Wrong image in flash found. You have to install in flash Enigma2 !!!'), MessageBox.TYPE_INFO, 10) - else: - session.open(NeoBootInstallation) + if not fileExists('%sImageBoot/.version' % getNeoLocation()): + if fileExists('' + LinkNeoBoot + '/files/mountpoint.sh'): + os.system('chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh; ' + LinkNeoBoot + '/files/mountpoint.sh') + version = 0 + if fileExists('%sImageBoot/.version' % getNeoLocation()): + f = open('%sImageBoot/.version' % getNeoLocation()) + version = float(f.read()) + f.close() + if fileExists('%sImageBoot/.neonextboot' % getNeoLocation()): + f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r' ) + mypath2 = f2.readline().strip() + f2.close() + if mypath2 != 'Flash' or mypath2 == 'Flash' and checkimage(): + if float(PLUGINVERSION) != version: + session.open(MyUpgrade) + else: + session.open(NeoBootImageChoose) + else: + session.open(MessageBox, _('Sorry, Unable to install, bad satellite receiver or you do not have the full plug-in version\n The full version of the NEO VIP plugin is on the forum address:\nhttp://all-forum.cba.pl in the VIP section.'), MessageBox.TYPE_INFO, 20) + else: + session.open(NeoBootInstallation) + + else: + session.open(MessageBox, (_('Sorry, Unable to install, bad satellite receiver or you do not have the full plug-in version\n\nThe full version of the NEO VIP plugin is on the forum address:\nhttp://all-forum.cba.pl in the VIP section.')), MessageBox.TYPE_INFO, 25) def menu(menuid, **kwargs): if menuid == 'mainmenu':