diff --git a/NeoBoot/extract.py b/NeoBoot/extract.py new file mode 100644 index 0000000..a159edd --- /dev/null +++ b/NeoBoot/extract.py @@ -0,0 +1,1321 @@ +# -*- coding: utf-8 -*- + +import sys +import os +import struct +import shutil + +# ver. gutosie + +def LanguageUsed(): + language = '' + lang = open('/etc/enigma2/settings', 'r') + usedlang = 'config.osd.language=pl_PL' + bak = lang.read().find(usedlang) + if bak != -1: + language = 'Yes' + else: + language = 'No' + return language + +def getBoxHostName(): + if os.path.exists('/etc/hostname'): + with open('/etc/hostname', 'r') as f: + myboxname = f.readline().strip() + f.close() + return myboxname + +def getCPUSoC(): + chipset='UNKNOWN' + if os.path.exists('/proc/stb/info/chipset'): + with open('/proc/stb/info/chipset', 'r') as f: + chipset = f.readline().strip() + f.close() + if chipset == '7405(with 3D)': + chipset == '7405' + + return chipset + +def getBoxVuModel(): + vumodel='UNKNOWN' + if os.path.exists("/proc/stb/info/vumodel") and not os.path.exists("/proc/stb/info/boxtype"): + with open('/proc/stb/info/vumodel', 'r') as f: + vumodel = f.readline().strip() + f.close() + return vumodel + +def getCPUtype() : + cpu='UNKNOWN' + if os.path.exists('/proc/cpuinfo'): + with open('/proc/cpuinfo', 'r') as f: + lines = f.read() + f.close() + if lines.find('ARMv7') != -1: + cpu='ARMv7' + elif lines.find('mips') != -1: + cpu='MIPS' + return cpu + +def getKernelVersion(): + try: + return open('/proc/version', 'r').read().split(' ', 4)[2].split('-', 2)[0] + except: + return _('unknown') + +def getNeoLocation(): + locatino='UNKNOWN' + if os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location'): + with open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location', 'r') as f: + locatino = f.readline().strip() + f.close() + return locatino + +media = getNeoLocation() +mediahome = media + '/ImageBoot/' +extensions_path = '/usr/lib/enigma2/python/Plugins/Extensions/' +dev_null = ' > /dev/null 2>&1' + +def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Sterowniki, InstallSettings, ZipDelete, RepairFTP, SoftCam, MediaPortal, BlackHole): + media_target = mediahome + target + list_one = ['rm -r ' + media_target + dev_null, 'mkdir ' + media_target + dev_null, 'chmod -R 0777 ' + media_target] + for command in list_one: + os.system(command) + + if stopenigma == 'True': + os.system('echo "All system processes have been stopped,\n please wait, after the installation is completed, E2 will restart..."') + os.system('touch /tmp/init4; init 4') + + rc = NEOBootExtract(source, target, ZipDelete, BlackHole) + + if not os.path.exists('%s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions' % (media, target)): + os.system('mkdir -p %s/ImageBoot/%s/usr/lib/' % (media, target)) + os.system('mkdir -p %s/ImageBoot/%s/usr/lib/enigma2' % (media, target)) + os.system('mkdir -p %s/ImageBoot/%s/usr/lib/enigma2/python' % (media, target)) + os.system('mkdir -p %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins' % (media, target)) + os.system('mkdir -p %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions' % (media, target)) + + if os.path.exists('%s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' % (media, target)): + os.system('rm -r %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' % (media, target)) + + list_two = ['mkdir -p ' + media_target + '/media' + dev_null, + 'rm ' + media_target + media + dev_null, + 'rmdir ' + media_target + media + dev_null, + 'mkdir -p ' + media_target + media + dev_null, + #'cp /etc/passwd ' + media_target + '/etc/passwd' + dev_null, + 'cp /etc/hostname ' + media_target + '/etc/hostname' + dev_null, + 'cp -rf ' + extensions_path + 'NeoBoot ' + media_target + extensions_path + 'NeoBoot' + dev_null] + for command in list_two: + os.system(command) + + if CopyFiles == 'False': + os.system('echo "No copying of files..."') + os.system('touch ' + getNeoLocation() + 'ImageBoot/.without_copying; sleep 5') + + if CopyKernel == 'True': + #mips + if getBoxHostName() == 'vuultimo' or getCPUSoC() == '7405' and os.path.exists('%s/ImageBoot/%s/etc/vtiversion.info' % (media, target)): + if os.path.exists('%s/ImageBoot/%s/lib/modules' % (media, target)): + cmd = 'rm -r %s/ImageBoot/%s/lib/modules' % (media, target) + rc = os.system(cmd) + cmd = 'mkdir -p %s/ImageBoot/%s/lib/modules > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /lib/modules %s/ImageBoot/%s/lib > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('%s/ImageBoot/%s/lib/firmware' % (media, target)): + cmd = 'rm -r %s/ImageBoot/%s/lib/firmware' % (media, target) + rc = os.system(cmd) + cmd = 'mkdir -p %s/ImageBoot/%s/lib/firmware > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /lib/firmware %s/ImageBoot/%s/lib > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + os.system('echo "Copied system drivers. Not recommended copied kernel.bin for Ultimo HD."') + + elif getBoxHostName() == 'vuultimo' or getCPUSoC() == '7335' or getCPUSoC() == '7325' or getCPUSoC() == '7405' or getCPUSoC() == '7356' or getCPUSoC() == '7424' or getCPUSoC() == '7241' or getCPUSoC() == '7362': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/vuplus/' + getBoxVuModel() + '/kernel_cfe_auto.bin ' + media_target + '/boot/' + getBoxHostName() + '.vmlinux.gz' + dev_null) + os.system('echo "Copied kernel.bin STB-MIPS"') + +#Ultra + elif getBoxHostName() == 'mbultra' or getCPUSoC() == 'bcm7424': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/miraclebox/ultra/kernel.bin ' + media_target + '/boot/' + getBoxHostName() + '.vmlinux.gz' + dev_null) + os.system('echo "Copied kernel.bin MiracleBoxUltra. Typ stb - MIPS"') + +#Edision OS MINI + elif getBoxHostName() == 'osmini' or getCPUSoC() == 'BCM7362': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/osmini/kernel.bin ' + media_target + '/boot/' + getBoxHostName() + '.vmlinux.gz' + dev_null) + os.system('echo "Copied kernel.bin Edision OS MINI. Typ stb - MIPS"') +#arm octagon + elif getBoxHostName() == 'sf4008': #getCPUSoC() == 'bcm7251' or + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + getBoxHostName() + '/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Copied kernel.bin STB-ARM Octagon."') + +#arm /uclan/ustym4kpro + elif getCPUSoC() == '3798mv200' or getBoxHostName() == 'ustym4kpro': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/uclan/' + getBoxHostName() + '/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Copied kernel.bin STB-ARM uclan ustym4kpro."') + + +#arm Galaxy Innvations ET-11000 4K et1x000 + elif getBoxHostName() == 'et1x000': #getCPUSoC() == 'bcm7251' or + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + getBoxHostName() + '/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Copied kernel.bin STB-ARM GI ET-11000 4K."') + +#arm Dreambox dm920 + elif getBoxHostName() == 'dm920': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + getBoxHostName() + '/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Copied kernel.bin STB-ARM DM920 4K."') + +#arm Dreambox dm920 + elif getBoxHostName() == 'ax51': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/hd51/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Copied kernel.bin STB-ARM AX 4K Box HD51 4K."') + +#arm Ariva 4K Combo + elif getBoxHostName() == 'arivatwin': #getCPUSoC() == 'bcm7251' or + os.system('mv ' + getNeoLocation() + 'ImagesUpload/e2/update/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Copied kernel.bin STB-ARM Ariva 4K Combo."') + +#arm Zgemma h7 + elif getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/zgemma/' + getBoxHostName() + '/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Copied kernel.bin STB-ARM Zgemma h7."') +#arm gbquad4k + elif getCPUSoC() == 'bcm7252s' or getBoxHostName() == 'gbquad4k': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/gigablue/quad4k' + getBoxHostName() + '/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Copied kernel.bin STB-ARM gbquad4k."') + +#arm vuplus + elif getCPUSoC() == '7444s' or getCPUSoC() == '7278' or getCPUSoC() == '7376' or getCPUSoC() == '7252s' or getCPUSoC() == '72604': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/vuplus/' + getBoxVuModel() + '/kernel_auto.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Copied kernel.bin STB-ARM"') + + if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'): + if os.path.exists('/usr/sbin/nandwrite'): + cmd = 'cp -r /usr/sbin/nandwrite %s/ImageBoot/%s/usr/sbin/nandwrite > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/usr/bin/fullwget'): + cmd = 'cp -r /usr/bin/fullwget %s/ImageBoot/%s/usr/bin/fullwget > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/init.d/inadyn-mt'): + cmd = 'cp -r /etc/init.d/inadyn-mt %s/ImageBoot/%s/etc/init.d/inadyn-mt > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/usr/bin/inadyn-mt'): + cmd = 'cp -r /usr/bin/inadyn-mt %s/ImageBoot/%s/usr/bin/inadyn-mt > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/inadyn.conf'): + cmd = 'cp -r /etc/inadyn.conf %s/ImageBoot/%s/etc/inadyn.conf > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/usr/lib/enigma2/python/Plugins/SystemPlugins/FanControl'): + cmd = 'cp -r /usr/lib/enigma2/python/Plugins/SystemPlugins/FanControl %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/SystemPlugins > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('' + extensions_path + 'EmuManager'): + cmd = 'cp -r ' + extensions_path + 'EmuManager %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('' + extensions_path + 'CamdMenager'): + cmd = 'cp -r ' + extensions_path + 'CamdMenager %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('' + extensions_path + 'IPTVPlayer'): + cmd = 'cp -r ' + extensions_path + 'IPTVPlayer %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp /usr/lib/python*.*/htmlentitydefs.pyo %s/ImageBoot/%s/usr/lib/python*.* > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('' + extensions_path + 'FeedExtra'): + cmd = 'cp -r ' + extensions_path + 'FeedExtra %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('' + extensions_path + 'MyUpdater'): + cmd = 'cp -r ' + extensions_path + 'MyUpdater %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if not os.path.exists('%s/ImageBoot/%s/usr/lib/enigma2/python/boxbranding.so' % (media, target)): + cmd = 'cp -r /usr/lib/enigma2/python/boxbranding.so %s/ImageBoot/%s/usr/lib/enigma2/python/boxbranding.so > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + os.system('echo "Copied plugins..."') + + if TvList == 'True': + if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)): + cmd = 'mkdir -p %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + cmd = 'cp /etc/enigma2/*.tv %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + cmd = 'cp /etc/enigma2/*.radio %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + cmd = 'cp /etc/enigma2/*.tv %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + cmd = 'cp /etc/enigma2/lamedb %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + os.system('echo "Copied TV list..."') + + if Sterowniki == 'True': + if os.path.exists('%s/ImageBoot/%s/lib/modules' % (media, target)): + cmd = 'rm -r %s/ImageBoot/%s/lib/modules' % (media, target) + rc = os.system(cmd) + cmd = 'mkdir -p %s/ImageBoot/%s/lib/modules > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /lib/modules %s/ImageBoot/%s/lib > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('%s/ImageBoot/%s/lib/firmware' % (media, target)): + cmd = 'rm -r %s/ImageBoot/%s/lib/firmware' % (media, target) + rc = os.system(cmd) + cmd = 'mkdir -p %s/ImageBoot/%s/lib/firmware > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /lib/firmware %s/ImageBoot/%s/lib > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + os.system('echo "System drivers copied..."') + + if InstallSettings == 'True': + if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)): + cmd = 'mkdir -p %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + cmd = 'cp /etc/enigma2/settings %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + if not os.path.exists('%s/ImageBoot/%s/etc/tuxbox/config' % (media, target)): + cmd = 'mkdir -p /etc/tuxbox/config %s/ImageBoot/%s/etc/tuxbox/config' % (media, target) + rc = os.system(cmd) + cmd = 'mkdir -p /etc/tuxbox/scce %s/ImageBoot/%s/etc/tuxbox/scce' % (media, target) + rc = os.system(cmd) + cmd = 'cp -a /etc/tuxbox/* %s/ImageBoot/%s/etc/tuxbox' % (media, target) + rc = os.system(cmd) + os.system('echo "System settings copied..."') + + if RepairFTP == 'True': + if os.path.exists('%s/ImageBoot/%s/etc/vsftpd.conf' % (media, target)): + filename = media + '/ImageBoot/' + target + '/etc/vsftpd.conf' + if os.path.exists(filename): + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('listen=NO') != -1: + line = 'listen=YES\n' + elif line.find('listen_ipv6=YES') != -1: + line = 'listen_ipv6=NO\n' + out.write(line) + + f.close() + out.close() + os.rename(filename2, filename) + os.system('echo "Repair ftp."') + + if SoftCam == 'True': + if os.path.exists('/etc/CCcam.cfg'): + cmd = 'cp -r /etc/CCcam.cfg %s/ImageBoot/%s/etc > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/tuxbox/config'): + cmd = 'cp -r /etc/tuxbox/config %s/ImageBoot/%s/etc/tuxbox > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + os.system('echo "Copied softcam files to the installed image..."') + + if MediaPortal == 'True': + if os.path.exists('' + extensions_path + 'MediaPortal'): + cmd = 'cp -r ' + extensions_path + 'MediaPortal %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r ' + extensions_path + 'mpgz %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /usr/lib/python2.7/argparse.pyo %s/ImageBoot/%s/usr/lib/python2.7 > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /usr/lib/python2.7/robotparser.pyo %s/ImageBoot/%s/usr/lib/python2.7 > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /usr/lib/python2.7/site-packages/Crypto %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /usr/lib/python2.7/site-packages/mechanize %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /usr/lib/python2.7/site-packages/requests %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + cmd = 'cp -r /usr/lib/python2.7/site-packages/requests-2.11.1-py2.7.egg-info %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + + if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)): + cmd = 'mkdir -p %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/enigma2/mp_2s4p'): + cmd = 'cp /etc/enigma2/mp_2s4p %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/enigma2/mp_config'): + cmd = 'cp /etc/enigma2/mp_config %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/enigma2/mp_pluginliste'): + cmd = 'cp /etc/enigma2/mp_pluginliste %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + os.system('echo "Copied MediaPortal..."') + elif not os.path.exists('' + extensions_path + 'MediaPortal'): + os.system('echo "MediaPortal not found."') + +# for all image: + + if os.path.exists('%s/ImageBoot/%s/etc/rc.local' % (media, target)): + filename = '%s/ImageBoot/%s/etc/rc.local' % (media, target) + if os.path.exists(filename): + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('exit 0') != -1: + line = '\n' + out.write(line) + + f.close() + out.close() + os.rename(filename2, filename) + cmd = 'echo -n "\n\n/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh \n\nexit 0" >> %s/ImageBoot/%s/etc/rc.local' % (media, target) + rc = os.system(cmd) + cmd = 'chmod 0755 %s/ImageBoot/%s/etc/rc.local' % (media, target) + rc = os.system(cmd) + + if os.path.exists('%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)): + filename = '%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target) + if os.path.exists(filename): + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('exit 0') != -1: + line = '\n' + out.write(line) + + f.close() + out.close() + os.rename(filename2, filename) + + cmd = 'echo -n "\n\n/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh \n\nexit 0" >> %s/ImageBoot/%s/etc/init.d/rc.local' % (media, target) + rc = os.system(cmd) + cmd = 'chmod 0755 %s/ImageBoot/%s/etc/init.d/rc.local' % (media, target) + rc = os.system(cmd) + + if not os.path.exists('%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)) and not os.path.exists('%s/ImageBoot/%s/etc/rc.local' % (media, target)) : + cmd = 'ln -s %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh %s/ImageBoot/%s/etc/rcS.d/S99neo.local' % (media, + target, + media, + target) + rc = os.system(cmd) + + if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'): + if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)): + cmd = 'mkdir -p %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + cmd = 'touch %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd) + cmd = 'grep "config.Nims" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd) + cmd = 'grep "av.videomode.DVI" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd) + cmd = 'grep "config.OpenWebif" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd) + cmd = 'grep "config.osd" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd) + cmd = 'grep "config.timezone.val" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd) + cmd = 'grep "config.servicelist.startuproot" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd) + cmd = 'grep "UUID=" /etc/fstab >> %s/ImageBoot/%s/etc/fstab' % (media, target) + rc = os.system(cmd) + + +##################################### + if not os.path.exists('' + media_target + '/boot/zImage.' + getBoxHostName() + ''): + namefile = media + '/ImageBoot/' + target + '/etc/fstab' + namefile2 = namefile + '.tmp' + if os.path.exists(namefile2): + out = open(namefile2, 'w') + f = open(namefile, 'r') + for line in f.readlines(): + if line.find('/dev/mmcblk0p1') != -1: + line = '#' + line + elif line.find('/dev/mmcblk0p2') != -1: + line = '#' + line + elif line.find('/dev/mmcblk0p3') != -1: + line = '#' + line + elif line.find('/dev/mmcblk0p4') != -1: + line = '#' + line + elif line.find('/dev/mmcblk0p5') != -1: + line = '#' + line + elif line.find('/dev/mmcblk0p6') != -1: + line = '#' + line + elif line.find('/dev/mmcblk0p7') != -1: + line = '#' + line + elif line.find('/dev/mmcblk0p8') != -1: + line = '#' + line + elif line.find('/dev/mmcblk0p9') != -1: + line = '#' + line + elif line.find('/dev/root') != -1: + line = '#' + line + elif line.find('/dev/mtdblock1') != -1: + line = '#' + line + elif line.find('/dev/mtdblock2') != -1: + line = '#' + line + elif line.find('/dev/mtdblock3') != -1: + line = '#' + line + elif line.find('/dev/mtdblock4') != -1: + line = '#' + line + elif line.find('/dev/mtdblock5') != -1: + line = '#' + line + elif line.find('/dev/mtdblock6') != -1: + line = '#' + line + elif line.find('/dev/mtdblock7') != -1: + line = '#' + line + elif line.find('/dev/mtdblock8') != -1: + line = '#' + line + elif line.find('/dev/mtdblock9') != -1: + line = '#' + line + elif line.find('/dev/root') != -1: + line = '#' + line + out.write(line) + + f.close() + out.close() + os.rename(namefile2, namefile) + + tpmd = media + '/ImageBoot/' + target + '/etc/init.d/tpmd' + if os.path.exists(tpmd): + os.system('rm ' + tpmd) + + fname = media + '/ImageBoot/' + target + '/usr/lib/enigma2/python/Components/config.py' + if os.path.exists(fname): + fname2 = fname + '.tmp' + out = open(fname2, 'w') + f = open(fname, 'r') + for line in f.readlines(): + if line.find('if file(""/proc/stb/info/vumodel")') != -1: + line = '#' + line + out.write(line) + + f.close() + out.close() + os.rename(fname2, fname) + + targetfile = media + '/ImageBoot/' + target + '/etc/vsftpd.conf' + if os.path.exists(targetfile): + targetfile2 = targetfile + '.tmp' + out = open(targetfile2, 'w') + f = open(targetfile, 'r') + for line in f.readlines(): + if not line.startswith('nopriv_user'): + out.write(line) + + f.close() + out.close() + os.rename(targetfile2, targetfile) + + mypath = media + '/ImageBoot/' + target + '/usr/lib/opkg/info/' + cmd = 'mkdir -p %s/ImageBoot/%s/var/lib/opkg/info > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if not os.path.exists(mypath): + mypath = media + '/ImageBoot/' + target + '/var/lib/opkg/info/' + for fn in os.listdir(mypath): + if fn.find('kernel-image') != -1 and fn.find('postinst') != -1: + filename = mypath + fn + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('/boot') != -1: + line = line.replace('/boot', '/boot > /dev/null 2>\\&1; exit 0') + out.write(line) + + if f.close(): + out.close() + os.rename(filename2, filename) + cmd = 'chmod -R 0755 %s' % filename + rc = os.system(cmd) + if fn.find('-bootlogo.postinst') != -1: + filename = mypath + fn + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('/boot') != -1: + line = line.replace('/boot', '/boot > /dev/null 2>\\&1; exit 0') + out.write(line) + + f.close() + out.close() + os.rename(filename2, filename) + cmd = 'chmod -R 0755 %s' % filename + rc = os.system(cmd) + if fn.find('-bootlogo.postrm') != -1: + filename = mypath + fn + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('/boot') != -1: + line = line.replace('/boot', '/boot > /dev/null 2>\\&1; exit 0') + out.write(line) + + f.close() + out.close() + os.rename(filename2, filename) + cmd = 'chmod -R 0755 %s' % filename + rc = os.system(cmd) + if fn.find('-bootlogo.preinst') != -1: + filename = mypath + fn + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('/boot') != -1: + line = line.replace('/boot', '/boot > /dev/null 2>\\&1; exit 0') + out.write(line) + + f.close() + out.close() + os.rename(filename2, filename) + cmd = 'chmod -R 0755 %s' % filename + rc = os.system(cmd) + if fn.find('-bootlogo.prerm') != -1: + filename = mypath + fn + filename2 = filename + '.tmp' + out = open(filename2, 'w') + f = open(filename, 'r') + for line in f.readlines(): + if line.find('/boot') != -1: + line = line.replace('/boot', '/boot > /dev/null 2>\\&1; exit 0') + out.write(line) + + f.close() + out.close() + os.rename(filename2, filename) + cmd = 'chmod -R 0755 %s' % filename + rc = os.system(cmd) + + os.system('mkdir -p ' + media_target + '/media/hdd' + dev_null) + os.system('mkdir -p ' + media_target + '/media/usb' + dev_null) + + os.system('mkdir -p ' + media_target + '/var/lib/opkg/info/' + dev_null) + os.system('touch ' + getNeoLocation() + 'ImageBoot/.data; echo "Data instalacji image" > ' + getNeoLocation() + 'ImageBoot/.data; echo " "; date > ' + getNeoLocation() + 'ImageBoot/.data') + os.system('mv -f ' + getNeoLocation() + 'ImageBoot/.data ' + getNeoLocation() + 'ImageBoot/%s/.data' % target) + cmd = 'touch /tmp/.init_reboot' + rc = os.system(cmd) + out = open(mediahome + '.neonextboot', 'w') + out.write(target) + out.close() + os.system('cp ' + getNeoLocation() + 'ImageBoot/.neonextboot ' + getNeoLocation() + 'ImageBoot/%s/.multinfo' % target) + out = open(mediahome + '.neonextboot', 'w') + out.write('Flash') + out.close() + if '.tar.xz' not in source and not os.path.exists('' + getNeoLocation() + '/ImageBoot/%s/etc/issue' % target): + os.system('echo ""; echo "No system installed! The reason for the installation error may be badly packed image files or it is not a system for your model."') + os.system('echo "The installed system may not start. Check the correctness of the installed image directory!!!"') + os.system('rm -r ' + getNeoLocation() + '/ImageBoot/%s' % target ) + + if os.path.exists('' + getNeoLocation() + 'ubi'): + os.system('rm -r ' + getNeoLocation() + 'ubi') + if os.path.exists('' + getNeoLocation() + 'image_cache/'): + os.system('rm -r ' + getNeoLocation() + 'image_cache') + if os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'): + os.system('rm -f ' + getNeoLocation() + 'ImageBoot/.without_copying') + + rc = RemoveUnpackDirs() + if os.path.exists('/tmp/init4'): + os.system('rm -f /tmp/init4; init 3') + + os.system('echo "End of installation:"; date +%T') + os.system('echo "If you want to save the installation process from the console press green."') + +def RemoveUnpackDirs(): + os.chdir(media + '/ImagesUpload') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/vuplus') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf4008'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/sf4008') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmio4k'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmio4k') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm900'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dm900') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd51'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/hd51') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/miraclebox') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e4hd'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/e4hd') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/update') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/*.nfi'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/*.nfi') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/zgemma') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler1'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/formuler1') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler3'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/formuler3') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler4turbo'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/formuler4turbo') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et*'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et*') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/xpeedl*'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/xpeedl*') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmini') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/xp1000 '): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/xp1000 ') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot '): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dinobot ') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e2/update'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/e2') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et1x000'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et1x000') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/protek4k'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/protek4k') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm920 '): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dm920 ') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multibox'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/unforce_multibox ' + getNeoLocation() + 'ImagesUpload/multibox; rm -r ' + getNeoLocation() + 'ImagesUpload/multibox') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/octagon/sf8008'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/octagon; rm -r ' + getNeoLocation() + 'ImagesUpload/octagon') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd60'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/hd60; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/hd60; rm -r ' + getNeoLocation() + 'ImagesUpload/hd60') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h7'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h7; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h7') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h7') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h9; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h9') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9combo'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h9combo_READ.ME ' + getNeoLocation() + 'ImagesUpload/h9combo; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h9combo.txt ' + getNeoLocation() + 'ImagesUpload/h9combo') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9combo') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h10'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h10_READ.ME ' + getNeoLocation() + 'ImagesUpload/h10; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h10.txt ' + getNeoLocation() + 'ImagesUpload/h10') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h10') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/uclan'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/uclan') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/uclan') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/beyonwiz') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/beyonwiz') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/beyonwiz') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/beyonwiz') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/amiko'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/amiko') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/amiko') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/amiko') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/amiko') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/amiko') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/gigablue') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/gigablue') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/gigablue') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/gigablue') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/gigablue') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/gigablue') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/apploader.bin ' + getNeoLocation() + 'ImagesUpload/gigablue') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/gigablue') + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/gigablue') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/gigablue') + +def NEOBootExtract(source, target, ZipDelete, BlackHole): + RemoveUnpackDirs() + os.system('echo "Press green to hide Console or red to abort the installation\nInstallation started:"; date +%T;echo "Extracting the installation file..."') + + if os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'): + os.system('rm -f ' + getNeoLocation() + 'ImageBoot/.without_copying') + if os.path.exists('' + getNeoLocation() + 'image_cache'): + os.system('rm -rf ' + getNeoLocation() + 'image_cache') + + sourcefile = media + '/ImagesUpload/%s.zip' % source + sourcefile2 = media + '/ImagesUpload/%s.nfi' % source + + #Instalacja *.nfi + if os.path.exists(sourcefile2) is True: + if sourcefile2.endswith('.nfi'): + os.system('echo "Instalacja systemu skapowanego w plik nfi..."') + to = '' + getNeoLocation() + 'ImageBoot/' + target + cmd = 'mkdir %s > /dev/null 2<&1' % to + rc = os.system(cmd) + to = '' + getNeoLocation() + 'ImageBoot/' + target + cmd = 'chmod -R 0777 %s' % to + rc = os.system(cmd) + cmd = '' + extensions_path + 'NeoBoot/bin/nfidump ' + sourcefile2 + ' ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + if ZipDelete == 'True': + rc = os.system('rm -rf ' + sourcefile2) + else: + os.system('echo "NeoBoot keep the file: %s for reinstallation."' % sourcefile2) + #Instalacja *.zip + elif os.path.exists(sourcefile) is True: + os.system('unzip ' + sourcefile) + if ZipDelete == 'True': + os.system('rm -rf ' + sourcefile) + + #Instalacja MIPS + if getCPUtype() == 'MIPS': + if os.path.exists('' + getNeoLocation() + 'ubi') is False: + rc = os.system('mkdir ' + getNeoLocation() + 'ubi') + to = '' + getNeoLocation() + 'ImageBoot/' + target + cmd = 'mkdir %s > /dev/null 2<&1' % to + rc = os.system(cmd) + to = '' + getNeoLocation() + 'ImageBoot/' + target + cmd = 'chmod -R 0777 %s' % to + rc = os.system(cmd) + rootfname = 'rootfs.bin' + brand = '' + #NANDSIM + if os.path.exists('/lib/modules/%s/kernel/drivers/mtd/nand/nandsim.ko' % getKernelVersion()): + for i in range(0, 20): + mtdfile = '/dev/mtd' + str(i) + if os.path.exists(mtdfile) is False: + break + + mtd = str(i) + os.chdir(media + '/ImagesUpload') + #zgemma + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma'): + os.chdir('zgemma') + brand = 'zgemma' + rootfname = 'rootfs.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/sh1'): + os.chdir('sh1') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/sh2'): + os.chdir('sh2') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h2'): + os.chdir('h2') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h3'): + os.chdir('h3') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h5'): + os.chdir('h5') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h7'): + os.chdir('h7') + + #miraclebox + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox'): + os.chdir('miraclebox') + brand = 'miraclebox' + rootfname = 'rootfs.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/mini'): + os.chdir('mini') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/miniplus'): + os.chdir('miniplus') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/minihybrid'): + os.chdir('minihybrid') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/twin'): + os.chdir('twin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/ultra'): + os.chdir('ultra') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/micro'): + os.chdir('micro') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/twinplus'): + os.chdir('twinplus') + #atemio + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio'): + os.chdir('atemio') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/5x00'): + os.chdir('5x00') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/6000'): + os.chdir('6000') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/6100'): + os.chdir('6100') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/6200'): + os.chdir('6200') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/8x00'): + os.chdir('8x00') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/8x00'): + os.chdir('8x00') + #Xtrend + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et10000'): + os.chdir('et10000') + brand = 'et10000' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et9x00'): + os.chdir('et9x00') + brand = 'et9x00' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et8500'): + os.chdir('et8500') + brand = 'et8500' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et8000'): + os.chdir('et8000') + brand = 'et8000' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et7x00'): + os.chdir('et7x00') + brand = 'et7x00' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et6x00'): + os.chdir('et6x00') + brand = 'et6x00' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et5x00'): + os.chdir('et5x00') + brand = 'et5x00' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et4x00'): + os.chdir('et4x00') + brand = 'et4x00' + #formuler + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler1'): + os.chdir('formuler1') + brand = 'formuler1' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler2'): + os.chdir('formuler2') + brand = 'formuler2' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler3'): + os.chdir('formuler3') + brand = 'formuler3' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler4turbo'): + os.chdir('formuler4turbo') + brand = 'formuler4turbo' + #inne + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf3038'): + os.chdir('sf3038') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xpeedlx'): + os.chdir('xpeedlx') + brand = 'xpeedlx' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xpeedlx3'): + os.chdir('xpeedlx3') + brand = 'xpeedlx3' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xp1000'): + os.chdir('xp1000') + brand = 'xp1000' + #VuPlus + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus'): + os.chdir('vuplus') + brand = 'vuplus' + rootfname = 'root_cfe_auto.jffs2' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/uno'): + os.chdir('uno') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/duo'): + os.chdir('duo') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/ultimo'): + os.chdir('ultimo') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solo'): + os.chdir('solo') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/duo2'): + os.chdir('duo2') + rootfname = 'root_cfe_auto.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solo2'): + os.chdir('solo2') + rootfname = 'root_cfe_auto.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solose'): + os.chdir('solose') + rootfname = 'root_cfe_auto.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/zero'): + os.chdir('zero') + rootfname = 'root_cfe_auto.bin' + + #osmini + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini'): + os.chdir('osmini') + brand = 'osmini' + + + #Instalacja image nandsim + os.system('echo "Instalacja - nandsim w toku..."') + rc = os.system('insmod /lib/modules/' + getKernelVersion() + '/kernel/drivers/mtd/nand/nandsim.ko cache_file=' + getNeoLocation() + 'image_cache first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15;sleep 5' )#% getKernelVersion()) + cmd = 'dd if=%s of=/dev/mtdblock%s bs=2048' % (rootfname, mtd) + rc = os.system(cmd) + cmd = 'ubiattach /dev/ubi_ctrl -m %s -O 2048' % mtd + rc = os.system(cmd) + rc = os.system('mount -t ubifs ubi1_0 ' + getNeoLocation() + 'ubi') + os.chdir('/home/root') + cmd = 'cp -r ' + getNeoLocation() + 'ubi/* ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + rc = os.system('umount ' + getNeoLocation() + 'ubi') + cmd = 'ubidetach -m %s' % mtd + rc = os.system(cmd) + rc = os.system('rmmod nandsim') + rc = os.system('rm ' + getNeoLocation() + 'image_cache') + + if '.tar.xz' not in source and not os.path.exists('%s/ImageBoot/%s/etc/issue' % (media, target)): + os.system("echo 3 > /proc/sys/vm/drop_caches") + + os.system('echo ""; echo "Nie zainstalowano systemu ! Powodem b\xc5\x82\xc4\x99du instalacji mo\xc5\xbce by\xc4\x87 kernel-module-nandsim."') + os.system('echo "By uzyc innego narzedzia do rozpakowania image, ponow instalacje image jeszcze raz po restarcie tunera."') + os.system('echo "RESTART ZA 15 sekund..."') + + rc = os.system('rm -rf /lib/modules/%s/kernel/drivers/mtd/nand/nandsim.ko ' % getKernelVersion()) + + os.system('rm -r %s/ImageBoot/%s' % (media, target)) + os.system('sleep 5; init 4; sleep 5; init 3 ') + + #UBI_READER + elif os.path.exists('' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py'): + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/venton-hdx'): + os.chdir('venton-hdx') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/hde'): + os.chdir('hde') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/hdx'): + os.chdir('hdx') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/hdp'): + os.chdir('hdp') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox'): + os.chdir('miraclebox') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/mini'): + os.chdir('mini') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/miniplus'): + os.chdir('miniplus') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/minihybrid'): + os.chdir('minihybrid') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/twin'): + os.chdir('twin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/ultra'): + os.chdir('ultra') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/micro'): + os.chdir('micro') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/microv2'): + os.chdir('microv2') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/twinplus'): + os.chdir('twinplus') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/mini4k'): + os.chdir('mini4k') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/ultra4k'): + os.chdir('ultra4k') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio'): + os.chdir('atemio') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/5x00'): + os.chdir('5x00') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/6000'): + os.chdir('6000') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/6100'): + os.chdir('6100') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/6200'): + os.chdir('6200') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/atemio/8x00'): + os.chdir('8x00') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xpeedlx'): + os.chdir('xpeedlx') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xpeedlx3'): + os.chdir('xpeedlx3') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/bwidowx'): + os.chdir('bwidowx') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/bwidowx2'): + os.chdir('bwidowx2') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz'): + os.chdir('beyonwiz') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz/hdx'): + os.chdir('hdx') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz/hdp'): + os.chdir('hdp') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz/hde2'): + os.chdir('hde2') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus'): + os.chdir('vuplus') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/duo'): + os.chdir('duo') + os.system('mv root_cfe_auto.jffs2 rootfs.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solo'): + os.chdir('solo') + os.system('mv -f root_cfe_auto.jffs2 rootfs.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solose'): + os.chdir('solose') + os.system('mv -f root_cfe_auto.jffs2 rootfs.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/ultimo'): + os.chdir('ultimo') + os.system('mv -f root_cfe_auto.jffs2 rootfs.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/uno'): + os.chdir('uno') + os.system('mv -f root_cfe_auto.jffs2 rootfs.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solo2'): + os.chdir('solo2') + os.system('mv -f root_cfe_auto.bin rootfs.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/duo2'): + os.chdir('duo2') + os.system('mv -f root_cfe_auto.bin rootfs.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/zero'): + os.chdir('zero') + os.system('mv -f root_cfe_auto.bin rootfs.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solo4k'): + os.chdir('solo4k') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/uno4k'): + os.chdir('uno4k') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/ultimo4k'): + os.chdir('ultimo4k') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/duo4k'): + os.chdir('duo4k') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/zero4k'): + os.chdir('zero4k') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/uno4kse'): + os.chdir('uno4kse') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et10000'): + os.chdir('et10000') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et9x00'): + os.chdir('et9x00') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et8500'): + os.chdir('et8500') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et8000'): + os.chdir('et8000') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et7x00'): + os.chdir('et7x00') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et6x00'): + os.chdir('et6x00') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et5x00'): + os.chdir('et5x00') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et4x00'): + os.chdir('et4x00') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf8'): + os.chdir('sf') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf98'): + os.chdir('sf98') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf108'): + os.chdir('sf108') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf128'): + os.chdir('sf128') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf138'): + os.chdir('sf138') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf208'): + os.chdir('sf208') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf228'): + os.chdir('sf228') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf3038'): + os.chdir('sf3038') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf4008'): + os.chdir('sf4008') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/octagon/sf8008'): + os.chdir('sf8008') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue'): + os.chdir('gigablue') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/quad'): + os.chdir('quad') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd2400'): + os.chdir('hd2400') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd51'): + os.chdir('hd51') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma'): + os.chdir('zgemma') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h3'): + os.chdir('h3') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h5'): + os.chdir('h5') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h7'): + os.chdir('h7') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm900'): + os.chdir('dm900') + #osmini + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini'): + os.chdir('osmini') + #xp1000 + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xp1000'): + os.chdir('xp1000') + + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler1'): + os.chdir('formuler1') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler2'): + os.chdir('formuler2') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler3'): + os.chdir('formuler3') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler4turbo'): + os.chdir('formuler4turbo') + + + #Instalacja image ubi_reader + os.system('echo "Instalacja - ubi_reader w toku..."') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/root_cfe_auto.*'): + os.system('mv -f root_cfe_auto.* rootfs.bin') + cmd = 'chmod 777 ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py' + rc = os.system(cmd) + cmd = 'python ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o' + getNeoLocation() + 'ubi' + rc = os.system(cmd) + os.chdir('/home/root') + os.system('mv ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/%s/' % target) + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + + else: + os.system('echo "NeoBoot wykrył błąd !!! Prawdopodobnie brak ubi_reader lub nandsim."') + +#ARM + elif getCPUtype() == 'ARMv7': + os.chdir('' + getNeoLocation() + 'ImagesUpload') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9/rootfs.ubi'): + os.chdir('h9') + os.system('mv -f rootfs.ubi rootfs.bin') + os.system('echo "Instalacja - ubi_reader w toku..."') + print '[NeoBoot] Extracting UBIFS image and moving extracted image to our target' + cmd = 'chmod 777 ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py' + rc = os.system(cmd) + cmd = 'python ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o ' + getNeoLocation() + 'ubi' + rc = os.system(cmd) + os.chdir('/home/root') + cmd = 'cp -r -p ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' + rc = os.system(cmd) + + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf4008'): + os.system('echo "Please wait. System installation Octagon SF4008."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/sf4008/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/sf4008/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/octagon/sf8008'): + os.system('echo "Please wait. System installation Octagon SF8008."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/octagon/sf8008/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/octagon/sf8008/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmio4k'): + os.system('echo "Please wait. System installation EDISION osmio4k"') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/osmio4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/osmio4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm900'): + os.system('echo "Please wait. System installation Dreambox DM900."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dm900/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/dm900/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/%s.tar.xz' % source): + os.system('echo "Please wait. System installation spakowanego w plik tar.xz w toku..."') + os.system('cp -r ' + getNeoLocation() + 'ImagesUpload/%s.tar.xz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz' % source) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz; tar -jJxvf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2'): + os.system('echo "Please wait. System installation AX 4K Box HD51 "') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd60'): + os.system('echo "Please wait. System installation AX HD60 4K"') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/hd60/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/hd60/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/quad4k'): + os.system('echo "Please wait. System installation GigaBlue quad4k"') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/quad4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/gigablue/quad4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/ue4k'): + os.system('echo "Please wait. System installation GigaBlue ue4k."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/ue4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/gigablue/ue4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solo4k'): + os.system('echo "Please wait. System installation VuPlus Solo4K."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/solo4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/vuplus/solo4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/uno4k'): + os.system('echo "Please wait. System installation dla modelu VuPlus Uno4K."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/uno4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/vuplus/uno4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/uno4kse'): + os.system('echo "Please wait. System installation VuPlus Uno4kse."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/uno4kse/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/vuplus/uno4kse/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/zero4k'): + os.system('echo "Please wait. System installation VuPlus zero4K."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/zero4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/vuplus/zero4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/ultimo4k'): + os.system('echo "Please wait. System installation VuPlus Ultimo4K."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/ultimo4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/vuplus/ultimo4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/duo4k'): + os.system('echo "Please wait. System installation VuPlus Duo4k."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/duo4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/vuplus/duo4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/revo4k'): + os.system('echo "Please wait. System installation Revo4k."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/revo4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/update/revo4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/force3uhd'): + os.system('echo "Please wait. System installation force3uhd."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/force3uhd/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/update/force3uhd/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/galaxy4k'): + os.system('echo "Please wait. System installation Galaxy4k."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/galaxy4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/update/galaxy4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h7/rootfs.tar.bz2'): + os.system('echo "Please wait. System installation Zgemma H7."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/zgemma/h7/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/zgemma/h7/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h9/rootfs.tar.bz2'): + os.system('echo "Please wait. System installation Zgemma H9S ."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/zgemma/h9/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/zgemma/h9/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9combo/rootfs.tar.bz2'): + os.system('echo "Please wait. System installation Zgemma h9combo ."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/h9combo/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/h9combo/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h10/rootfs.tar.bz2'): + os.system('echo "Please wait. System installation Zgemma h10 ."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/h10/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/h10/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/mini4k'): + os.system('echo "Please wait. System installation Miraclebox mini4k."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/miraclebox/mini4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/miraclebox/mini4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/ultra4k'): + os.system('echo "Please wait. System installation Miraclebox ultra4k."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/miraclebox/ultra4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/miraclebox/ultra4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e4hd'): + os.system('echo "Please wait. System installation Axas E4HD 4K Ultra w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/e4hd/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/e4hd/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/lunix3-4k'): + os.system('echo "Please wait. System installation Qviart lunix3-4k w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/lunix3-4k; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/update/lunix3-4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot/u5'): + os.system('echo "Please wait. System installation dinobot w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dinobot/u5; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/dinobot/u5/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/uclan/ustym4kpro'): + os.system('echo "Please wait. System installation ustym4kpro w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/uclan/ustym4kpro; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/uclan/ustym4kpro/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et1x000'): + os.system('echo "Please wait. System installation GI ET-11000 4K w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/et1x000; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/et1x000/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e2/update'): + os.system('echo "Please wait. System installation Ferguson Ariva 4K Combo w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/e2/update; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/e2/update/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e2/update'): + os.system('echo "Please wait. System installation Ferguson Ariva 4K Combo w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dm920; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/dm920/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz/v2'): + os.system('echo "Please wait. System installation beyonwiz v2 4K w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/beyonwiz/v2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/beyonwiz/v2/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/amiko/viper4k'): + os.system('echo "Please wait. System installation Amiko viper4k 4K w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/amiko/viper4k; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/amiko/viper4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/tmtwin4k'): + os.system('echo "Please wait. System installation tmtwin4k."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/tmtwin4k/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/update/tmtwin4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/trio4k'): + os.system('echo "Please wait. System installation trio4k 4K Combo..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/trio4k; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/gigablue/trio4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/ip4k'): + os.system('echo "Please wait. System installation gbip4k 4K..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/ip4k; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/gigablue/ip4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/protek4k'): + os.system('echo "Please wait. System installation protek4k..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/protek4k; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/protek4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multibox'): + os.system('echo "Please wait. System installation multibox..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/multibox; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/multibox/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + else: + os.system('echo "NeoBoot wykrył dłąd!!! Prawdopodobnie brak pliku instalacyjnego."') + + + if BlackHole == 'True': + if 'BlackHole' in source and os.path.exists('%s/ImageBoot/%s/usr/lib/enigma2/python/Blackhole' % (media, target)): + ver = source.replace('BlackHole-', '') + try: + text = ver.split('-')[0] + except: + text = '' + + cmd = 'mkdir ' + getNeoLocation() + 'ImageBoot/%s/boot/blackhole' % target + rc = os.system(cmd) + cmd = 'cp -f ' + extensions_path + 'NeoBoot/bin/version ' + getNeoLocation() + 'ImageBoot/%s/boot/blackhole' % target + rc = os.system(cmd) + cmd = 'mv ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.pyo ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.pyo.org' % (target, target) + rc = os.system(cmd) + cmd = 'cp -rf ' + extensions_path + 'NeoBoot/bin/utilsbh ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.py' % target + rc = os.system(cmd) + localfile = '' + getNeoLocation() + 'ImageBoot/%s/boot/blackhole/version' % target + temp_file = open(localfile, 'w') + temp_file.write(text) + temp_file.close() + cmd = 'mv ' + getNeoLocation() + 'ImageBoot/%s/usr/bin/enigma2 ' + getNeoLocation() + 'ImageBoot/%s/usr/bin/enigma2-or' % (target, target) + rc = os.system(cmd) + fail = '' + getNeoLocation() + 'ImageBoot/%s/usr/bin/enigma2-or' % target + f = open(fail, 'r') + content = f.read() + f.close() + localfile2 = '' + getNeoLocation() + 'ImageBoot/%s/usr/bin/enigma2' % target + temp_file2 = open(localfile2, 'w') + temp_file2.write(content.replace('/proc/blackhole/version', '/boot/blackhole/version')) + temp_file2.close() + cmd = 'chmod -R 0755 %s' % localfile2 + rc = os.system(cmd) + cmd = 'rm -r ' + getNeoLocation() + 'ImageBoot/%s/usr/bin/enigma2-or' % target + rc = os.system(cmd) + + return 0 +#END diff --git a/NeoBoot/plugin.py b/NeoBoot/plugin.py index 5518816..17eb724 100644 --- a/NeoBoot/plugin.py +++ b/NeoBoot/plugin.py @@ -530,8 +530,31 @@ class NeoBootInstallation(Screen): 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 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') + if getCPUSoC() or getBoxHostName() or getTunerModel() == ['ax51', + 'dm920', + 'et1x000', + 'bcm7251', + 'sf4008', + 'bcm7251s', + 'h7', + 'h9combo', + 'zgemmah9s', + 'h10', + 'bcm7252s', + 'gbquad4k', + 'osmio4k', + 'ax60', + 'sf8008', + 'bcm7251', + 'BCM97252SSFF', + 'dm900', + 'tmtwin4k', + 'anadol4k', + 'protek4k', + 'maxytecmulti', + 'force3uhd', + 'viper4k']: + 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': @@ -550,13 +573,17 @@ class NeoBootInstallation(Screen): 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 + '/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() == 'bcm7251s' or getBoxHostName() == 'h7': + 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/h7s_kernel.sh ' + LinkNeoBoot + '/files/kernel.sh; mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/tmpfiles/runpy/target/h7s_run.py /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/run.py; cd') + elif getCPUSoC() or getBoxHostName() == ['7444s', '7252s', '7376', @@ -954,20 +981,25 @@ class NeoBootImageChoose(Screen): 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/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) + if fileExists('' + LinkNeoBoot + '/ver.txt'): + mypath = '' + version = open('' + LinkNeoBoot + '/ver.txt', 'r') + mypath = float(version.read().strip()) + version.close() + if float(UPDATEVERSION) != mypath: + message = _('NeoBoot has detected update.\nDo you want to update NeoBoota now ?') + ybox = self.session.openWithCallback(self.aktualizacjamboot, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Updating ... ')) + elif fileExists('' + LinkNeoBoot + '/ver.txt'): + os.system('rm ' + LinkNeoBoot + '/ver.txt') + if fileExists('' + LinkNeoBoot + '/wget-log'): + os.system('rm ' + LinkNeoBoot + '/wget-log') + self.session.open(MessageBox, _('Updated unnecessary, you have the latest version. Please try again later.'), MessageBox.TYPE_INFO) + else: + self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 10) else: - mypath = '' - version = open('' + LinkNeoBoot + '/ver.txt', 'r') - mypath = float(version.read().strip()) - version.close() - if float(UPDATEVERSION) != mypath: - message = _('NeoBoot has detected update.\nDo you want to update NeoBoota now ?') - ybox = self.session.openWithCallback(self.aktualizacjamboot, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Updating ... ')) - elif fileExists('' + LinkNeoBoot + '/ver.txt'): - os.system('rm ' + LinkNeoBoot + '/ver.txt') - self.session.open(MessageBox, _('Updated unnecessary, you have the latest version. Please try again later.'), MessageBox.TYPE_INFO) + if not fileExists('' + LinkNeoBoot + '/ver.txt'): + self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 10) def aktualizacjamboot(self, yesno): if yesno: @@ -1251,7 +1283,13 @@ class NeoBootImageChoose(Screen): 'ustym4kpro' 'h3' 'formuler4turbo' - 'formuler3']: + 'formuler3', + 'tmtwin4k', + 'anadol4k', + 'protek4k', + 'maxytecmulti', + 'force3uhd', + 'viper4k ']: self.extractImage() else: self.messagebox = self.session.open(MessageBox, _('The tuner is not supported by NeoBoot.\nContact the author.\nNo proper STB for installation !!!!'), MessageBox.TYPE_INFO, 8) @@ -1381,7 +1419,7 @@ def checkInternet(): def checkimage(): mycheck = False - if not fileExists('/proc/stb/info') or not fileExists('' + LinkNeoBoot + '/neoskins/neo/neo_skin.py') or not fileExists('' + LinkNeoBoot + '/tmpfiles') or not fileExists('' + LinkNeoBoot + '/usedskin.pyo') or not fileExists('/etc/neo'): + if not fileExists('/proc/stb/info') or not fileExists('' + LinkNeoBoot + '/neoskins/neo/neo_skin.py') or not fileExists('' + LinkNeoBoot + '/bin/neoinitarm'): mycheck = False else: mycheck = True diff --git a/NeoBoot/stbinfo b/NeoBoot/stbinfo new file mode 100644 index 0000000..c18a60e --- /dev/null +++ b/NeoBoot/stbinfo @@ -0,0 +1,78 @@ +#!/bin/sh +#Wspierane tunery satelitarne: +#Machine BCM - getCPUSoC(): + +cat /proc/stb/info/chipset: +cat /proc/stb/info/chipset +cat /etc/hostname +cat /proc/cpuinfo +cat /proc/version +cat /etc/issue +cat /proc/mtd +mtd_debug info /dev/mtd0 +cat /proc/cmdline +cat /proc/partitions +cat /var/lib/opkg/info/kernel-image*.postinst + + +Ultimo4k : 7444s +Solo4k : 7376 +Zero 4K : 72604 +Duo4k : 7278 #BCM7278 +Uno4K : 7252s +Uno4kSE : 7252s +Ultimo : 7405(with 3D) +Uno : 7405(with 3D) +Duo : 7335 +Duo2 : 7424 +Zero : 7362 +Solo : 7325 +Solose : 7241 +Solose-v2 : 7241 +Solo2 : 7356 + +Formuler F1 : bcm7356 +Formuler F3 : 7362 + +Miraclebox MBmini : bcm7358 +Miraclebox Micro : bcm7362 +Miraclebox Ultra : bcm7424 + +Octagon Sf8008 : 3798mv200 +Octagon SF4008 : bcm7251 + +Zgemma h7S : bcm7251s +Zgemma H9S : hi3798mv200 hostname: zgemmah9s; mtd6: 01000000 00020000 "kernel" ; mtd7: 0ea00000 00020000 "rootfs" + +AX HD60 4K : hi3798mv200 # cat /etc/hostname : ax60 + +OSmini : BCM7362 + +atemio6000 : bcm7362 + +gbquad4k : bcm7252s # cat /proc/stb/info/model : gbquad4k # # cat /etc/hostname : gbquad4k # cat /proc/cmdline root=/dev/mmcblk0p5 rootwait rw rootflags=data=journal libata.force=1:3.0G,2:3.0G,3:3.0G coherent_poll=2M vmalloc=525m bmem=529m@491m bmem=608m@2464m + +ustym4kpro: cat /proc/stb/info/chipset 3798mv200 root@ustym4kpro: cat /etc/hostname ustym4kpro + +GI ET-11000 4K : bcm7251 #cat /etc/hostname et1x000 #Galaxy Innvations ET-11000 + +AX HD51 4K : bcm7251s # cat /etc/hostname : ax51 # cat /proc/stb/info/boxtype : hd51 + +viper4k +osmio4k +ax60 +sf8008 +sf4008 +et1x000 +dm920 +ax51 +gbquad4k +ustym4kpro +dm900 +tmtwin4k +anadol4k +protek4k +maxytecmulti +force3uhd + + \ No newline at end of file diff --git a/NeoBoot/unpack.py b/NeoBoot/unpack.py new file mode 100644 index 0000000..417c419 --- /dev/null +++ b/NeoBoot/unpack.py @@ -0,0 +1,327 @@ +# -*- coding: utf-8 -*- + +#from __init__ import _ +from Plugins.Extensions.NeoBoot.__init__ import _ +from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getKernelVersionString, getKernelImageVersion, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel +from enigma import getDesktop +from enigma import eTimer +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 +from Screens.Standby import TryQuitMainloop +from Components.About import about +from Components.Sources.List import List +from Components.Button import Button +from Components.ActionMap import ActionMap, NumberActionMap +from Components.GUIComponent import * +from Components.MenuList import MenuList +from Components.Input import Input +from Components.Label import Label +from Components.ProgressBar import ProgressBar +from Components.ScrollLabel import ScrollLabel +from Components.Pixmap import Pixmap, MultiPixmap +from Components.config import * +from Components.ConfigList import ConfigListScreen +from Tools.LoadPixmap import LoadPixmap +from Tools.Directories import fileExists, pathExists, createDir, resolveFilename, SCOPE_PLUGINS +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 +import os +import time +if fileExists('/etc/vtiversion.info') and fileExists('/.multinfo'): + from Screens.Console import Console +else: + from files.neoconsole import Console +LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' + +def getDS(): + s = getDesktop(0).size() + return (s.width(), s.height()) + +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 InstallImage(Screen, ConfigListScreen): + if isFHD(): + skin = """ + + + + + + + + + + + + + \ + """ + else: + skin = """ + + + + + + + + + + + + + + + """ + + 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('.tar.xz') != -1: + fn = fn.replace('.tar.xz', '') + 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) + self.CopyKernel = ConfigYesNo(default=True) + self.TvList = ConfigYesNo(default=False) + self.Sterowniki = ConfigYesNo(default=False) + 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.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 createSetup(self): + self.list = [] + self.list.append(getConfigListEntry(_('Source Image file'), self.source)) + self.list.append(getConfigListEntry(_('Image Name'), self.target)) + self.list.append(getConfigListEntry(_('Stop E2 processes during installation?'), self.stopenigma)) + self.list.append(getConfigListEntry(_('Copy files from Flash to the installed image ?'), self.CopyFiles )) + self.list.append(getConfigListEntry(_('Copy the kernel of the installed system (recommended ?'), self.CopyKernel )) + self.list.append(getConfigListEntry(_('Copy the channel list ?'), self.TvList)) + self.list.append(getConfigListEntry(_('Copy the drivers ? (Recommended only other image.)'), self.Sterowniki)) + self.list.append(getConfigListEntry(_('Copy Settings to the new Image'), self.InstallSettings)) + self.list.append(getConfigListEntry(_('Delete Image zip after Install ?'), self.ZipDelete)) + self.list.append(getConfigListEntry(_('Repair FTP ? (Recommended only other image if it does not work.)'), self.RepairFTP)) + self.list.append(getConfigListEntry(_('Copy config SoftCam ?'), self.SoftCam)) + self.list.append(getConfigListEntry(_('Copy MediaPortal ?'), self.MediaPortal)) + self.list.append(getConfigListEntry(_('Path BlackHole ? (Not recommended for VuPlus)'), self.BlackHole)) + + def HelpInstall(self): + self.session.open(HelpInstall) + + def typeChange(self, value): + self.createSetup() + self['config'].l.setList(self.list) + if self.curselimage != self.source.value: + self.target.value = self.source.value[:-13] + self.curselimage = self.source.value + + def openKeyboard(self): + sel = self['config'].getCurrent() + if sel: + if sel == self.target: + if self['config'].getCurrent()[1].help_window.instance is not None: + self['config'].getCurrent()[1].help_window.hide() + self.vkvar = sel[0] + if self.vkvar == _('Image Name'): + self.session.openWithCallback(self.VirtualKeyBoardCallback, VirtualKeyBoard, title=self['config'].getCurrent()[0], text=self['config'].getCurrent()[1].value) + return + + def VirtualKeyBoardCallback(self, callback = None): + if callback is not None and len(callback): + self['config'].getCurrent()[1].setValue(callback) + self['config'].invalidate(self['config'].getCurrent()) + return + + def imageInstall(self): + if self.check_free_space(): + 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 ' % (cmd1, + source, + target.replace(' ', '.'), + str(self.stopenigma.value), + str(self.CopyFiles.value), + str(self.CopyKernel.value), + str(self.TvList.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.BlackHole.value)) + print '[NEO-BOOT]: ', cmd + from Plugins.Extensions.NeoBoot.plugin import PLUGINVERSION + self.session.open(Console, _('NeoBoot v.%s - Install new image') % PLUGINVERSION, [message, cmd]) + + 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 cancel(self): + self.close() + + +class HelpInstall(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 = _('Source Image file') + message += _(' - Select the software to be installed with the cursor (left or right).\n\n') + + message += _('Image Name') + message += _(' - to change, press blue on the remote control.\n\n') + + message += _('Copy files from Flash to the installed image ?') + message += _(' - this checking this option on it nothing will be copied from the image flash to the installed image in neoboot.\n\n') + + message += _('Copy the kernel of the installed system (recommended ?') + message += _('- after selecting this option, the kernel of the installed image will be copied to neoboot, only recommended for STB vuplus\n\n') + + message += _('Copy the channel list ?') + message += _(' - Option to copy channel list from flash to image installed in neoboot.\n\n') + + message += _('Copy mounting disks ? (Recommended)') + message += _(' - the option transfers mounts to the image installed in neoboot from the flashlight, recommended only if you are installing an image from a different model than you have.\n\n') + + message += _('Copy network settings LAN-WLAN ?') + message += _(' - the option moves files with the settings for lan and wlan.\n\n') + + message += _('Copy the drivers ? (Recommended only other image.)') + message += _(' - Option to copy drivers to the image installed in neoboot from the flashlight, recommended only if you are installing an image from a different model than you have.\n\n') + + message += _('Copy Settings to the new Image') + message += _(' - the option copies the software settings from the flashlight to the system being installed in the neobot.\n\n') + + message += _('Delete Image zip after Install ?') + message += _(' - po instalacji, opcja kasuje plik zip image z katalogu ImagesUpload.\n\n') + + message += _('Repair FTP ? (Recommended only other image if it does not work.)') + message += _(' - the option in some cases repairs the File Transfer Protocol connection in the installed image.\n\n') + + message += _('Copy config SoftCam ?') + message += _(' - the option copies oscam configi and cccam, openpli default.\n\n') + + message += _('Path BlackHole ? (Not recommended for VuPlus)') + message += _(' - option for image blackhole, helps to run BH in neoboot\n\n') + + self['lab1'].show() + self['lab1'].setText(message) + \ No newline at end of file diff --git a/NeoBoot/usedskin.py b/NeoBoot/usedskin.py index efefdf9..5f32cdd 100644 --- a/NeoBoot/usedskin.py +++ b/NeoBoot/usedskin.py @@ -1,9 +1,10 @@ -# skin = ./meoskins/defaul_skin - gutosie +# neo = /neoskins/neo/neo_skin.py - gutosie from Screens.Screen import Screen from Components.Pixmap import Pixmap import os + #Colors (#AARRGGBB) #____Recommended colors - Zalecane kolory : #color name="white" value="#ffffff" @@ -15,305 +16,112 @@ import os #color name="orange" value="#00ffa500" #color name="gray" value="#808080" #color name="lightgrey" value="#009b9b9b" -# green = '#00389416' lub #00389416 -# red = '#00ff2525' -# yellow = '#00ffe875' -# orange = '#00ff7f50' -# seledynowy = #00FF00 -# jasny-blue = #99FFFF -# Zamiast font=Regular ktory nie rozpoznaje polskich znakow np. na VTi, mozesz zmienic na ponizsze font="*: - # font - genel - # font - baslk - # font - tasat - # font - dugme +# font genel +# font baslk +# font tasat +# font dugme -# +#jak by chcial ktos wlasny selektor, to przyklad: +# -###____ Skin Ultra HD - ImageChooseFULLHD ___ mod. gutosie___ +### ImageChooseFULLHD ImageChooseFULLHD =""" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - + + + + + + + + + + + + + + + + + +#Window image selection - Okno wyboru image + + +#Used Kernel: + + +#More options - Menu + + + + +#key 1> 2> 3> + + + + + + + +#Please choose an image to boot + + +#NeoBoot is running from: + + + +#NeoBoot is running image: + + + +#Memory disc: - Pamiec dysku + + + +#Number of images installed: + + + +#Version update: + +#UPDATEVERSION + + +#NeoBoot version: + +#PLUGINVERSION + + +#Kernel Version + +#KERNELVERSION + + +#hostname + + +#Memory - Used: Available: + + +#VIP + + + """ -###____ Skin Ultra HD - ImageChooseULTRAHD ___ mod. gutosie___ -ImageChooseULTRAHD =""" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default - - Format:%A - - Format:%e. %b. - -""" +###ImageChoose-HD -###____ Skin HD - ImageChoose ___mod. gutosie ___ -ImageChooseHD =""" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Format:%-H:%M - - -""" - - -###____ Skin FULLHD - MyUpgradeFULLHD ___mod. gutosie ___ -MyUpgradeFULLHD =""" - - - - \ - {"template": [MultiContentEntryText(pos = (90, 1), size = (1250, 66), flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER, text = 0), - MultiContentEntryPixmapAlphaTest(pos = (8, 4), size = (66, 66), png = 1), - ], - "fonts": [gFont("dugme", 40)], - "itemHeight": 66 - } - - - - - """ - - -###____ Skin UltraHD - MyUpgradeUltraHD ___mod. gutosie ___ -MyUpgradeUltraHD =""" - - - - - {"template": [MultiContentEntryText(pos=(0,0), size=(1680,132), flags=RT_HALIGN_CENTER|RT_VALIGN_CENTER, text=0)], "fonts": [gFont("Regular",66)], "itemHeight":132}\n - - - - - - - - """ - - -###____ Skin MyUpgradeHD - MyUpgradeHD ___mod. gutosie ___ -MyUpgradeHD =""" - - - - - {"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 - } - - - - - """ - - -###____ Skin NeoBootInstallationFULLHD - NeoBootInstallationFULLHD ___mod. gutosie ___ -NeoBootInstallationFULLHD =""" - - - - - - - - - - - - - - - - - - - """ - -###____ Skin NeoBootInstallationUltraHD - NeoBootInstallationUltraHD ___mod. gutosie ___ -NeoBootInstallationUltraHD =""" - - - - - - - - - - - - - - - - - - - - - Default - - - Format:%A - - Format:%e. %b. - - """ - - -###____ Skin NeoBootInstallationHD - NeoBootInstallationHD ___mod. gutosie ___ -NeoBootInstallationHD =""" - - - - - - - - - - - - - - - """ - - - - - - - \ No newline at end of file