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 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 StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() )) system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh') self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') if not fileExists('/bin/busybox.nosuid'): os.system('ln -sf "busybox" "/bin/busybox.nosuid" ') #################_____mips___########################## #VUPLUS MIPS vu_dev_mtd1.sh if getBoxHostName() == 'vuultimo' or getBoxHostName() == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vuuno' or getBoxHostName() == 'vusolo' or getBoxHostName() == 'vuduo': if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName()) ): self.myclose2(_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash kernel vmlinux.gz ' % getNeoLocation() )) else: if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _('...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh' elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init; /etc/init.d/reboot' elif getImageNeoBoot() != 'Flash': if not fileExists('/.multinfo'): if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz'): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh' elif not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /etc/init.d/reboot' elif fileExists('/.multinfo'): if not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT_REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'flash_eraseall /dev/mtd1; sleep 2; ' + LinkNeoBoot + '/bin/nandwrite -p /dev/mtd1 %sImagesUpload/.kernel/%s.vmlinux.gz; /etc/init.d/reboot' % ( getNeoLocation(), getBoxHostName()) elif fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _('...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh' self.session.open(Console, _('NeoBoot MIPS....'), [cmd, cmd1]) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) self.close()
def check_free_space(self): if Freespace('%sImagesUpload' % getNeoLocation()) < 1000000: self.session.open( MessageBox, _('Not enough free space on %s !!\nYou need at least 500Mb free space.\n\nExit plugin.' % getNeoLocation()), type=MessageBox.TYPE_ERROR) return False return True
def KeyOk(self): if getImageNeoBoot() != 'Flash': os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() else: os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() #--------------------------------------------- getMountPointNeo2()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() )) system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo_location') self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/mmc/etc/init.d/neobootmount.sh'): os.system('rm -f /media/mmc/etc/init.d/neobootmount.sh;') #################_____ARM____########################## #ARM procesor: DM900; AX HD60 4K if getCPUtype() == 'ARMv7' and getCPUSoC() or getBoxHostName() == ['osmio4k', 'ax60', 'sf8008', 'bcm7251', 'sf4008', 'et1x000', 'dm920', 'bcm7251s', 'h7', 'hi3798mv200' 'zgemmah9s', 'bcm7252s', 'gbquad4k', 'ustym4kpro', '3798mv200' 'dm900'] : if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): os.system('cd /media/mmc; ln -sfn /sbin/init.sysvinit /media/mmc/sbin/init; reboot -f ') elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') cmd1='sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -f ' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) elif getImageNeoBoot() != 'Flash': cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') cmd1='sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; reboot -f ' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open(MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! '), MessageBox.TYPE_INFO, 8) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open(MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! '), MessageBox.TYPE_INFO, 8) self.close()
def kernel_image(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 KeyOk(self): if getImageNeoBoot() != 'Flash': if not fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())): cmd = _("echo -e '[NeoBoot] Uwaga!!! po poprawnym starcie wybranego oprogramowania w neoboot,\nnalezy uruchomic NEOBOOTA by potwierdzic prawidlowy start image.\n\nNacisnij OK lub exit na pilocie by kontynuowac...\n\n\n'") self.session.openWithCallback(self.StartImageInNeoBoot, Console, _('NeoBoot: Start image...'), [cmd]) else: os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() else: os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot()
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 KeyOk(self): if getImageNeoBoot() != 'Flash': os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() else: os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() if getNandWrite() == 'nandwrite': os.system('echo "nandwrite" > /tmp/check_nandwrite') #--------------------------------------------- getMountPointNeo2()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) #system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh') self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): os.system( 'rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') if (getSupportedTuners()): if getImageNeoBoot() == 'Flash': cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) elif getImageNeoBoot() != 'Flash': if fileExists('/.multinfo'): self.session.open(TryQuitMainloop, 2) elif not fileExists('/.multinfo'): cmd = 'ln -sfn /sbin/neoinitmips /sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.session.open(TryQuitMainloop, 2) else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('It looks like it that multiboot does not support this STB.' ), MessageBox.TYPE_INFO, 8) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('It looks like it that multiboot does not support this STB.' ), MessageBox.TYPE_INFO, 8) self.close()
def KeyOk(self): if getImageNeoBoot() != 'Flash': os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() else: os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() #--------------------------------------------- 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': os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda1 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount() == 'hdd_install_/dev/sdb1': os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sdb1 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount() == 'hdd_install_/dev/sda2': os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount() == 'hdd_install_/dev/sdb2': os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh') #--------------------------------------------- if getNeoMount2() == 'usb_install_/dev/sdb1': os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount2() == 'usb_install_/dev/sda1': os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sda1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount2() == 'usb_install_/dev/sdb2': os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb2 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount2() == 'usb_install_/dev/sdc1': os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdc1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount2() == 'usb_install_/dev/sdd1': os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdd1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount2() == 'usb_install_/dev/sde1': os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sde1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount2() == 'usb_install_/dev/sdf1': os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdf1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') #--------------------------------------------- elif getNeoMount3() == 'cf_install_/dev/sda1': os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sda1 /media/cf" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount3() == 'cf_install_/dev/sdb1': os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sdb1 /media/cf" >> ' + LinkNeoBoot + '/files/mountpoint.sh') #--------------------------------------------- elif getNeoMount4() == 'card_install_/dev/sda1': os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sda1 /media/card" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount4() == 'card_install_/dev/sdb1': os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sdb1 /media/card" >> ' + LinkNeoBoot + '/files/mountpoint.sh') #--------------------------------------------- elif getNeoMount5() == 'mmc_install_/dev/sda1': os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sda1 /media/mmc" >> ' + LinkNeoBoot + '/files/mountpoint.sh') elif getNeoMount5() == 'mmc_install_/dev/sdb1': os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sdb1 /media/mmc" >> ' + LinkNeoBoot + '/files/mountpoint.sh') os.system('echo "\n\nexit 0" >> ' + LinkNeoBoot + '/files/mountpoint.sh')
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 imageInstall(self): pluginpath = '' + LinkNeoBoot + '' myerror = '' source = self.source.value.replace(' ', '') target = self.target.value.replace(' ', '') for fn in os.listdir('%sImageBoot' % getNeoLocation()): if fn == target: myerror = _('Sorry, an Image with the name ') + target + _( ' is already installed.\n Please try another name.') continue if source == 'None': myerror = _( 'You have to select one Image to install.\nPlease, upload your zip file in the folder: %sImagesUpload and select the image to install.' ) if target == '': myerror = _('You have to provide a name for the new Image.') if target == 'Flash': myerror = _( 'Sorry this name is reserved. Choose another name for the new Image.' ) if len(target) > 30: myerror = _('Sorry the name of the new Image is too long.') if myerror: myerror self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) else: myerror message = "echo -e '" message += _('NeoBot started installing new image.\n') message += _('The installation process may take a few minutes.\n') message += _( 'Please: DO NOT reboot your STB and turn off the power.\n') message += _('Please, wait...\n') message += "'" cmd1 = 'python ' + pluginpath + '/ex_init.py' cmd = '%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s ' % ( cmd1, source, target.replace(' ', '.'), str(self.stopenigma.value), str(self.CopyFiles.value), str(self.CopyKernel.value), str(self.TvList.value), str(self.LanWlan.value), str(self.Sterowniki.value), str(self.InstallSettings.value), str(self.ZipDelete.value), str(self.RepairFTP.value), str(self.SoftCam.value), str(self.MediaPortal.value), str(self.PiconR.value), str(self.Kodi.value), str(self.BlackHole.value)) print("[MULTI-BOOT]: "), cmd from Plugins.Extensions.NeoBoot.plugin import PLUGINVERSION self.session.open( Console, _('NeoBoot v.%s - Install new image') % PLUGINVERSION, [message, cmd])
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 __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 __init__(self, session): Screen.__init__(self, session) fn = 'NewImage' sourcelist = [] for fn in os.listdir('%sImagesUpload' % getNeoLocation()): if fn.find('.zip') != -1: fn = fn.replace('.zip', '') sourcelist.append((fn, fn)) continue if fn.find('.rar') != -1: fn = fn.replace('.rar', '') sourcelist.append((fn, fn)) continue if fn.find('.tar.xz') != -1: fn = fn.replace('.tar.xz', '') sourcelist.append((fn, fn)) continue if fn.find('.tar.gz') != -1: fn = fn.replace('.tar.gz', '') sourcelist.append((fn, fn)) continue if fn.find('.tar.bz2') != -1: fn = fn.replace('.tar.bz2', '') sourcelist.append((fn, fn)) continue if fn.find('.mb') != -1: fn = fn.replace('.mb', '') sourcelist.append((fn, fn)) continue if fn.find('.nfi') != -1: fn = fn.replace('.nfi', '') sourcelist.append((fn, fn)) continue if len(sourcelist) == 0: sourcelist = [('None', 'None')] self.source = ConfigSelection(choices=sourcelist) self.target = ConfigText(fixed_size=False) self.stopenigma = ConfigYesNo(default=False) self.CopyFiles = ConfigYesNo(default=True) if fileExists('/proc/stb/info/vumodel' ) and not fileExists('/proc/stb/info/boxtype'): self.CopyKernel = ConfigYesNo(default=True) else: self.CopyKernel = ConfigYesNo(default=False) self.TvList = ConfigYesNo(default=False) self.LanWlan = ConfigYesNo(default=False) if fileExists('/proc/stb/info/vumodel' ) and not fileExists('/proc/stb/info/boxtype'): self.Sterowniki = ConfigYesNo(default=False) else: self.Sterowniki = ConfigYesNo(default=True) self.InstallSettings = ConfigYesNo(default=False) self.ZipDelete = ConfigYesNo(default=False) self.RepairFTP = ConfigYesNo(default=False) self.SoftCam = ConfigYesNo(default=False) self.MediaPortal = ConfigYesNo(default=False) self.PiconR = ConfigYesNo(default=False) self.Kodi = ConfigYesNo(default=False) self.BlackHole = ConfigYesNo(default=False) self.target.value = '' self.curselimage = '' try: if self.curselimage != self.source.value: self.target.value = self.source.value[:-13] self.curselimage = self.source.value except: pass self.createSetup() ConfigListScreen.__init__(self, self.list, session=session) self.source.addNotifier(self.typeChange) self['actions'] = ActionMap( [ 'OkCancelActions', 'ColorActions', 'CiSelectionActions', 'VirtualKeyboardActions' ], { 'cancel': self.cancel, 'red': self.cancel, 'green': self.imageInstall, 'yellow': self.HelpInstall, 'blue': self.openKeyboard }, -2) self['key_green'] = Label(_('Install')) self['key_red'] = Label(_('Cancel')) self['key_yellow'] = Label(_('Help')) self['key_blue'] = Label(_('Keyboard')) self['HelpWindow'] = Pixmap() self['HelpWindow'].hide()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) system( 'chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo_location' ) self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/mmc/etc/init.d/neobootmount.sh'): os.system('rm -f /media/mmc/etc/init.d/neobootmount.sh;') #################_____ARM____########################## #VUPLUS ARM ultimo4k, solo4k, uno4k, uno4kse - mmcblk0p1.sh if getCPUtype() == 'ARMv7' and getCPUSoC() or getBoxHostName() == [ '7444s', '7376', '7252s', 'vuultimo4k' 'vusolo4k', 'vuuno4k', 'vuuno4kse' ]: if not fileExists( '%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())): self.myclose2( _( '\n\n\nError - w lokalizacji %sImagesUpload/.kernel/ \nnie odnaleziono pliku kernela flash-kernel-%s.bin ' % getNeoLocation(), getBoxHostName())) else: if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'cd /media/mmc; ln -sf "init.sysvinit" "/media/mmc/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh ' elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"; reboot -dfhi' elif getImageNeoBoot() != 'Flash': if not fileExists('/.multinfo'): if not fileExists( '%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; /etc/init.d/reboot' elif fileExists( '%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh ' elif fileExists('/.multinfo'): if not fileExists( '%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'dd if=' + getNeoLocation( ) + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName( ) + '.bin of=/dev/mmcblk0p1; cd /media/mmc; ln -sf "neoinitarm" "/media/mmc/sbin/init" ; sleep 2; reboot -dfhi ' elif fileExists( '%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'cd /media/mmc; ln -sf "neoinitarmvu" "/media/mmc/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh ' self.session.open(Console, _('NeoBoot ARM VU+....'), [cmd, cmd1]) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! ' ), MessageBox.TYPE_INFO, 8) self.close()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() )) if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': if getBoxVuModel() == 'zero4k': os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash') system('chmod 755 ' + LinkNeoBoot + '/files/kernel.sh') self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') if not fileExists('/bin/busybox.nosuid'): os.system('ln -sf "busybox" "/bin/busybox.nosuid" ') #################_____ARM____########################## #VUPLUS ARM - Zero4k vu_mmcblk0p4.sh if getBoxHostName() == 'vuzero4k' or getCPUSoC() == '72604': if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName()) ): mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName()) ) self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) else: if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'cd /media/InternalFlash; ln -sf "init.sysvinit" "/media/InternalFlash/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh ' elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"; reboot -dfhi' elif getImageNeoBoot() != 'Flash': if not fileExists('/.multinfo'): if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; /etc/init.d/reboot' elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh ' elif fileExists('/.multinfo'): if not fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/mmcblk0p1; cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init" ; sleep 2; reboot -dfhi ' elif fileExists('%sImageBoot/%s/boot/zImage.%s' % ( getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh ' self.session.open(Console, _('NeoBoot ARM VU'), [cmd, cmd1]) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) self.close()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) system( 'chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/*' ) self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): os.system( 'rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') if not fileExists('/bin/busybox.nosuid'): os.system('ln -sf "busybox" "/bin/busybox.nosuid" ') #################_____mips___########################## #VUPLUS MIPS vu_dev_mtd1.sh if "vu" + getBoxVuModel() == getBoxHostName(): if getBoxHostName() == 'vuultimo' or getBoxHostName( ) == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName( ) == 'vuuno' or getBoxHostName() == 'vusolo' or getBoxHostName( ) == 'vuduo': mtd = 'mtd1' if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/etc/vtiversion.info' ) and getExtCheckHddUsb() == 'ext4': if fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): os.system( 'rm -r %sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())) elif getBoxHostName() == 'vusolo2' or getBoxHostName( ) == 'vusolose' or getBoxHostName( ) == 'vuduo2' or getBoxHostName() == 'vuzero': mtd = 'mtd2' else: self.messagebox = self.session.open( MessageBox, _('It looks like it that multiboot does not found MTD.' ), MessageBox.TYPE_INFO, 8) self.close() if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName())): self.myclose2( _('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash kernel vmlinux.gz ' % getNeoLocation())) else: if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): cmd = "echo -e '\n%s '" % _( '...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'flash_erase /dev/' + mtd + ' 0 0 > /dev/null 2>&1 ; flash_eraseall /dev/' + mtd + ' 0 0 > /dev/null 2>&1' if getNandWrite() == 'nandwrite': cmd2 = 'nandwrite -p /dev/' + mtd + ' ' + getNeoLocation( ) + 'ImagesUpload/.kernel/' + getBoxHostName( ) + '.vmlinux.gz > /dev/null 2>&1' else: cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + mtd + ' ' + getNeoLocation( ) + 'ImagesUpload/.kernel/' + getBoxHostName( ) + '.vmlinux.gz > /dev/null 2>&1' cmd3 = "echo -e '\n%s '" % _( 'Start image FLASH - kernel flash !\n' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ' ) cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' elif not fileExists('/.multinfo'): cmd = "echo -e '\n%s '" % _( '...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init' cmd2 = 'sync' cmd3 = "echo -e '\n%s '" % _( 'Start image flash !\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ' ) cmd4 = 'sleep 8; reboot -d -f' elif getImageNeoBoot() != 'Flash': if fileExists('/.multinfo') and getImageNeoBoot( ) == getImageBootNow(): cmd = "echo -e '\n%s '" % _( '...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init' cmd2 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true' cmd3 = "echo -e '\n%s '" % _( 'Reboot system E2 now !\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will REBOOT in 5 seconds !____ ' ) cmd4 = 'sync; sleep 8; reboot -d -f ' elif not fileExists('/.multinfo'): if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz'): cmd = "echo -e '\n%s '" % _( '...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'flash_erase /dev/' + mtd + ' 0 0 > /dev/null 2>&1; flash_eraseall /dev/' + mtd + ' 0 0 > /dev/null 2>&1' if getNandWrite() == 'nandwrite': cmd2 = 'nandwrite -p /dev/' + mtd + ' ' + getNeoLocation( ) + 'ImageBoot/' + getImageNeoBoot( ) + '/boot/' + getBoxHostName( ) + '.vmlinux.gz > /dev/null 2>&1' else: cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + mtd + ' ' + getNeoLocation( ) + 'ImageBoot/' + getImageNeoBoot( ) + '/boot/' + getBoxHostName( ) + '.vmlinux.gz > /dev/null 2>&1' cmd3 = "echo -e '\n%s '" % _( 'Changed kernel COMPLETE ! ' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUtype() + ' ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ' ) cmd4 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' elif not fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n%s '" % _( '...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init' cmd2 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true' cmd3 = "echo -e '\n%s '" % _( 'Start image without changing the kernel!\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ' ) cmd4 = 'sync; sleep 8; reboot -d -f' elif fileExists('/.multinfo'): if not fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n%s '" % _( '...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'flash_erase /dev/' + mtd + ' 0 0 > /dev/null 2>&1 ; flash_eraseall /dev/' + mtd + ' 0 0 > /dev/null 2>&1' if getNandWrite() == 'nandwrite': cmd2 = 'nandwrite -p /dev/' + mtd + ' ' + getNeoLocation( ) + 'ImagesUpload/.kernel/' + getBoxHostName( ) + '.vmlinux.gz > /dev/null 2>&1' else: cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + mtd + ' ' + getNeoLocation( ) + 'ImagesUpload/.kernel/' + getBoxHostName( ) + '.vmlinux.gz > /dev/null 2>&1' cmd3 = "echo -e '\n%s '" % _( 'Changed kernel COMPLETE ! ' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ' ) cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' elif fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n%s '" % _( '...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'flash_erase /dev/' + mtd + ' 0 0 > /dev/null 2>&1 ; flash_eraseall /dev/' + mtd + ' 0 0 > /dev/null 2>&1 ' if getNandWrite() == 'nandwrite': cmd2 = 'nandwrite -p /dev/' + mtd + ' ' + getNeoLocation( ) + 'ImageBoot/' + getImageNeoBoot( ) + '/boot/' + getBoxHostName( ) + '.vmlinux.gz > /dev/null 2>&1' else: cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + mtd + ' ' + getNeoLocation( ) + 'ImageBoot/' + getImageNeoBoot( ) + '/boot/' + getBoxHostName( ) + '.vmlinux.gz > /dev/null 2>&1' cmd3 = "echo -e '\n%s '" % _( 'Changed kernel COMPLETE ! ' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ' ) cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' self.session.open(Console, _('NeoBoot MIPS....'), [cmd, cmd1, cmd2, cmd3, cmd4]) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('It looks like it that multiboot does not support this STB.' ), MessageBox.TYPE_INFO, 8) self.close()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': os.system( ' ' + LinkNeoBoot + '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash; sleep 1' ) self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if not fileExists('/bin/busybox.nosuid'): os.system('ln -sf "busybox" "/bin/busybox.nosuid" ') if fileExists('/media/InternalFlash/etc/init.d/neomountboot.sh'): os.system( 'rm -f /media/InternalFlash/etc/init.d/neomountboot.sh;') if fileExists( '/media/InternalFlash/linuxrootfs1/etc/init.d/neomountboot.sh' ): os.system( 'rm -f /media/InternalFlash/linuxrootfs1/etc/init.d/neomountboot.sh;' ) if fileExists( '/media/InternalFlash/linuxrootfs2/etc/init.d/neomountboot.sh' ): os.system( 'rm -f /media/InternalFlash/linuxrootfs2/etc/init.d/neomountboot.sh;' ) if fileExists( '/media/InternalFlash/linuxrootfs3/etc/init.d/neomountboot.sh' ): os.system( 'rm -f /media/InternalFlash/linuxrootfs3/etc/init.d/neomountboot.sh;' ) if fileExists( '/media/InternalFlash/linuxrootfs4/etc/init.d/neomountboot.sh' ): os.system( 'rm -f /media/InternalFlash/linuxrootfs4/etc/init.d/neomountboot.sh;' ) # else: # pass #_____ARM procesor____ if (getSupportedTuners()): if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): if fileExists( '/media/InternalFlash/linuxrootfs1/sbin/neoinitarm' ): os.system( 'ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs1/sbin/init"' ) if fileExists( '/media/InternalFlash/linuxrootfs2/sbin/neoinitarm' ): os.system( 'ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs2/sbin/init"' ) if fileExists( '/media/InternalFlash/linuxrootfs3/sbin/neoinitarm' ): os.system( 'ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs3/sbin/init"' ) if fileExists( '/media/InternalFlash/linuxrootfs4/sbin/neoinitarm' ): os.system( 'ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs4/sbin/init"' ) if fileExists('/media/InternalFlash/sbin/init'): os.system( 'ln -sfn "init.sysvinit" "/media/InternalFlash/sbin/init"' ) if fileExists('/media/InternalFlash'): self.session.open(TryQuitMainloop, 2) else: self.session.open(TryQuitMainloop, 2) elif not fileExists('/.multinfo'): cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) else: cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) elif getImageNeoBoot() != 'Flash': if fileExists('/.multinfo'): if fileExists( '/media/InternalFlash/linuxrootfs1/sbin/neoinitarm' ): cmd = 'cd /media/InternalFlash/linuxrootfs1; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs1/sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) elif fileExists( '/media/InternalFlash/linuxrootfs2/sbin/neoinitarm' ): cmd = 'cd /media/InternalFlash/linuxrootfs2; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs2/sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) elif fileExists( '/media/InternalFlash/linuxrootfs3/sbin/neoinitarm' ): cmd = 'cd /media/InternalFlash/linuxrootfs3; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs3/sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) elif fileExists( '/media/InternalFlash/linuxrootfs4/sbin/neoinitarm' ): cmd = 'cd /media/InternalFlash/linuxrootfs4; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs4/sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) else: self.session.open(TryQuitMainloop, 2) elif not fileExists('/.multinfo'): cmd = 'ln -sfn /sbin/neoinitarm /sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) else: cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' rc = os.system(cmd) self.session.open(TryQuitMainloop, 2) else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('It looks like it that multiboot does not support this STB.' ), MessageBox.TYPE_INFO, 8) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('It looks like it that multiboot does not support this STB.' ), MessageBox.TYPE_INFO, 8) self.close()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) system( 'chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/target/*' ) self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/mmc/etc/init.d/neobootmount.sh'): os.system('rm -f /media/mmc/etc/init.d/neobootmount.sh;') #################_____ARM____########################## #Zgemma h7S ARM ARM - h7s_mmcblk0p2.sh if getBoxHostName() == 'h7' or getCPUSoC() == 'bcm7251s': if not fileExists( '%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())): self.myclose2( _('\n\n\nError - w lokalizacji %sImagesUpload/.kernel/ \nnie odnaleziono pliku kernela flash-kernel-%s.bin ' % getNeoLocation() % (getBoxHostName()))) else: if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'cd /media/mmc; ln -sf "init.sysvinit" "/media/mmc/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/target/h7s_kernel.sh ' elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sf "init.sysvinit" "/sbin/init"; reboot -f' elif getImageNeoBoot() != 'Flash': if not fileExists('/.multinfo'): if not fileExists( '%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sfn /sbin/neoinitarm /sbin/init; reboot -f' elif fileExists( '%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sfn /sbin/neoinitarm /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/target/h7s_kernel.sh ' elif fileExists('/.multinfo'): if not fileExists( '%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'python /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/target/findkerneldevice.py; dd if=%sImagesUpload/.kernel/flash-kernel-%s.bin of=/dev/kernel; cd /media/mmc;ln -sf "neoinitarm" "/media/mmc/sbin/init"; reboot -f' % getNeoLocation( ) % getBoxHostName() elif fileExists( '%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'cd /media/mmc; ln -sf "neoinitarm" "/media/mmc/sbin/init"; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/target/h7s_kernel.sh ' self.session.open(Console, _('NeoBoot ARM....'), [cmd, cmd1]) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! ' ), MessageBox.TYPE_INFO, 8) self.close()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) #system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh') self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): os.system( 'rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') if (getSupportedTuners()): if getImageNeoBoot() == 'Flash': cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n' ) cmd1 = 'sleep 8; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -f ' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) elif getImageNeoBoot() != 'Flash': if fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n' ) cmd1 = 'sleep 5; reboot -f ' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n' ) cmd1 = 'sleep 8; ln -sfn /sbin/neoinitmips /sbin/init; reboot -f ' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) else: cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n' ) cmd1 = 'sleep 8; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -f ' self.session.open(Console, _('NeoBoot-ERROR!!! ....'), [cmd, cmd1]) else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('It looks like it that multiboot does not support this STB.' ), MessageBox.TYPE_INFO, 8) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('It looks like it that multiboot does not support this STB.' ), MessageBox.TYPE_INFO, 8) self.close()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() )) if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': os.system(' ' +LinkNeoBoot+ '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash') self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if not fileExists('/bin/busybox.nosuid'): os.system('ln -sf "busybox" "/bin/busybox.nosuid" ') if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') elif fileExists('/media/InternalFlash/linuxrootfs1/etc/init.d/neobootmount.sh'): os.system('rm -f /media/InternalFlash/linuxrootfs1/etc/init.d/neobootmount.sh;') elif fileExists('/media/InternalFlash/linuxrootfs2/etc/init.d/neobootmount.sh'): os.system('rm -f /media/InternalFlash/linuxrootfs2/etc/init.d/neobootmount.sh;') elif fileExists('/media/InternalFlash/linuxrootfs3/etc/init.d/neobootmount.sh'): os.system('rm -f /media/InternalFlash/linuxrootfs3/etc/init.d/neobootmount.sh;') elif fileExists('/media/InternalFlash/linuxrootfs4/etc/init.d/neobootmount.sh'): os.system('rm -f /media/InternalFlash/linuxrootfs4/etc/init.d/neobootmount.sh;') # else: # pass #_____ARM procesor____ if (getSupportedTuners()): if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): if fileExists('/media/InternalFlash/linuxrootfs1/sbin/neoinitarm'): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'cd /media/InternalFlash/linuxrootfs1; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs1/sbin/init; sleep 5; reboot -d -f ' self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) elif fileExists('/media/InternalFlash/linuxrootfs2/sbin/neoinitarm'): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'cd /media/InternalFlash/linuxrootfs2; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs2/sbin/init; sleep 5; reboot -d -f ' self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) elif fileExists('/media/InternalFlash/linuxrootfs3/sbin/neoinitarm'): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'cd /media/InternalFlash/linuxrootfs3; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs3/sbin/init; sleep 5; reboot -d -f ' self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) elif fileExists('/media/InternalFlash/linuxrootfs4/sbin/neoinitarm') : cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'cd /media/InternalFlash/linuxrootfs4; ln -sfn /sbin/init.sysvinit /media/InternalFlash/linuxrootfs4/sbin/init; sleep 5; reboot -d -f ' self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) elif fileExists('/media/InternalFlash/sbin/init'): cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'cd /media/InternalFlash; ln -sfn /sbin/init.sysvinit /media/InternalFlash/sbin/init; sleep 5; reboot -d -f ' self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) else: cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') cmd1 = 'sleep 5; reboot -d -f ' self.session.open(Console, _('NeoBoot-Reboot ....'), [cmd, cmd1]) elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') cmd1='sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -d -f ' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) else: cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') cmd1='sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -d -f ' self.session.open(Console, _('NeoBoot-ERROR!!! ....'), [cmd, cmd1]) elif getImageNeoBoot() != 'Flash': if fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') cmd1='sleep 5; reboot -d -f ' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') cmd1='sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; reboot -d -f ' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) else: cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') cmd1='sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -d -f ' self.session.open(Console, _('NeoBoot-ERROR!!! ....'), [cmd, cmd1]) else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) self.close()
def reinstallMB(self): system('/bin/tar -xzvf ' + getNeoLocation() + 'NeoBoot_Backup.tar.gz -C /') self.close()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) system( 'chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo_location' ) self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/mmc/etc/init.d/neobootmount.sh'): os.system('rm -f /media/mmc/etc/init.d/neobootmount.sh;') #################_____mips___########################## #VUPLUS MIPS vu_dev_mtd1.sh if getCPUSoC() == '7335' or getCPUSoC() == '7325' or getCPUSoC( ) == '7405' or getCPUSoC() == '7405(with 3D)' or getBoxHostName( ) == 'vuultimo' or getBoxHostName() == 'bm750' or getBoxHostName( ) == 'duo' or getBoxHostName() == 'vuuno' or getBoxHostName( ) == 'vusolo' or getBoxHostName() == 'vuduo': if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName())): self.myclose2( _('\n\n\nError - w lokalizacji %sImagesUpload/.kernel/ \nnie odnaleziono pliku kernela vmlinux.gz ' % getNeoLocation())) else: if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _( '...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh' elif not fileExists('/.multinfo'): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init; /etc/init.d/reboot' elif getImageNeoBoot() != 'Flash': if not fileExists('/.multinfo'): if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz'): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh' elif not fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /etc/init.d/reboot' elif fileExists('/.multinfo'): if not fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( '...............NEOBOOT_REBOOT...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = 'flash_eraseall /dev/mtd1; sleep 2; nandwrite -p /dev/mtd1 %sImagesUpload/.kernel/%s.vmlinux.gz; /etc/init.d/reboot' % getNeoLocation( ), getBoxHostName() elif fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = "echo -e '\n\n%s '" % _( '...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...' ) cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh' self.session.open(Console, _('NeoBoot MIPS....'), [cmd, cmd1]) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! ' ), MessageBox.TYPE_INFO, 8) self.close()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) system( 'chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo_location' ) self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/mmc/etc/init.d/neobootmount.sh'): os.system('rm -f /media/mmc/etc/init.d/neobootmount.sh;') #################_____mips___########################## #VUPLUS MIPS vu_dev_mtd2.sh , #Miracle Box Ultra dev_mtd2.sh if getCPUSoC() == '7356' or getCPUSoC() == '7429' or getCPUSoC( ) == '7424' or getCPUSoC() == '7241' or getCPUSoC( ) == '7362' or getBoxHostName() == 'vusolo2' or getBoxHostName( ) == 'vusolose' or getBoxHostName() == 'vuduo2' or getBoxHostName( ) == 'vuzero': if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName())): self.myclose2( _('\n\n\nError - w lokalizacji %sImagesUpload/.kernel/ \nnie odnaleziono pliku kernela vmlinux.gz ' % getNeoLocation())) else: if getImageNeoBoot() == 'Flash': if fileExists('/.multinfo'): cmd = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh' elif not fileExists('/.multinfo'): cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init; /etc/init.d/reboot' elif getImageNeoBoot() != 'Flash': if not fileExists('/.multinfo'): if not fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): os.system( 'ln -sfn /sbin/neoinitmipsvu /sbin/init') cmd = '/etc/init.d/reboot' elif fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): os.system( 'ln -sfn /sbin/neoinitmipsvu /sbin/init') cmd = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh' elif fileExists('/.multinfo'): if not fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): cmd = 'flash_eraseall /dev/mtd2; sleep 2; nandwrite -p /dev/mtd2 %sImagesUpload/.kernel/%s.vmlinux.gz; /etc/init.d/reboot' % getNeoLocation( ), getBoxHostName() elif fileExists( '%sImageBoot/%s/boot/%s.vmlinux.gz' % (getImageNeoBoot(), getBoxHostName())): cmd = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh' self.session.open(Console, _('NeoBoot MIPS....'), [cmd]) self.close()
def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) system( 'chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo_location' ) self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/mmc/etc/init.d/neobootmount.sh'): os.system('rm -f /media/mmc/etc/init.d/neobootmount.sh;') #################_____MIPS____################################## #MIPS procesor: MiracleBox, ET8500, Formuler F1, Formuler F3, Atemio6000 - MIPS # test - ultra, osmini if getCPUtype() != 'ARMv7' and getCPUSoC() or getBoxHostName() == [ 'bcm7358', 'ax60', 'bcm7362', 'bcm7356', 'bcm7241', 'bcm7362', 'mbmini', 'h3', 'ini-1000sv', 'osmini' ]: if getImageNeoBoot() == 'Flash': self.session.open(TryQuitMainloop, 2) elif getImageNeoBoot() != 'Flash': cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n' ) cmd1 = 'sleep 5; ln -sfn /sbin/neoinitmips /sbin/init; reboot -d -f -h -i' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! ' ), MessageBox.TYPE_INFO, 8) self.close() elif getCPUtype() != 'ARMv7' and getCPUSoC() or getBoxHostName( ) == ['bcm7424', 'mbultra', 'ini-8000sv']: if getImageNeoBoot() == 'Flash': self.session.open(TryQuitMainloop, 2) elif getImageNeoBoot() != 'Flash': cmd = "echo -e '\n\n%s '" % _( 'NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n' ) cmd1 = 'sleep 5; ln -sfn /sbin/neoinitmipsvu /sbin/init; reboot -d -f -h -i' self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! ' ), MessageBox.TYPE_INFO, 8) self.close() else: os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') self.messagebox = self.session.open( MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! ' ), MessageBox.TYPE_INFO, 8) self.close()
from Screens.Console import Console 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 Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getImageNeoBoot, getKernelVersionString import os import time import sys import struct, shutil PLUGINVERSION = '5.00' 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()