From 2aad78a9b4a280dcf86a9529797eeb3a0a3fe708 Mon Sep 17 00:00:00 2001 From: gutosie Date: Sun, 7 Dec 2025 14:40:55 +0200 Subject: [PATCH] Add files via upload --- NeoBoot/__init__.py | 18 +- NeoBoot/ex_init.py | 33 +- NeoBoot/extract.py | 6869 ++++++++++--------------------------------- NeoBoot/plugin.py | 3477 +++++++--------------- NeoBoot/stbinfo.cfg | 5 +- NeoBoot/unpack.py | 486 ++- NeoBoot/usedskin.py | 36 + 7 files changed, 2873 insertions(+), 8051 deletions(-) diff --git a/NeoBoot/__init__.py b/NeoBoot/__init__.py index 3d598c1..9f8891e 100644 --- a/NeoBoot/__init__.py +++ b/NeoBoot/__init__.py @@ -1,28 +1,26 @@ +# -*- coding: utf-8 -*- + +from __future__ import print_function from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE import os import gettext - -PluginLanguageDomain = "NeoBoot" -PluginLanguagePath = "Extensions/NeoBoot/locale" +PluginLanguageDomain = 'NeoBoot' +PluginLanguagePath = 'Extensions/NeoBoot/locale' def localeInit(): lang = language.getLanguage()[:2] - os.environ["LANGUAGE"] = lang + os.environ['LANGUAGE'] = lang print("[NeoBoot] set language to "), lang - gettext.bindtextdomain( - PluginLanguageDomain, - resolveFilename( - SCOPE_PLUGINS, - PluginLanguagePath)) + gettext.bindtextdomain(PluginLanguageDomain, resolveFilename(SCOPE_PLUGINS, PluginLanguagePath)) def _(txt): t = gettext.dgettext(PluginLanguageDomain, txt) if t == txt: print("[NeoBoot] fallback to default translation for"), txt - t = gettext.dgettext("enigma2", txt) + t = gettext.dgettext('enigma2', txt) return t diff --git a/NeoBoot/ex_init.py b/NeoBoot/ex_init.py index 2325406..d30f3c5 100644 --- a/NeoBoot/ex_init.py +++ b/NeoBoot/ex_init.py @@ -1,35 +1,8 @@ +#!/usr/bin/python + import sys import extract - if len(sys.argv) < 17: pass -#if len(sys.argv) < 18: - #print( - #f"Error: Incorrect number of arguments. Expected 17, got { - #len( - #sys.argv) - - #1}", - #file=sys.stderr, - #) - #print(f"Usage: {sys.argv[0]} ... ", file=sys.stderr) - #sys.exit(1) else: - extract.NEOBootMainEx( - sys.argv[1], - sys.argv[2], - sys.argv[3], - sys.argv[4], - sys.argv[5], - sys.argv[6], - sys.argv[7], - sys.argv[8], - sys.argv[9], - sys.argv[10], - sys.argv[11], - sys.argv[12], - sys.argv[13], - sys.argv[14], - sys.argv[15], - sys.argv[16], - sys.argv[17] - ) + extract.NEOBootMainEx(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4], sys.argv[5], sys.argv[6], sys.argv[7], sys.argv[8], sys.argv[9], sys.argv[10], sys.argv[11], sys.argv[12], sys.argv[13], sys.argv[14], sys.argv[15], sys.argv[16], sys.argv[17] ) diff --git a/NeoBoot/extract.py b/NeoBoot/extract.py index b133aed..2867b71 100644 --- a/NeoBoot/extract.py +++ b/NeoBoot/extract.py @@ -1,790 +1,401 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- from __future__ import absolute_import +from __future__ import print_function import sys import os import struct import shutil -import subprocess +# ver. gutosie +#--------------------------------------------- 2024 ---------------------------------------------# -def NEOBootMainEx( - source, - target, - CopyFiles, - CopyKernel, - TvList, - LanWlan, - Sterowniki, - Montowanie, - InstallSettings, - ZipDelete, - RepairFTP, - SoftCam, - MediaPortal, - PiconR, - Kodi, - BlackHole, - Nandsim, -): - NEOBootR( - source, - target, - CopyFiles, - CopyKernel, - TvList, - LanWlan, - Sterowniki, - Montowanie, - InstallSettings, - ZipDelete, - RepairFTP, - SoftCam, - MediaPortal, - PiconR, - Kodi, - BlackHole, - Nandsim, - ) +def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterowniki, Montowanie, InstallSettings, ZipDelete, RepairFTP, SoftCam, MediaPortal, PiconR, Kodi, BlackHole, Nandsim): + NEOBootR(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterowniki, Montowanie, InstallSettings, ZipDelete, RepairFTP, SoftCam, MediaPortal, PiconR, Kodi, BlackHole, Nandsim) def LanguageUsed(): - language = "" - usedlang = "config.osd.language=pl_PL" - try: - with open( - "/etc/enigma2/settings", "r", encoding="utf-8", errors="ignore" - ) as lang: - bak = lang.read().find(usedlang) - if bak != -1: - language = "Yes" - else: - language = "No" - except IOError: - language = "No" + 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(): - myboxname = "unknown" - if os.path.exists("/etc/hostname"): - try: - with open("/etc/hostname", "r", encoding="utf-8", errors="ignore") as f: - myboxname = f.readline().strip() - except IOError: - pass + 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"): - try: - with open( - "/proc/stb/info/chipset", "r", encoding="utf-8", errors="ignore" - ) as f: - chipset = f.readline().strip() - if chipset == "7405(with 3D)": - chipset = "7405" - except IOError: - pass + 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" - ): - try: - with open( - "/proc/stb/info/vumodel", "r", encoding="utf-8", errors="ignore" - ) as f: - vumodel = f.readline().strip() - except IOError: - pass + 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"): - try: - with open("/proc/cpuinfo", "r", encoding="utf-8", errors="ignore") as f: - lines = f.read() - if "ARMv7" in lines: - cpu = "ARMv7" - elif "mips" in lines: - cpu = "MIPS" - except IOError: - pass + 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(): - if not os.path.exists("/tmp/.isnandsim"): - if ( - os.system("opkg list-installed | grep kernel-module-nandsim" + dev_null) - != 0 - ): - os.system("touch /tmp/.isnandsim") - - if os.path.exists("" + - getNeoLocation() + - "ImagesUpload/dm520") or os.path.exists("" + - getNeoLocation() + - "ImagesUpload/dm525"): + if not os.path.exists('/tmp/.isnandsim'): + if os.system('opkg list-installed | grep kernel-module-nandsim' + dev_null) != 0: + os.system('touch /tmp/.isnandsim') + + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm520') or os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm525') : try: - result = ( - subprocess.check_output(["uname", "-r"], text=True, errors="ignore") - .strip("\n") - .split("-") - ) + result = popen('uname -r', 'r').read().strip('\n').split('-') kernel_version = result[0] return kernel_version - except Exception: - os.system("uname -r > /tmp/.uname_r") - try: - with open("/tmp/.uname_r", "r", encoding="utf-8", errors="ignore") as f: - return f.read().strip().upper() - except IOError: - return "UNKNOWN" - else: + except: + os.system('uname -r > /tmp/.uname_r') + return open('/tmp/.uname_r').read().strip().upper() + else: try: - with open("/proc/version", "r", encoding="utf-8", errors="ignore") as f: - return f.read().split(" ", 4)[2].split("-", 2)[0] - except Exception: - os.system("uname -r > /tmp/.uname_r") - try: - with open("/tmp/.uname_r", "r", encoding="utf-8", errors="ignore") as f: - return f.read().strip().upper() - except IOError: - return "UNKNOWN" - - + return open('/proc/version', 'r').read().split(' ', 4)[2].split('-', 2)[0] + except: + os.system('uname -r > /tmp/.uname_r') + return open('/tmp/.uname_r').read().strip().upper() + + def getNeoLocation(): - locatino = "UNKNOWN" - if os.path.exists( - "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location"): - try: - with open( - "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location", - "r", - encoding="utf-8", - errors="ignore", - ) as f: - locatino = f.readline().strip() - except IOError: - pass + 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" -supportedTuners = "vuplus" +mediahome = media + '/ImageBoot/' +extensions_path = '/usr/lib/enigma2/python/Plugins/Extensions/' +dev_null = ' > /dev/null 2>&1' +supportedTuners = 'vuplus' -def NEOBootMainEx( - source, - target, - CopyFiles, - CopyKernel, - TvList, - LanWlan, - Sterowniki, - Montowanie, - InstallSettings, - ZipDelete, - RepairFTP, - SoftCam, - MediaPortal, - PiconR, - Kodi, - BlackHole, - Nandsim, -): +def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterowniki, Montowanie, InstallSettings, ZipDelete, RepairFTP, SoftCam, MediaPortal, PiconR, Kodi, BlackHole, Nandsim): media_target = mediahome + target - list_one = [ - "rm -r " + media_target + dev_null, - "mkdir " + media_target + dev_null, - "chmod -R 0777 " + media_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) rc = NEOBootExtract(source, target, ZipDelete, Nandsim) - os.system("sync; echo 1 > /proc/sys/vm/drop_caches") + os.system('sync; echo 1 > /proc/sys/vm/drop_caches') - 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 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/hostname " + - media_target + - "/etc/hostname" + - dev_null, - "cp -a /usr/share/enigma2/rc_models/* " + - media_target + - "/usr/share/enigma2/rc_models/" + - dev_null, - "cp -r -p /usr/share/enigma2/rc_models " + - media_target + - "/usr/share/enigma2" + - dev_null, - "cp -af " + - extensions_path + - "NeoBoot " + - media_target + - extensions_path + - "NeoBoot" + - dev_null, - "mkdir -p " + - media_target + - extensions_path + - "NeoReboot" + - dev_null, - "touch " + - media_target + - extensions_path + - "NeoReboot/__init__.py" + - dev_null, - "chmod 644 " + - media_target + - extensions_path + - "NeoReboot/__init__.py" + - dev_null, - "cp -af " + - extensions_path + - "NeoBoot/files/backflash " + - media_target + - extensions_path + - "NeoReboot/backflash.sh" + - dev_null, - "cp -af " + - extensions_path + - "NeoBoot/files/neoreboot " + - media_target + - extensions_path + - "NeoReboot/plugin.py" + - dev_null, - ] + 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 ' + extensions_path + 'NeoBoot/bin/hdd' + media_target+'/etc/init.d/hddusb' + dev_null, + 'cp /etc/hostname ' + media_target + '/etc/hostname' + dev_null, + 'cp -a /usr/share/enigma2/rc_models/* ' + media_target + '/usr/share/enigma2/rc_models/' + dev_null, + 'cp -r -p /usr/share/enigma2/rc_models ' + media_target + '/usr/share/enigma2' + dev_null, + 'cp -af ' + extensions_path + 'NeoBoot ' + media_target + extensions_path + 'NeoBoot' + dev_null, + 'mkdir -p ' + media_target + extensions_path + 'NeoReboot' + dev_null, + 'touch ' + media_target + extensions_path + 'NeoReboot/__init__.py' + dev_null, + 'chmod 644 ' + media_target + extensions_path + 'NeoReboot/__init__.py' + dev_null, + 'cp -af ' + extensions_path + 'NeoBoot/files/backflash ' + media_target + extensions_path + 'NeoReboot/backflash.sh' + dev_null, + 'cp -af ' + extensions_path + 'NeoBoot/files/neoreboot ' + media_target + extensions_path + 'NeoReboot/plugin.py' + dev_null] for command in list_two: os.system(command) - if CopyFiles == "False": + if CopyFiles == 'False': os.system('echo "No copying of files..."') - os.system( - "touch " + - getNeoLocation() + - "ImageBoot/.without_copying; sleep 5") + os.system('touch ' + getNeoLocation() + 'ImageBoot/.without_copying; sleep 5') - if CopyKernel == "True": - 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) + if CopyKernel == 'True': + #mips vuplus + 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 = "mkdir -p %s/ImageBoot/%s/lib/modules > /dev/null 2>&1" % ( - media, - target, - ) - rc = os.system(cmd) - cmd = "cp -af /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) + cmd = 'cp -af /lib/modules %s/ImageBoot/%s/lib > /dev/null 2>&1' % (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 -af /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 ( - getCPUtype() == "MIPS" - and getBoxHostName() == "vuultimo" - or getBoxHostName() == "bm750" - or getBoxHostName() == "vuduo" - or getBoxHostName() == "vuuno" - or getBoxHostName() == "vusolo" - or getBoxHostName() == "vuduo" - or getBoxHostName() == "vusolo2" - or getBoxHostName() == "vusolose" - or getBoxHostName() == "vuduo2" - or getBoxHostName() == "vuzero" - or getBoxHostName() == "mbultra" - ): - 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"') - elif getCPUtype() == "MIPS" and getBoxHostName() == "et5x00": - os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/" - + getBoxHostName() - + "/kernel.bin " - + media_target - + "/boot/" - + getBoxHostName() - + ".vmlinux.gz" - + dev_null - ) - os.system('echo "Copied kernel.bin STB-MIPS Clarke-Tech & Xtrend"') - elif ( - getCPUtype() == "ARMv7" - and getBoxHostName() == "vuultimo4k" - or getBoxHostName() == "vusolo4k" - or getBoxHostName() == "vuuno4k" - or getBoxHostName() == "vuuno4kse" - or getBoxHostName() == "vuduo4k" - or getBoxHostName() == "vuduo4kse" - or getBoxHostName() == "vuzero4k" - ): - 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 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 -af /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 getCPUtype() == "MIPS" and getBoxHostName() == 'vuultimo' or getBoxHostName() == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vuuno' or getBoxHostName() == 'vusolo' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vusolo2' or getBoxHostName() == 'vusolose' or getBoxHostName() == 'vuduo2' or getBoxHostName() == 'vuzero' or getBoxHostName() == 'mbultra': + 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"') + elif getCPUtype() == "MIPS" and getBoxHostName() == 'et5x00' : + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + getBoxHostName() + '/kernel.bin ' + media_target + '/boot/' + getBoxHostName() + '.vmlinux.gz' + dev_null) + os.system('echo "Copied kernel.bin STB-MIPS Clarke-Tech & Xtrend"') + #arm vuplus arms + elif getCPUtype() == "ARMv7" and getBoxHostName() == "vuultimo4k" or getBoxHostName() == "vusolo4k" or getBoxHostName() == "vuuno4k" or getBoxHostName() == "vuuno4kse" or getBoxHostName() == "vuduo4k" or getBoxHostName() == "vuduo4kse" or getBoxHostName() == "vuzero4k": + 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 -af /usr/sbin/nandwrite %s/ImageBoot/%s/usr/sbin/nandwrite > /dev/null 2>&1" % - (media, target)) + if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'): + if os.path.exists('/usr/sbin/nandwrite'): + cmd = 'cp -af /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 -af /usr/bin/fullwget %s/ImageBoot/%s/usr/bin/fullwget > /dev/null 2>&1" % - (media, target)) + if os.path.exists('/usr/bin/fullwget'): + cmd = 'cp -af /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 -af /etc/init.d/inadyn-mt %s/ImageBoot/%s/etc/init.d/inadyn-mt > /dev/null 2>&1" % - (media, target)) + if os.path.exists('/etc/init.d/inadyn-mt'): + cmd = 'cp -af /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 -af /usr/bin/inadyn-mt %s/ImageBoot/%s/usr/bin/inadyn-mt > /dev/null 2>&1" % - (media, target)) + if os.path.exists('/usr/bin/inadyn-mt'): + cmd = 'cp -af /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 -af /etc/inadyn.conf %s/ImageBoot/%s/etc/inadyn.conf > /dev/null 2>&1" % - (media, target)) + if os.path.exists('/etc/inadyn.conf'): + cmd = 'cp -af /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 -af /usr/lib/enigma2/python/Plugins/SystemPlugins/FanControl %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/SystemPlugins > /dev/null 2>&1" % - (media, target)) + if os.path.exists('/usr/lib/enigma2/python/Plugins/SystemPlugins/FanControl'): + cmd = 'cp -af /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 -af " + - extensions_path + - "EmuManager %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) + if os.path.exists('' + extensions_path + 'EmuManager'): + cmd = 'cp -af ' + 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 -af " + - extensions_path + - "CamdMenager %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) + if os.path.exists('' + extensions_path + 'CamdMenager'): + cmd = 'cp -af ' + 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 -af " + - extensions_path + - "IPTVPlayer %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) + if os.path.exists('' + extensions_path + 'IPTVPlayer'): + cmd = 'cp -af ' + 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)) + 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 -af " + - extensions_path + - "FeedExtra %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) + if os.path.exists('' + extensions_path + 'FeedExtra'): + cmd = 'cp -af ' + 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 -af " + - extensions_path + - "MyUpdater %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) + if os.path.exists('' + extensions_path + 'MyUpdater'): + cmd = 'cp -af ' + extensions_path + 'MyUpdater %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 + "AlternativeSoftCamManager"): - cmd = ( - "cp -af " + - extensions_path + - "AlternativeSoftCamManager %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) + if os.path.exists('' + extensions_path + 'AlternativeSoftCamManager'): + cmd = 'cp -af ' + extensions_path + 'AlternativeSoftCamManager %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 + "TempFanControl"): - cmd = ( - "cp -af " + - extensions_path + - "TempFanControl %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/TempFanControl > /dev/null 2>&1" % - (media, - target)) + if os.path.exists('' + extensions_path + 'TempFanControl'): + cmd = 'cp -af ' + extensions_path + 'TempFanControl %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/TempFanControl > /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 -af /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) - if not os.path.exists( - "%s/ImageBoot/%s/usr/lib/enigma2/python/boxbranding.so" % - (media, target)): - cmd = ( - "cp -af /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) - if os.path.exists( - "%s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/HbbTV" - % (media, target) - ): - os.system( - "rm -rf %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/HbbTV" % - (media, target)) + if os.path.exists('%s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/HbbTV' % (media, target)): + os.system('rm -rf %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/HbbTV' % (media, target)) - 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) + 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) + 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, - ) + 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) + 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) + cmd = 'cp /etc/enigma2/lamedb %s/ImageBoot/%s/etc/enigma2' % (media, target) rc = os.system(cmd) os.system('echo "Copied TV list..."') - if LanWlan == "True": - if os.path.exists( - "%s/ImageBoot/%s/etc/vtiversion.info" % - (media, target)): - os.system( - 'echo "Not copied LAN-WLAN, not recommended for this image."') - elif os.path.exists("/etc/vtiversion.info") and os.path.exists( - "%s/usr/lib/enigma2/python/Plugins/PLi" % (media, target) - ): - os.system( - 'echo "Not copied LAN-WLAN, not recommended for this image."') - elif os.path.exists("/etc/bhversion") and os.path.exists( - "%s/usr/lib/enigma2/python/Plugins/PLi" % (media, target) - ): - os.system( - 'echo "Not copied LAN-WLAN, not recommended for this image."') - if os.path.exists("/etc/wpa_supplicant.wlan0.conf"): - cmd = ( - "cp -af /etc/wpa_supplicant.wlan0.conf %s/ImageBoot/%s/etc/wpa_supplicant.wlan0.conf > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) - if os.path.exists("/etc/network/interfaces"): - cmd = ( - "cp -af /etc/network/interfaces %s/ImageBoot/%s/etc/network/interfaces > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) - if os.path.exists("/etc/wpa_supplicant.conf"): - cmd = ( - "cp -af /etc/wpa_suppligetinstallscant.conf %s/ImageBoot/%s/etc/wpa_supplicant.conf > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) - if os.path.exists("/etc/resolv.conf"): - cmd = ( - "cp -af /etc/resolv.conf %s/ImageBoot/%s/etc/resolv.conf > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) - if os.path.exists("/etc/wl.conf.wlan3"): - cmd = ( - "cp -af /etc/wl.conf.wlan3 %s/ImageBoot/%s/etc/wl.conf.wlan3 > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) + if LanWlan == 'True': + if os.path.exists('%s/ImageBoot/%s/etc/vtiversion.info' % (media, target)): + os.system('echo "Not copied LAN-WLAN, not recommended for this image."') + elif os.path.exists('/etc/vtiversion.info') and os.path.exists('%s/usr/lib/enigma2/python/Plugins/PLi' % (media, target)): + os.system('echo "Not copied LAN-WLAN, not recommended for this image."') + elif os.path.exists('/etc/bhversion') and os.path.exists('%s/usr/lib/enigma2/python/Plugins/PLi' % (media, target)): + os.system('echo "Not copied LAN-WLAN, not recommended for this image."') + if os.path.exists('/etc/wpa_supplicant.wlan0.conf'): + cmd = 'cp -af /etc/wpa_supplicant.wlan0.conf %s/ImageBoot/%s/etc/wpa_supplicant.wlan0.conf > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/network/interfaces'): + cmd = 'cp -af /etc/network/interfaces %s/ImageBoot/%s/etc/network/interfaces > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/wpa_supplicant.conf'): + cmd = 'cp -af /etc/wpa_supplicant.conf %s/ImageBoot/%s/etc/wpa_supplicant.conf > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/resolv.conf'): + cmd = 'cp -af /etc/resolv.conf %s/ImageBoot/%s/etc/resolv.conf > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) + if os.path.exists('/etc/wl.conf.wlan3'): + cmd = 'cp -af /etc/wl.conf.wlan3 %s/ImageBoot/%s/etc/wl.conf.wlan3 > /dev/null 2>&1' % (media, target) + rc = os.system(cmd) os.system('echo "Copied LAN-WLAN..."') - if Sterowniki == "True": - if os.path.exists("%s/ImageBoot/%s/lib/modules" % (media, target)): - cmd = "rm -r %s/ImageBoot/%s/lib/modules" % (media, target) + 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, - ) + cmd = 'mkdir -p %s/ImageBoot/%s/lib/modules > /dev/null 2>&1' % (media, target) rc = os.system(cmd) - cmd = "cp -af /lib/modules %s/ImageBoot/%s/lib > /dev/null 2>&1" % ( - media, target, ) + cmd = 'cp -af /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) + 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, - ) + cmd = 'mkdir -p %s/ImageBoot/%s/lib/firmware > /dev/null 2>&1' % (media, target) rc = os.system(cmd) - cmd = "cp -af /lib/firmware %s/ImageBoot/%s/lib > /dev/null 2>&1" % ( - media, target, ) + cmd = 'cp -af /lib/firmware %s/ImageBoot/%s/lib > /dev/null 2>&1' % (media, target) rc = os.system(cmd) os.system('echo "System drivers copied..."') - - if Montowanie == "True": + + if Montowanie == 'True': if getCPUtype() == "MIPS": - if os.path.exists( - "%s/ImageBoot/%s/etc/fstab" % - (media, target)): - cmd = ( - "mv %s/ImageBoot/%s/etc/fstab %s/ImageBoot/%s/etc/fstab.org" % - (media, target, media, target)) + if os.path.exists('%s/ImageBoot/%s/etc/fstab' % (media, target)): + cmd = 'mv %s/ImageBoot/%s/etc/fstab %s/ImageBoot/%s/etc/fstab.org' % (media, + target, + media, + target) rc = os.system(cmd) - if os.path.exists( - "%s/ImageBoot/%s/etc/init.d/volatile-media.sh" % - (media, target)): - cmd = ( - "mv %s/ImageBoot/%s/etc/init.d/volatile-media.sh %s/ImageBoot/%s/etc/init.d/volatile-media.sh.org" % - (media, target, media, target)) + if os.path.exists('%s/ImageBoot/%s/etc/init.d/volatile-media.sh' % (media, target)): + cmd = 'mv %s/ImageBoot/%s/etc/init.d/volatile-media.sh %s/ImageBoot/%s/etc/init.d/volatile-media.sh.org' % (media, + target, + media, + target) rc = os.system(cmd) - cmd = "cp -r /etc/fstab %s/ImageBoot/%s/etc/fstab" % ( - media, target) + cmd = 'cp -r /etc/fstab %s/ImageBoot/%s/etc/fstab' % (media, target) rc = os.system(cmd) os.system('echo "The fstab mount file was copied..."') elif getCPUtype() == "ARMv7": os.system('echo "No copied mount ARM..."') + - 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) + 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, - ) + 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)) + 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, ) + cmd = 'mkdir -p /etc/tuxbox/scce %s/ImageBoot/%s/etc/tuxbox/scce' % (media, target) rc = os.system(cmd) - cmd = "cp -af /etc/tuxbox/* %s/ImageBoot/%s/etc/tuxbox" % ( - media, target) + cmd = 'cp -af /etc/tuxbox/* %s/ImageBoot/%s/etc/tuxbox' % (media, target) rc = os.system(cmd) - os.system( - 'touch /tmp/settings_copied; echo "System settings copied..."') + os.system('touch /tmp/settings_copied; echo "System settings copied..."') - if RepairFTP == "True": - filename = media + "/ImageBoot/" + target + "/etc/vsftpd.conf" - if os.path.exists(filename): - filename2 = filename + ".tmp" - try: - with open(filename, "r", encoding="utf-8", errors="ignore") as f: - lines = f.readlines() - - with open(filename2, "w", encoding="utf-8", errors="ignore") as out: - for line in lines: - 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) + 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) - except Exception as e: - os.system(f'echo "Failed to patch {filename}: {e}"') - if os.path.exists(filename2): - os.remove(filename2) os.system('echo "Repair ftp."') - if SoftCam == "True": - if os.path.exists("/etc/CCcam.cfg"): - cmd = "cp -af /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 -af /etc/tuxbox/config %s/ImageBoot/%s/etc/tuxbox > /dev/null 2>&1" % - (media, target)) + if SoftCam == 'True': + if os.path.exists('/etc/CCcam.cfg'): + cmd = 'cp -af /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 -af /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 -af " + - extensions_path + - "MediaPortal %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) + if MediaPortal == 'True': + if os.path.exists('' + extensions_path + 'MediaPortal'): + cmd = 'cp -af ' + extensions_path + 'MediaPortal %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target) rc = os.system(cmd) - cmd = ( - "cp -af " + - extensions_path + - "mpgz %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) + cmd = 'cp -af ' + extensions_path + 'mpgz %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1' % (media, target) rc = os.system(cmd) - cmd = ( - "cp -af /usr/lib/python2.7/argparse.pyo %s/ImageBoot/%s/usr/lib/python2.7 > /dev/null 2>&1" % - (media, target)) + cmd = 'cp -af /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 -af /usr/lib/python2.7/robotparser.pyo %s/ImageBoot/%s/usr/lib/python2.7 > /dev/null 2>&1" % - (media, target)) + cmd = 'cp -af /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 -af /usr/lib/python2.7/site-packages/Crypto %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1" % - (media, target)) + cmd = 'cp -af /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 -af /usr/lib/python2.7/site-packages/mechanize %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1" % - (media, target)) + cmd = 'cp -af /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 -af /usr/lib/python2.7/site-packages/requests %s/ImageBoot/%s/usr/lib/python2.7/site-packages > /dev/null 2>&1" % - (media, target)) + cmd = 'cp -af /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 -af /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)) + cmd = 'cp -af /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) + 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, ) + 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, ) + 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)) + 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"): + elif not os.path.exists('' + extensions_path + 'MediaPortal'): os.system('echo "MediaPortal not found."') - if PiconR == "True": - if os.path.exists("/usr/share/enigma2/picon"): - cmd = ( - "cp -af /usr/share/enigma2/picon %s/ImageBoot/%s/usr/share/enigma2" % - (media, target)) + if PiconR == 'True': + if os.path.exists('/usr/share/enigma2/picon'): + cmd = 'cp -af /usr/share/enigma2/picon %s/ImageBoot/%s/usr/share/enigma2' % (media, target) rc = os.system(cmd) os.system('echo "Copied picon..."') - elif not os.path.exists("/usr/share/enigma2/picon"): + elif not os.path.exists('/usr/share/enigma2/picon'): os.system('echo "Picon flash not found."') - if Kodi == "True": - cmd = "mkdir -p %s/ImageBoot/%s/home/root/.kodi > /dev/null 2>&1" % ( - media, target, ) + if Kodi == 'True': + cmd = 'mkdir -p %s/ImageBoot/%s/home/root/.kodi > /dev/null 2>&1' % (media, target) rc = os.system(cmd) - if os.path.exists("/home/root/.kodi"): + if os.path.exists('/home/root/.kodi'): os.system('echo "Kodi set ok."') else: - if not os.path.exists("/home/root/.kodi"): - if not os.path.exists("/.multinfo"): - if os.path.exists("/media/hdd/.kodi"): + if not os.path.exists('/home/root/.kodi'): + if not os.path.exists('/.multinfo'): + if os.path.exists('/media/hdd/.kodi'): cmd = 'mv /media/hdd/.kodi /media/hdd/.kodi_flash; ln -sf "/media/hdd/.kodi_flash" "/home/root/.kodi"; ln -sf "/home/root/.kodi" "/media/hdd/.kodi" ' rc = os.system(cmd) os.system('echo "Kodi fix ok."') @@ -795,4934 +406,1500 @@ def NEOBootMainEx( else: os.system('echo "Kodi not found."') - if BlackHole == "True": - if "BlackHole" in source or os.path.exists( - "%s/ImageBoot/%s/usr/lib/enigma2/python/Blackhole" % - (media, target)): - cmd = ( - "mkdir -p " - + getNeoLocation() - + "ImageBoot/%s/boot/blackhole" % target - ) + if BlackHole == 'True': + if 'BlackHole' in source or os.path.exists('%s/ImageBoot/%s/usr/lib/enigma2/python/Blackhole' % (media, target)): + cmd = 'mkdir -p ' + getNeoLocation() + 'ImageBoot/%s/boot/blackhole' % target rc = os.system(cmd) - cmd = ( - "mv " + - getNeoLocation() + - "ImageBoot/" + - target + - "/usr/lib/enigma2/python/Blackhole/BhUtils.pyo " + - getNeoLocation() + - "ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.pyo.org" % - target) + cmd = 'mv ' + getNeoLocation() + 'ImageBoot/' + target + '/usr/lib/enigma2/python/Blackhole/BhUtils.pyo ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.pyo.org' % target rc = os.system(cmd) - cmd = ( - "cp -af " + - extensions_path + - "NeoBoot/bin/utilsbh " + - getNeoLocation() + - "ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.py" % - target) + cmd = 'cp -af ' + extensions_path + 'NeoBoot/bin/utilsbh ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.py' % target rc = os.system(cmd) - ver = source.replace("BlackHole-", "") + ver = source.replace('BlackHole-', '') try: - text = ver.split("-")[0] - except Exception: - text = "" - localfile = ( - "" - + getNeoLocation() - + "ImageBoot/%s/boot/blackhole/version" % target - ) - try: - with open( - localfile, "w", encoding="utf-8", errors="ignore" - ) as temp_file: - temp_file.write(text) - except Exception as e: - os.system(f'echo "Failed to write {localfile}: {e}"') - - cmd = ( - "mv " - + getNeoLocation() - + "ImageBoot/" - + target - + "/usr/bin/enigma2 " - + getNeoLocation() - + "ImageBoot/%s/usr/bin/enigma2-or" % target - ) + text = ver.split('-')[0] + except: + text = '' + localfile = '' + getNeoLocation() + 'ImageBoot/%s/boot/blackhole/version' % target + temp_file = open(localfile, 'w') + temp_file.write(text) + temp_file.close() + cmd = 'mv ' + getNeoLocation() + 'ImageBoot/' + target + '/usr/bin/enigma2 ' + getNeoLocation() + 'ImageBoot/%s/usr/bin/enigma2-or' % target rc = os.system(cmd) - - fail = ( - "" + - getNeoLocation() + - "ImageBoot/%s/usr/bin/enigma2-or" % - target) - content = "" - try: - with open(fail, "r", encoding="utf-8", errors="ignore") as f: - content = f.read() - except Exception as e: - os.system(f'echo "Failed to read {fail}: {e}"') - - if content: - localfile2 = ( - "" + - getNeoLocation() + - "ImageBoot/%s/usr/bin/enigma2" % - target) - try: - with open( - localfile2, "w", encoding="utf-8", errors="ignore" - ) as temp_file2: - temp_file2.write( - content.replace( - "/proc/blackhole/version", - "/boot/blackhole/version")) - - 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) - except Exception as e: - os.system(f'echo "Failed to write {localfile2}: {e}"') + 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) + #cmd = 'cp -af' + getNeoLocation() + 'ImageBoot/' + target + '/etc/bhversion ' + getNeoLocation() + 'ImageBoot/%s/boot/blackhole/version' % target + #rc = os.system(cmd) + #cmd = 'cp -f ' + extensions_path + 'NeoBoot/bin/version ' + getNeoLocation() + 'ImageBoot/%s/boot/blackhole/version' % target + #rc = os.system(cmd) # for all image: - # copying zerotier script if exists + #copying zerotier script if exists if os.path.exists('/var/lib/zerotier-one/identity.secret'): cmd = 'mkdir -p ' + getNeoLocation() + 'ImageBoot/%s/var/lib/zerotier-one' % target rc = os.system(cmd) - cmd1 = 'cp -af /var/lib/zerotier-one/identity.secret ' + \ - getNeoLocation() + 'ImageBoot/%s/var/lib/zerotier-one/' % target + cmd1 = 'cp -af /var/lib/zerotier-one/identity.secret ' + getNeoLocation() + 'ImageBoot/%s/var/lib/zerotier-one/' % target rc = os.system(cmd1) - - # copying tailscale if exists + + #copying tailscale if exists if os.path.exists('/var/lib/tailscale/tailscaled.state'): cmd = 'mkdir -p ' + getNeoLocation() + 'ImageBoot/%s/var/lib/tailscale' % target rc = os.system(cmd) - cmd1 = 'cp -af /var/lib/tailscale/* ' + \ - getNeoLocation() + 'ImageBoot/%s/var/lib/tailscale/' % target + cmd1 = 'cp -af /var/lib/tailscale/* ' + getNeoLocation() + 'ImageBoot/%s/var/lib/tailscale/' % target rc = os.system(cmd1) - cmd2 = 'cp -af /var/lib/tailscale/* ' + \ - getNeoLocation() + 'ImageBoot/%s/var/lib/tailscale/' % target + cmd2 = 'cp -af /var/lib/tailscale/* ' + getNeoLocation() + 'ImageBoot/%s/var/lib/tailscale/' % target rc = os.system(cmd2) if os.path.exists('/usr/sbin/tailscaled'): - cmd3 = 'cp -af /usr/sbin/tailscaled ' + \ - getNeoLocation() + 'ImageBoot/%s/susr/sbin/' % target - rc = os.system(cmd3) + cmd3 = 'cp -af /usr/sbin/tailscaled ' + getNeoLocation() + 'ImageBoot/%s/susr/sbin/' % target + rc = os.system(cmd3) elif os.path.exists('/usr/bin/tailscaled'): - cmd3 = 'cp -af /usr/bin/tailscaled ' + \ - getNeoLocation() + 'ImageBoot/%s/usr/bin/' % target - rc = os.system(cmd3) - cmd4 = 'cp -af /usr/bin/tailscale ' + \ - getNeoLocation() + 'ImageBoot/%s/usr/bin/' % target + cmd3 = 'cp -af /usr/bin/tailscaled ' + getNeoLocation() + 'ImageBoot/%s/usr/bin/' % target + rc = os.system(cmd3) + cmd4 = 'cp -af /usr/bin/tailscale ' + getNeoLocation() + 'ImageBoot/%s/usr/bin/' % target rc = os.system(cmd4) - cmd5 = 'cp -af /etc/init.d/tailscal* ' + \ - getNeoLocation() + 'ImageBoot/%s/etc/init.d/' % target - rc = os.system(cmd5) - + cmd5 = 'cp -af /etc/init.d/tailscal* ' + getNeoLocation() + 'ImageBoot/%s/etc/init.d/' % target + rc = os.system(cmd5) + if not os.path.exists('%s/ImageBoot/%s/lib/modules/kernel/drivers/net/tun.ko' % (media, target)): + if not os.path.exists('%s/ImageBoot/%s/lib/modules/kernel/drivers/net' % (media, target)): + #cmd = 'mkdir -p ' + getNeoLocation() + 'ImageBoot/%s/lib/modules/' + getKernelVersion() + '/kernel/drivers/net/' % target + cmd = 'mkdir -p %s/ImageBoot/%s/lib/modules/kernel/drivers/net/' % (media, target) + rc = os.system(cmd) + cmd = 'cp -af /lib/modules/' + getKernelVersion() + '/kernel/drivers/net/tun.ko %s/ImageBoot/%s/lib/modules/kernel/drivers/net/' % (media, target) + rc = os.system(cmd) if not os.path.exists('%s/ImageBoot/%s/var/run/tailscale' % (media, target)): - cmd = 'mkdir -p ' + getNeoLocation() + '/ImageBoot/%s/run/tailscale/' % target - rc = os.system(cmd) - if os.path.exists('/run/tailscale'): - cmd = 'cp -aRf /run/tailscale/tailscaled.sock ' + \ - getNeoLocation() + 'ImageBoot/%s/run/tailscale/' % target - rc = os.system(cmd) - - if os.path.exists("%s/ImageBoot/%s/etc/init.d" % (media, target)): - cmd = ( - "ln -s %sImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh %sImageBoot/%s/etc/rcS.d/S99neo.local" % - (media, target, media, target)) - - elif not os.path.exists("%s/ImageBoot/%s/etc/init.d" % (media, target)): - os.system('echo "/etc/init.d not found."') + cmd = 'mkdir -p ' + getNeoLocation() + '/ImageBoot/%s/run/tailscale/' % target + rc = os.system(cmd) + if os.path.exists('/run/tailscale'): + cmd = 'cp -aRf /run/tailscale/tailscaled.sock ' + getNeoLocation() + 'ImageBoot/%s/run/tailscale/' % target + rc = os.system(cmd) + cmd1 = 'cp -aRf /run/resolvconf/interfaces/tailscale ' + getNeoLocation() + 'ImageBoot/%s/run/tailscale/' % target + rc = os.system(cmd1) + + if os.path.exists('%s/ImageBoot/%s/etc/init.d' % (media, target)): + cmd = 'ln -s %sImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh %sImageBoot/%s/etc/rcS.d/S99neo.local' % (media, + target, + media, + target) + + elif not os.path.exists('%s/ImageBoot/%s/etc/init.d' % (media, target)): + os.system('echo "/etc/init.d not found."') os.system('echo "Copied file neo_userscript.sh"') + + if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying') and not os.path.exists(' /tmp/settings_copied'): + for line in open("/etc/hostname"): + if getCPUtype() == 'MIPS' and "dm500hd" in line or "dm800se" in line or "dm800" in line or "dm800se" in line or "dm8000" in line: + if os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)): + cmd = 'rm -r %s/ImageBoot/%s/etc/enigma2' % (media, target) + rc = os.system(cmd) + else: + 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) + cmd1 = 'grep "av.videomode.DVI" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd1) + cmd2 = 'grep "config.OpenWebif" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd2) + cmd3 = 'grep "config.osd" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd3) + cmd4 = 'grep "config.timezone.val" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd4) + cmd5 = 'grep "config.servicelist.startuproot" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % (media, target) + rc = os.system(cmd5) + cmd6 = 'grep "UUID=" /etc/fstab >> %s/ImageBoot/%s/etc/fstab' % (media, target) + rc = os.system(cmd6) - if not os.path.exists( - "" + getNeoLocation() + "ImageBoot/.without_copying" - ) and not os.path.exists(" /tmp/settings_copied"): - try: - with open("/etc/hostname", "r", encoding="utf-8", errors="ignore") as f: - for line in f: - if ( - getCPUtype() == "MIPS" - and "dm500hd" in line - or "dm800se" in line - or "dm800" in line - or "dm800se" in line - or "dm8000" in line - ): - if os.path.exists( - "%s/ImageBoot/%s/etc/enigma2" % (media, target) - ): - cmd = "rm -r %s/ImageBoot/%s/etc/enigma2" % ( - media, target) - rc = os.system(cmd) - else: - 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) - cmd1 = ( - 'grep "av.videomode.DVI" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd1) - cmd2 = ( - 'grep "config.OpenWebif" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd2) - cmd3 = ( - 'grep "config.osd" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd3) - cmd4 = ( - 'grep "config.timezone.val" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd4) - cmd5 = ( - 'grep "config.servicelist.startuproot" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd5) - cmd6 = ( - 'grep "UUID=" /etc/fstab >> %s/ImageBoot/%s/etc/fstab' % - (media, target)) - rc = os.system(cmd6) - except Exception as e: - os.system(f'echo "Failed reading /etc/hostname: {e}"') +##################################### + if not os.path.exists('' + media_target + '/boot/zImage.' + getBoxHostName() + '') and getCPUtype() == 'MIPS': + 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/mmcblk0p2') != -1: + line = '#' + line + elif line.find('/dev/root') != -1: + line = '#' + line + out.write(line) - if ( - not os.path.exists( - "" + media_target + "/boot/zImage." + getBoxHostName() + "" - ) - and getCPUtype() == "MIPS" - ): - namefile = media + "/ImageBoot/" + target + "/etc/fstab" - namefile2 = namefile + ".tmp" - if os.path.exists(namefile): # Check if source exists - try: - with open(namefile, "r", encoding="utf-8", errors="ignore") as f: - lines = f.readlines() - with open(namefile2, "w", encoding="utf-8", errors="ignore") as out: - for line in lines: - if line.find("/dev/mmcblk0p2") != -1: - line = "#" + line - elif line.find("/dev/root") != -1: - line = "#" + line - out.write(line) - os.rename(namefile2, namefile) - except Exception as e: - os.system(f'echo "Failed to patch {namefile}: {e}"') - if os.path.exists(namefile2): - os.remove(namefile2) + f.close() + out.close() + os.rename(namefile2, namefile) - tpmd = media + "/ImageBoot/" + target + "/etc/init.d/tpmd" + tpmd = media + '/ImageBoot/' + target + '/etc/init.d/tpmd' if os.path.exists(tpmd): - os.system("rm " + tpmd) + os.system('rm ' + tpmd) - fname = ( - media - + "/ImageBoot/" - + target - + "/usr/lib/enigma2/python/Components/config.py" - ) + fname = media + '/ImageBoot/' + target + '/usr/lib/enigma2/python/Components/config.py' if os.path.exists(fname): - fname2 = fname + ".tmp" - try: - with open(fname, "r", encoding="utf-8", errors="ignore") as f: - lines = f.readlines() - with open(fname2, "w", encoding="utf-8", errors="ignore") as out: - for line in lines: - if line.find( - 'if file(""/proc/stb/info/vumodel")') != -1: - line = "#" + line - out.write(line) - os.rename(fname2, fname) - except Exception as e: - os.system(f'echo "Failed to patch {fname}: {e}"') - if os.path.exists(fname2): - os.remove(fname2) + 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) - targetfile = media + "/ImageBoot/" + target + "/etc/vsftpd.conf" + f.close() + out.close() + os.rename(fname2, fname) + + targetfile = media + '/ImageBoot/' + target + '/etc/vsftpd.conf' if os.path.exists(targetfile): - targetfile2 = targetfile + ".tmp" - try: - with open(targetfile, "r", encoding="utf-8", errors="ignore") as f: - lines = f.readlines() - with open( - targetfile2, "w", encoding="utf-8", errors="ignore" - ) as out: - for line in lines: - if not line.startswith("nopriv_user"): - out.write(line) - os.rename(targetfile2, targetfile) - except Exception as e: - os.system(f'echo "Failed to patch {targetfile}: {e}"') - if os.path.exists(targetfile2): - os.remove(targetfile2) + 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) - mypath = media + "/ImageBoot/" + target + "/usr/lib/opkg/info/" - cmd = "mkdir -p %s/ImageBoot/%s/var/lib/opkg/info > /dev/null 2>&1" % ( - media, target, ) + 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/" + 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 os.path.exists(mypath): # Check if path exists before listing - for fn in os.listdir(mypath): - if ((fn.find("kernel-image") != - - 1 and fn.find("postinst") != - - 1) or fn.find("-bootlogo.postinst") != - - 1 or fn.find("-bootlogo.postrm") != - - 1 or fn.find("-bootlogo.preinst") != - - 1 or fn.find("-bootlogo.prerm") != - - 1): - - filename = os.path.join(mypath, fn) - filename2 = filename + ".tmp" - try: - with open( - filename, "r", encoding="utf-8", errors="ignore" - ) as f: - lines = f.readlines() - - with open( - filename2, "w", encoding="utf-8", errors="ignore" - ) as out: - for line in lines: - if line.find("/boot") != -1: - line = line.replace( - "/boot", "/boot > /dev/null 2>\\&1; exit 0") - out.write(line) - - os.rename(filename2, filename) - cmd = "chmod -R 0755 %s" % filename - rc = os.system(cmd) - except Exception as e: - os.system( - f'echo "Failed to patch {filename}: {e}"') - if os.path.exists(filename2): - os.remove(filename2) - - if os.path.exists( - "%s/ImageBoot/%s/var/lib/opkg/status1" % - (media, target)): - cmd = ( - "mv " - + getNeoLocation() - + "ImageBoot/" - + target - + "/var/lib/opkg/status " - + getNeoLocation() - + "ImageBoot/%s/var/lib/opkg/status-or" % target - ) - rc = os.system(cmd) - - fail = ( - "" - + getNeoLocation() - + "ImageBoot/%s/var/lib/opkg/status-or" % target - ) - content = "" - try: - with open(fail, "r", encoding="utf-8", errors="ignore") as f: - content = f.read() - except Exception as e: - os.system(f'echo "Failed to read {fail}: {e}"') - - if content: - localfile2 = ( - "" - + getNeoLocation() - + "ImageBoot/%s/var/lib/opkg/status" % target - ) - try: - with open( - localfile2, "w", encoding="utf-8", errors="ignore" - ) as temp_file2: - temp_file2.write( - content.replace( - "kernel-image", - "#kernel-image")) - - cmd = "chmod -R 0755 %s" % localfile2 + if f.close(): + out.close() + os.rename(filename2, filename) + cmd = 'chmod -R 0755 %s' % filename rc = os.system(cmd) - cmd = ( - "rm -r " - + getNeoLocation() - + "ImageBoot/%s/var/lib/opkg/status-or" % target - ) - rc = os.system(cmd) - except Exception as e: - os.system(f'echo "Failed to write {localfile2}: {e}"') - - if os.path.exists("%s/ImageBoot/%s/usr/lib" % (media, target)): - cmd = ( - "cp -af /usr/lib/periodon " - + getNeoLocation() - + "ImageBoot/%s/usr/lib/" % target - ) - rc = os.system(cmd) - cmd = ( - "mkdir -p " - + getNeoLocation() - + "ImageBoot/%s/usr/lib/enigma2/python/Tools/" % target - ) - rc = os.system(cmd) - cmd = ( - "cp -af /usr/lib/enigma2/python/Tools/Testinout.py " - + getNeoLocation() - + "ImageBoot/%s/usr/lib/enigma2/python/Tools/" % target - ) - rc = os.system(cmd) - - cmd = "rm -r " + getNeoLocation() + "ImageBoot/%s/tmp" % target - 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) - - try: - with open( - mediahome + ".neonextboot", "w", encoding="utf-8", errors="ignore" - ) as out: - out.write(target) - except Exception as e: - os.system(f'echo "Failed to write .neonextboot: {e}"') - - os.system( - "cp " - + getNeoLocation() - + "ImageBoot/.neonextboot " - + getNeoLocation() - + "ImageBoot/%s/.multinfo" % target - ) - - try: - with open( - mediahome + ".neonextboot", "w", encoding="utf-8", errors="ignore" - ) as out: - out.write("Flash") - except Exception as e: - os.system(f'echo "Failed to write .neonextboot: {e}"') - - 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() - - 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/unpackedzip"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/unpackedzip") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/*.bin"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/*.bin") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/*.txt"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/*.txt") - elif 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/osmio4kplus"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/osmio4kplus") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dm900"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/dm900") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/hd60"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/hd60") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/hd61"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/hd61") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/hd51"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/hd51") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/bre2ze4k"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/bre2ze4k") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/multibox"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/multibox") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxse"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/multiboxse") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxpro"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/multiboxpro") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/axas"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/axas") - 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/osminiplus"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osminiplus") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osnino"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osnino") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osninoplus"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osninoplus") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osninopro"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osninopro") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osmini4k"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osmini4k") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/xp1000 "): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/xp1000") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/et5x00"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/et5x00") - 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/dreamtwo "): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/dreamtwo ") - elif ( - os.path.exists("" + getNeoLocation() + "ImagesUpload/multibox") - or os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxse") - or os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxpro")): - rc = os.system( "rm -r "+ getNeoLocation()+ "ImagesUpload/multibox") - rc = os.system( "rm -r "+ getNeoLocation()+ "ImagesUpload/multiboxse") - rc = os.system( "rm -r "+ getNeoLocation()+ "ImagesUpload/multiboxpro") - - 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/octagon/sf8008m"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/octagon") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/h5"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/bootargs.bin " - + getNeoLocation() - + "ImagesUpload/h5; mv " - + getNeoLocation() - + "ImagesUpload/fastboot.bin " - + getNeoLocation() - + "ImagesUpload/h5" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h") - 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/h9se"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/bootargs.bin " - + getNeoLocation() - + "ImagesUpload/h9se; mv " - + getNeoLocation() - + "ImagesUpload/fastboot.bin " - + getNeoLocation() - + "ImagesUpload/h9se" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h9se") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/i55plus"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/bootargs.bin " - + getNeoLocation() - + "ImagesUpload/i55plus; mv " - + getNeoLocation() - + "ImagesUpload/fastboot.bin " - + getNeoLocation() - + "ImagesUpload/i55plus" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/i55plus") - 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/h9combose"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/force_h9combose_READ.ME " - + getNeoLocation() - + "ImagesUpload/h9combo; mv " - + getNeoLocation() - + "ImagesUpload/unforce_h9combose.txt " - + getNeoLocation() - + "ImagesUpload/h9combose" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h9combose") - 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/h11"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/force_h11_READ.ME " - + getNeoLocation() - + "ImagesUpload/h11; mv " - + getNeoLocation() - + "ImagesUpload/unforce_h11.txt " - + getNeoLocation() - + "ImagesUpload/h11" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h11") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/h8"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h8") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/uclan"): - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/usb_update.bin"): - 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/ustym4kpro"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/ustym4kpro") - 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/x1" - ) or os.path.exists("" + getNeoLocation() + "ImagesUpload/gigablue/x34k"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/gigablue") - elif os.path.exists( - "" + getNeoLocation() + "ImagesUpload/gigablue" - ) and os.path.exists("" + getNeoLocation() + "ImagesUpload/usb_update.bin"): - 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/et10000"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/et10000") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/vs1000"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/vs1000") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/vs1500"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/vs1500") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/pulse4k"): - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/pulse4k/force_pulse4k_READ.ME"): - rc = os.system( - "rm -r " - + getNeoLocation() - + "ImagesUpload/pulse4k/force_pulse4k_READ.ME; rm -r " - + getNeoLocation() - + "ImagesUpload/pulse4k/unforce_pulse4k.txt" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/pulse4k") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/pulse4kmin"): - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/pulse4kmin/force_pulse4kmini_READ.ME"): - rc = os.system( - "rm -r " - + getNeoLocation() - + "ImagesUpload/pulse4kmini/force_pulse4kmini_READ.ME; rm -r " - + getNeoLocation() - + "ImagesUpload/pulse4kmini/unforce_pulse4kmini.txt" - ) - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/pulse4kmini") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/xpeedlx"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/xpeedlx") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dm520"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/dm520") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/rootfs.tar.gz"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/rootfs.tar.gz") - 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/rootfs.tar.bz2"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/rootfs.tar.bz2") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/rootfs.tar"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/rootfs.tar") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/unforce_h9combo.txt"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/unforce_h9combo.txt") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/imageversion"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/imageversion") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/kernel.bin"): - rc = os.system( - "rm -rf " + - getNeoLocation() + - "ImagesUpload/kernel.bin") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/update_bootargs_h8"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/update_bootargs_h8") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/force_hd60_READ.ME"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/force_hd60_READ.ME") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/unforce_hd60.txt"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/unforce_hd60.txt") - if os.path.exists("/tmp/root_jffs2"): - rc = os.system("rm -fr /tmp/root_jffs2") - if os.path.exists("/tmp/xz-gz-tar"): - rc = os.system("rm -fr /tmp/xz-gz-tar") - if os.path.exists("/tmp/other_image"): - rc = os.system("rm -fr /tmp/other_image") - - if os.path.exists("" +getNeoLocation() +"ImagesUpload/force_multibox_READ.ME"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/force_multibox_READ.ME") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/force_multiboxpro_READ.ME"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/force_multiboxpro_READ.ME") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/unforce_multiboxpro.txt"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/unforce_multiboxpro.txt") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/force"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/force") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/rootfs.bin"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/rootfs.bin") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/splash.bin"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/splash.bin") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/gigablue"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/gigablue") - - rc = os("rm -r " + getNeoLocation() + "ImagesUpload/*.ME'; rm -r " + getNeoLocation() + "ImagesUpload/*.txt") - - -def NEOBootMainEx( - source, - target, - CopyFiles, - CopyKernel, - TvList, - LanWlan, - Sterowniki, - Montowanie, - InstallSettings, - ZipDelete, - RepairFTP, - SoftCam, - MediaPortal, - PiconR, - Kodi, - BlackHole, - Nandsim, -): - NEOBootR( - source, - target, - CopyFiles, - CopyKernel, - TvList, - LanWlan, - Sterowniki, - Montowanie, - InstallSettings, - ZipDelete, - RepairFTP, - SoftCam, - MediaPortal, - PiconR, - Kodi, - BlackHole, - Nandsim, - ) - - -def LanguageUsed(): - language = "" - usedlang = "config.osd.language=pl_PL" - try: - with open( - "/etc/enigma2/settings", "r", encoding="utf-8", errors="ignore" - ) as lang: - bak = lang.read().find(usedlang) - if bak != -1: - language = "Yes" - else: - language = "No" - except IOError: - language = "No" - return language - - -def getBoxHostName(): - myboxname = "unknown" - if os.path.exists("/etc/hostname"): - try: - with open("/etc/hostname", "r", encoding="utf-8", errors="ignore") as f: - myboxname = f.readline().strip() - except IOError: - pass - return myboxname - - -def getCPUSoC(): - chipset = "UNKNOWN" - if os.path.exists("/proc/stb/info/chipset"): - try: - with open( - "/proc/stb/info/chipset", "r", encoding="utf-8", errors="ignore" - ) as f: - chipset = f.readline().strip() - if chipset == "7405(with 3D)": - chipset = "7405" - except IOError: - pass - return chipset - - -def getBoxVuModel(): - vumodel = "UNKNOWN" - if os.path.exists("/proc/stb/info/vumodel") and not os.path.exists( - "/proc/stb/info/boxtype" - ): - try: - with open( - "/proc/stb/info/vumodel", "r", encoding="utf-8", errors="ignore" - ) as f: - vumodel = f.readline().strip() - except IOError: - pass - return vumodel - - -def getCPUtype(): - cpu = "UNKNOWN" - if os.path.exists("/proc/cpuinfo"): - try: - with open("/proc/cpuinfo", "r", encoding="utf-8", errors="ignore") as f: - lines = f.read() - if "ARMv7" in lines: - cpu = "ARMv7" - elif "mips" in lines: - cpu = "MIPS" - except IOError: - pass - return cpu - - -def getKernelVersion(): - if not os.path.exists("/tmp/.isnandsim"): - if ( - os.system("opkg list-installed | grep kernel-module-nandsim" + dev_null) - != 0 - ): - os.system("touch /tmp/.isnandsim") - - if os.path.exists("" + - getNeoLocation() + - "ImagesUpload/dm520") or os.path.exists("" + - getNeoLocation() + - "ImagesUpload/dm525"): - try: - result = ( - subprocess.check_output(["uname", "-r"], text=True, errors="ignore") - .strip("\n") - .split("-") - ) - kernel_version = result[0] - return kernel_version - except Exception: - os.system("uname -r > /tmp/.uname_r") - try: - with open("/tmp/.uname_r", "r", encoding="utf-8", errors="ignore") as f: - return f.read().strip().upper() - except IOError: - return "UNKNOWN" - else: - try: - with open("/proc/version", "r", encoding="utf-8", errors="ignore") as f: - return f.read().split(" ", 4)[2].split("-", 2)[0] - except Exception: - os.system("uname -r > /tmp/.uname_r") - try: - with open("/tmp/.uname_r", "r", encoding="utf-8", errors="ignore") as f: - return f.read().strip().upper() - except IOError: - return "UNKNOWN" - - -def getNeoLocation(): - locatino = "UNKNOWN" - if os.path.exists( - "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location"): - try: - with open( - "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location", - "r", - encoding="utf-8", - errors="ignore", - ) as f: - locatino = f.readline().strip() - except IOError: - pass - return locatino - - -media = getNeoLocation() -mediahome = media + "/ImageBoot/" -extensions_path = "/usr/lib/enigma2/python/Plugins/Extensions/" -dev_null = " > /dev/null 2>&1" -supportedTuners = "vuplus" - - -def NEOBootMainEx( - source, - target, - CopyFiles, - CopyKernel, - TvList, - LanWlan, - Sterowniki, - Montowanie, - InstallSettings, - ZipDelete, - RepairFTP, - SoftCam, - MediaPortal, - PiconR, - Kodi, - BlackHole, - Nandsim, -): - 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) - - rc = NEOBootExtract(source, target, ZipDelete, Nandsim) - - os.system("sync; echo 1 > /proc/sys/vm/drop_caches") - - 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/hostname " + - media_target + - "/etc/hostname" + - dev_null, - "cp -a /usr/share/enigma2/rc_models/* " + - media_target + - "/usr/share/enigma2/rc_models/" + - dev_null, - "cp -r -p /usr/share/enigma2/rc_models " + - media_target + - "/usr/share/enigma2" + - dev_null, - "cp -af " + - extensions_path + - "NeoBoot " + - media_target + - extensions_path + - "NeoBoot" + - dev_null, - "mkdir -p " + - media_target + - extensions_path + - "NeoReboot" + - dev_null, - "touch " + - media_target + - extensions_path + - "NeoReboot/__init__.py" + - dev_null, - "chmod 644 " + - media_target + - extensions_path + - "NeoReboot/__init__.py" + - dev_null, - "cp -af " + - extensions_path + - "NeoBoot/files/backflash " + - media_target + - extensions_path + - "NeoReboot/backflash.sh" + - dev_null, - "cp -af " + - extensions_path + - "NeoBoot/files/neoreboot " + - media_target + - extensions_path + - "NeoReboot/plugin.py" + - 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": - 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 -af /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 -af /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 ( - getCPUtype() == "MIPS" - and getBoxHostName() == "vuultimo" - or getBoxHostName() == "bm750" - or getBoxHostName() == "vuduo" - or getBoxHostName() == "vuuno" - or getBoxHostName() == "vusolo" - or getBoxHostName() == "vuduo" - or getBoxHostName() == "vusolo2" - or getBoxHostName() == "vusolose" - or getBoxHostName() == "vuduo2" - or getBoxHostName() == "vuzero" - or getBoxHostName() == "mbultra" - ): - 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"') - elif getCPUtype() == "MIPS" and getBoxHostName() == "et5x00": - os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/" - + getBoxHostName() - + "/kernel.bin " - + media_target - + "/boot/" - + getBoxHostName() - + ".vmlinux.gz" - + dev_null - ) - os.system('echo "Copied kernel.bin STB-MIPS Clarke-Tech & Xtrend"') - elif ( - getCPUtype() == "ARMv7" - and getBoxHostName() == "vuultimo4k" - or getBoxHostName() == "vusolo4k" - or getBoxHostName() == "vuuno4k" - or getBoxHostName() == "vuuno4kse" - or getBoxHostName() == "vuduo4k" - or getBoxHostName() == "vuduo4kse" - or getBoxHostName() == "vuzero4k" - ): - 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 -af /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 -af /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 -af /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 -af /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 -af /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 -af /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 -af " + - 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 -af " + - 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 -af " + - 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 -af " + - 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 -af " + - extensions_path + - "MyUpdater %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 + "AlternativeSoftCamManager"): - cmd = ( - "cp -af " + - extensions_path + - "AlternativeSoftCamManager %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 + "TempFanControl"): - cmd = ( - "cp -af " + - extensions_path + - "TempFanControl %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/TempFanControl > /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 -af /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) - if os.path.exists( - "%s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/HbbTV" - % (media, target) - ): - os.system( - "rm -rf %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/HbbTV" % - (media, target)) - - 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 LanWlan == "True": - if os.path.exists( - "%s/ImageBoot/%s/etc/vtiversion.info" % - (media, target)): - os.system( - 'echo "Not copied LAN-WLAN, not recommended for this image."') - elif os.path.exists("/etc/vtiversion.info") and os.path.exists( - "%s/usr/lib/enigma2/python/Plugins/PLi" % (media, target) - ): - os.system( - 'echo "Not copied LAN-WLAN, not recommended for this image."') - elif os.path.exists("/etc/bhversion") and os.path.exists( - "%s/usr/lib/enigma2/python/Plugins/PLi" % (media, target) - ): - os.system( - 'echo "Not copied LAN-WLAN, not recommended for this image."') - if os.path.exists("/etc/wpa_supplicant.wlan0.conf"): - cmd = ( - "cp -af /etc/wpa_supplicant.wlan0.conf %s/ImageBoot/%s/etc/wpa_supplicant.wlan0.conf > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) - if os.path.exists("/etc/network/interfaces"): - cmd = ( - "cp -af /etc/network/interfaces %s/ImageBoot/%s/etc/network/interfaces > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) - if os.path.exists("/etc/wpa_supplicant.conf"): - cmd = ( - "cp -af /etc/wpa_suppligetinstallscant.conf %s/ImageBoot/%s/etc/wpa_supplicant.conf > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) - if os.path.exists("/etc/resolv.conf"): - cmd = ( - "cp -af /etc/resolv.conf %s/ImageBoot/%s/etc/resolv.conf > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) - if os.path.exists("/etc/wl.conf.wlan3"): - cmd = ( - "cp -af /etc/wl.conf.wlan3 %s/ImageBoot/%s/etc/wl.conf.wlan3 > /dev/null 2>&1" % - (media, target)) - rc = os.system(cmd) - os.system('echo "Copied LAN-WLAN..."') - - 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 -af /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 -af /lib/firmware %s/ImageBoot/%s/lib > /dev/null 2>&1" % ( - media, target, ) - rc = os.system(cmd) - os.system('echo "System drivers copied..."') - - if Montowanie == "True": - if getCPUtype() == "MIPS": - if os.path.exists( - "%s/ImageBoot/%s/etc/fstab" % - (media, target)): - cmd = ( - "mv %s/ImageBoot/%s/etc/fstab %s/ImageBoot/%s/etc/fstab.org" % - (media, target, media, target)) - rc = os.system(cmd) - if os.path.exists( - "%s/ImageBoot/%s/etc/init.d/volatile-media.sh" % - (media, target)): - cmd = ( - "mv %s/ImageBoot/%s/etc/init.d/volatile-media.sh %s/ImageBoot/%s/etc/init.d/volatile-media.sh.org" % - (media, target, media, target)) - rc = os.system(cmd) - cmd = "cp -r /etc/fstab %s/ImageBoot/%s/etc/fstab" % ( - media, target) - rc = os.system(cmd) - os.system('echo "The fstab mount file was copied..."') - elif getCPUtype() == "ARMv7": - os.system('echo "No copied mount ARM..."') - - 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 -af /etc/tuxbox/* %s/ImageBoot/%s/etc/tuxbox" % ( - media, target) - rc = os.system(cmd) - os.system( - 'touch /tmp/settings_copied; echo "System settings copied..."') - - if RepairFTP == "True": - filename = media + "/ImageBoot/" + target + "/etc/vsftpd.conf" - if os.path.exists(filename): - filename2 = filename + ".tmp" - try: - with open(filename, "r", encoding="utf-8", errors="ignore") as f: - lines = f.readlines() - - with open(filename2, "w", encoding="utf-8", errors="ignore") as out: - for line in lines: - 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) + 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) - except Exception as e: - os.system(f'echo "Failed to patch {filename}: {e}"') - if os.path.exists(filename2): - os.remove(filename2) - os.system('echo "Repair ftp."') - - if SoftCam == "True": - if os.path.exists("/etc/CCcam.cfg"): - cmd = "cp -af /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 -af /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 -af " + - extensions_path + - "MediaPortal %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) - rc = os.system(cmd) - cmd = ( - "cp -af " + - extensions_path + - "mpgz %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions > /dev/null 2>&1" % - (media, - target)) - rc = os.system(cmd) - cmd = ( - "cp -af /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 -af /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 -af /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 -af /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 -af /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 -af /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) + cmd = 'chmod -R 0755 %s' % filename 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, ) + 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 os.path.exists("/etc/enigma2/mp_config"): - cmd = "cp /etc/enigma2/mp_config %s/ImageBoot/%s/etc/enigma2" % ( - media, target, ) + 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 os.path.exists("/etc/enigma2/mp_pluginliste"): - cmd = ( - "cp /etc/enigma2/mp_pluginliste %s/ImageBoot/%s/etc/enigma2" % - (media, target)) + 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('echo "Copied MediaPortal..."') - elif not os.path.exists("" + extensions_path + "MediaPortal"): - os.system('echo "MediaPortal not found."') - - if PiconR == "True": - if os.path.exists("/usr/share/enigma2/picon"): - cmd = ( - "cp -af /usr/share/enigma2/picon %s/ImageBoot/%s/usr/share/enigma2" % - (media, target)) + + #_______________________________________________status1 zmienione + if os.path.exists('%s/ImageBoot/%s/var/lib/opkg/status1' % (media, target)): + cmd = 'mv ' + getNeoLocation() + 'ImageBoot/' + target + '/var/lib/opkg/status ' + getNeoLocation() + 'ImageBoot/%s/var/lib/opkg/status-or' % target rc = os.system(cmd) - os.system('echo "Copied picon..."') - elif not os.path.exists("/usr/share/enigma2/picon"): - os.system('echo "Picon flash not found."') - - if Kodi == "True": - cmd = "mkdir -p %s/ImageBoot/%s/home/root/.kodi > /dev/null 2>&1" % ( - media, target, ) - rc = os.system(cmd) - if os.path.exists("/home/root/.kodi"): - os.system('echo "Kodi set ok."') - else: - if not os.path.exists("/home/root/.kodi"): - if not os.path.exists("/.multinfo"): - if os.path.exists("/media/hdd/.kodi"): - cmd = 'mv /media/hdd/.kodi /media/hdd/.kodi_flash; ln -sf "/media/hdd/.kodi_flash" "/home/root/.kodi"; ln -sf "/home/root/.kodi" "/media/hdd/.kodi" ' - rc = os.system(cmd) - os.system('echo "Kodi fix ok."') - else: - os.system('echo "Kodi not found.."') - else: - os.system('echo "Kodi path possible only from flash."') - else: - os.system('echo "Kodi not found."') - - if BlackHole == "True": - if "BlackHole" in source or os.path.exists( - "%s/ImageBoot/%s/usr/lib/enigma2/python/Blackhole" % - (media, target)): - cmd = ( - "mkdir -p " - + getNeoLocation() - + "ImageBoot/%s/boot/blackhole" % target - ) + fail = '' + getNeoLocation() + 'ImageBoot/%s/var/lib/opkg/status-or' % target + f = open(fail, 'r') + content = f.read() + f.close() + localfile2 = '' + getNeoLocation() + 'ImageBoot/%s/var/lib/opkg/status' % target + temp_file2 = open(localfile2, 'w') + temp_file2.write(content.replace('kernel-image', '#kernel-image')) + temp_file2.close() + + cmd = 'chmod -R 0755 %s' % localfile2 rc = os.system(cmd) - cmd = ( - "mv " + - getNeoLocation() + - "ImageBoot/" + - target + - "/usr/lib/enigma2/python/Blackhole/BhUtils.pyo " + - getNeoLocation() + - "ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.pyo.org" % - target) - rc = os.system(cmd) - cmd = ( - "cp -af " + - extensions_path + - "NeoBoot/bin/utilsbh " + - getNeoLocation() + - "ImageBoot/%s/usr/lib/enigma2/python/Blackhole/BhUtils.py" % - target) - rc = os.system(cmd) - ver = source.replace("BlackHole-", "") - try: - text = ver.split("-")[0] - except Exception: - text = "" - localfile = ( - "" - + getNeoLocation() - + "ImageBoot/%s/boot/blackhole/version" % target - ) - try: - with open( - localfile, "w", encoding="utf-8", errors="ignore" - ) as temp_file: - temp_file.write(text) - except Exception as e: - os.system(f'echo "Failed to write {localfile}: {e}"') + cmd = 'rm -r ' + getNeoLocation() + 'ImageBoot/%s/var/lib/opkg/status-or' % target + rc = os.system(cmd) - cmd = ( - "mv " - + getNeoLocation() - + "ImageBoot/" - + target - + "/usr/bin/enigma2 " - + getNeoLocation() - + "ImageBoot/%s/usr/bin/enigma2-or" % target - ) - rc = os.system(cmd) - - fail = ( - "" + - getNeoLocation() + - "ImageBoot/%s/usr/bin/enigma2-or" % - target) - content = "" - try: - with open(fail, "r", encoding="utf-8", errors="ignore") as f: - content = f.read() - except Exception as e: - os.system(f'echo "Failed to read {fail}: {e}"') - - if content: - localfile2 = ( - "" + - getNeoLocation() + - "ImageBoot/%s/usr/bin/enigma2" % - target) - try: - with open( - localfile2, "w", encoding="utf-8", errors="ignore" - ) as temp_file2: - temp_file2.write( - content.replace( - "/proc/blackhole/version", - "/boot/blackhole/version")) - - 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) - except Exception as e: - os.system(f'echo "Failed to write {localfile2}: {e}"') - - if os.path.exists("/var/lib/zerotier-one/identity.secret"): - cmd = ( - "mkdir -p " - + getNeoLocation() - + "ImageBoot/%s/var/lib/zerotier-one" % target - ) - rc = os.system(cmd) - cmd1 = ( - "cp -af /var/lib/zerotier-one/identity.secret " - + getNeoLocation() - + "ImageBoot/%s/var/lib/zerotier-one/" % target - ) - rc = os.system(cmd1) - - if os.path.exists("/var/lib/tailscale/tailscaled.state"): - cmd = ( - "mkdir -p " - + getNeoLocation() - + "ImageBoot/%s/var/lib/tailscale" % target - ) - rc = os.system(cmd) - cmd1 = ( - "cp -af /var/lib/tailscale/* " - + getNeoLocation() - + "ImageBoot/%s/var/lib/tailscale/" % target - ) - rc = os.system(cmd1) - cmd2 = ( - "cp -af /var/lib/tailscale/* " - + getNeoLocation() - + "ImageBoot/%s/var/lib/tailscale/" % target - ) - rc = os.system(cmd2) - if os.path.exists("/usr/sbin/tailscaled"): - cmd3 = ( - "cp -af /usr/sbin/tailscaled " - + getNeoLocation() - + "ImageBoot/%s/susr/sbin/" % target - ) - rc = os.system(cmd3) - elif os.path.exists("/usr/bin/tailscaled"): - cmd3 = ( - "cp -af /usr/bin/tailscaled " - + getNeoLocation() - + "ImageBoot/%s/usr/bin/" % target - ) - rc = os.system(cmd3) - cmd4 = ( - "cp -af /usr/bin/tailscale " - + getNeoLocation() - + "ImageBoot/%s/usr/bin/" % target - ) - rc = os.system(cmd4) - cmd5 = ( - "cp -af /etc/init.d/tailscal* " - + getNeoLocation() - + "ImageBoot/%s/etc/init.d/" % target - ) - rc = os.system(cmd5) - - if not os.path.exists( - "%s/ImageBoot/%s/var/run/tailscale" % (media, target) - ): - cmd = ( - "mkdir -p " - + getNeoLocation() - + "/ImageBoot/%s/run/tailscale/" % target - ) - rc = os.system(cmd) - if os.path.exists("/run/tailscale"): - cmd = ( - "cp -aRf /run/tailscale/tailscaled.sock " - + getNeoLocation() - + "ImageBoot/%s/run/tailscale/" % target - ) - rc = os.system(cmd) - - if os.path.exists("%s/ImageBoot/%s/etc/init.d" % (media, target)): - cmd = ( - "ln -s %sImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh %sImageBoot/%s/etc/rcS.d/S99neo.local" % - (media, target, media, target)) - os.system('echo "Copied file neo_userscript.sh"') - - elif not os.path.exists("%s/ImageBoot/%s/etc/init.d" % (media, target)): - os.system('echo "/etc/init.d not found."') +# cmd = 'cp -f ' + extensions_path + 'NeoBoot/bin/hdd ' + getNeoLocation() + 'ImageBoot/%s/etc/init.d/hddusb' % target +# rc = os.system(cmd) + if os.path.exists('%s/ImageBoot/%s/usr/lib' % (media, target)): + cmd = 'cp -af /usr/lib/periodon ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/' % target + rc = os.system(cmd) + cmd = 'mkdir -p ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Tools/' % target + rc = os.system(cmd) + cmd = 'cp -af /usr/lib/enigma2/python/Tools/Testinout.py ' + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Tools/' % target + rc = os.system(cmd) - - if not os.path.exists( - "" + getNeoLocation() + "ImageBoot/.without_copying" - ) and not os.path.exists(" /tmp/settings_copied"): - try: - with open("/etc/hostname", "r", encoding="utf-8", errors="ignore") as f: - for line in f: - if ( - getCPUtype() == "MIPS" - and "dm500hd" in line - or "dm800se" in line - or "dm800" in line - or "dm800se" in line - or "dm8000" in line - ): - if os.path.exists( - "%s/ImageBoot/%s/etc/enigma2" % (media, target) - ): - cmd = "rm -r %s/ImageBoot/%s/etc/enigma2" % ( - media, target) - rc = os.system(cmd) - else: - 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) - cmd1 = ( - 'grep "av.videomode.DVI" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd1) - cmd2 = ( - 'grep "config.OpenWebif" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd2) - cmd3 = ( - 'grep "config.osd" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd3) - cmd4 = ( - 'grep "config.timezone.val" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd4) - cmd5 = ( - 'grep "config.servicelist.startuproot" /etc/enigma2/settings >> %s/ImageBoot/%s/etc/enigma2/settings' % - (media, target)) - rc = os.system(cmd5) - cmd6 = ( - 'grep "UUID=" /etc/fstab >> %s/ImageBoot/%s/etc/fstab' % - (media, target)) - rc = os.system(cmd6) - except Exception as e: - os.system(f'echo "Failed reading /etc/hostname: {e}"') - - if ( - not os.path.exists( - "" + media_target + "/boot/zImage." + getBoxHostName() + "" - ) - and getCPUtype() == "MIPS" - ): - namefile = media + "/ImageBoot/" + target + "/etc/fstab" - namefile2 = namefile + ".tmp" - if os.path.exists(namefile): # Check if source exists - try: - with open(namefile, "r", encoding="utf-8", errors="ignore") as f: - lines = f.readlines() - with open(namefile2, "w", encoding="utf-8", errors="ignore") as out: - for line in lines: - if line.find("/dev/mmcblk0p2") != -1: - line = "#" + line - elif line.find("/dev/root") != -1: - line = "#" + line - out.write(line) - os.rename(namefile2, namefile) - except Exception as e: - os.system(f'echo "Failed to patch {namefile}: {e}"') - if os.path.exists(namefile2): - os.remove(namefile2) - - 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" - try: - with open(fname, "r", encoding="utf-8", errors="ignore") as f: - lines = f.readlines() - with open(fname2, "w", encoding="utf-8", errors="ignore") as out: - for line in lines: - if line.find( - 'if file(""/proc/stb/info/vumodel")') != -1: - line = "#" + line - out.write(line) - os.rename(fname2, fname) - except Exception as e: - os.system(f'echo "Failed to patch {fname}: {e}"') - if os.path.exists(fname2): - os.remove(fname2) - - targetfile = media + "/ImageBoot/" + target + "/etc/vsftpd.conf" - if os.path.exists(targetfile): - targetfile2 = targetfile + ".tmp" - try: - with open(targetfile, "r", encoding="utf-8", errors="ignore") as f: - lines = f.readlines() - with open( - targetfile2, "w", encoding="utf-8", errors="ignore" - ) as out: - for line in lines: - if not line.startswith("nopriv_user"): - out.write(line) - os.rename(targetfile2, targetfile) - except Exception as e: - os.system(f'echo "Failed to patch {targetfile}: {e}"') - if os.path.exists(targetfile2): - os.remove(targetfile2) - - 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/" - - if os.path.exists(mypath): # Check if path exists before listing - for fn in os.listdir(mypath): - if ((fn.find("kernel-image") != - - 1 and fn.find("postinst") != - - 1) or fn.find("-bootlogo.postinst") != - - 1 or fn.find("-bootlogo.postrm") != - - 1 or fn.find("-bootlogo.preinst") != - - 1 or fn.find("-bootlogo.prerm") != - - 1): - - filename = os.path.join(mypath, fn) - filename2 = filename + ".tmp" - try: - with open( - filename, "r", encoding="utf-8", errors="ignore" - ) as f: - lines = f.readlines() - - with open( - filename2, "w", encoding="utf-8", errors="ignore" - ) as out: - for line in lines: - if line.find("/boot") != -1: - line = line.replace( - "/boot", "/boot > /dev/null 2>\\&1; exit 0") - out.write(line) - - os.rename(filename2, filename) - cmd = "chmod -R 0755 %s" % filename - rc = os.system(cmd) - except Exception as e: - os.system( - f'echo "Failed to patch {filename}: {e}"') - if os.path.exists(filename2): - os.remove(filename2) - - if os.path.exists( - "%s/ImageBoot/%s/var/lib/opkg/status1" % - (media, target)): - cmd = ( - "mv " - + getNeoLocation() - + "ImageBoot/" - + target - + "/var/lib/opkg/status " - + getNeoLocation() - + "ImageBoot/%s/var/lib/opkg/status-or" % target - ) - rc = os.system(cmd) - - fail = ( - "" - + getNeoLocation() - + "ImageBoot/%s/var/lib/opkg/status-or" % target - ) - content = "" - try: - with open(fail, "r", encoding="utf-8", errors="ignore") as f: - content = f.read() - except Exception as e: - os.system(f'echo "Failed to read {fail}: {e}"') - - if content: - localfile2 = ( - "" - + getNeoLocation() - + "ImageBoot/%s/var/lib/opkg/status" % target - ) - try: - with open( - localfile2, "w", encoding="utf-8", errors="ignore" - ) as temp_file2: - temp_file2.write( - content.replace( - "kernel-image", - "#kernel-image")) - - cmd = "chmod -R 0755 %s" % localfile2 - rc = os.system(cmd) - cmd = ( - "rm -r " - + getNeoLocation() - + "ImageBoot/%s/var/lib/opkg/status-or" % target - ) - rc = os.system(cmd) - except Exception as e: - os.system(f'echo "Failed to write {localfile2}: {e}"') - - if os.path.exists("%s/ImageBoot/%s/usr/lib" % (media, target)): - cmd = ( - "cp -af /usr/lib/periodon " - + getNeoLocation() - + "ImageBoot/%s/usr/lib/" % target - ) - rc = os.system(cmd) - cmd = ( - "mkdir -p " - + getNeoLocation() - + "ImageBoot/%s/usr/lib/enigma2/python/Tools/" % target - ) - rc = os.system(cmd) - cmd = ( - "cp -af /usr/lib/enigma2/python/Tools/Testinout.py " - + getNeoLocation() - + "ImageBoot/%s/usr/lib/enigma2/python/Tools/" % target - ) - rc = os.system(cmd) - - cmd = "rm -r " + getNeoLocation() + "ImageBoot/%s/tmp" % target + #delet dir tmp + cmd = 'rm -r ' + getNeoLocation() + 'ImageBoot/%s/tmp' % target 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" + + 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) - try: - with open( - mediahome + ".neonextboot", "w", encoding="utf-8", errors="ignore" - ) as out: - out.write(target) - except Exception as e: - os.system(f'echo "Failed to write .neonextboot: {e}"') - - os.system( - "cp " - + getNeoLocation() - + "ImageBoot/.neonextboot " - + getNeoLocation() - + "ImageBoot/%s/.multinfo" % target - ) - - try: - with open( - mediahome + ".neonextboot", "w", encoding="utf-8", errors="ignore" - ) as out: - out.write("Flash") - except Exception as e: - os.system(f'echo "Failed to write .neonextboot: {e}"') - - 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") + 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() os.system('echo "End of installation:"; date +%T') - os.system( - 'echo "If you want to save the installation process from the console press green."' - ) + 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/unpackedzip"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/unpackedzip") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/*.bin"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/*.bin") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/*.txt"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/*.txt") - elif 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/osmio4kplus"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/osmio4kplus") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dm900"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/dm900") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/hd60"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/hd60") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/hd61"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/hd61") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/hd51"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/hd51") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/bre2ze4k"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/bre2ze4k") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/multibox"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/multibox") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxse"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/multiboxse") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxpro"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/multiboxpro") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/unforce_multibox.txt"): - rc = os.system( - "rm -r " + getNeoLocation() + "ImagesUpload/unforce_multibox.txt" - ) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/axas"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/axas") - 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/osminiplus"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osminiplus") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osnino"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osnino") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osninoplus"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osninoplus") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osninopro"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osninopro") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osmini4k"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/osmini4k") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/xp1000 "): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/xp1000") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/et5x00"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/et5x00") - 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/dreamtwo "): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/dreamtwo ") - elif ( - os.path.exists("" + getNeoLocation() + "ImagesUpload/multibox") - or os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxse") - or os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxpro") - ): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/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/octagon/sf8008m"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/octagon") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/h5"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/bootargs.bin " - + getNeoLocation() - + "ImagesUpload/h5; mv " - + getNeoLocation() - + "ImagesUpload/fastboot.bin " - + getNeoLocation() - + "ImagesUpload/h5" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h") - 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/h9se"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/bootargs.bin " - + getNeoLocation() - + "ImagesUpload/h9se; mv " - + getNeoLocation() - + "ImagesUpload/fastboot.bin " - + getNeoLocation() - + "ImagesUpload/h9se" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h9se") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/i55plus"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/bootargs.bin " - + getNeoLocation() - + "ImagesUpload/i55plus; mv " - + getNeoLocation() - + "ImagesUpload/fastboot.bin " - + getNeoLocation() - + "ImagesUpload/i55plus" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/i55plus") - 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/h9combose"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/force_h9combose_READ.ME " - + getNeoLocation() - + "ImagesUpload/h9combo; mv " - + getNeoLocation() - + "ImagesUpload/unforce_h9combose.txt " - + getNeoLocation() - + "ImagesUpload/h9combose" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h9combose") - 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/h11"): - rc = os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/force_h11_READ.ME " - + getNeoLocation() - + "ImagesUpload/h11; mv " - + getNeoLocation() - + "ImagesUpload/unforce_h11.txt " - + getNeoLocation() - + "ImagesUpload/h11" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h11") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/h8"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/h8") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/uclan"): - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/usb_update.bin"): - 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/ustym4kpro"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/ustym4kpro") - 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/x1" - ) or os.path.exists("" + getNeoLocation() + "ImagesUpload/gigablue/x34k"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/gigablue") - elif os.path.exists( - "" + getNeoLocation() + "ImagesUpload/gigablue" - ) and os.path.exists("" + getNeoLocation() + "ImagesUpload/usb_update.bin"): - 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/et10000"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/et10000") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/vs1000"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/vs1000") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/vs1500"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/vs1500") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/pulse4k"): - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/pulse4k/force_pulse4k_READ.ME"): - rc = os.system( - "rm -r " - + getNeoLocation() - + "ImagesUpload/pulse4k/force_pulse4k_READ.ME; rm -r " - + getNeoLocation() - + "ImagesUpload/pulse4k/unforce_pulse4k.txt" - ) - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/pulse4k") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/pulse4kmin"): - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/pulse4kmin/force_pulse4kmini_READ.ME"): - rc = os.system( - "rm -r " - + getNeoLocation() - + "ImagesUpload/pulse4kmini/force_pulse4kmini_READ.ME; rm -r " - + getNeoLocation() - + "ImagesUpload/pulse4kmini/unforce_pulse4kmini.txt" - ) - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/pulse4kmini") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/xpeedlx"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/xpeedlx") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dm520"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/dm520") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/rootfs.tar.gz"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/rootfs.tar.gz") - 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/rootfs.tar.bz2"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/rootfs.tar.bz2") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/rootfs.tar"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/rootfs.tar") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/unforce_h9combo.txt"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/unforce_h9combo.txt") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/imageversion"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/imageversion") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/kernel.bin"): - rc = os.system( - "rm -rf " + - getNeoLocation() + - "ImagesUpload/kernel.bin") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/force_multibox_READ.ME"): - rc = os.system( - "rm -r " + getNeoLocation() + "ImagesUpload/force_multibox_READ.ME" - ) - if os.path.exists("" + getNeoLocation() + "ImagesUpload/force"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/force") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/rootfs.bin"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/rootfs.bin") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/splash.bin"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/splash.bin") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/gigablue"): - rc = os.system("rm -r " + getNeoLocation() + "ImagesUpload/gigablue") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/update_bootargs_h8"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/update_bootargs_h8") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/force_hd60_READ.ME"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/force_hd60_READ.ME") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/unforce_hd60.txt"): - rc = os.system( - "rm -r " + - getNeoLocation() + - "ImagesUpload/unforce_hd60.txt") - if os.path.exists("/tmp/root_jffs2"): - rc = os.system("rm -fr /tmp/root_jffs2") - if os.path.exists("/tmp/xz-gz-tar"): - rc = os.system("rm -fr /tmp/xz-gz-tar") - if os.path.exists("/tmp/other_image"): - rc = os.system("rm -fr /tmp/other_image") - + os.chdir(media + '/ImagesUpload') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/unpackedzip'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/unpackedzip') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/*.bin'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/*.bin') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/*.txt'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/*.txt') + elif 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/osmio4kplus'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmio4kplus') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm900'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dm900') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd60'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/hd60') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd61'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/hd61') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd51'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/hd51') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/bre2ze4k'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/bre2ze4k') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multibox'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/multibox') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multiboxse'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/multiboxse') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/unforce_multibox.txt'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/unforce_multibox.txt') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/axas'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/axas') + 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/osminiplus'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osminiplus') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osnino'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osnino') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osninoplus'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osninoplus') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osninopro'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osninopro') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini4k'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/osmini4k') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/xp1000 '): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/xp1000') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et5x00'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et5x00') + 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/dreamtwo '): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dreamtwo ') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multibox') or os.path.exists('' + getNeoLocation() + 'ImagesUpload/multiboxse'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/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/octagon/sf8008m'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/octagon') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h5'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h5; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h5') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h') + 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/h9se'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/h9se; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/h9se') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9se') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/i55plus'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/bootargs.bin ' + getNeoLocation() + 'ImagesUpload/i55plus; mv ' + getNeoLocation() + 'ImagesUpload/fastboot.bin ' + getNeoLocation() + 'ImagesUpload/i55plus') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/i55plus') + 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/h9combose'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h9combose_READ.ME ' + getNeoLocation() + 'ImagesUpload/h9combo; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h9combose.txt ' + getNeoLocation() + 'ImagesUpload/h9combose') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h9combose') + 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/h11'): + rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/force_h11_READ.ME ' + getNeoLocation() + 'ImagesUpload/h11; mv ' + getNeoLocation() + 'ImagesUpload/unforce_h11.txt ' + getNeoLocation() + 'ImagesUpload/h11') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h11') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h8'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/h8') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/uclan'): + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/usb_update.bin'): + 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/ustym4kpro'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/ustym4kpro') + 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/x1') or os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/x34k'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/gigablue') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue') and os.path.exists('' + getNeoLocation() + 'ImagesUpload/usb_update.bin'): + 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/et10000'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et10000') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vs1000'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/vs1000') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vs1500'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/vs1500') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/pulse4k'): + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/pulse4k/force_pulse4k_READ.ME'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/pulse4k/force_pulse4k_READ.ME; rm -r ' + getNeoLocation() + 'ImagesUpload/pulse4k/unforce_pulse4k.txt') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/pulse4k') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/pulse4kmin'): + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/pulse4kmin/force_pulse4kmini_READ.ME'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/pulse4kmini/force_pulse4kmini_READ.ME; rm -r ' + getNeoLocation() + 'ImagesUpload/pulse4kmini/unforce_pulse4kmini.txt') + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/pulse4kmini') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/xpeedlx'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/xpeedlx') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm520'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dm520') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz') + 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/rootfs.tar.bz2'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/unforce_h9combo.txt'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/unforce_h9combo.txt') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/imageversion'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/imageversion') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/kernel.bin'): + rc = os.system('rm -rf ' + getNeoLocation() + 'ImagesUpload/kernel.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/force_multibox_READ.ME'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/force_multibox_READ.ME') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/force'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/force') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.bin'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/splash.bin'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/splash.bin') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/gigablue') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/update_bootargs_h8'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/update_bootargs_h8') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/force_hd60_READ.ME'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/force_hd60_READ.ME') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/unforce_hd60.txt'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/unforce_hd60.txt') + if os.path.exists('/tmp/root_jffs2'): + rc = os.system('rm -fr /tmp/root_jffs2') + if os.path.exists('/tmp/xz-gz-tar'): + rc = os.system('rm -fr /tmp/xz-gz-tar') + if os.path.exists('/tmp/other_image'): + rc = os.system('rm -fr /tmp/other_image') + #Finish def NEOBootExtract(source, target, ZipDelete, Nandsim): RemoveUnpackDirs() - os.system( - 'echo "Press green to hide Console or red to abort the installation\nInstallation started:"; date +%T;echo "Extracting the installation file..."' - ) + 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 - sourcefile3 = media + "/ImagesUpload/%s.rar" % source - sourcefile4 = media + "/ImagesUpload/%s.gz" % source - - if os.path.exists(sourcefile2): - if sourcefile2.endswith(".nfi"): + 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 + sourcefile3 = media + '/ImagesUpload/%s.rar' % source + sourcefile4 = media + '/ImagesUpload/%s.gz' % 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 + 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 + to = '' + getNeoLocation() + 'ImageBoot/' + target + cmd = 'chmod -R 0777 %s' % to rc = os.system(cmd) - cmd = ( - "touch /tmp/root_jffs2; " - + extensions_path - + "NeoBoot/bin/nfidump " - + sourcefile2 - + " " - + getNeoLocation() - + "ImageBoot/" - + target - ) + cmd = 'touch /tmp/root_jffs2; ' + extensions_path + 'NeoBoot/bin/nfidump ' + sourcefile2 + ' ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - if os.path.exists( - "%sImageBoot/%s/media/squashfs-images" % (media, target) - ) and os.path.exists("%s/squashfs-images" % (media)): - os.system( - 'cp -af %s/squashfs-images/* "%sImageBoot/%s/media/squashfs-images' % - (media, media, target)) - if ZipDelete == "True": - rc = os.system("rm -rf " + sourcefile2) + if os.path.exists('%sImageBoot/%s/media/squashfs-images' % (media, target)) and os.path.exists('%s/squashfs-images' % (media)) : + os.system('cp -af %s/squashfs-images/* "%sImageBoot/%s/media/squashfs-images' % (media, media, target)) + if ZipDelete == 'True': + rc = os.system('rm -rf ' + sourcefile2) else: - os.system( - 'echo "NeoBoot keep the file: %s for reinstallation."' - % sourcefile2 - ) - if os.path.exists(sourcefile3): - if sourcefile3.endswith(".rar"): + os.system('echo "NeoBoot keep the file: %s for reinstallation."' % sourcefile2) + #Instalacja *.rar + if os.path.exists(sourcefile3) is True: + if sourcefile3.endswith('.rar'): os.system('echo "Installing iamge x.rar..."') - cmd = ( - "unrar e " - + sourcefile3 - + " " - + getNeoLocation() - + "ImagesUpload/ > /dev/null 2>&1" - ) + cmd = 'unrar e ' + sourcefile3 + ' ' + getNeoLocation() + 'ImagesUpload/ > /dev/null 2>&1' rc = os.system(cmd) - if ZipDelete == "True": - rc = os.system("rm -rf " + sourcefile3) + if ZipDelete == 'True': + rc = os.system('rm -rf ' + sourcefile3) else: - os.system( - 'echo "NeoBoot keep the file: %s for reinstallation."' - % sourcefile3 - ) + os.system('echo "NeoBoot keep the file: %s for reinstallation."' % sourcefile3) - elif os.path.exists(sourcefile): - os.system("unzip -o " + sourcefile) - if ZipDelete == "True": - os.system("rm -rf " + sourcefile) - - fn = "NewImage" + #Instalacja *.zip + elif os.path.exists(sourcefile) is True: + os.system('unzip -o ' + sourcefile) + if ZipDelete == 'True': + os.system('rm -rf ' + sourcefile) + + fn = 'NewImage' sourcelist = [] - if os.path.exists("%sImagesUpload" % getNeoLocation()): - for fn in os.listdir("%sImagesUpload" % getNeoLocation()): - if fn.find(".rootfs.tar.xz") != -1: - os.system("touch /tmp/other_image") - elif fn.find(".tar.xz") != -1: - os.system("touch /tmp/other_image") - elif fn.find(".tar.bz2") != -1: - os.system("touch /tmp/other_image") - elif fn.find(".tar.gz") != -1: - os.system("touch /tmp/other_image") - elif fn.find(".tar") != -1: - os.system("touch /tmp/other_image") - elif fn.find(".gz") != -1: - os.system("touch /tmp/other_image") + for fn in os.listdir('%sImagesUpload' % getNeoLocation()): + if fn.find('.rootfs.tar.xz') != -1: + os.system('touch /tmp/other_image') + elif fn.find('.tar.xz') != -1: + os.system('touch /tmp/other_image') + elif fn.find('.tar.bz2') != -1: + os.system('touch /tmp/other_image') + elif fn.find('.tar.gz') != -1: + os.system('touch /tmp/other_image') + elif fn.find('.tar') != -1: + os.system('touch /tmp/other_image') + elif fn.find('.gz') != -1: + os.system('touch /tmp/other_image') - if ( - getCPUtype() == "MIPS" - and not os.path.exists("/tmp/root_jffs2") - and not os.path.exists("/tmp/other_image") - ): - if not os.path.exists("" + getNeoLocation() + "ubi"): - rc = os.system("mkdir " + getNeoLocation() + "ubi") - to = "" + getNeoLocation() + "ImageBoot/" + target - cmd = "mkdir %s > /dev/null 2<&1" % to + #Instalacja MIPS + if getCPUtype() == 'MIPS' and not os.path.exists('/tmp/root_jffs2') and not os.path.exists('/tmp/other_image'): + 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) - cmd = "chmod -R 0777 %s" % to + cmd = 'chmod -R 0777 %s' % to rc = os.system(cmd) - rootfname = "rootfs.bin" - brand = "" - - if ( - Nandsim == "True" - or os.path.exists("/tmp/.isnandsim") - or os.path.exists( - "/lib/modules/%s/kernel/drivers/mtd/nand/nandsim.ko" - % getKernelVersion() - ) - ): + rootfname = 'rootfs.bin' + brand = '' + + #NANDSIM + if Nandsim == 'True' or os.path.exists('/tmp/.isnandsim') or 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 not os.path.exists(mtdfile): - break + mtdfile = '/dev/mtd' + str(i) + if os.path.exists(mtdfile) is False: + break mtd = str(i) - os.chdir(media + "/ImagesUpload") + 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') - 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") - - 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") - 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") - 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" - 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" - 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/gigablue"): - os.chdir("gigablue") - brand = "gigablue" - rootfname = "rootfs.bin" - if os.path.exists( - "" + getNeoLocation() + "ImagesUpload/gigablue/x1"): - os.chdir("x1") - 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" - - if os.path.exists("" + getNeoLocation() + "ImagesUpload/osmini"): - os.chdir("osmini") - brand = "osmini" - rootfname = "rootfs.bin" - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/osminiplus"): - os.chdir("osminiplus") - brand = "osmini" - rootfname = "rootfs.bin" - if os.path.exists("" + getNeoLocation() + "ImagesUpload/osmega"): - os.chdir("osmega") - brand = "osmini" - rootfname = "rootfs.bin" - if os.path.exists("" + getNeoLocation() + "ImagesUpload/osnino"): - os.chdir("osnino") - brand = "osnino" - rootfname = "rootfs.bin" - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/osninoplus"): - os.chdir("osninoplus") - brand = "osnino" - rootfname = "rootfs.bin" - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/osninopro"): - os.chdir("osninopro") - brand = "osnino" - rootfname = "rootfs.bin" - if os.path.exists("" + getNeoLocation() + "ImagesUpload/vs1000"): - os.chdir("vs1000") - brand = "vs1000" - rootfname = "rootfs.bin" - if os.path.exists("" + getNeoLocation() + "ImagesUpload/sf3038"): - os.chdir("sf3038") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/xp1000"): - os.chdir("xp1000") - brand = "xp1000" - - if os.path.exists( - "" + getNeoLocation() + "ImagesUpload/dm520" - ) and not os.path.exists("/tmp/dm_image"): - os.system("touch /tmp/dm_image") - os.chdir("dm520") - brand = "dm520" - rootfname = "rootfs.bin" + #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' + # Golden Interstar + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xpeedlx'): + os.chdir('xpeedlx') + brand = 'xpeedlx' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xpeedlx3'): + os.chdir('xpeedlx3') + brand = 'xpeedlx3' + #GigaBlue + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue'): + os.chdir('gigablue') + brand = 'gigablue' + rootfname = 'rootfs.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/x1'): + os.chdir('x1') + #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' + #os_Edision + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini'): + os.chdir('osmini') + brand = 'osmini' + rootfname = 'rootfs.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osminiplus'): + os.chdir('osminiplus') + brand = 'osmini' + rootfname = 'rootfs.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmega'): + os.chdir('osmega') + brand = 'osmini' + rootfname = 'rootfs.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osnino'): + os.chdir('osnino') + brand = 'osnino' + rootfname = 'rootfs.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osninoplus'): + os.chdir('osninoplus') + brand = 'osnino' + rootfname = 'rootfs.bin' + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osninopro'): + os.chdir('osninopro') + brand = 'osnino' + rootfname = 'rootfs.bin' + #Vimastec + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vs1000'): + os.chdir('vs1000') + brand = 'vs1000' + rootfname = 'rootfs.bin' + # + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf3038'): + os.chdir('sf3038') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xp1000'): + os.chdir('xp1000') + brand = 'xp1000' + + #Dreambox + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm520') and not os.path.exists('/tmp/dm_image'): + os.system('touch /tmp/dm_image') + os.chdir('dm520') + brand = 'dm520' + rootfname = 'rootfs.bin' + + #Instalacja image nandsim os.system('echo "Instalacja - nandsim w toku..."') - os.system( - 'echo "If the image installation failed, try disabling the use of nandsim installation"' - ) - if not os.path.exists( - "/lib/modules/%s/kernel/drivers/mtd/nand/nandsim.ko" - % getKernelVersion() - ): - rc = os.system( - "insmod /tmp/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()) + os.system('echo "If the image installation failed, try disabling the use of nandsim installation"') + #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()) + if not os.path.exists('/lib/modules/%s/kernel/drivers/mtd/nand/nandsim.ko' % getKernelVersion()): + rc = os.system('insmod /tmp/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()) else: - 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('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 + 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 -af " - + getNeoLocation() - + "ubi/* " - + getNeoLocation() - + "ImageBoot/" - + target - ) + rc = os.system('mount -t ubifs ubi1_0 ' + getNeoLocation() + 'ubi') + os.chdir('/home/root') + cmd = 'cp -af ' + getNeoLocation() + 'ubi/* ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - rc = os.system("umount " + getNeoLocation() + "ubi") - cmd = "ubidetach -m %s" % mtd + 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 os.path.exists("/tmp/dm_image") and os.path.exists( - "%s/ImageBoot/%s/etc/issue" % (media, target) - ): - os.system("rm -f /tmp/dm_image") + rc = os.system('rmmod nandsim') + rc = os.system('rm ' + getNeoLocation() + 'image_cache') + if os.path.exists('/tmp/dm_image') and os.path.exists('%s/ImageBoot/%s/etc/issue' % (media, target)): + os.system('rm -f /tmp/dm_image') - if ".tar.xz" not in source and not os.path.exists( - "%s/ImageBoot/%s/etc/issue" % (media, target) - ): + if '.tar.xz' not in source and not os.path.exists('%s/ImageBoot/%s/etc/issue' % (media, target)): RemoveUnpackDirs() 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 ""; 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..."') - os.system("rm -r %s/ImageBoot/%s" % (media, target)) - if os.path.exists("/tmp/dm_image"): - os.system("rm -f /tmp/dm_image") - os.system("sleep 5; init 4; sleep 5; init 3 ") + os.system('rm -r %s/ImageBoot/%s' % (media, target)) + if os.path.exists('/tmp/dm_image'): + os.system('rm -f /tmp/dm_image') + os.system('sleep 5; init 4; sleep 5; init 3 ') - elif os.path.exists( - "" + extensions_path + "NeoBoot/ubi_reader/ubi_extract_files.py" - ) and not os.path.exists("/tmp/root_jffs2"): - 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"): - if os.path.exists( - "" - + getNeoLocation() - + "ImagesUpload/vuplus/solose/root_cfe_auto.bin" - ): - os.chdir("solose") - os.system("mv -f root_cfe_auto.bin rootfs.bin") - elif os.path.exists( - "" - + getNeoLocation() - + "ImagesUpload/vuplus/solose/root_cfe_auto.jffs2" - ): - 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/duo4kse" - ): - os.chdir("duo4kse") - 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/gigablue/x1"): - os.chdir("x1") - 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") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/osmini"): - os.chdir("osmini") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/osminiplus"): - os.chdir("osminiplus") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/osmega"): - os.chdir("osmega") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/osnino"): - os.chdir("osnino") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/osninoplus"): - os.chdir("osninoplus") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/osninopro"): - os.chdir("osninopro") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/xp1000"): - os.chdir("xp1000") + #UBI_READER + elif os.path.exists('' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py') and not os.path.exists('/tmp/root_jffs2'): + 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'): + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solose/root_cfe_auto.bin'): + os.chdir('solose') + os.system('mv -f root_cfe_auto.bin rootfs.bin') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/solose/root_cfe_auto.jffs2'): + 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/duo4kse'): + os.chdir('duo4kse') + 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/gigablue/x1'): + os.chdir('x1') + 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') + #os_Edision + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini'): + os.chdir('osmini') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osminiplus'): + os.chdir('osminiplus') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmega'): + os.chdir('osmega') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osnino'): + os.chdir('osnino') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osninoplus'): + os.chdir('osninoplus') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osninopro'): + os.chdir('osninopro') + #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") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/patch.e2"): - os.system( - "rm -f " + - getNeoLocation() + - "ImagesUpload/patch.e2 ") - os.system('echo "____NEOBOOT will not unpack this image.____"') - os.system( - 'echo "____Try to install the image vuultimo mips____"') - if os.path.exists("" + getNeoLocation() + "ImagesUpload/vs1000"): - os.chdir("vs1000") - if os.path.exists("" + getNeoLocation() + "ImagesUpload/dm520"): - if os.path.exists("/tmp/dm_image"): - os.system("rm -f /tmp/dm_image") - os.chdir("dm520") + 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') + #AZBOX - Install image VUULTIMO MIPS It works + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/patch.e2'): + os.system('rm -f ' + getNeoLocation() + 'ImagesUpload/patch.e2 ') + os.system('echo "____NEOBOOT will not unpack this image.____"') + os.system('echo "____Try to install the image vuultimo mips____"') + #Vimastec + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vs1000'): + os.chdir('vs1000') + #Dreambox + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm520'): + if os.path.exists('/tmp/dm_image'): + os.system('rm -f /tmp/dm_image') + os.chdir('dm520') - 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") - if os.path.exists("" + getNeoLocation() + "ubi/dreambox-rootfs "): - os.system( - "mv " - + getNeoLocation() - + "ubi/dreambox-rootfs/* " - + getNeoLocation() - + "ImageBoot/%s/" % target - ) - else: - os.system( - "mv " - + getNeoLocation() - + "ubi/rootfs/* " - + getNeoLocation() - + "ImageBoot/%s/" % target - ) - cmd = "chmod -R +x " + getNeoLocation() + "ImageBoot/" + target - rc = os.system(cmd) + #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') + if os.path.exists('' + getNeoLocation() + 'ubi/dreambox-rootfs '): + os.system('mv ' + getNeoLocation() + 'ubi/dreambox-rootfs/* ' + getNeoLocation() + 'ImageBoot/%s/' % target) + else: + 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."' - ) + os.system('echo "NeoBoot wykrył błąd !!! Prawdopodobnie brak ubi_reader lub nandsim."') - elif getCPUtype() == "ARMv7": - os.chdir("" + getNeoLocation() + "ImagesUpload") - if (os.path.exists("" + - getNeoLocation() + - "ImagesUpload/h9/rootfs.ubi") or os.path.exists("" + - getNeoLocation() + - "ImagesUpload/h8/rootfs.ubi") or os.path.exists("" + - getNeoLocation() + - "ImagesUpload/e2/update/rootfs.ubi")): - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/h9/rootfs.ubi"): - os.chdir("h9") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/h8/rootfs.ubi"): - os.chdir("h8") - elif os.path.exists( - "" + getNeoLocation() + "ImagesUpload/e2/update/rootfs.ubi" - ): - os.system( - "mv -f " - + getNeoLocation() - + "ImagesUpload/e2/update/rootfs.ubi " - + getNeoLocation() - + "ImagesUpload/e2" - ) - os.chdir("e2") - os.system("mv -f rootfs.ubi rootfs.bin") +#ARM + elif getCPUtype() == 'ARMv7': + os.chdir('' + getNeoLocation() + 'ImagesUpload') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9/rootfs.ubi') or os.path.exists('' + getNeoLocation() + 'ImagesUpload/h8/rootfs.ubi') or os.path.exists('' + getNeoLocation() + 'ImagesUpload/e2/update/rootfs.ubi'): + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9/rootfs.ubi'): + os.chdir('h9') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h8/rootfs.ubi'): + os.chdir('h8') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e2/update/rootfs.ubi'): + os.system('mv -f ' + getNeoLocation() + 'ImagesUpload/e2/update/rootfs.ubi ' + getNeoLocation() + 'ImagesUpload/e2') + os.chdir('e2') + 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" - ) + 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" - ) + 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 -af -p " - + getNeoLocation() - + "ubi/rootfs/* " - + getNeoLocation() - + "ImageBoot/" - + target - ) + os.chdir('/home/root') + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "chmod -R +x " + getNeoLocation() + "ImageBoot/" + target + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "rm -rf " + getNeoLocation() + "ubi" + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/axas/axashistwin"): - os.chdir("axas") - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/axas/axashistwin"): - os.chdir("axashistwin") + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/axas/axashistwin'): + os.chdir('axas') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/axas/axashistwin'): + os.chdir('axashistwin') 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" - ) + 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" - ) + 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 -af -p " - + getNeoLocation() - + "ubi/rootfs/* " - + getNeoLocation() - + "ImageBoot/" - + target - ) + os.chdir('/home/root') + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "chmod -R +x " + getNeoLocation() + "ImageBoot/" + target + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "rm -rf " + getNeoLocation() + "ubi" + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/et10000/rootfs.bin"): - os.chdir("et10000") - os.system("mv -f rootfs.bin rootfs.bin") + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et10000/rootfs.bin'): + os.chdir('et10000') + os.system('mv -f rootfs.bin 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" - ) + 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" - ) + 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 -af " - + getNeoLocation() - + "ubi/rootfs/* " - + getNeoLocation() - + "ImageBoot/" - + target - ) + os.chdir('/home/root') + cmd = 'cp -af ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "chmod -R +x " + getNeoLocation() + "ImageBoot/" + target + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "rm -rf " + getNeoLocation() + "ubi" + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' rc = os.system(cmd) - - elif os.path.exists( - "" + getNeoLocation() + "ImagesUpload/update/lunix/cfe/oe_rootfs.bin" - ): - os.chdir("update") - os.system( - "mv -f " - + getNeoLocation() - + "ImagesUpload/update/lunix/cfe/oe_rootfs.bin " - + getNeoLocation() - + "ImagesUpload/update/rootfs.bin" - ) + + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/lunix/cfe/oe_rootfs.bin'): + os.chdir('update') + os.system('mv -f ' + getNeoLocation() + 'ImagesUpload/update/lunix/cfe/oe_rootfs.bin ' + getNeoLocation() + 'ImagesUpload/update/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" - ) + 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" - ) + 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 -af -p " - + getNeoLocation() - + "ubi/rootfs/* " - + getNeoLocation() - + "ImageBoot/" - + target - ) + os.chdir('/home/root') + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "chmod -R +x " + getNeoLocation() + "ImageBoot/" + target + 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/vuplus/solo4k"): + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' + rc = os.system(cmd) + + #vuplus________________________ + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/vuplus/solo4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/solo4k/rootfs.tar.bz2; tar -jxf ' + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/vuplus/uno4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + 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 -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/vuplus/uno4kse/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/uno4kse/rootfs.tar.bz2; tar -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/vuplus/zero4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/zero4k/rootfs.tar.bz2; tar -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/vuplus/ultimo4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/ultimo4k/rootfs.tar.bz2; tar -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/vuplus/duo4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/duo4k/rootfs.tar.bz2; tar -jxf ' + 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/vuplus/duo4kse"): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus/duo4kse'): os.system('echo "Please wait. System installation VuPlus Duo4kse."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/vuplus/duo4kse/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/vuplus/duo4kse/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vuplus/duo4kse/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/vuplus/duo4kse/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/sf4008"): + #________________________________ + 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 -jxf " - + 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/sf8008m"): + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/sf4008/rootfs.tar.bz2; tar -jxf ' + 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/sf8008m'): os.system('echo "Please wait. System installation Octagon SF8008m."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/octagon/sf8008m/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/octagon/sf8008m/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/octagon/sf8008m/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/octagon/sf8008m/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/octagon/sf8008"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/octagon/sf8008/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/octagon/sf8008/rootfs.tar.bz2; tar -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/osmio4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/osmio4k/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/osmio4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osmio4kplus"): - os.system( - 'echo "Please wait. System installation EDISION osmio4kplus"') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/osmio4kplus/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/osmio4kplus/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmio4kplus'): + os.system('echo "Please wait. System installation EDISION osmio4kplus"') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/osmio4kplus/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/osmio4kplus/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/osmini4k"): - os.system( - 'echo "Please wait. System installation Edision OS mini 4K"') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/osmini4k/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/osmini4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) - rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dm900"): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini4k'): + os.system('echo "Please wait. System installation Edision OS mini 4K"') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/osmini4k/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/osmini4k/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 -jxf " - + getNeoLocation() - + "ImagesUpload/dm900/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dm900/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dm900/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dm920"): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm920'): os.system('echo "Please wait. System installation Dreambox DM920."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/dm920; tar -jxf " - + getNeoLocation() - + "ImagesUpload/dm920/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dm920; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dm920/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dreamtwo"): - os.system( - 'echo "Please wait. System installation Dreambox dreamtwo."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/dreamtwo; tar -jxf " - + getNeoLocation() - + "ImagesUpload/dreamtwo/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dreamtwo'): + os.system('echo "Please wait. System installation Dreambox dreamtwo."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dreamtwo; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dreamtwo/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/hd51/rootfs.tar.bz2"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/hd51/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2; tar -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/hd60/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/hd60/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/hd60/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/hd61"): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd61'): os.system('echo "Please wait. System installation AX HD60 4K"') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/hd61/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/hd61/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/hd61/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/hd61/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 AX multi twin or combo"') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/multibox/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/multibox/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) +# elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/unpackedzip/hd61'): +# os.system('echo "Please wait. System installation AX 4K HD61"') +# cmd = 'chmod -R 777 ' + getNeoLocation() + 'ImagesUpload/unpackedzip; tar -jxf ' + getNeoLocation() + 'ImagesUpload/unpackedzip/hd61/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 AX multi twin or combo"') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/multibox/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/multibox/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxse"): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/multiboxse'): os.system('echo "Please wait. System installation maxytec"') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/multiboxse/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/multiboxse/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/multiboxse/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/multiboxse/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/multiboxpro"): - os.system('echo "Please wait. System installation novaler 4k pro"') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/multiboxpro/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/multiboxpro/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) - rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/axas/axasc4k"): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/axas/axasc4k'): os.system('echo "Please wait. System installation Axas his c4k"') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/axas/axasc4k/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/axas/axasc4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/axas/axasc4k/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/axas/axasc4k/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 -jxf " - + getNeoLocation() - + "ImagesUpload/e4hd/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + 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 -jxf ' + getNeoLocation() + 'ImagesUpload/e4hd/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/gigablue/quad4k"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/gigablue/quad4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/quad4k/rootfs.tar.bz2; tar -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/gigablue/ue4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/ue4k/rootfs.tar.bz2; tar -jxf ' + 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/update/revo4k"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/update/revo4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/revo4k/rootfs.tar.bz2; tar -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/update/force3uhd/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/force3uhd/rootfs.tar.bz2; tar -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/update/galaxy4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/galaxy4k/rootfs.tar.bz2; tar -jxf ' + 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" - ): + 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" - ) + 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/h9/rootfs.ubi" - ) or os.path.exists("" + getNeoLocation() + "ImagesUpload/h8/rootfs.ubi"): - if os.path.exists( - "" + - getNeoLocation() + - "ImagesUpload/h9/rootfs.ubi"): - os.chdir("h9") - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/h8/rootfs.ubi"): - os.chdir("h8") - os.system("mv -f rootfs.ubi rootfs.bin") + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9/rootfs.ubi') or os.path.exists('' + getNeoLocation() + 'ImagesUpload/h8/rootfs.ubi'): + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9/rootfs.ubi'): + os.chdir('h9') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h8/rootfs.ubi'): + os.chdir('h8') + 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" - ) + 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" - ) + 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 -af -p " - + getNeoLocation() - + "ubi/rootfs/* " - + getNeoLocation() - + "ImageBoot/" - + target - ) + os.chdir('/home/root') + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "chmod -R +x " + getNeoLocation() + "ImageBoot/" + target + 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/zgemma/h9/rootfs.tar.bz2" - ): + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' + 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" - ) + 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/zgemma/h9se/rootfs.tar.bz2" - ): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h9se/rootfs.tar.bz2'): os.system('echo "Please wait. System installation Zgemma H9SE ."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/zgemma/h9se/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/zgemma/h9se/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) - rc = os.system(cmd) - elif os.path.exists( - "" + getNeoLocation() + "ImagesUpload/zgemma/i55plus/rootfs.tar.bz2" - ): + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/zgemma/h9se/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/zgemma/h9se/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/i55plus/rootfs.tar.bz2'): os.system('echo "Please wait. System installation Zgemma i55plus ."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/zgemma/i55plus/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/zgemma/i55plus/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/zgemma/i55plus/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/zgemma/i55plus/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" - ): + 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" - ) + 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/h9combose/rootfs.tar.bz2" - ): - os.system( - 'echo "Please wait. System installation Zgemma h9combose ."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/h9combose/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/h9combose/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h9combose/rootfs.tar.bz2'): + os.system('echo "Please wait. System installation Zgemma h9combose ."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/h9combose/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/h9combose/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"): + 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" - ) + 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/h11/rootfs.tar.bz2"): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/h11/rootfs.tar.bz2'): os.system('echo "Please wait. System installation Zgemma h11 ."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/h11/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/h11/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/h11/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/h11/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 -jxf ' + 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/mini4k"): - os.system( - 'echo "Please wait. System installation Miraclebox mini4k."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/miraclebox/mini4k/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/miraclebox/mini4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + 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 -jxf ' + 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/miraclebox/ultra4k"): - os.system( - 'echo "Please wait. System installation Miraclebox ultra4k."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/miraclebox/ultra4k/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/miraclebox/ultra4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + 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 -jxf ' + 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/update/lunix3-4k"): - os.system( - 'echo "Please wait. System installation Qviart lunix3-4k w toku..."' - ) - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/update/lunix3-4k; tar -jxf " - + getNeoLocation() - + "ImagesUpload/update/lunix3-4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/update/lunix4k'): + os.system('echo "Please wait. System installation Qviart Lunix 4K w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/lunix4k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/update/lunix4k/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 u5 w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dinobot/u5; tar -jxf ' + 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/update/lunix4k"): - os.system( - 'echo "Please wait. System installation Qviart Lunix 4K w toku..."' - ) - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/update/lunix4k; tar -jxf " - + getNeoLocation() - + "ImagesUpload/update/lunix4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot/u51'): + os.system('echo "Please wait. System installation dinobot u51 w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dinobot/u51; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dinobot/u51/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 u5 w toku..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/dinobot/u5; tar -jxf " - + getNeoLocation() - + "ImagesUpload/dinobot/u5/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot/u52'): + os.system('echo "Please wait. System installation dinobot u52 w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dinobot/u52; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dinobot/u52/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot/u53'): + os.system('echo "Please wait. System installation dinobot u53 w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dinobot/u53; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dinobot/u53/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dinobot/u51"): - os.system( - 'echo "Please wait. System installation dinobot u51 w toku..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/dinobot/u51; tar -jxf " - + getNeoLocation() - + "ImagesUpload/dinobot/u51/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot/u55/rootfs.tar.bz2'): + os.system('echo "Please wait. System installation dinobot u55 w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dinobot/uu55; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dinobot/u55/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dinobot/u52"): - os.system( - 'echo "Please wait. System installation dinobot u52 w toku..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/dinobot/u52; tar -jxf " - + getNeoLocation() - + "ImagesUpload/dinobot/u52/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) - rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dinobot/u53"): - os.system( - 'echo "Please wait. System installation dinobot u53 w toku..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/dinobot/u53; tar -jxf " - + getNeoLocation() - + "ImagesUpload/dinobot/u53/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) - rc = os.system(cmd) - elif os.path.exists( - "" + getNeoLocation() + "ImagesUpload/dinobot/u55/rootfs.tar.bz2" - ): - os.system( - 'echo "Please wait. System installation dinobot u55 w toku..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/dinobot/uu55; tar -jxf " - + getNeoLocation() - + "ImagesUpload/dinobot/u55/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) - rc = os.system(cmd) - - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dinobot/u55"): - if os.path.exists("" + getNeoLocation() + "ImagesUpload/dinobot"): - os.chdir("dinobot") - if os.path.exists( - "" + getNeoLocation() + "ImagesUpload/dinobot/u55"): - os.chdir("u55") + + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot/u55'): + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot'): + os.chdir('dinobot') + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot/u55'): + os.chdir('u55') os.system('echo "Instalacja - ubi_reader w toku..."') os.system('echo "[NeoBoot] Extracting image HITUBE4k"') - cmd = ( - "chmod 777 " - + extensions_path - + "NeoBoot/ubi_reader/ubi_extract_files.py" - ) + 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") + 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 -af -p " - + getNeoLocation() - + "ubi/rootfs/* " - + getNeoLocation() - + "ImageBoot/" - + target - ) + os.chdir('/home/root') + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "chmod -R +x " + getNeoLocation() + "ImageBoot/" + target + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "rm -rf " + getNeoLocation() + "ubi" + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' rc = os.system(cmd) - - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dinobot/u5pvr"): - os.system( - 'echo "Please wait. System installation dinobot u5pvr w toku..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/dinobot/u5pvr; tar -jxf " - + getNeoLocation() - + "ImagesUpload/dinobot/u5pvr/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot/u5pvr'): + os.system('echo "Please wait. System installation dinobot u5pvr w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dinobot/u5pvr; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dinobot/u5pvr/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/dinobot/u57"): - os.system( - 'echo "Please wait. System installation dinobot u57 w toku..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/dinobot/u57; tar -jxf " - + getNeoLocation() - + "ImagesUpload/dinobot/u57/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dinobot/u57'): + os.system('echo "Please wait. System installation dinobot u57 w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dinobot/u57; tar -jxf ' + getNeoLocation() + 'ImagesUpload/dinobot/u57/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 -jxf " - + getNeoLocation() - + "ImagesUpload/uclan/ustym4kpro/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + 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 -jxf ' + 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/ustym4kpro"): - os.system( - 'echo "Please wait. System installation ustym4kpro w toku..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/ustym4kpro; tar -jxf " - + getNeoLocation() - + "ImagesUpload/ustym4kpro/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/ustym4kpro'): + os.system('echo "Please wait. System installation ustym4kpro w toku..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/ustym4kpro; tar -jxf ' + getNeoLocation() + 'ImagesUpload/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 -jxf ' + getNeoLocation() + 'ImagesUpload/et1x000/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 -jxf " - + 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/rootfs.tar.bz2" - ): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e2/update/rootfs.tar.bz2'): os.system('echo "Please wait. System installation..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/e2/update; tar -jxf " - + getNeoLocation() - + "ImagesUpload/e2/update/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/e2/update; tar -jxf ' + 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/beyonwiz/v2"): - os.system( - 'echo "Please wait. System installation beyonwiz v2 4K w toku..."' - ) - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/beyonwiz/v2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/beyonwiz/v2/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + 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 -jxf ' + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/amiko/viper4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + 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 -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/update/tmtwin4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/update/tmtwin4k/rootfs.tar.bz2; tar -jxf ' + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/gigablue/trio4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + 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 -jxf ' + 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"): + 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 -jxf " - + getNeoLocation() - + "ImagesUpload/gigablue/ip4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/ip4k; tar -jxf ' + 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/gigablue/x34k"): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/gigablue/x34k'): os.system('echo "Please wait. System installation Gigablue X3 4k..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/gigablue/x34k; tar -jxf " - + getNeoLocation() - + "ImagesUpload/gigablue/x34k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) - rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/protek4k"): + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/gigablue/x34k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/gigablue/x34k/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 -jxf " - + getNeoLocation() - + "ImagesUpload/protek4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/protek4k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/protek4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/pulse4k"): - os.system( - 'echo "Please wait. System installation AB-COM PULSe 4K..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/pulse4k; tar -jxf " - + getNeoLocation() - + "ImagesUpload/pulse4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/pulse4k'): + os.system('echo "Please wait. System installation AB-COM PULSe 4K..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/pulse4k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/pulse4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/pulse4kmini"): - os.system( - 'echo "Please wait. System installation AB-COM PULSe 4K..."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/pulse4kmini; tar -jxf " - + getNeoLocation() - + "ImagesUpload/pulse4kmini/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/pulse4kmini'): + os.system('echo "Please wait. System installation AB-COM PULSe 4K..."') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/pulse4kmini; tar -jxf ' + getNeoLocation() + 'ImagesUpload/pulse4kmini/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/bre2ze4k"): + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/bre2ze4k'): os.system('echo "Please wait. System installation WWIO BRE2ZE 4K."') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/bre2ze4k; tar -jxf " - + getNeoLocation() - + "ImagesUpload/bre2ze4k/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/bre2ze4k; tar -jxf ' + getNeoLocation() + 'ImagesUpload/bre2ze4k/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists("" + getNeoLocation() + "ImagesUpload/vs1500"): - os.system( - 'echo "Please wait. System installation VIMASTEC VS1500 4K"') - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/vs1500; tar -jxf " - + getNeoLocation() - + "ImagesUpload/vs1500/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + #Vimastec + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/vs1500'): + os.system('echo "Please wait. System installation VIMASTEC VS1500 4K"') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/vs1500; tar -jxf ' + getNeoLocation() + 'ImagesUpload/vs1500/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - + else: - os.system( - 'echo "NeoBoot wykrył błąd!!! Prawdopodobnie brak pliku instalacyjnego."' - ) - - elif not os.path.exists("/tmp/xz-gz-tar"): - fn = "NewImage" + os.system('echo "NeoBoot wykrył błąd!!! Prawdopodobnie brak pliku instalacyjnego."') + + #Instalacja other image: + elif not os.path.exists('/tmp/xz-gz-tar'): + fn = 'NewImage' sourcelist = [] - if os.path.exists("%sImagesUpload" % getNeoLocation()): - for fn in os.listdir("%sImagesUpload" % getNeoLocation()): - os.system("touch /tmp/root_jffs2") - if fn.find(".rootfs.tar.xz") != -1: - if not os.path.exists("/tmp/xz-gz-tar"): - os.system("touch /tmp/xz-gz-tar") - os.system( - 'echo "Installing the file rootfs.tar.xz in progress..."' - ) - cmd = ( - "mv " - + getNeoLocation() - + "ImagesUpload/" - + source - + ".rootfs.tar.xz " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.xz > /dev/null 2>&1" - ) - rc = os.system(cmd) - cmd1 = ( - "mv " - + getNeoLocation() - + "ImagesUpload/*rootfs.tar.xz " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.xz > /dev/null 2>&1" - ) + for fn in os.listdir('%sImagesUpload' % getNeoLocation()): + os.system('touch /tmp/root_jffs2') + if fn.find('.rootfs.tar.xz') != -1: + if not os.path.exists('/tmp/xz-gz-tar'): + os.system('touch /tmp/xz-gz-tar') + os.system('echo "Installing the file rootfs.tar.xz in progress..."') + cmd = 'mv ' + getNeoLocation() + 'ImagesUpload/' + source + '.rootfs.tar.xz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz > /dev/null 2>&1' + rc = os.system(cmd) + cmd1 = 'mv ' + getNeoLocation() + 'ImagesUpload/*rootfs.tar.xz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz > /dev/null 2>&1' rc = os.system(cmd1) - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.xz; tar -xf " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.xz -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz; tar -xf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - rc = os.system( - "rm -r " + - getNeoLocation() + - "/ImagesUpload/rootfs.tar.xz") - - elif fn.find(".tar.xz") != -1: - if not os.path.exists("/tmp/xz-gz-tar"): - os.system("touch /tmp/xz-gz-tar") - os.system( - 'echo "Installing the file .tar.xz in progress..."') - os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/" - + source - + ".tar.xz " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.xz" - ) - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.xz; tar -xf " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.xz -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + rc = os.system('rm -r ' + getNeoLocation() + '/ImagesUpload/rootfs.tar.xz') + + elif fn.find('.tar.xz') != -1: + if not os.path.exists('/tmp/xz-gz-tar'): + os.system('touch /tmp/xz-gz-tar') + os.system('echo "Installing the file .tar.xz in progress..."') + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.xz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz; tar -xf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - rc = os.system( - "rm -r " + - getNeoLocation() + - "/ImagesUpload/rootfs.tar.xz") - - elif fn.find(".tar.gz") != -1: - if not os.path.exists("/tmp/xz-gz-tar"): - os.system("touch /tmp/xz-gz-tar") - os.system( - 'echo "Installing the file tar.gz in progress..."') - os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/" - + source - + ".tar.gz " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.gz" - ) - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.gz; /bin/tar -xzvf " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.gz -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + rc = os.system('rm -r ' + getNeoLocation() + '/ImagesUpload/rootfs.tar.xz') + + elif fn.find('.tar.gz') != -1: + if not os.path.exists('/tmp/xz-gz-tar'): + os.system('touch /tmp/xz-gz-tar') + os.system('echo "Installing the file tar.gz in progress..."') + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.gz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz; /bin/tar -xzvf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - rc = os.system( - "rm -r " + - getNeoLocation() + - "/ImagesUpload/rootfs.tar.gz") - - elif fn.find(".tar") != -1: - if not os.path.exists("/tmp/xz-gz-tar"): - os.system("touch /tmp/xz-gz-tar") - os.system( - 'echo "Installing the file tar in progress..."') - os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/" - + source - + " " - + getNeoLocation() - + "ImagesUpload/rootfs.tar" - ) - cmd = ( - "/bin/tar -xvf " - + getNeoLocation() - + "ImagesUpload/rootfs.tar -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + rc = os.system('rm -r ' + getNeoLocation() + '/ImagesUpload/rootfs.tar.gz') + + elif fn.find('.tar') != -1: + if not os.path.exists('/tmp/xz-gz-tar'): + os.system('touch /tmp/xz-gz-tar') + os.system('echo "Installing the file tar in progress..."') + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + source + ' ' + getNeoLocation() + 'ImagesUpload/rootfs.tar') + cmd = '/bin/tar -xvf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - rc = os.system( - "rm -r " + - getNeoLocation() + - "/ImagesUpload/rootfs.tar") - - elif fn.find(".tar.bz2") != -1: - if not os.path.exists("/tmp/xz-gz-tar"): - os.system("touch /tmp/xz-gz-tar") - os.system( - 'echo "Installing the file .tar.bz2 in progress..."') - os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/" - + source - + ".tar.bz2 " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.bz2" - ) - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.bz2; tar -jxf " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.bz2 -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + rc = os.system('rm -r ' + getNeoLocation() + '/ImagesUpload/rootfs.tar') + + elif fn.find('.tar.bz2') != -1: + if not os.path.exists('/tmp/xz-gz-tar'): + os.system('touch /tmp/xz-gz-tar') + os.system('echo "Installing the file .tar.bz2 in progress..."') + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.bz2 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2; tar -jxf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - rc = os.system( - "rm -r " + - getNeoLocation() + - "/ImagesUpload/rootfs.tar.bz2") + rc = os.system('rm -r ' + getNeoLocation() + '/ImagesUpload/rootfs.tar.bz2') - elif fn.find(".mb") != -1: - os.system( - 'echo "Please wait. System installation spakowanego w plik .mb w toku..."' - ) - os.system( - "cp -af " - + getNeoLocation() - + "ImagesUpload/" - + source - + ".mb " - + getNeoLocation() - + "ImagesUpload/rootfs.tar.gz" - ) - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/*.tar.gz; tar -xzvf " - + getNeoLocation() - + "ImagesUpload/*.tar.gz -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + elif fn.find('.mb') != -1: + os.system('echo "Please wait. System installation spakowanego w plik .mb w toku..."') + os.system('cp -af ' + getNeoLocation() + 'ImagesUpload/' + source + '.mb ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/*.tar.gz; tar -xzvf ' + getNeoLocation() + 'ImagesUpload/*.tar.gz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - - elif ( - os.path.exists("" + getNeoLocation() + "ImagesUpload/rootfs.bin") - or fn.find(".bin") != -1 - ): - os.chdir("ImagesUpload") - os.system("mv -f rootfs.bin rootfs.bin") + + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.bin') or fn.find('.bin') != -1: + os.chdir('ImagesUpload') + os.system('mv -f rootfs.bin 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" - ) + 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") + 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 -af " - + getNeoLocation() - + "ubi/rootfs/* " - + getNeoLocation() - + "ImageBoot/" - + target - ) + os.chdir('/home/root') + cmd = 'cp -af ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "chmod -R +x " + getNeoLocation() + "ImageBoot/" + target + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) - cmd = "rm -rf " + getNeoLocation() + "ubi" + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' rc = os.system(cmd) - - elif fn.find(".gz") != -1: - if not os.path.exists("/tmp/xz-gz-tar"): - os.system("touch /tmp/xz-gz-tar") - os.system( - 'echo "Installing the file .gz in progress..."') - os.system( - "mv " - + getNeoLocation() - + "ImagesUpload/" - + source - + ".gz " - + getNeoLocation() - + "ImagesUpload/rootfs.gz" - ) - cmd = ( - "chmod 777 " - + getNeoLocation() - + "ImagesUpload/rootfs.gz; /bin/tar -xvf " - + getNeoLocation() - + "ImagesUpload/rootfs.gz -C " - + getNeoLocation() - + "ImageBoot/" - + target - + " > /dev/null 2>&1" - ) + + elif fn.find('.gz') != -1: + if not os.path.exists('/tmp/xz-gz-tar'): + os.system('touch /tmp/xz-gz-tar') + os.system('echo "Installing the file .gz in progress..."') + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + source + '.gz ' + getNeoLocation() + 'ImagesUpload/rootfs.gz') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.gz; /bin/tar -xvf ' + getNeoLocation() + 'ImagesUpload/rootfs.gz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - rc = os.system( - "rm -r " + - getNeoLocation() + - "/ImagesUpload/rootfs.gz") - cmd = ( - "rm -rf " - + getNeoLocation() - + "ImagesUpload/" - + sourcefile4 - + " " - " > /dev/null 2>&1" - ) + rc = os.system('rm -r ' + getNeoLocation() + '/ImagesUpload/rootfs.gz') + cmd = 'rm -rf ' + getNeoLocation() + 'ImagesUpload/' + sourcefile4 + ' ' ' > /dev/null 2>&1' rc = os.system(cmd) - cmd = ( - "rm -f " + getNeoLocation() + "ImagesUpload/*.jpg " - " > /dev/null 2>&1" - ) + cmd = 'rm -f ' + getNeoLocation() + 'ImagesUpload/*.jpg ' ' > /dev/null 2>&1' rc = os.system(cmd) else: - os.system(f'echo "Image {source} not installed"') + os.system('echo "Image %s not installed "' % source) + return + +# ver. gutosie +#--------------------------------------------- 2023 ---------------------------------------------# +#END diff --git a/NeoBoot/plugin.py b/NeoBoot/plugin.py index e8e9b04..11971e1 100644 --- a/NeoBoot/plugin.py +++ b/NeoBoot/plugin.py @@ -1,40 +1,24 @@ +# -*- coding: utf-8 -*- +#-------------------------------------- _q(-_-)p_ gutosie _q(-_-)p_ --------------------------------------# +#--------------------------------------------- -#[NEOBOOT]#- ---------------------------------------------# +# Copyright (c) , gutosie license +#EN: + +# Redistribution of the program version and making modifications IS PROHIBITED. +# The author assumes NO responsibility for the consequences of using this program or for the use that may be made of the information contained therein. +# Creating an ipk package and placing it in the official repository of ANY software is forbidden without my permission. +# Please respect the work. Never remove anyone from the authors list. +#PL: +# Redystrybucja wersji programu i dokonywania modyfikacji JEST ZABRONIONE. +# Autor NIE ponosi JAKIEJKOLWIEK odpowiedzialnoĹ›ci za skutki uĹĽtkowania tego programu oraz za wykorzystanie zawartych tu informacji. +# Tworzenie paczki ipk i umieszczanie jej w oficjalnym repozytorium DOWOLNEGO softu jest zabronione bez mojej zgody. +# Prosze uszanuj prace. Nigdy nie usuwaj nikogo z listy autorow. +#--------------------------------------------- -#[NEOBOOT]#- ---------------------------------------------# +#neoboot modules from __future__ import absolute_import from __future__ import print_function -from Plugins.Plugin import PluginDescriptor from . import _ -from Plugins.Extensions.NeoBoot.files.stbbranding import ( - LogCrashGS, - getSupportedTuners, - getLabelDisck, - getINSTALLNeo, - getNeoLocation, - getLocationMultiboot, - getNeoMount, - getNeoMount2, - getNeoMount3, - getNeoMount4, - getNeoMount5, - getFSTAB, - getFSTAB2, - getKernelVersionString, - getKernelImageVersion, - getChipSetString, - getCPUtype, - getCPUSoC, - getImageNeoBoot, - getBoxVuModel, - getBoxHostName, - getTunerModel, - getImageDistroN, - getFormat, - getNEO_filesystems, - getBoxModelVU, - getMountPointAll, - getMountPointNeo, - getCheckActivateVip, - getBoxMacAddres, - getCheckExt, -) +from Plugins.Extensions.NeoBoot.files.stbbranding import LogCrashGS, getSupportedTuners, getLabelDisck, getINSTALLNeo, getNeoLocation, getLocationMultiboot, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getFSTAB, getFSTAB2, getKernelVersionString, getKernelImageVersion, getChipSetString, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel, getImageDistroN, getFormat, getNEO_filesystems, getBoxModelVU, getMountPointAll, getMountPointNeo, getCheckActivateVip, getBoxMacAddres, getCheckExt from Plugins.Extensions.NeoBoot.files import Harddisk from Components.About import about from enigma import getDesktop, eTimer @@ -57,74 +41,44 @@ 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 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 from time import gmtime, strftime -from Tools.Testinout import ( - getTestIn, - getTestOut, - getTestInTime, - getTestOutTime, - getAccessN, - getAccesDate, - getButtonPin, - getTestToTest, -) - -if ( - not fileExists("/etc/vtiversion.info") - and not fileExists("/etc/bhversion") - and fileExists("/usr/lib/python2.7") -): +from Tools.Testinout import getTestIn, getTestOut, getTestInTime, getTestOutTime, getAccessN, getAccesDate, getButtonPin, getTestToTest +if not fileExists('/etc/vtiversion.info') and not fileExists('/etc/bhversion') and fileExists('/usr/lib/python2.7'): from Plugins.Extensions.NeoBoot.files.neoconsole import Console else: from Screens.Console import Console loggscrash = time.localtime(time.time()) -PLUGINVERSION = '9.86' -UPDATEVERSION = '9.86' +PLUGINVERSION = '9.80' +UPDATEVERSION = '9.80' UPDATEDATE = '"+%Y13%d"' -LinkNeoBoot = "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot" +LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' try: from enigma import addFont - - font_osans = LinkNeoBoot + "/neoskins/osans.ttf" - font_sagoe = LinkNeoBoot + "/neoskins/sagoe.ttf" - addFont(font_osans, "genel", 100, True) - addFont(font_sagoe, "baslk", 100, True) - addFont(font_sagoe, "tasat", 100, True) - addFont(font_sagoe, "dugme", 90, True) -except BaseException: + font_osans = LinkNeoBoot + '/neoskins/osans.ttf' + font_sagoe = LinkNeoBoot + '/neoskins/sagoe.ttf' + addFont(font_osans, 'genel', 100, True) + addFont(font_sagoe, 'baslk', 100, True) + addFont(font_sagoe, 'tasat', 100, True) + addFont(font_sagoe, 'dugme', 90, True) +except: print("ERROR INSERTING FONT") def neoTranslator(): - neolang = "" - usedlang = open("/etc/enigma2/settings", "r") - lang = "config.osd.language=pl_PL" + neolang = '' + usedlang = open('/etc/enigma2/settings', 'r') + lang = 'config.osd.language=pl_PL' local = usedlang.read().find(lang) if local != -1: - neolang = "islangPL" + neolang = 'islangPL' else: - neolang = "isnotlangPL" + neolang = 'isnotlangPL' return neolang @@ -151,15 +105,12 @@ def isUHD(): class MyUpgrade(Screen): if isFHD(): from Plugins.Extensions.NeoBoot.neoskins.default import MyUpgradeFULLHD - skin = MyUpgradeFULLHD elif isUHD(): from Plugins.Extensions.NeoBoot.neoskins.default import MyUpgradeUltraHD - skin = MyUpgradeUltraHD else: from Plugins.Extensions.NeoBoot.neoskins.default import MyUpgradeHD - skin = MyUpgradeHD __module__ = __name__ @@ -167,44 +118,35 @@ class MyUpgrade(Screen): def __init__(self, session): Screen.__init__(self, session) self.list = [] - self["list"] = List(self.list) + self['list'] = List(self.list) self.wybierz() - self["actions"] = ActionMap( - ["WizardActions", "ColorActions"], - {"ok": self.KeyOk, "back": self.changever}, - ) + self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk, + 'back': self.changever}) def changever(self): ImageChoose = self.session.open(NeoBootImageChoose) - if fileExists("" + LinkNeoBoot + "/.location"): - out = open("%sImageBoot/.version" % getNeoLocation(), "w") + if fileExists('' + LinkNeoBoot + '/.location'): + out = open('%sImageBoot/.version' % getNeoLocation(), 'w') out.write(PLUGINVERSION) out.close() self.close() else: - self.close( - self.session.open( - MessageBox, - _("No file location NeoBot, do re-install the plugin."), - MessageBox.TYPE_INFO, - 10, - ) - ) + self.close(self.session.open(MessageBox, _('No file location NeoBot, do re-install the plugin.'), MessageBox.TYPE_INFO, 10)) self.close() return ImageChoose def wybierz(self): self.list = [] - mypath = "" + LinkNeoBoot + "" - if not fileExists(mypath + "icons"): - mypixmap = "" + LinkNeoBoot + "/images/ok.png" + mypath = '' + LinkNeoBoot + '' + if not fileExists(mypath + 'icons'): + mypixmap = '' + LinkNeoBoot + '/images/ok.png' png = LoadPixmap(mypixmap) - res = (_("Update neoboot in all images ?"), png, 0) + res = (_('Update neoboot in all images ?'), png, 0) self.list.append(res) - self["list"].list = self.list + self['list'].list = self.list def KeyOk(self): - self.sel = self["list"].getCurrent() + self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0 and self.goKeyOk(): @@ -212,311 +154,188 @@ class MyUpgrade(Screen): self.close() def goKeyOk(self): - try: - from Plugins.Extensions.NeoBoot.files.tools import UpdateNeoBoot - - self.session.open(UpdateNeoBoot) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + try: + from Plugins.Extensions.NeoBoot.files.tools import UpdateNeoBoot + self.session.open(UpdateNeoBoot) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() def CRASHlogNeo(self): - showlog = ( - 'echo "\nCRARSH LOG-neoboot startup error!" >> ' - + getNeoLocation() - + "ImageBoot/neoboot.log; cat " - + getNeoLocation() - + "ImageBoot/neoboot.log" - ) - self.session.openWithCallback( - self.close, Console, _("NeoBoot ERROR !!!"), [showlog] - ) - + showlog = 'echo "\nCRARSH LOG-neoboot startup error!" >> ' + getNeoLocation() + 'ImageBoot/neoboot.log; cat ' + getNeoLocation() + 'ImageBoot/neoboot.log' + self.session.openWithCallback(self.close, Console, _('NeoBoot ERROR !!!'), [showlog]) class NeoBootInstallation(Screen): if isFHD(): - from Plugins.Extensions.NeoBoot.neoskins.default import ( - NeoBootInstallationFULLHD, - ) - + from Plugins.Extensions.NeoBoot.neoskins.default import NeoBootInstallationFULLHD skin = NeoBootInstallationFULLHD elif isUHD(): - from Plugins.Extensions.NeoBoot.neoskins.default import ( - NeoBootInstallationUltraHD, - ) - + from Plugins.Extensions.NeoBoot.neoskins.default import NeoBootInstallationUltraHD skin = NeoBootInstallationUltraHD else: from Plugins.Extensions.NeoBoot.neoskins.default import NeoBootInstallationHD - skin = NeoBootInstallationHD def __init__(self, session): Screen.__init__(self, session) self.list = [] - self["config"] = MenuList(self.list) - self["key_red"] = Label(_("Instruction")) - self["key_green"] = Label(_("Installation")) - self["key_yellow"] = Label(_("Set UUID Label")) - self["key_blue"] = Label(_("Device Manager")) - self["label1"] = Label( - _("Welcome to NeoBoot %s Plugin installation.") % PLUGINVERSION - ) - self["label2"] = Label( - _("Here is the list of mounted devices in Your STB\nPlease choose a device where You would like to install NeoBoot")) - self["label3"] = Label( - _("It is recommended to give a label to the disk.")) - self["label4"] = Label(_("Press MENU - Backup")) - self["label5"] = Label(_("Press 1 - Mounting")) - self["label6"] = Label(_("Press 2 - Delete NeoBoot")) - self["actions"] = ActionMap( - [ - "WizardActions", - "ColorActions", - "MenuActions", - "NumberActionMap", - "SetupActions", - "number" "DirectionActions", - ], - { - "red": self.Instrukcja, - "green": self.checkinstall, - "ok": self.checkinstall, - "0": self.checkinstall, - "menu": self.helpneo, - "1": self.datadrive, - "2": self.deleteneo, - "yellow": self.SetDiskLabel, - "blue": self.devices, - "back": self.close, - }, - ) + self['config'] = MenuList(self.list) + self['key_red'] = Label(_('Instruction')) + self['key_green'] = Label(_('Installation')) + self['key_yellow'] = Label(_('Set UUID Label')) + self['key_blue'] = Label(_('Device Manager')) + self['label1'] = Label(_('Welcome to NeoBoot %s Plugin installation.') % PLUGINVERSION) + self['label2'] = Label(_('Here is the list of mounted devices in Your STB\nPlease choose a device where You would like to install NeoBoot')) + self['label3'] = Label(_('It is recommended to give a label to the disk.')) + self['label4'] = Label(_('Press MENU - Backup')) + self['label5'] = Label(_('Press 1 - Mounting')) + self['label6'] = Label(_('Press 2 - Delete NeoBoot')) + self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'MenuActions', 'NumberActionMap', 'SetupActions', 'number' 'DirectionActions'], {'red': self.Instrukcja, + 'green': self.checkinstall, + 'ok': self.checkinstall, + '0': self.checkinstall, + 'menu': self.helpneo, + '1': self.datadrive, + '2': self.deleteneo, + 'yellow': self.SetDiskLabel, + 'blue': self.devices, + 'back': self.close}) self.updateList() - if fileExists("/etc/fstab"): + if fileExists('/etc/fstab'): neoformat = getFormat() - writefile = open("/tmp/.neo_format", "w") + writefile = open('/tmp/.neo_format', 'w') writefile.write(neoformat) writefile.close() def SetDiskLabel(self): - if ( - getCheckExt() != "vfat" - and getCheckExt() == "ext3" - or getCheckExt() == "ext4" - ): + #if fileExists('/usr/lib/python3.8') or fileExists('/usr/lib/python3.9') or fileExists('/tmp/.upneo') : + #self.session.open(MessageBox, _('Skip this step and install neoboot.\nThis option is available in the neoboot menu.'), type=MessageBox.TYPE_INFO) + if getCheckExt() != 'vfat' and getCheckExt() == 'ext3' or getCheckExt() == 'ext4': try: - if fileExists("/usr/lib/python2.7"): + if fileExists('/usr/lib/python2.7'): from Plugins.Extensions.NeoBoot.files.devices import SetDiskLabel - self.session.open(SetDiskLabel) else: from Plugins.Extensions.NeoBoot.files.tools import DiskLabelSet - self.session.open(DiskLabelSet) except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() else: - self.session.open( - MessageBox, - _("Disk the directory HDD or USB is not a ext2, ext3 or ext4.\nMake sure you select a valid partition type to install neoboot."), - type=MessageBox.TYPE_ERROR, - ) + self.session.open(MessageBox, _('Disk the directory HDD or USB is not a ext2, ext3 or ext4.\nMake sure you select a valid partition type to install neoboot.'), type=MessageBox.TYPE_ERROR) def Instrukcja(self): - try: - from Plugins.Extensions.NeoBoot.files.tools import MyHelpNeo - - self.session.open(MyHelpNeo) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + try: + from Plugins.Extensions.NeoBoot.files.tools import MyHelpNeo + self.session.open(MyHelpNeo) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() def datadrive(self): try: message = "echo -e '\n" - message += _("NeoBot checks the connected media.\nWAIT ...\n\nDISCS:") + message += _('NeoBot checks the connected media.\nWAIT ...\n\nDISCS:') message += "'" os.system(" 'mount | sed '/sd/!d' | cut -d" " -f1,2,3,4,5' ") - cmd = "/sbin/blkid " + cmd = '/sbin/blkid ' system(cmd) - print("[MULTI-BOOT]: %s" % cmd) - self.session.open( - Console, _(" NeoBot - Available media:"), [message, cmd] - ) + print("[MULTI-BOOT]: "), cmd + self.session.open(Console, _(' NeoBot - Available media:'), [message, cmd]) except Exception as e: loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) pass - + def helpneo(self): - if fileExists( - "/media/hdd/CopyNEOBoot") or fileExists("/media/usb/CopyNEOBoot"): + if fileExists('/media/hdd/CopyNEOBoot') or fileExists('/media/usb/CopyNEOBoot') : try: from Plugins.Extensions.NeoBoot.files.tools import ReinstllNeoBoot - self.session.open(ReinstllNeoBoot) except Exception as e: loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) pass else: - self.session.open( - MessageBox, - _("Neoboot backup not found."), - type=MessageBox.TYPE_INFO) - + self.session.open(MessageBox, _('Neoboot backup not found.'), type=MessageBox.TYPE_INFO) + def deleteneo(self): - message = _( - "Are you sure you want to completely remove NeoBoota of your image?\n\nIf you choose so all directories NeoBoota will be removed.\nA restore the original image settings Flash." - ) - ybox = self.session.openWithCallback( - self.mbdelete, MessageBox, message, MessageBox.TYPE_YESNO - ) - ybox.setTitle(_("Removed successfully.")) + message = _('Are you sure you want to completely remove NeoBoota of your image?\n\nIf you choose so all directories NeoBoota will be removed.\nA restore the original image settings Flash.') + ybox = self.session.openWithCallback(self.mbdelete, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Removed successfully.')) def mbdelete(self, answer): if answer is True: - if fileExists("/etc/fstab.org"): - system("rm -r /etc/fstab; mv /etc/fstab.org /etc/fstab") - if fileExists("/etc/rcS.d/S99neo.local"): - system("rm -r /etc/rcS.d/S99neo.local") - if fileExists("/etc/name"): - system("rm -r /etc/name") - if fileExists("/etc/init.d/volatile-media.sh.org"): - system( - " mv /etc/init.d/volatile-media.sh.org /etc/init.d/volatile-media.sh; rm -r /etc/init.d/volatile-media.sh.org; chmod 755 /etc/init.d/volatile-media.sh " - ) - if os.path.isfile("%sImageBoot/.neonextboot" % getNeoLocation()): - os.system( - "rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.Flash; " % - (getNeoLocation(), getNeoLocation(), getNeoLocation())) - if os.path.isfile("%sImagesUpload/.kernel " % getNeoLocation()): - os.system("rm -r %sImagesUpload/.kernel" % getNeoLocation()) - cmd = "echo -e '\n\n%s '" % _("Recovering setting....\n") - cmd1 = "rm -R " + LinkNeoBoot + "" - cmd2 = "rm -R /sbin/neoinit*" - cmd3 = "ln -sfn /sbin/init.sysvinit /sbin/init" - cmd4 = "rm -rf /usr/lib/enigma2/python/Tools/Testinout.p*" - cmd5 = "rm -rf /usr/lib/periodon" + if fileExists('/etc/fstab.org'): + system('rm -r /etc/fstab; mv /etc/fstab.org /etc/fstab') + if fileExists('/etc/rcS.d/S99neo.local'): + system('rm -r /etc/rcS.d/S99neo.local') + if fileExists('/etc/name'): + system('rm -r /etc/name') + if fileExists('/etc/init.d/volatile-media.sh.org'): + system(' mv /etc/init.d/volatile-media.sh.org /etc/init.d/volatile-media.sh; rm -r /etc/init.d/volatile-media.sh.org; chmod 755 /etc/init.d/volatile-media.sh ') + if os.path.isfile('%sImageBoot/.neonextboot' % getNeoLocation()): + os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.Flash; ' % (getNeoLocation(), getNeoLocation(), getNeoLocation())) + if os.path.isfile('%sImagesUpload/.kernel ' % getNeoLocation()): + os.system('rm -r %sImagesUpload/.kernel' % getNeoLocation()) + cmd = "echo -e '\n\n%s '" % _('Recovering setting....\n') + cmd1 = 'rm -R ' + LinkNeoBoot + '' + cmd2 = 'rm -R /sbin/neoinit*' + cmd3 = 'ln -sfn /sbin/init.sysvinit /sbin/init' + cmd4 = 'rm -rf /usr/lib/enigma2/python/Tools/Testinout.p*' + cmd5 = 'rm -rf /usr/lib/periodon' cmd6 = 'opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade volatile-media; sleep 10; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Rebooting... "; reboot -d -f' - self.session.open( - Console, - _( - "NeoBot was removed !!! \nThe changes will be visible only after complete restart of the receiver." - ), - [cmd, cmd1, cmd2, cmd3, cmd4, cmd5, cmd6], - ) + self.session.open(Console, _('NeoBot was removed !!! \nThe changes will be visible only after complete restart of the receiver.'), [cmd, + cmd1, + cmd2, + cmd3, + cmd4, + cmd5, + cmd6]) self.close() else: - self.close() + self.close() def updateList(self): - mycf, mymmc, myusb, myusb2, myusb3, mysd, mycard, myhdd, myssd = ( - "", - "", - "", - "", - "", - "", - "", - "", - "", - ) + mycf, mymmc, myusb, myusb2, myusb3, mysd, mycard, myhdd, myssd = ('', '', '', '', '', '', '', '', '') myoptions = [] - if fileExists("/proc/mounts"): - fileExists("/proc/mounts") - f = open("/proc/mounts", "r") + if fileExists('/proc/mounts'): + fileExists('/proc/mounts') + f = open('/proc/mounts', 'r') for line in f.readlines(): - if line.find("/media/cf") != -1: - mycf = "/media/cf/" + if line.find('/media/cf') != -1: + mycf = '/media/cf/' continue - if line.find("/media/mmc") != -1: - mymmc = "/media/mmc/" + if line.find('/media/mmc') != -1: + mymmc = '/media/mmc/' continue - if line.find("/media/usb") != -1: - myusb = "/media/usb/" + if line.find('/media/usb') != -1: + myusb = '/media/usb/' continue - if line.find("/media/usb2") != -1: - myusb2 = "/media/usb2/" + if line.find('/media/usb2') != -1: + myusb2 = '/media/usb2/' continue - if line.find("/media/usb3") != -1: - myusb3 = "/media/usb3/" + if line.find('/media/usb3') != -1: + myusb3 = '/media/usb3/' continue - if line.find("/media/card") != -1: - mysd = "/media/card/" + if line.find('/media/card') != -1: + mysd = '/media/card/' continue - if line.find("/hdd") != -1: - myhdd = "/media/hdd/" + if line.find('/hdd') != -1: + myhdd = '/media/hdd/' continue - if line.find("/ssd") != -1: - myhdd = "/media/ssd/" + if line.find('/ssd') != -1: + myhdd = '/media/ssd/' continue f.close() else: - self["label2"].setText( - _("Sorry it seems that there are not Linux formatted devices mounted on your STB. To install NeoBoot you need a Linux formatted part1 device. Click on the blue button to open Devices Panel")) - fileExists("/proc/mounts") + self['label2'].setText(_('Sorry it seems that there are not Linux formatted devices mounted on your STB. To install NeoBoot you need a Linux formatted part1 device. Click on the blue button to open Devices Panel')) + fileExists('/proc/mounts') if mycf: self.list.append(mycf) else: @@ -558,861 +377,395 @@ class NeoBootInstallation(Screen): else: myssd - self["config"].setList(self.list) + self['config'].setList(self.list) def checkReadWriteDir(self, configele): - supported_filesystems = frozenset(("ext4", "ext3", "ext2", "nfs")) + supported_filesystems = frozenset(('ext4', 'ext3', 'ext2', 'nfs')) candidates = [] mounts = Harddisk.getProcMounts() - for partition in Harddisk.harddiskmanager.getMountedPartitions( - False, mounts): + for partition in Harddisk.harddiskmanager.getMountedPartitions(False, mounts): if partition.filesystem(mounts) in supported_filesystems: - candidates.append( - (partition.description, partition.mountpoint)) + candidates.append((partition.description, partition.mountpoint)) if candidates: locations = [] for validdevice in candidates: locations.append(validdevice[1]) - if ( - Harddisk.findMountPoint(os.path.realpath(configele)) + "/" in locations - or Harddisk.findMountPoint(os.path.realpath(configele)) in locations - ): - if fileExists(configele, "w"): + if Harddisk.findMountPoint(os.path.realpath(configele)) + '/' in locations or Harddisk.findMountPoint(os.path.realpath(configele)) in locations: + if fileExists(configele, 'w'): return True else: dir = configele - self.session.open( - MessageBox, - _("The directory %s is not a ext2, ext3, ext4 or nfs partition.\nMake sure you select a valid partition type to install.") % - dir, - type=MessageBox.TYPE_ERROR, - ) + self.session.open(MessageBox, _('The directory %s is not a ext2, ext3, ext4 or nfs partition.\nMake sure you select a valid partition type to install.') % dir, type=MessageBox.TYPE_ERROR) return False - elif ( - getFormat() == "ext4" - or getFormat() == "ext3" - or getFormat() == "ext2" - or getFormat() == "nfs" - ): + elif getFormat() == 'ext4' or getFormat() == 'ext3' or getFormat() == 'ext2' or getFormat() == 'nfs': return True else: dir = configele - self.session.open( - MessageBox, - _("The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.") % - dir, - type=MessageBox.TYPE_ERROR, - ) + self.session.open(MessageBox, _('The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.') % dir, type=MessageBox.TYPE_ERROR) return False else: dir = configele - self.session.open( - MessageBox, - _("The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.\nIt may be helpful to restart the stb device completely.") % - dir, - type=MessageBox.TYPE_ERROR, - ) + self.session.open(MessageBox, _('The directory %s is not a EXT2, EXT3, EXT4 or NFS partition.\nMake sure you select a valid partition type.\nIt may be helpful to restart the stb device completely.') % dir, type=MessageBox.TYPE_ERROR) return False def devices(self): check = False - if ( - not fileExists("/usr/lib/python2.7") - or fileExists("/usr/lib/python3.8") - or fileExists("/usr/lib/python3.9") - or fileExists("/usr/lib/python3.10") - or fileExists("/usr/lib/python3.11") - or fileExists("/usr/lib/python3.12") - or fileExists("/usr/lib/python3.13") - or fileExists("/tmp/.upneo") - ): - if fileExists("/.multinfo"): - self.session.open( - MessageBox, - _("This option is available only from Flash"), - MessageBox.TYPE_INFO, - timeout=10, - ) + if not fileExists('/usr/lib/python2.7') or fileExists('/usr/lib/python3.8') or fileExists('/usr/lib/python3.9') or fileExists('/tmp/.upneo'): + #self.session.open(MessageBox, _('Skip this step and install neoboot.\nThis option is available in the neoboot menu.'), type=MessageBox.TYPE_INFO) + if fileExists('/.multinfo'): + self.session.open(MessageBox, _("This option is available only from Flash"), MessageBox.TYPE_INFO, timeout=10) else: - from Plugins.Extensions.NeoBoot.files.tools import ( - InitializationFormattingDisk, - ) - - self.session.open(InitializationFormattingDisk) + from Plugins.Extensions.NeoBoot.files.tools import InitializationFormattingDisk + self.session.open(InitializationFormattingDisk) elif check == False: - message = _( - "After selecting OK start Mounting Manager, option Mount - green\n" - ) - message += _( - "Do you want to run the manager to mount the drives correctly ?\n" - ) - ybox = self.session.openWithCallback( - self.device2, MessageBox, message, MessageBox.TYPE_YESNO - ) - ybox.setTitle(_("Device Manager")) + message = _('After selecting OK start Mounting Manager, option Mount - green\n') + message += _('Do you want to run the manager to mount the drives correctly ?\n') + ybox = self.session.openWithCallback(self.device2, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Device Manager')) def device2(self, yesno): if yesno: from Plugins.Extensions.NeoBoot.files.devices import ManagerDevice - self.session.open(ManagerDevice) else: self.close() def checkinstall(self): - if fileExists("/.multinfo"): - mess = _( - "Sorry, Neoboot can be installed or upgraded only when booted from Flash" - ) - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) - elif ( - getCheckExt() != "vfat" - and getCheckExt() == "ext3" - or getCheckExt() == "ext4" - ): - self.checkinstall2() + if fileExists('/.multinfo'): + mess = _('Sorry, Neoboot can be installed or upgraded only when booted from Flash') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + elif getCheckExt() != 'vfat' and getCheckExt() == 'ext3' or getCheckExt() == 'ext4' : + self.checkinstall2() else: - self["label2"].setText( - _("Sorry it seems that there are not Linux formatted devices mounted on your STB. To install NeoBoot you need a Linux formatted part1 device. Click on the blue button to open Devices Panel.")) - self.session.open( - MessageBox, - _("Disk the directory HDD or USB is not a ext2, ext3 or ext4.\nMake sure you select a valid partition type to install neoboot."), - type=MessageBox.TYPE_ERROR, - ) + self['label2'].setText(_('Sorry it seems that there are not Linux formatted devices mounted on your STB. To install NeoBoot you need a Linux formatted part1 device. Click on the blue button to open Devices Panel.')) + self.session.open(MessageBox, _('Disk the directory HDD or USB is not a ext2, ext3 or ext4.\nMake sure you select a valid partition type to install neoboot.'), type=MessageBox.TYPE_ERROR) def checkinstall2(self): - if fileExists( - "/media/usb/ImageBoot/") and fileExists("/media/hdd/ImageBoot/"): - os.system("umount -l /media/usb; sleep 2") - if fileExists("/media/usb"): - if len(os.listdir("/media/usb")) == 0: - os.system("rm -r /media/usb") - mess = _( - "An error was encountered, you have neoboot installed on usb and hdd.\nUninstall one directories from one drive." - ) - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + if fileExists('/media/usb/ImageBoot/') and fileExists('/media/hdd/ImageBoot/'): + os.system('umount -l /media/usb; sleep 2') + if fileExists('/media/usb'): + if len(os.listdir('/media/usb') ) == 0: + #print("Directory is empty") + os.system('rm -r /media/usb') + mess = _('An error was encountered, you have neoboot installed on usb and hdd.\nUninstall one directories from one drive.') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) else: - self.checkinstall3() + self.checkinstall3() def checkinstall3(self): if checkInternet(): self.check_LabelDisck() else: - mess = _("Geen internet") + mess = _('Geen internet') self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) def check_LabelDisck(self): - system( - "blkid -c /dev/null /dev/sd* > " - + LinkNeoBoot - + "/bin/reading_blkid; chmod 755 " - + LinkNeoBoot - + "/bin/reading_blkid " - ) - if getLabelDisck() != "LABEL=": - message = _( - "NeoBot - First use yellow button and Set Disk Label!\nWithout labeling disc neoboot may not work properly" - ) - ybox = self.session.openWithCallback( - self.goSetDiskLabel, MessageBox, message, MessageBox.TYPE_YESNO - ) - ybox.setTitle(_("Install Confirmation")) - else: - self.check_fstabUUID() + system('blkid -c /dev/null /dev/sd* > ' + LinkNeoBoot + '/bin/reading_blkid; chmod 755 ' + LinkNeoBoot + '/bin/reading_blkid ') + if getLabelDisck() != 'LABEL=': + message = _('NeoBot - First use yellow button and Set Disk Label!\nWithout labeling disc neoboot may not work properly') + ybox = self.session.openWithCallback(self.goSetDiskLabel, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Install Confirmation')) + else: + self.check_fstabUUID() def check_fstabUUID(self): - if getFSTAB2() != "OKinstall": - message = _( - "Disk UUID not found\n - Universally unique identifier (UUID) is not required.\nYou can proceed with further installation or give an ID to your disk.\nTo continue the installation neoboo, press OK or No to abort." - ) - ybox = self.session.openWithCallback( - self.SetMountPointFSTAB, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_("Install Confirmation")) + if getFSTAB2() != 'OKinstall': + message = (_('Disk UUID not found\n - Universally unique identifier (UUID) is not required.\nYou can proceed with further installation or give an ID to your disk.\nTo continue the installation neoboo, press OK or No to abort.')) + ybox = self.session.openWithCallback(self.SetMountPointFSTAB, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Install Confirmation')) - else: - self.first_installation() + else: + self.first_installation() def goSetDiskLabel(self, yesno): if yesno: from Plugins.Extensions.NeoBoot.files.devices import SetDiskLabel - self.session.open(SetDiskLabel) else: - message = _( - "NeoBot - choose what you want to do, install or not !!!") - ybox = self.session.openWithCallback( - self.goInstall, MessageBox, message, MessageBox.TYPE_YESNO - ) - ybox.setTitle(_("Install Confirmation")) + message = _('NeoBot - choose what you want to do, install or not !!!') + ybox = self.session.openWithCallback(self.goInstall, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Install Confirmation')) def SetMountPointFSTAB(self, yesno): if yesno: - message = _( - "Proceed with further installation without providing a unique identifier for the disks ?" - ) - ybox = self.session.openWithCallback( - self.goInstall, MessageBox, message, MessageBox.TYPE_YESNO - ) - ybox.setTitle(_("Install Confirmation")) + message = _('Proceed with further installation without providing a unique identifier for the disks ?') + ybox = self.session.openWithCallback(self.goInstall, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Install Confirmation')) else: - self.devices() + self.devices() def goInstall(self, yesno): if yesno: self.first_installation() else: - self.myclose2(_("NeoBoot has not been installed ! :(")) + self.myclose2(_('NeoBoot has not been installed ! :(')) def first_installation(self): check = False - if fileExists("/proc/mounts"): - with open("/proc/mounts", "r") as f: + if fileExists('/proc/mounts'): + with open('/proc/mounts', 'r') as f: for line in f.readlines(): - if ( - line.find(" ext") - and line.find("/media/hdd") - or line.find("/media/usb") == -1 - and ( - line.find("ext4") != -1 - or line.find("ext3") != -1 - or line.find("ext2") != -1 - ) - ): + if line.find(' ext') and line.find('/media/hdd') or line.find('/media/usb') == -1 and (line.find('ext4') != -1 or line.find('ext3') != -1 or line.find('ext2') != -1): check = True break - if not check: - self.session.open( - MessageBox, - _("Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to install NeoBoot!"), - MessageBox.TYPE_INFO, - ) + if check == False: + self.session.open(MessageBox, _('Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to install NeoBoot!'), MessageBox.TYPE_INFO) else: - self.mysel = self["config"].getCurrent() + self.mysel = self['config'].getCurrent() if self.checkReadWriteDir(self.mysel): - message = ( - _("Do You really want to install NeoBoot in:\n ") - + self.mysel - + " ?" - ) - ybox = self.session.openWithCallback( - self.install2, MessageBox, message, MessageBox.TYPE_YESNO - ) - ybox.setTitle(_("Install Confirmation")) + message = _('Do You really want to install NeoBoot in:\n ') + self.mysel + ' ?' + ybox = self.session.openWithCallback(self.install2, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Install Confirmation')) else: self.close() def install2(self, yesno): - print("yesno: %s" % yesno) + print("yesno:"), yesno if yesno: self.first_installationNeoBoot() else: - self.myclose2(_("NeoBoot has not been installed ! :(")) + self.myclose2(_('NeoBoot has not been installed ! :(')) def first_installationNeoBoot(self): - self.mysel = self["config"].getCurrent() - os.system( - "cd " + - LinkNeoBoot + - "/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./files/userscript.sh") - cmd1 = "mkdir " + self.mysel + "ImageBoot;mkdir " + self.mysel + "ImagesUpload" - system(cmd1) - cmd2 = ( - "mkdir " - + self.mysel - + "ImageBoot;mkdir " - + self.mysel - + "ImagesUpload/.kernel" - ) - system(cmd2) + self.mysel = self['config'].getCurrent() + os.system('cd ' + LinkNeoBoot + '/; chmod 0755 ./bin/neoini*; chmod 0755 ./ex_init.py; chmod 0755 ./files/userscript.sh') + cmd1 = 'mkdir ' + self.mysel + 'ImageBoot;mkdir ' + self.mysel + 'ImagesUpload' + system(cmd1) + cmd2 = 'mkdir ' + self.mysel + 'ImageBoot;mkdir ' + self.mysel + 'ImagesUpload/.kernel' + system(cmd2) - if os.path.isfile("" + LinkNeoBoot + "/.location"): - os.system("rm -f " + LinkNeoBoot + "/.location") - out = open( - "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location", - "w") - out.write(self.mysel) - out.close() + if os.path.isfile('' + LinkNeoBoot + '/.location'): + os.system('rm -f ' + LinkNeoBoot + '/.location') + out = open('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location', 'w') + out.write(self.mysel) + out.close() - if os.path.isfile("%sImageBoot/.neonextboot" % getNeoLocation()): - os.system( - "rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.Flash; rm -f %sImageBoot/.imagedistro; rm -f %sImageBoot/.initneo.log; rm -f %sImageBoot/.updateversion" % - (getNeoLocation(), - getNeoLocation(), - getNeoLocation(), - getNeoLocation(), - getNeoLocation(), - )) + if os.path.isfile('%sImageBoot/.neonextboot' % getNeoLocation()): + os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.Flash; rm -f %sImageBoot/.imagedistro; rm -f %sImageBoot/.initneo.log; rm -f %sImageBoot/.updateversion' % (getNeoLocation(),getNeoLocation(), getNeoLocation(), getNeoLocation(), getNeoLocation())) + + if os.path.isfile('%sImagesUpload/.kernel/zImage*.ipk or %sImagesUpload/.kernel/zImage*.bin' % (getNeoLocation(), getNeoLocation())): + os.system('rm -f %sImagesUpload/.kernel/zImage*.ipk; rm -f %sImagesUpload/.kernel/zImage*.bin' % (getNeoLocation(), getNeoLocation())) - if os.path.isfile( - "%sImagesUpload/.kernel/zImage*.ipk or %sImagesUpload/.kernel/zImage*.bin" % - (getNeoLocation(), getNeoLocation())): - os.system( - "rm -f %sImagesUpload/.kernel/zImage*.ipk; rm -f %sImagesUpload/.kernel/zImage*.bin" % - (getNeoLocation(), getNeoLocation())) + if fileExists('/etc/issue.net'): + try: + lines = open('/etc/hostname', 'r').readlines() + imagename = lines[0][:-1] + image = imagename + open('%sImageBoot/.Flash' % getNeoLocation(), 'w').write(image) + except: + False - if fileExists("/etc/issue.net"): - try: - lines = open("/etc/hostname", "r").readlines() - imagename = lines[0][:-1] - image = imagename - open("%sImageBoot/.Flash" % getNeoLocation(), "w").write(image) - except BaseException: - False - - if not fileExists("/usr/lib/periodon/.accessdate"): - os.system("date %s > /usr/lib/periodon/.accessdate" % UPDATEDATE) - if not fileExists("/usr/lib/periodon/.accessdate") or not fileExists( - "/etc/name" - ): - out1 = open("%sImageBoot/.version" % getNeoLocation(), "w") - out1.write(PLUGINVERSION) - out1.close() - out2 = open("%sImageBoot/.neonextboot" % getNeoLocation(), "w") - out2.write("Flash ") - out2.close() - if not (fileExists("/usr/lib/python3.12") - or fileExists("/usr/lib/python3.13")): - out3 = open("" + LinkNeoBoot + "/.neo_info", "w") - out3.write("Kernel\n") - out3.write( - "Kernel-Version: " + - about.getKernelVersionString() + - "\n") - out3.write("NeoBoot\n") - out3.write("NeoBoot-Version: " + PLUGINVERSION + "\n") + if not fileExists('/usr/lib/periodon/.accessdate'): + os.system('date %s > /usr/lib/periodon/.accessdate' % UPDATEDATE) + if not fileExists('/usr/lib/periodon/.accessdate') or not fileExists('/etc/name'): + out1 = open('%sImageBoot/.version' % getNeoLocation(), 'w') + out1.write(PLUGINVERSION) + out1.close() + out2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w') + out2.write('Flash ') + out2.close() + out3 = open('' + LinkNeoBoot + '/.neo_info', 'w') + out3.write('Kernel\n') + out3.write('Kernel-Version: ' + about.getKernelVersionString() + '\n') + out3.write('NeoBoot\n') + out3.write('NeoBoot-Version: ' + PLUGINVERSION + '\n') out3.close() - out = open("%sImageBoot/.updateversion" % getNeoLocation(), "w") - out.write(UPDATEVERSION) - out.close() + out = open('%sImageBoot/.updateversion' % getNeoLocation(), 'w') + out.write(UPDATEVERSION) + out.close() - if fileExists("/usr/lib/enigma2/python/boxbranding.so"): - from boxbranding import getImageDistro + if fileExists('/usr/lib/enigma2/python/boxbranding.so'): + from boxbranding import getImageDistro + imagedistro = getImageDistro() + writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') + writefile.write(imagedistro) + writefile.close() + elif fileExists('/usr/lib/enigma2/python/Plugins/PLi'): + obraz = open('/etc/issue.net', 'r').readlines() + imagetype = obraz[0][:-3] + image = imagetype + writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') + writefile.write(imagetype) + writefile.close() + elif fileExists('/etc/vtiversion.info'): + f = open("/etc/vtiversion.info", 'r') + imagever = f.readline().strip().replace("Release ", " ") + f.close() + image = imagever + writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') + writefile.write(imagever) + writefile.close() + elif fileExists('/etc/bhversion'): + f = open("/etc/bhversion", 'r') + imagever = f.readline().strip() + f.close() + image = imagever + writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') + writefile.write(imagever) + writefile.close() - imagedistro = getImageDistro() - writefile = open( - "%sImageBoot/.imagedistro" % - getNeoLocation(), "w") - writefile.write(imagedistro) - writefile.close() - elif fileExists("/usr/lib/enigma2/python/Plugins/PLi"): - obraz = open("/etc/issue.net", "r").readlines() - imagetype = obraz[0][:-3] - image = imagetype - writefile = open( - "%sImageBoot/.imagedistro" % - getNeoLocation(), "w") - writefile.write(imagetype) - writefile.close() - elif fileExists("/etc/vtiversion.info"): - f = open("/etc/vtiversion.info", "r") - imagever = f.readline().strip().replace("Release ", " ") - f.close() - image = imagever - writefile = open( - "%sImageBoot/.imagedistro" % - getNeoLocation(), "w") - writefile.write(imagever) - writefile.close() - elif fileExists("/etc/bhversion"): - f = open("/etc/bhversion", "r") - imagever = f.readline().strip() - f.close() - image = imagever - writefile = open( - "%sImageBoot/.imagedistro" % - getNeoLocation(), "w") - writefile.write(imagever) - writefile.close() + if not os.path.isfile('/etc/name'): + if getBoxHostName() == "dm500hd" or getBoxHostName() == "dm520" or getBoxHostName() == "dm525" or getBoxHostName() == "dm800" or getBoxHostName() == "dm800se" or getBoxHostName() == "dm8000": + system('chmod 755 ' + LinkNeoBoot + '/bin/dminit') + else: + system('opkg update') + os.system('opkg install --force-overwrite --force-reinstall python-subprocess') + os.system('opkg install --force-overwrite --force-reinstall python-argparse') + os.system('opkg install liblzo2-2') + os.system('opkg install curl') + if getCPUtype() == 'MIPS': + os.system('opkg install --force-overwrite --force-reinstall kernel-module-nandsim') + os.system('opkg install --force-overwrite --force-reinstall mtd-utils-jffs2') + os.system('opkg install --force-overwrite --force-reinstall lzo') + os.system('opkg install --force-overwrite --force-reinstall python-setuptools') + os.system('opkg install --force-overwrite --force-reinstall util-linux-sfdisk') + os.system('opkg install --force-overwrite --force-reinstall packagegroup-base-nfs') + os.system('opkg install --force-overwrite --force-reinstall ofgwrite') + os.system('opkg install --force-overwrite --force-reinstall bzip2') + os.system('opkg install --force-overwrite --force-reinstall mtd-utils') + os.system('opkg install --force-overwrite --force-reinstall mtd-utils-ubifs') + # STB ARM + if getCPUtype() == "ARMv7": + if getBoxHostName() == "vuduo4k" and getBoxHostName() != "ustym4kpro": + os.system('cd ' + LinkNeoBoot + '/') + os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv ' + LinkNeoBoot + '/tmpfiles/vu4k_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu') + os.system('dd if=/dev/mmcblk0p6 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())) - if not os.path.isfile("/etc/name"): - if ( - getBoxHostName() == "dm500hd" - or getBoxHostName() == "dm520" - or getBoxHostName() == "dm525" - or getBoxHostName() == "dm800" - or getBoxHostName() == "dm800se" - or getBoxHostName() == "dm8000" - ): - system("chmod 755 " + LinkNeoBoot + "/bin/dminit") + elif getBoxHostName() == "vuduo4kse" and getBoxHostName() != "vuultimo4k" and getBoxHostName() != "ustym4kpro": + os.system('cd ' + LinkNeoBoot + '/') + os.system('cp -Rf ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv ' + LinkNeoBoot + '/tmpfiles/vu4k_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu') + os.system('dd if=/dev/mmcblk0p6 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())) + + elif getBoxHostName() == "vuzero4k" and getBoxHostName() != "ustym4kpro": + os.system('cd ' + LinkNeoBoot + '/') + os.system('cp -af ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarmvu; cd') + os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu') + os.system('dd if=/dev/mmcblk0p4 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())) + os.system('mv ' + LinkNeoBoot + '/tmpfiles/vu4k_run.py ' + LinkNeoBoot + '/run.py; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd') + + elif getBoxHostName() == "vuultimo4k" or getBoxHostName() == "vusolo4k" or getBoxHostName() == "vuuno4k" or getBoxHostName() == "vuuno4kse" and getBoxHostName() != "ustym4kpro": + os.system('cd ' + LinkNeoBoot + '/') + os.system('cp -af ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; cp -Rf ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarmvu; cd') + os.system('chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu') + os.system('dd if=/dev/mmcblk0p1 of=%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())) + os.system('mv ' + LinkNeoBoot + '/tmpfiles/vu4k_run.py ' + LinkNeoBoot + '/run.py; rm -f; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd') + + elif getBoxHostName() == "lunix4k" and getCPUSoC() == "72604" and getBoxHostName() != "vuzero4k": + os.system('cp -af ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv ' + LinkNeoBoot + '/tmpfiles/arm_run.py ' + LinkNeoBoot + '/run.py; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd') + + elif getBoxHostName() == "revo4k" and getCPUSoC() == "7252S" and getBoxHostName() != "vuuno4k": + os.system('cp -af ' + LinkNeoBoot + '/bin/neoinitarmvu /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv ' + LinkNeoBoot + '/tmpfiles/arm_run.py ' + LinkNeoBoot + '/run.py; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd') + + elif getBoxHostName() == "osmio4k" or getBoxHostName() == "osmio4kplus" or getBoxHostName() == "osmini4k": + os.system('mv ' + LinkNeoBoot + '/bin/neoinitmips ' + LinkNeoBoot + '/bin/neoinitosmi4k; cp -af ' + LinkNeoBoot + '/bin/neoinitosmi4k /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv ' + LinkNeoBoot + '/tmpfiles/arm_run.py ' + LinkNeoBoot + '/run.py; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd') + else: + os.system('cp -af ' + LinkNeoBoot + '/bin/neoinitarm /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv ' + LinkNeoBoot + '/tmpfiles/arm_run.py ' + LinkNeoBoot + '/run.py; rm -f ' + LinkNeoBoot + '/bin/neoinitarmvuDuo4k; cd') + + # STB MIPS + elif getCPUtype() == 'MIPS': + os.system('chmod 755 ' + LinkNeoBoot + '/bin/nfidump; chmod 0755 ' + LinkNeoBoot + '/bin/nanddump_mips; cd /') + if fileExists('' + getNeoLocation() + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz') and not os.path.isfile('/etc/name'): + os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz') + #vuplus stb mtd1 + if getBoxHostName() == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vusolo' or getBoxHostName() == 'vuuno' or getBoxHostName() == 'vuultimo': + if fileExists('/usr/sbin/nanddump'): + os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; /usr/sbin/nanddump -f vmlinux.gz /dev/mtd1; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz') + elif not fileExists('/usr/sbin/nanddump'): + os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; ' + LinkNeoBoot + '/bin/nanddump_mips -f vmlinux.gz /dev/mtd1; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz') + os.system('cd ' + LinkNeoBoot + '/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo;mv ' + LinkNeoBoot + '/tmpfiles/vu_run.py ' + LinkNeoBoot + '/run.py; cd') + #os.system('cp -af ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmipsvu') #test nowe pli + os.system('cp -af ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmips; cp -Rf ' + LinkNeoBoot + '/bin/neoinitmipsvu /sbin/neoinitmipsvu') + + #vuplus stb mtd2 + elif getBoxHostName() == 'vuduo2' or getBoxHostName() == 'vusolose' or getBoxHostName() == 'vuzero': + if fileExists('/usr/sbin/nanddump'): + os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd2 -f vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz') + elif not fileExists('/usr/sbin/nanddump'): + os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; ' + LinkNeoBoot + '/bin/nanddump_mips -f vmlinux.gz /dev/mtd2; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz') + os.system('cd ' + LinkNeoBoot + '/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/tmpfiles/vu_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('cp -af ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmips; cp -Rf ' + LinkNeoBoot + '/bin/neoinitmips_vu /sbin/neoinitmipsvu') + + elif getBoxHostName() == 'vusolo2': + if fileExists('/usr/sbin/nanddump'): + os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd2 -f vmlinux.gz; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz') + elif not fileExists('/usr/sbin/nanddump'): + os.system('cd ' + getNeoLocation() + 'ImagesUpload/.kernel/; ' + LinkNeoBoot + '/bin/nanddump_mips -o -b vmlinux.gz /dev/mtd2; mv ./vmlinux.gz ./' + getBoxHostName() + '.vmlinux.gz') + os.system('cd ' + LinkNeoBoot + '/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv ' + LinkNeoBoot + '/tmpfiles/vu_run.py ' + LinkNeoBoot + '/run.py; cd') + os.system('cp -af ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmips; cp -Rf ' + LinkNeoBoot + '/bin/neoinitmipsvu /sbin/neoinitmipsvu') + + os.system('opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade kernel-image') + if fileExists('/home/root/*.ipk'): + os.system('rm -Rf /home/root/*.ipk') + os.system('opkg download kernel-image; sleep 2; mv /home/root/*.ipk ' + getNeoLocation() + 'ImagesUpload/.kernel/zImage.%s.ipk' % getBoxVuModel()) + + #Other stb MIPS + else: + os.system('cd ' + LinkNeoBoot + '/; chmod 755 ./bin/nandwrite; mv ./bin/fontforneoboot.ttf /usr/share/fonts; mv ./bin/libpngneo /usr/lib; cp -f ./bin/neoinitmips /sbin/neoinitmips; cp -f ./bin/neoinitmipsvu /sbin/neoinitmipsvu; chmod 0755 /sbin/neoinit*; mv ./bin/neobmmips ./bin/neobm; chmod 0755 ./bin/neobm; chmod 0755 /usr/lib/libpngneo; cd; chmod 0755 /sbin/neoinitmips; ln -sf /media/neoboot/ImageBoot/.neonextboot /etc/neoimage; mv ' + LinkNeoBoot + '/tmpfiles/mips_run.py ' + LinkNeoBoot + '/run.py; cd') + if getBoxHostName() == "et5x00": + os.system('cd ' + LinkNeoBoot + '/; cp -af ./bin/neoinitarmvuDuo4k /sbin/neoinitmips; cp -af ./bin/neoinitmips ./bin/neoinitmipsvu; cp -af ./bin/neoinitarmvuDuo4k ./bin/neoinitmips; cd') + if getBoxHostName() == 'dm500hd' or getBoxHostName() == 'dm800se' or getBoxHostName() == 'dm800' or getBoxHostName() == 'dm8000': + os.system('cd ' + LinkNeoBoot + '/; cp -af ./bin/dminit /sbin/neoinitmips; cp -af ./bin/neoinitmipsvu ./bin/neoinitmipsvu; rm -r ./ubi_reade*; cd') + os.system('chmod 755 ' + LinkNeoBoot + '/bin/nfidump; chmod 0755 ' + LinkNeoBoot + '/bin/nanddump_mips; rm -r ' + LinkNeoBoot + '/bin/neoinitar*; cd /') + if fileExists('' + LinkNeoBoot + '/bin/fontforneoboot.ttf'): + ('cd ' + LinkNeoBoot + '/;mv ./bin/fontforneoboot.ttf /usr/share/fonts; cd /') + if fileExists('' + LinkNeoBoot + '/bin/libpngneo'): + ('cd ' + LinkNeoBoot + '/;mv ./bin/libpngneo /usr/lib; chmod 0755 /usr/lib/libpngneo; cd /') + if fileExists('' + LinkNeoBoot + '/bin/neobm'): + ('cd ' + LinkNeoBoot + '/;chmod 0755 ./bin/neobm; cd /') else: - system("opkg update") - os.system( - "opkg install --force-overwrite --force-reinstall python-subprocess" - ) - os.system( - "opkg install --force-overwrite --force-reinstall python-argparse" - ) - os.system("opkg install liblzo2-2") - os.system("opkg install curl") - if getCPUtype() == "MIPS": - os.system( - "opkg install --force-overwrite --force-reinstall kernel-module-nandsim" - ) - os.system( - "opkg install --force-overwrite --force-reinstall mtd-utils-jffs2" - ) - os.system( - "opkg install --force-overwrite --force-reinstall lzo") - os.system( - "opkg install --force-overwrite --force-reinstall python-setuptools" - ) - os.system( - "opkg install --force-overwrite --force-reinstall util-linux-sfdisk" - ) - os.system( - "opkg install --force-overwrite --force-reinstall packagegroup-base-nfs" - ) - os.system( - "opkg install --force-overwrite --force-reinstall ofgwrite" - ) - os.system( - "opkg install --force-overwrite --force-reinstall bzip2") - os.system( - "opkg install --force-overwrite --force-reinstall mtd-utils" - ) - os.system( - "opkg install --force-overwrite --force-reinstall mtd-utils-ubifs" - ) - if getCPUtype() == "ARMv7": - if getBoxHostName() == "vuduo4k" and getBoxHostName() != "ustym4kpro": - os.system("cd " + LinkNeoBoot + "/") - os.system( - "cp -Rf " - + LinkNeoBoot - + "/bin/neoinitarm /sbin/neoinitarm; cp -Rf " - + LinkNeoBoot - + "/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv " - + LinkNeoBoot - + "/tmpfiles/vu4k_run.py " - + LinkNeoBoot - + "/run.py; cd" - ) - os.system( - "chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu") - os.system( - "dd if=/dev/mmcblk0p6 of=%sImagesUpload/.kernel/flash-kernel-%s.bin" % - (getNeoLocation(), getBoxHostName())) + self.messagebox = self.session.open(MessageBox, _('The tuner is not supported by NeoBoot.\nContact the author.\nNo proper STB for installation !!!!'), type=MessageBox.TYPE_ERROR) - elif ( - getBoxHostName() == "vuduo4kse" - and getBoxHostName() != "vuultimo4k" - and getBoxHostName() != "ustym4kpro" - ): - os.system("cd " + LinkNeoBoot + "/") - os.system( - "cp -Rf " - + LinkNeoBoot - + "/bin/neoinitarm /sbin/neoinitarm; cp -Rf " - + LinkNeoBoot - + "/bin/neoinitarmvuDuo4k /sbin/neoinitarmvu; mv " - + LinkNeoBoot - + "/tmpfiles/vu4k_run.py " - + LinkNeoBoot - + "/run.py; cd" - ) - os.system( - "chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu") - os.system( - "dd if=/dev/mmcblk0p6 of=%sImagesUpload/.kernel/flash-kernel-%s.bin" % - (getNeoLocation(), getBoxHostName())) + if fileExists('/home/root/vmlinux.gz'): + os.system('mv -f /home/root/vmlinux.gz %sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName())) - elif getBoxHostName() == "vuzero4k" and getBoxHostName() != "ustym4kpro": - os.system("cd " + LinkNeoBoot + "/") - os.system( - "cp -af " - + LinkNeoBoot - + "/bin/neoinitarm /sbin/neoinitarm; cp -Rf " - + LinkNeoBoot - + "/bin/neoinitarmvu /sbin/neoinitarmvu; cd" - ) - os.system( - "chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu") - os.system( - "dd if=/dev/mmcblk0p4 of=%sImagesUpload/.kernel/flash-kernel-%s.bin" % - (getNeoLocation(), getBoxHostName())) - os.system( - "mv " - + LinkNeoBoot - + "/tmpfiles/vu4k_run.py " - + LinkNeoBoot - + "/run.py; rm -f " - + LinkNeoBoot - + "/bin/neoinitarmvuDuo4k; cd" - ) + if fileExists('' + LinkNeoBoot + '/ubi_reader_mips') or fileExists('' + LinkNeoBoot + '/ubi_reader_arm') and fileExists('' + LinkNeoBoot + '/ubi_reader'): + os.system('rm -r ' + LinkNeoBoot + '/ubi_reader ') - elif ( - getBoxHostName() == "vuultimo4k" - or getBoxHostName() == "vusolo4k" - or getBoxHostName() == "vuuno4k" - or getBoxHostName() == "vuuno4kse" - and getBoxHostName() != "ustym4kpro" - ): - os.system("cd " + LinkNeoBoot + "/") - os.system( - "cp -af " - + LinkNeoBoot - + "/bin/neoinitarm /sbin/neoinitarm; cp -Rf " - + LinkNeoBoot - + "/bin/neoinitarmvu /sbin/neoinitarmvu; cd" - ) - os.system( - "chmod 755 /sbin/neoinitarm; chmod 755 /sbin/neoinitarmvu") - os.system( - "dd if=/dev/mmcblk0p1 of=%sImagesUpload/.kernel/flash-kernel-%s.bin" % - (getNeoLocation(), getBoxHostName())) - os.system( - "mv " - + LinkNeoBoot - + "/tmpfiles/vu4k_run.py " - + LinkNeoBoot - + "/run.py; rm -f; rm -f " - + LinkNeoBoot - + "/bin/neoinitarmvuDuo4k; cd" - ) + if getCPUtype() == 'ARMv7': + os.system('cd ' + LinkNeoBoot + '/;chmod 755 ./files/findsk.sh; mv ./bin/fbcleararm ./bin/fbclear; chmod 755 ./bin/fbclear; rm -f ./bin/nandwrite; rm -f ./bin/fbclearmips; mv ./ubi_reader_arm ./ubi_reader; rm -r ./ubi_reader_mips; rm ./bin/neoinitmips; rm ./bin/neoinitmipsvu; rm -r ./bin/nanddump_mips; rm ./bin/nfidump; rm ./bin/neobmmips; mv ./bin/neobmarm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; rm ./bin/dminit; cd') + elif getCPUtype() == 'MIPS': + os.system('cd ' + LinkNeoBoot + '/;rm -f ./files/findsk.sh; mv ./bin/fbclearmips ./bin/fbclear; chmod 755 ./bin/fbclear; rm -f ./bin/fbcleararm; mv ./ubi_reader_mips ./ubi_reader; rm -r ./ubi_reader_arm; rm -f /bin/neoinitarm; rm -f /bin/neoinitarmvu; rm -r ./bin/nanddump_arm; rm -f /bin/neoinitarmvuDuo4k; rm -f ./bin/neobmarm') + + os.system(' ln -sfn ' + LinkNeoBoot + '/files/userscript.sh /etc/rcS.d/S99neo.local; ln -sfn ' + getNeoLocation() + 'ImageBoot/.neonextboot /etc/neoimage; chmod 644 ' + getNeoLocation() + 'ImagesUpload/.kernel/*; ln -sfn ' + getNeoLocation() + 'ImageBoot /etc/imageboot; rm -r ' + LinkNeoBoot + '/tmpfiles; chmod 0755 ' + LinkNeoBoot + '/files/kernel.sh') - elif ( - getBoxHostName() == "lunix4k" - and getCPUSoC() == "72604" - and getBoxHostName() != "vuzero4k" - ): - os.system( - "cp -af " + - LinkNeoBoot + - "/bin/neoinitarmvu /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv " + - LinkNeoBoot + - "/tmpfiles/arm_run.py " + - LinkNeoBoot + - "/run.py; rm -f " + - LinkNeoBoot + - "/bin/neoinitarmvuDuo4k; cd") - - elif ( - getBoxHostName() == "revo4k" - and getCPUSoC() == "7252S" - and getBoxHostName() != "vuuno4k" - ): - os.system( - "cp -af " + - LinkNeoBoot + - "/bin/neoinitarmvu /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv " + - LinkNeoBoot + - "/tmpfiles/arm_run.py " + - LinkNeoBoot + - "/run.py; rm -f " + - LinkNeoBoot + - "/bin/neoinitarmvuDuo4k; cd") - - elif ( - getBoxHostName() == "osmio4k" - or getBoxHostName() == "osmio4kplus" - or getBoxHostName() == "osmini4k" - ): - os.system( - "mv " + - LinkNeoBoot + - "/bin/neoinitmips " + - LinkNeoBoot + - "/bin/neoinitosmi4k; cp -af " + - LinkNeoBoot + - "/bin/neoinitosmi4k /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv " + - LinkNeoBoot + - "/tmpfiles/arm_run.py " + - LinkNeoBoot + - "/run.py; rm -f " + - LinkNeoBoot + - "/bin/neoinitarmvuDuo4k; cd") + if os.path.isfile('' + LinkNeoBoot + '/.location'): + if getLabelDisck() != 'LABEL=': + cmd = "echo -e '\n%s '" % _('NeoBoot has been installed succesfully!\nNeoBoot has detected that the disks do not have a label.\nFor correct neo boot operation, please give the disks the name LABEL\nRecommended total restart of the tuner.\n') + elif getLabelDisck() == 'LABEL=': + cmd = "echo -e '\n%s '" % _('Installed succesfully NEOBOOT!\nNeoBoot has detected that the disks have been marked.\nRecommended total restart of the tuner\n') else: - os.system( - "cp -af " + - LinkNeoBoot + - "/bin/neoinitarm /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv " + - LinkNeoBoot + - "/tmpfiles/arm_run.py " + - LinkNeoBoot + - "/run.py; rm -f " + - LinkNeoBoot + - "/bin/neoinitarmvuDuo4k; cd") - - elif getCPUtype() == "MIPS": - os.system( - "chmod 755 " - + LinkNeoBoot - + "/bin/nfidump; chmod 0755 " - + LinkNeoBoot - + "/bin/nanddump_mips; cd /" - ) - if fileExists( - "" - + getNeoLocation() - + "ImagesUpload/.kernel/" - + getBoxHostName() - + ".vmlinux.gz" - ) and not os.path.isfile("/etc/name"): - os.system( - "rm -r " - + getNeoLocation() - + "ImagesUpload/.kernel/" - + getBoxHostName() - + ".vmlinux.gz" - ) - if ( - getBoxHostName() == "bm750" - or getBoxHostName() == "vuduo" - or getBoxHostName() == "vusolo" - or getBoxHostName() == "vuuno" - or getBoxHostName() == "vuultimo" - ): - if fileExists("/usr/sbin/nanddump"): - os.system( - "cd " + - getNeoLocation() + - "ImagesUpload/.kernel/; /usr/sbin/nanddump -f vmlinux.gz /dev/mtd1; mv ./vmlinux.gz ./" + - getBoxHostName() + - ".vmlinux.gz") - elif not fileExists("/usr/sbin/nanddump"): - os.system( - "cd " + - getNeoLocation() + - "ImagesUpload/.kernel/; " + - LinkNeoBoot + - "/bin/nanddump_mips -f vmlinux.gz /dev/mtd1; mv ./vmlinux.gz ./" + - getBoxHostName() + - ".vmlinux.gz") - os.system( - "cd " - + LinkNeoBoot - + "/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo;mv " - + LinkNeoBoot - + "/tmpfiles/vu_run.py " - + LinkNeoBoot - + "/run.py; cd" - ) - os.system( - "cp -af " - + LinkNeoBoot - + "/bin/neoinitmips /sbin/neoinitmips; cp -Rf " - + LinkNeoBoot - + "/bin/neoinitmipsvu /sbin/neoinitmipsvu" - ) - - elif ( - getBoxHostName() == "vuduo2" - or getBoxHostName() == "vusolose" - or getBoxHostName() == "vuzero" - ): - if fileExists("/usr/sbin/nanddump"): - os.system( - "cd " + - getNeoLocation() + - "ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd2 -f vmlinux.gz; mv ./vmlinux.gz ./" + - getBoxHostName() + - ".vmlinux.gz") - elif not fileExists("/usr/sbin/nanddump"): - os.system( - "cd " + - getNeoLocation() + - "ImagesUpload/.kernel/; " + - LinkNeoBoot + - "/bin/nanddump_mips -f vmlinux.gz /dev/mtd2; mv ./vmlinux.gz ./" + - getBoxHostName() + - ".vmlinux.gz") - os.system( - "cd " - + LinkNeoBoot - + "/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv " - + LinkNeoBoot - + "/tmpfiles/vu_run.py " - + LinkNeoBoot - + "/run.py; cd" - ) - os.system( - "cp -af " - + LinkNeoBoot - + "/bin/neoinitmips /sbin/neoinitmips; cp -Rf " - + LinkNeoBoot - + "/bin/neoinitmips_vu /sbin/neoinitmipsvu" - ) - - elif getBoxHostName() == "vusolo2": - if fileExists("/usr/sbin/nanddump"): - os.system( - "cd " + - getNeoLocation() + - "ImagesUpload/.kernel/; /usr/sbin/nanddump /dev/mtd2 -f vmlinux.gz; mv ./vmlinux.gz ./" + - getBoxHostName() + - ".vmlinux.gz") - elif not fileExists("/usr/sbin/nanddump"): - os.system( - "cd " + - getNeoLocation() + - "ImagesUpload/.kernel/; " + - LinkNeoBoot + - "/bin/nanddump_mips -o -b vmlinux.gz /dev/mtd2; mv ./vmlinux.gz ./" + - getBoxHostName() + - ".vmlinux.gz") - os.system( - "cd " - + LinkNeoBoot - + "/; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; mv " - + LinkNeoBoot - + "/tmpfiles/vu_run.py " - + LinkNeoBoot - + "/run.py; cd" - ) - os.system( - "cp -af " - + LinkNeoBoot - + "/bin/neoinitmips /sbin/neoinitmips; cp -Rf " - + LinkNeoBoot - + "/bin/neoinitmipsvu /sbin/neoinitmipsvu" - ) - - os.system( - "opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade kernel-image" - ) - if fileExists("/home/root/*.ipk"): - os.system("rm -Rf /home/root/*.ipk") - os.system( - "opkg download kernel-image; sleep 2; mv /home/root/*.ipk " - + getNeoLocation() - + "ImagesUpload/.kernel/zImage.%s.ipk" % getBoxVuModel() - ) + self.myclose2(_('NeoBoot has not been installed ! :(')) + if os.path.isfile('/etc/name'): + self.myclose2(_('The plug-in has been successfully installed.')) + self.close() else: - os.system( - "cd " + - LinkNeoBoot + - "/; chmod 755 ./bin/nandwrite; mv ./bin/fontforneoboot.ttf /usr/share/fonts; mv ./bin/libpngneo /usr/lib; cp -f ./bin/neoinitmips /sbin/neoinitmips; cp -f ./bin/neoinitmipsvu /sbin/neoinitmipsvu; chmod 0755 /sbin/neoinit*; mv ./bin/neobmmips ./bin/neobm; chmod 0755 ./bin/neobm; chmod 0755 /usr/lib/libpngneo; cd; chmod 0755 /sbin/neoinitmips; ln -sf /media/neoboot/ImageBoot/.neonextboot /etc/neoimage; mv " + - LinkNeoBoot + - "/tmpfiles/mips_run.py " + - LinkNeoBoot + - "/run.py; cd") - if getBoxHostName() == "et5x00": - os.system( - "cd " + - LinkNeoBoot + - "/; cp -af ./bin/neoinitarmvuDuo4k /sbin/neoinitmips; cp -af ./bin/neoinitmips ./bin/neoinitmipsvu; cp -af ./bin/neoinitarmvuDuo4k ./bin/neoinitmips; cd") - if ( - getBoxHostName() == "dm500hd" - or getBoxHostName() == "dm800se" - or getBoxHostName() == "dm800" - or getBoxHostName() == "dm8000" - ): - os.system( - "cd " + - LinkNeoBoot + - "/; cp -af ./bin/dminit /sbin/neoinitmips; cp -af ./bin/neoinitmipsvu ./bin/neoinitmipsvu; rm -r ./ubi_reade*; cd") - os.system( - "chmod 755 " - + LinkNeoBoot - + "/bin/nfidump; chmod 0755 " - + LinkNeoBoot - + "/bin/nanddump_mips; rm -r " - + LinkNeoBoot - + "/bin/neoinitar*; cd /" - ) - if fileExists("" + LinkNeoBoot + "/bin/fontforneoboot.ttf"): - ( - "cd " - + LinkNeoBoot - + "/;mv ./bin/fontforneoboot.ttf /usr/share/fonts; cd /" - ) - if fileExists("" + LinkNeoBoot + "/bin/libpngneo"): - ("cd " + LinkNeoBoot + - "/;mv ./bin/libpngneo /usr/lib; chmod 0755 /usr/lib/libpngneo; cd /") - if fileExists("" + LinkNeoBoot + "/bin/neobm"): - ("cd " + LinkNeoBoot + "/;chmod 0755 ./bin/neobm; cd /") - else: - self.messagebox = self.session.open( - MessageBox, - _("The tuner is not supported by NeoBoot.\nContact the author.\nNo proper STB for installation !!!!"), - type=MessageBox.TYPE_ERROR, - ) - - if fileExists("/home/root/vmlinux.gz"): - os.system( - "mv -f /home/root/vmlinux.gz %sImagesUpload/.kernel/%s.vmlinux.gz" % - (getNeoLocation(), getBoxHostName())) - - if ( - fileExists("" + LinkNeoBoot + "/ubi_reader_mips") - or fileExists("" + LinkNeoBoot + "/ubi_reader_arm") - and fileExists("" + LinkNeoBoot + "/ubi_reader") - ): - os.system("rm -r " + LinkNeoBoot + "/ubi_reader ") - - if getCPUtype() == "ARMv7": - os.system( - "cd " - + LinkNeoBoot - + "/;chmod 755 ./files/findsk.sh; mv ./bin/fbcleararm ./bin/fbclear; chmod 755 ./bin/fbclear; rm -f ./bin/nandwrite; rm -f ./bin/fbclearmips; mv ./ubi_reader_arm ./ubi_reader; rm -r ./ubi_reader_mips; rm ./bin/neoinitmips; rm ./bin/neoinitmipsvu; rm -r ./bin/nanddump_mips; rm ./bin/nfidump; rm ./bin/neobmmips; mv ./bin/neobmarm ./bin/neobm; rm ./bin/fontforneoboot.ttf; rm ./bin/libpngneo; rm ./bin/dminit; cd" - ) - elif getCPUtype() == "MIPS": - os.system( - "cd " - + LinkNeoBoot - + "/;rm -f ./files/findsk.sh; mv ./bin/fbclearmips ./bin/fbclear; chmod 755 ./bin/fbclear; rm -f ./bin/fbcleararm; mv ./ubi_reader_mips ./ubi_reader; rm -r ./ubi_reader_arm; rm -f /bin/neoinitarm; rm -f /bin/neoinitarmvu; rm -r ./bin/nanddump_arm; rm -f /bin/neoinitarmvuDuo4k; rm -f ./bin/neobmarm" - ) - - os.system( - " ln -sfn " - + LinkNeoBoot - + "/files/userscript.sh /etc/rcS.d/S99neo.local; ln -sfn " - + getNeoLocation() - + "ImageBoot/.neonextboot /etc/neoimage; chmod 644 " - + getNeoLocation() - + "ImagesUpload/.kernel/*; ln -sfn " - + getNeoLocation() - + "ImageBoot /etc/imageboot; rm -r " - + LinkNeoBoot - + "/tmpfiles; chmod 0755 " - + LinkNeoBoot - + "/files/kernel.sh" - ) - - if os.path.isfile("" + LinkNeoBoot + "/.location"): - if getLabelDisck() != "LABEL=": - cmd = "echo -e '\n%s '" % _( - "NeoBoot has been installed succesfully!\nNeoBoot has detected that the disks do not have a label.\nFor correct neo boot operation, please give the disks the name LABEL\nRecommended total restart of the tuner.\n" - ) - elif getLabelDisck() == "LABEL=": - cmd = "echo -e '\n%s '" % _( - "Installed succesfully NEOBOOT!\nNeoBoot has detected that the disks have been marked.\nRecommended total restart of the tuner\n" - ) - else: - self.myclose2(_("NeoBoot has not been installed ! :(")) - - if os.path.isfile("/etc/name"): - self.myclose2(_("The plug-in has been successfully installed.")) - self.close() - else: - if not fileExists("/etc/name"): - os.system("touch /etc/name") - closereboot = self.rebootSTBE2() - self.session.open(Console, _("NeoBoot Install...."), [cmd]) - self.close(closereboot) + if not fileExists('/etc/name'): + os.system('touch /etc/name') + closereboot = self.rebootSTBE2() + self.session.open(Console, _('NeoBoot Install....'), [cmd]) + self.close(closereboot) def myclose2(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) def rebootSTBE2(self): - restartbox = self.session.openWithCallback( - self.RebootSTB, - MessageBox, - _("Reboot stb now ?"), - MessageBox.TYPE_YESNO) - restartbox.setTitle(_("Reboot")) + restartbox = self.session.openWithCallback(self.RebootSTB, MessageBox, _('Reboot stb now ?'), MessageBox.TYPE_YESNO) + restartbox.setTitle(_('Reboot')) def RebootSTB(self, answer): if answer is True: - cmd = "echo 3 > /proc/sys/vm/drop_caches; shutdown -r now ;sleep 1; reboot -d -f &" - rc = os.system(cmd) + cmd = 'echo 3 > /proc/sys/vm/drop_caches; shutdown -r now ;sleep 1; reboot -d -f &' + rc = os.system(cmd) + #os.system('sync && echo 3 > /proc/sys/vm/drop_caches; reboot -d -f') else: self.close() @@ -1421,714 +774,517 @@ class NeoBootImageChoose(Screen): if isFHD(): try: from Plugins.Extensions.NeoBoot.usedskin import ImageChooseFULLHD - skin = ImageChooseFULLHD - except BaseException: + except: from Plugins.Extensions.NeoBoot.neoskins.default import ImageChooseFULLHD - skin = ImageChooseFULLHD elif isUHD(): from Plugins.Extensions.NeoBoot.neoskins.default import ImageChooseULTRAHD - skin = ImageChooseULTRAHD else: try: from Plugins.Extensions.NeoBoot.usedskin import ImageChooseHD - skin = ImageChooseHD - except BaseException: + except: from Plugins.Extensions.NeoBoot.neoskins.default import ImageChooseHD - skin = ImageChooseHD def __init__(self, session): Screen.__init__(self, session) - + self.list = [] - self.setTitle( - " NeoBoot %s - Menu" % PLUGINVERSION - + " " - + "Ver. update: %s" % UPDATEVERSION - ) - self["device_icon"] = Pixmap() - self["progreso"] = ProgressBar() - self["linea"] = ProgressBar() - self["config"] = MenuList(self.list) - self["key_red"] = Label(_("Download Image")) - self["key_green"] = Label(_("Installation")) - self["key_yellow"] = Label(_("Remove Image ")) - self["key_blue"] = Label(_("Info")) - self["key_menu"] = Label(_("More options")) - self["key_1"] = Label(_("Update NeoBot")) - self["key_2"] = Label(_("Reinstall NeoBoot")) - self["key_3"] = Label(_("Reinstall kernel")) - self["label1"] = Label(_("Please choose an image to boot")) - self["label2"] = Label(_("NeoBoot is running from:")) - self["label3"] = Label("") - self["label4"] = Label(_("NeoBoot is running image:")) - self["label5"] = Label("") - self["label6"] = Label("") - self["label7"] = Label("") - self["label8"] = Label(_("Number of images installed:")) - self["label9"] = Label("") - self["label10"] = Label("") - self["label11"] = Label("") - self["label12"] = Label("") - self["label13"] = Label(_("Version update: ")) - if fileExists("/.multinfo") and getImageNeoBoot() != "Flash": - self["label14"] = Label(_("VIP-on NeoBoot: ")) - elif getCheckActivateVip() == getBoxMacAddres() and fileExists( - "/usr/lib/periodon/.kodn" - ): - self["label14"] = Label(_("VIP-on NeoBoot: ")) - else: - self["label14"] = Label(_("VIP-off NeoBoot: ")) - self["label15"] = Label(_("Memory disc:")) - self["label16"] = Label(_("Kernel")) - self["label17"] = Label("") - self["label18"] = Label("") - self["label19"] = Label("") - self["label20"] = Label("") - if fileExists("/.multinfo") and getImageNeoBoot() != "Flash": - self["label21"] = Label("VIP-OK!") - elif getCheckActivateVip() == getBoxMacAddres() and fileExists( - "/usr/lib/periodon/.kodn" - ): - self["label21"] = Label("VIP-OK!") - else: - self["label21"] = Label("Enter pin code") - self["actions"] = ActionMap( - [ - "WizardActions", - "ColorActions", - "MenuActions", - "NumberActionMap", - "SetupActions", - "number", - ], - { - "ok": self.bootIMG, - "red": self.DownloadImageOnline, - "green": self.ImageInstall, - "yellow": self.removeIMG, - "blue": self.pomoc, - "menu": self.mytools, - "1": self.neoboot_update, - "2": self.ReinstallNeoBoot, - "3": self.ReinstallKernel, - "4": self.touch4, # hidden option - "5": self.touch5, # hidden option - "6": self.touch6, # hidden option - "7": self.touch7, # hidden option - "8": self.touch8, # hidden option - "9": self.touch9, # hidden option - "0": self.touch0, # hidden option - "back": self.close_exit, - }, - ) + self.setTitle(' NeoBoot %s - Menu' % PLUGINVERSION + ' ' + 'Ver. update: %s' % UPDATEVERSION) + self['device_icon'] = Pixmap() + self['progreso'] = ProgressBar() + self['linea'] = ProgressBar() + self['config'] = MenuList(self.list) + self['key_red'] = Label(_('Download Image')) + self['key_green'] = Label(_('Installation')) + self['key_yellow'] = Label(_('Remove Image ')) + self['key_blue'] = Label(_('Info')) + self['key_menu'] = Label(_('More options')) + self['key_1'] = Label(_('Update NeoBot')) + self['key_2'] = Label(_('Reinstall NeoBoot')) + self['key_3'] = Label(_('Reinstall kernel')) + self['label1'] = Label(_('Please choose an image to boot')) + self['label2'] = Label(_('NeoBoot is running from:')) + self['label3'] = Label('') + self['label4'] = Label(_('NeoBoot is running image:')) + self['label5'] = Label('') + self['label6'] = Label('') + self['label7'] = Label('') + self['label8'] = Label(_('Number of images installed:')) + self['label9'] = Label('') + self['label10'] = Label('') + self['label11'] = Label('') + self['label12'] = Label('') + self['label13'] = Label(_('Version update: ')) + if fileExists('/.multinfo') and getImageNeoBoot() != "Flash": + self['label14'] = Label(_('VIP-on NeoBoot: ')) + elif getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn'): + self['label14'] = Label(_('VIP-on NeoBoot: ')) + else: + self['label14'] = Label(_('VIP-off NeoBoot: ')) + self['label15'] = Label(_('Memory disc:')) + self['label16'] = Label(_('Kernel')) + self['label17'] = Label('') + self['label18'] = Label('') + self['label19'] = Label('') + self['label20'] = Label('') + if fileExists('/.multinfo') and getImageNeoBoot() != "Flash": + self['label21'] = Label('VIP-OK!') + elif getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn'): + self['label21'] = Label('VIP-OK!') + else: + self['label21'] = Label('Enter pin code') + self['actions'] = ActionMap(['WizardActions', + 'ColorActions', + 'MenuActions', + 'NumberActionMap', + 'SetupActions', + 'number'], {'ok': self.bootIMG, + 'red': self.DownloadImageOnline, + 'green': self.ImageInstall, + 'yellow': self.removeIMG, + 'blue': self.pomoc, + 'menu': self.mytools, + '1': self.neoboot_update, + '2': self.ReinstallNeoBoot, + '3': self.ReinstallKernel, + '4': self.touch4, #hidden option + '5': self.touch5, #hidden option + '6': self.touch6, #hidden option + '7': self.touch7, #hidden option + '8': self.touch8, #hidden option + '9': self.touch9, #hidden option + '0': self.touch0, #hidden option + 'back': self.close_exit}) self.availablespace = 0 self.onShow.append(self.updateList) - if not fileExists("" + LinkNeoBoot + "/files/mountpoint.sh"): - getMountPointAll() + if not fileExists('' + LinkNeoBoot + '/files/mountpoint.sh'): + getMountPointAll() - if not fileExists("" + LinkNeoBoot + "/files/neo.sh"): - getMountPointNeo() - - if ( - os.path.exists("/media/hdd/swapfile") - or os.path.exists("/media/usb/swapfile") - or os.path.exists("/swapfile") - ): - system("swapon -a") - - if fileExists("/tmp/.init_reboot"): - system("rm /tmp/.init_reboot") - - if fileExists("/media/sda1"): - if len(os.listdir("/media/sda1")) == 0: - os.system("rm -r /media/sda1") - - if fileExists("/media/sdb1"): - if len(os.listdir("/media/sdb1")) == 0: - os.system("rm -r /media/sdb1") - - if fileExists("/.multinfo"): - if not fileExists("/.control_ok"): - if fileExists("/.control_boot_new_image"): - os.system( - 'rm -f /.control_boot_new_image; echo "Image uruchomione OK\nNie kasuj tego pliku. \n\nImage started OK\nDo not delete this file." > /.control_ok ' - ) - if not fileExists("/.control_boot_new_image"): - os.system( - 'echo "Image uruchomione OK\nNie kasuj tego pliku. \n\nImage started OK\nDo not delete this file." > /.control_ok' - ) + if not fileExists('' + LinkNeoBoot + '/files/neo.sh'): + getMountPointNeo() + + if os.path.exists('/media/hdd/swapfile') or os.path.exists('/media/usb/swapfile') or os.path.exists('/swapfile'): + system('swapon -a') + + if fileExists('/tmp/.init_reboot'): + system('rm /tmp/.init_reboot') + + if fileExists('/media/sda1'): + if len(os.listdir('/media/sda1') ) == 0: + os.system('rm -r /media/sda1') + #print("Directory sda1 is empty") + + if fileExists('/media/sdb1'): + if len(os.listdir('/media/sdb1') ) == 0: + os.system('rm -r /media/sdb1') + #print("Directory sdb1 is empty") + if fileExists('/.multinfo'): + if not fileExists('/.control_ok'): + if fileExists('/.control_boot_new_image'): + os.system('rm -f /.control_boot_new_image; echo "Image uruchomione OK\nNie kasuj tego pliku. \n\nImage started OK\nDo not delete this file." > /.control_ok ') + if not fileExists('/.control_boot_new_image'): + os.system('echo "Image uruchomione OK\nNie kasuj tego pliku. \n\nImage started OK\nDo not delete this file." > /.control_ok') + def DownloadImageOnline(self): - if not fileExists("/usr/lib/python2.7"): - mess = _( - "Plug installation lost.The plugin doesnt work on python 3 yet. Please try again later." - ) - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) - elif not os.path.exists( - "/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py" - ): - message = _( - "Plugin ImageDownloader not installed!\nInstall plugin to download new image? \and---Continue ?---" - ) - ybox = self.session.openWithCallback( - self.InstallImageDownloader, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_("Installation")) - else: - try: - from Plugins.Extensions.ImageDownloader.main import STBmodelsScreen - - self.session.open(STBmodelsScreen) - except Exception as e: - system("rm -f " + getNeoLocation() + "ImageBoot/neoboot.log") - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + if not fileExists('/usr/lib/python2.7'): + mess = _('Plug installation lost.The plugin doesnt work on python 3 yet. Please try again later.') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + elif not os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py'): + message = _('Plugin ImageDownloader not installed!\nInstall plugin to download new image? \and---Continue ?---') + ybox = self.session.openWithCallback(self.InstallImageDownloader, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Installation')) + else: + try: + from Plugins.Extensions.ImageDownloader.main import STBmodelsScreen + self.session.open(STBmodelsScreen) + except Exception as e: + system('rm -f ' + getNeoLocation() + 'ImageBoot/neoboot.log') + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() def InstallImageDownloader(self, yesno): if yesno: if checkInternet(): - cmd = "mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk" + cmd = 'mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk' system(cmd) - if fileExists("/usr/bin/curl"): - os.system( - "cd /tmp; curl -O --ftp-ssl -k http://read.cba.pl/box/skrypt/img.sh" - ) - if not fileExists( - "/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader" - ): - if fileExists("/usr/bin/fullwget"): - cmd1 = "cd /tmp; fullwget --no-check-certificate http://read.cba.pl/box/skrypt/img.sh" + if fileExists('/usr/bin/curl'): + os.system('cd /tmp; curl -O --ftp-ssl -k http://read.cba.pl/box/skrypt/img.sh') + if not fileExists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader'): + if fileExists('/usr/bin/fullwget'): + cmd1 = 'cd /tmp; fullwget --no-check-certificate http://read.cba.pl/box/skrypt/img.sh' system(cmd1) - if not fileExists( - "/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader" - ): - if fileExists("/usr/bin/wget"): - os.system( - "cd /tmp; wget --no-check-certificate http://read.cba.pl/box/skrypt/img.sh" - ) - if fileExists("/tmp/img.sh"): - cmd2 = ( - "chmod -R +x /tmp/img.sh; /tmp/img.sh; sleep 2; rm /tmp/img.sh" - ) + if not fileExists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader'): + if fileExists('/usr/bin/wget'): + os.system('cd /tmp; wget --no-check-certificate http://read.cba.pl/box/skrypt/img.sh') + if fileExists('/tmp/img.sh'): + cmd2 = 'chmod -R +x /tmp/img.sh; /tmp/img.sh; sleep 2; rm /tmp/img.sh' system(cmd2) - if not fileExists( - "/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/plugin.py" - ) and fileExists("/usr/bin/curl"): - os.system( - "cd /tmp; curl -O --ftp-ssl -k http://read.cba.pl/box/plugin/enigma2-plugin-extensions-imagedownloader_all.ipk" - ) - if fileExists( - "/tmp/enigma2-plugin-extensions-imagedownloader_all.ipk" - ): - cmd2 = "opkg install --force-overwrite --force-reinstall --force-downgrade /tmp/enigma2-plugin-extensions-imagedownloader_all.ipk; rm /tmp/enigma2-plugin-extensions-imagedownloader_all.ipk" + if not fileExists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/plugin.py') and fileExists('/usr/bin/curl'): + os.system('cd /tmp; curl -O --ftp-ssl -k http://read.cba.pl/box/plugin/enigma2-plugin-extensions-imagedownloader_all.ipk') + if fileExists('/tmp/enigma2-plugin-extensions-imagedownloader_all.ipk'): + cmd2 = 'opkg install --force-overwrite --force-reinstall --force-downgrade /tmp/enigma2-plugin-extensions-imagedownloader_all.ipk; rm /tmp/enigma2-plugin-extensions-imagedownloader_all.ipk' system(cmd2) - if not fileExists( - "/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/plugin.py" - ) and fileExists("/usr/bin/curl"): - os.system( - "cd /tmp; curl -O --ftp-ssl -k http://read.cba.pl/box/plugin/enigma2-plugin-extensions-imagedownloader_all.ipk" - ) - cmd3 = "cd /tmp; ar x enigma2-plugin-extensions-imagedownloader_all.ipk; rm -rf control.tar.gz; rm -rf *.ipk; rm -rf debian-binary; /bin/tar -xzvf /tmp/*.tar.gz -C /; rm -fr /tmp/*.tar.gz" - system(cmd3) - if fileExists( - "/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/plugin.py" - ): - self.session.open( - MessageBox, - _("The plug-in has been successfully installed."), - MessageBox.TYPE_INFO, - 5, - ) - self.close() + if not fileExists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/plugin.py') and fileExists('/usr/bin/curl'): + os.system('cd /tmp; curl -O --ftp-ssl -k http://read.cba.pl/box/plugin/enigma2-plugin-extensions-imagedownloader_all.ipk') + cmd3 = 'cd /tmp; ar x enigma2-plugin-extensions-imagedownloader_all.ipk; rm -rf control.tar.gz; rm -rf *.ipk; rm -rf debian-binary; /bin/tar -xzvf /tmp/*.tar.gz -C /; rm -fr /tmp/*.tar.gz' + system(cmd3) + if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/plugin.py'): + self.session.open(MessageBox, _('The plug-in has been successfully installed.'), MessageBox.TYPE_INFO, 5) + self.close() else: - if not fileExists( - "/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/plugin.py" - ): - self.session.open( - MessageBox, - _("The plugin not installed.\nAccess Fails with Error code 0x04."), - MessageBox.TYPE_INFO, - 10, - ) + if not fileExists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/plugin.py'): + self.session.open(MessageBox, _('The plugin not installed.\nAccess Fails with Error code 0x04.'), MessageBox.TYPE_INFO, 10) self.close() else: - mess = _("Geen internet") + mess = _('Geen internet') self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) else: - mess = _( - "Upload image files in zip formats to the ImagesUpload location.") - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + mess = _('Upload image files in zip formats to the ImagesUpload location.') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + def chackkernel(self): - message = _( - "NeoBoot detected a kernel mismatch in flash, \nInstall a kernel for flash image??" - ) - ybox = self.session.openWithCallback( - self.updatekernel, MessageBox, message, MessageBox.TYPE_YESNO - ) - ybox.setTitle(_("Updating ... ")) + message = _('NeoBoot detected a kernel mismatch in flash, \nInstall a kernel for flash image??') + ybox = self.session.openWithCallback(self.updatekernel, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Updating ... ')) def pomoc(self): - try: - from Plugins.Extensions.NeoBoot.files.tools import Opis - - self.session.open(Opis) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + try: + from Plugins.Extensions.NeoBoot.files.tools import Opis + self.session.open(Opis) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() def ReinstallNeoBoot(self): - INSTALLbox = self.session.openWithCallback( - self.reinstallboot, - MessageBox, - _("Select Yes to reinstall the neoboot.\n NEOBOOT."), - MessageBox.TYPE_YESNO, - ) - INSTALLbox.setTitle(_("Reinstall neoboot")) + INSTALLbox = self.session.openWithCallback(self.reinstallboot, MessageBox, _('Select Yes to reinstall the neoboot.\n NEOBOOT.'), MessageBox.TYPE_YESNO) + INSTALLbox.setTitle(_('Reinstall neoboot')) def reinstallboot(self, answer): if answer is True: try: - cmd = "echo -e '\n\n%s '" % _( - "NEOBOOT - Please reinstall NeoBoot....\nPlease wait, done...\nrestart systemu..." - ) - cmd1 = ( - "cd " + - LinkNeoBoot + - '/; rm ./bin/install; rm ./.location; rm ./files/mountpoint.sh; rm ./files/neo.sh; sleep 5; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Restarting E2... "; init 4; sleep 1; init 3 ') - except BaseException: + cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Please reinstall NeoBoot....\nPlease wait, done...\nrestart systemu...') + cmd1 = 'cd ' + LinkNeoBoot + '/; rm ./bin/install; rm ./.location; rm ./files/mountpoint.sh; rm ./files/neo.sh; sleep 5; PATH=/sbin:/bin:/usr/sbin:/usr/bin; echo -n "Restarting E2... "; init 4; sleep 1; init 3 ' + except: False - self.session.open(Console, _("NeoBoot ARM...."), [cmd, cmd1]) + self.session.open(Console, _('NeoBoot ARM....'), [cmd, cmd1]) self.close() else: try: - self.session.open( - MessageBox, _("Resignation."), MessageBox.TYPE_INFO, 4 - ) + self.session.open(MessageBox, _('Resignation.'), MessageBox.TYPE_INFO, 4) self.close() - except BaseException: + except: False def close_exit(self): - try: - self.close_exit2() - except BaseException: - system("touch /tmp/.init_reboot") - self.close() - - def close_exit2(self): - system("touch /tmp/.init_reboot") - if fileExists("/tmp/error_neo"): try: - cmd = "cat /tmp/error_neo" - cmd1 = "" - self.session.openWithCallback( - self.close, Console, _("NeoBoot...."), [cmd, cmd1] - ) + self.close_exit2() + except: + system('touch /tmp/.init_reboot') + self.close() + + #if fileExists('/usr/lib/python2.7'): + #self.close_exit2() + #else: + #system('touch /tmp/.init_reboot') + #self.close() + + def close_exit2(self): + system('touch /tmp/.init_reboot') + if fileExists('/tmp/error_neo'): + try: + cmd = 'cat /tmp/error_neo' + cmd1 = '' + self.session.openWithCallback(self.close, Console, _('NeoBoot....'), [cmd, + cmd1]) self.close() - except BaseException: + except: self.close() - if ( - not fileExists("/tmp/.finishdate") - or not fileExists("/tmp/.nkod") - or fileExists("/.multinfo") - ): + if not fileExists('/tmp/.finishdate') or not fileExists('/tmp/.nkod') or fileExists('/.multinfo'): if checkInternet(): pass else: - system( - "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh" - ) - mess = _("Geen internet") - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + system('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh') + mess = _('Geen internet') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) - if not fileExists("/.multinfo"): - system("ln -sfn /sbin/init.sysvinit /sbin/init") - os.system( - 'echo "Flash" > %sImageBoot/.neonextboot' % - getNeoLocation()) + if not fileExists('/.multinfo'): + system('ln -sfn /sbin/init.sysvinit /sbin/init') + os.system('echo "Flash" > %sImageBoot/.neonextboot' % getNeoLocation() ) + #out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w') + #out.write('Flash') + #out.close() + #self.close() - elif fileExists("/.multinfo"): - with open("/.multinfo", "r") as f: + elif fileExists('/.multinfo'): + with open('/.multinfo', 'r') as f: imagefile = f.readline().strip() f.close() - out = open("%sImageBoot/.neonextboot" % getNeoLocation(), "w") + out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w') out.write(imagefile) out.close() else: - system("touch /tmp/.init_reboot") - out = open("%sImageBoot/.neonextboot" % getNeoLocation(), "w") - out.write("Flash") + system('touch /tmp/.init_reboot') + out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w') + out.write('Flash') out.close() self.close() def ReinstallKernel(self): - try: - from Plugins.Extensions.NeoBoot.files.tools import ReinstallKernel - - self.session.open(ReinstallKernel) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + try: + from Plugins.Extensions.NeoBoot.files.tools import ReinstallKernel + self.session.open(ReinstallKernel) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() def touch5(self): - if fileExists("/tmp/.testneo"): - os.system("rm -f /tmp/.testneo") - if fileExists("/usr/lib/periodon/.kodn"): + if fileExists('/tmp/.testneo'): + os.system('rm -f /tmp/.testneo') + if fileExists('/usr/lib/periodon/.kodn'): if getTestIn() == getTestOut(): - pass + pass else: - system("touch /tmp/guto") + system('touch /tmp/guto') else: - system("touch /tmp/guto") + system('touch /tmp/guto') def touch7(self): - if fileExists("/usr/lib/periodon/.kodn"): + if fileExists('/usr/lib/periodon/.kodn'): pass else: - if not fileExists("/tmp/guto"): + if not fileExists('/tmp/guto'): pass else: - system("touch /tmp/gutos") + system('touch /tmp/gutos') def touch6(self): - if fileExists("/usr/lib/periodon/.kodn"): + if fileExists('/usr/lib/periodon/.kodn'): pass else: - if not fileExists("/tmp/gutos"): + if not fileExists('/tmp/gutos'): pass else: - system("touch /tmp/gutosi") + system('touch /tmp/gutosi') def touch4(self): - if fileExists("/usr/lib/periodon/.kodn"): + if fileExists('/usr/lib/periodon/.kodn'): pass else: - if not fileExists("/tmp/gutosi"): + if not fileExists('/tmp/gutosi'): pass else: - if not fileExists("/usr/lib/periodon"): - system("mkdir /usr/lib/periodon") + if not fileExists('/usr/lib/periodon'): + system('mkdir /usr/lib/periodon') else: - if getButtonPin() == "pinok": - os.system( - "sleep 2; rm -f /tmp/gut*; date %s > /usr/lib/periodon/.accessdate" % - UPDATEDATE) - if fileExists("/usr/lib/periodon/.accessdate") and fileExists( - "/usr/lib/periodon/.kodn" - ): - restartbox = self.session.openWithCallback( - self.GUIRestart, - MessageBox, - _("Bravo! Neoboot vip full version activated OK!\nPlease restart your system E2."), - MessageBox.TYPE_YESNO, - 10, - ) - restartbox.setTitle(_("Restart GUI now !!")) - elif not fileExists("/usr/lib/periodon/.accessdate"): - mess = _( - "VIP Access Activation Fails with Error code 0x10." - ) - self.session.open( - MessageBox, mess, MessageBox.TYPE_INFO) - elif not fileExists("/usr/lib/periodon/.kodn"): - mess = _( - "VIP Access Activation Fails with Error code 0x20." - ) - self.session.open( - MessageBox, mess, MessageBox.TYPE_INFO) + if getButtonPin() == 'pinok': + os.system('sleep 2; rm -f /tmp/gut*; date %s > /usr/lib/periodon/.accessdate' % UPDATEDATE) + if fileExists('/usr/lib/periodon/.accessdate') and fileExists('/usr/lib/periodon/.kodn'): + restartbox = self.session.openWithCallback(self.GUIRestart, MessageBox, _('Bravo! Neoboot vip full version activated OK!\nPlease restart your system E2.'), MessageBox.TYPE_YESNO, 10) + restartbox.setTitle(_('Restart GUI now !!')) + elif not fileExists('/usr/lib/periodon/.accessdate'): + mess = _('VIP Access Activation Fails with Error code 0x10.') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + elif not fileExists('/usr/lib/periodon/.kodn'): + mess = _('VIP Access Activation Fails with Error code 0x20.') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) def touch9(self): - if fileExists("/usr/lib/periodon/.kodn"): - system("touch /tmp/gut1") + if fileExists('/usr/lib/periodon/.kodn'): + system('touch /tmp/gut1') else: - if not fileExists("/tmp/gutosie"): + if not fileExists('/tmp/gutosie'): pass else: - system("touch /tmp/gutosiep") + system('touch /tmp/gutosiep') def touch8(self): - if fileExists("/usr/lib/periodon/.kodn"): - system("touch /tmp/gut2") + if fileExists('/usr/lib/periodon/.kodn'): + system('touch /tmp/gut2') else: - if not fileExists("/tmp/gutosiep"): + if not fileExists('/tmp/gutosiep'): pass else: - system("touch /tmp/gutosiepi") + system('touch /tmp/gutosiepi') def touch0(self): - if fileExists("/usr/lib/periodon/.kodn"): - if not fileExists("/tmp/gut3"): - system("touch /tmp/gut3") - elif fileExists("/tmp/gut3"): - system( - "rm -f /tmp/gut*; rm -f /usr/lib/periodon/.kodn; rm -f /usr/lib/periodon/.accessdate; rm -f /tmp/.finishdate; rm -f /tmp/.nkod" - ) - restartbox = self.session.openWithCallback( - self.GUIRestart, - MessageBox, - _("Bravo - pin code removed!\nPlease re-enter your pin code."), - MessageBox.TYPE_YESNO, - 10, - ) - restartbox.setTitle(_("Restart GUI now !!")) + if fileExists('/usr/lib/periodon/.kodn'): + if not fileExists('/tmp/gut3'): + system('touch /tmp/gut3') + elif fileExists('/tmp/gut3'): + system('rm -f /tmp/gut*; rm -f /usr/lib/periodon/.kodn; rm -f /usr/lib/periodon/.accessdate; rm -f /tmp/.finishdate; rm -f /tmp/.nkod') + restartbox = self.session.openWithCallback(self.GUIRestart, MessageBox, _('Bravo - pin code removed!\nPlease re-enter your pin code.'), MessageBox.TYPE_YESNO, 10) + restartbox.setTitle(_('Restart GUI now !!')) else: pass else: - if not fileExists("/tmp/gutosiepi"): + if not fileExists('/tmp/gutosiepi'): pass else: - system("touch /tmp/gutosiepin") + system('touch /tmp/gutosiepin') def GUIRestart(self, answer): if answer is True: self.session.open(TryQuitMainloop, 3) else: self.close() + +# def neoboot_update(self): +# mess = _('Updated unnecessary, you have the latest version. Please try again later.') +# self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + + #Zablokowanie aktualizacji przez zmiane nazwy neoboot_update na neoboot_update2 i likwidacja 3 lini hastagu wyzej def neoboot_update(self): if checkInternet(): - if fileExists("/.multinfo"): - mess = _("Downloading available only from the image Flash.") - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + #if getTestInTime() == getTestOutTime() or getTestIn() != getTestOut(): + #myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button.') + #self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) + #else: + if fileExists('/.multinfo'): + mess = _('Downloading available only from the image Flash.') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) else: - out = open("%sImageBoot/.neonextboot" % getNeoLocation(), "w") - out.write("Flash") - out.close() - message = _("\n\n\n") - message += _( - "WARNING !: The update brings with it the risk of errors.\n" - ) - message += _( - "Before upgrading it is recommended that you make a backup NeoBoot.\n" - ) - message += _("Do you want to run the update now ?\n") - message += _("\n") - message += _("Select Yes to do update\n") - message += _("\n") - message += _("Select No to do backup\n") - message += _("\n") - ybox = self.session.openWithCallback( - self.chackupdate2, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_("The download neoboot update.")) + out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w') + out.write('Flash') + out.close() + message = _('\n\n\n') + message += _('WARNING !: The update brings with it the risk of errors.\n') + message += _('Before upgrading it is recommended that you make a backup NeoBoot.\n') + message += _('Do you want to run the update now ?\n') + message += _('\n') + message += _('Select Yes to do update\n') + message += _('\n') + message += _('Select No to do backup\n') + message += _('\n') + ybox = self.session.openWithCallback(self.chackupdate2, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('The download neoboot update.')) else: - mess = _("Geen internet") - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + mess = _('Geen internet') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) def chackupdate2(self, yesno): if yesno: self.chackupdate3() else: from Plugins.Extensions.NeoBoot.files.tools import BackupMultiboot - - self.session.open(BackupMultiboot) + self.session.open(BackupMultiboot) + #self.session.open(MessageBox, _('Canceled update.'), MessageBox.TYPE_INFO, 7) def chackupdate3(self): - if fileExists("/usr/bin/curl"): - os.system( - "cd " + - LinkNeoBoot + - ";curl -O --ftp-ssl -k https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt;sleep 3;cd /") - if not fileExists("" + LinkNeoBoot + "/ver.txt"): - if fileExists("/usr/bin/wget"): - os.system( - "cd " + - LinkNeoBoot + - ";wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; sleep 3;cd /") - if not fileExists("" + LinkNeoBoot + "/ver.txt"): - if fileExists("/usr/bin/fullwget"): - os.system( - "cd " + - LinkNeoBoot + - ";fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; sleep 3;cd /") - 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, - ) + if fileExists('/usr/bin/curl'): + os.system('cd ' + LinkNeoBoot + ';curl -O --ftp-ssl -k https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt;sleep 3;cd /') + if not fileExists('' + LinkNeoBoot + '/ver.txt'): + if fileExists('/usr/bin/wget'): + os.system('cd ' + LinkNeoBoot + ';wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; sleep 3;cd /') + if not fileExists('' + LinkNeoBoot + '/ver.txt'): + if fileExists('/usr/bin/fullwget'): + os.system('cd ' + LinkNeoBoot + ';fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; sleep 3;cd /') + 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: - 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, - ) + 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: - if fileExists("/.multinfo"): - self.myClose( - _("Sorry, Neoboot can be installed or upgraded only when booted from Flash")) + if fileExists('/.multinfo'): + self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) self.close() else: - os.system("touch /tmp/.upneo; rm -r /tmp/.*") - if fileExists("/usr/bin/curl"): - cmd1 = "curl -kLs -k https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh|sh" - self.session.open(Console, _("NeoBoot...."), [cmd1]) - self.close() - elif fileExists("/usr/bin/wget"): - cmd1 = "cd /tmp; rm ./*.sh; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh;chmod 755 ./iNB.sh;sh ./iNB.sh; rm ./iNB.sh; cd /" - self.session.open(Console, _("NeoBoot...."), [cmd1]) - self.close() - elif fileExists("/usr/bin/fullwget"): - cmd1 = "cd /tmp; rm ./*.sh; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh;chmod 755 ./iNB.sh;sh ./iNB.sh; rm ./iNB.sh; cd /" - self.session.open(Console, _("NeoBoot...."), [cmd1]) - self.close() + os.system('touch /tmp/.upneo; rm -r /tmp/.*') + if fileExists('/usr/bin/curl'): + cmd1 = 'curl -kLs -k https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh|sh' + self.session.open(Console, _('NeoBoot....'), [cmd1]) + self.close() + elif fileExists('/usr/bin/wget'): + cmd1 = 'cd /tmp; rm ./*.sh; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh;chmod 755 ./iNB.sh;sh ./iNB.sh; rm ./iNB.sh; cd /' + self.session.open(Console, _('NeoBoot....'), [cmd1]) + self.close() + elif fileExists('/usr/bin/fullwget'): + cmd1 = 'cd /tmp; rm ./*.sh; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh;chmod 755 ./iNB.sh;sh ./iNB.sh; rm ./iNB.sh; cd /' + self.session.open(Console, _('NeoBoot....'), [cmd1]) + self.close() else: - self.session.open( - MessageBox, - _("Unfortunately, at the moment not found an update, try again later."), - MessageBox.TYPE_INFO, - 10, - ) + self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 10) else: - os.system("rm -f " + LinkNeoBoot + "/ver.txt") - self.session.open( - MessageBox, - _("The update has been canceled."), - MessageBox.TYPE_INFO, - 8) + os.system('rm -f ' + LinkNeoBoot + '/ver.txt') + self.session.open(MessageBox, _('The update has been canceled.'), MessageBox.TYPE_INFO, 8) def MBBackup(self): - try: - from Plugins.Extensions.NeoBoot.files.tools import MBBackup - - self.session.open(MBBackup) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + try: + from Plugins.Extensions.NeoBoot.files.tools import MBBackup + self.session.open(MBBackup) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() def MBRestore(self): - try: - from Plugins.Extensions.NeoBoot.files.tools import MBRestore - - self.session.open(MBRestore) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + try: + from Plugins.Extensions.NeoBoot.files.tools import MBRestore + self.session.open(MBRestore) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() def updateList(self): self.list = [] - pluginpath = "" + LinkNeoBoot + "" - f = open(pluginpath + "/.location", "r") + pluginpath = '' + LinkNeoBoot + '' + f = open(pluginpath + '/.location', 'r') mypath = f.readline().strip() f.close() - icon = "dev_usb.png" - if "card" in mypath or "sd" in mypath: - icon = "dev_sd.png" - elif "ntfs" in mypath: - icon = "dev_sd.png" - elif "hdd" in mypath: - icon = "dev_hdd.png" - elif "cf" in mypath: - icon = "dev_cf.png" - elif "ssd" in mypath: - icon = "dev_ssd.png" + icon = 'dev_usb.png' + if 'card' in mypath or 'sd' in mypath: + icon = 'dev_sd.png' + elif 'ntfs' in mypath: + icon = 'dev_sd.png' + elif 'hdd' in mypath: + icon = 'dev_hdd.png' + elif 'cf' in mypath: + icon = 'dev_cf.png' + elif 'ssd' in mypath: + icon = 'dev_ssd.png' - icon = pluginpath + "/images/" + icon + icon = pluginpath + '/images/' + icon png = LoadPixmap(icon) - self["device_icon"].instance.setPixmap(png) - linesdevice = open("" + LinkNeoBoot + "/.location", "r").readlines() + self['device_icon'].instance.setPixmap(png) + linesdevice = open('' + LinkNeoBoot + '/.location', 'r').readlines() deviceneo = linesdevice[0][0:-1] device = deviceneo - ustot = usfree = usperc = "" - rc = system("df > /tmp/memoryinfo.tmp") - if fileExists("/tmp/memoryinfo.tmp"): - f = open("/tmp/memoryinfo.tmp", "r") + ustot = usfree = usperc = '' + rc = system('df > /tmp/memoryinfo.tmp') + if fileExists('/tmp/memoryinfo.tmp'): + f = open('/tmp/memoryinfo.tmp', 'r') for line in f.readlines(): - line = line.replace("part1", " ") + line = line.replace('part1', ' ') parts = line.strip().split() totsp = len(parts) - 1 if parts[totsp] == device: @@ -2137,253 +1293,183 @@ class NeoBootImageChoose(Screen): usfree = parts[3] usperc = parts[4] else: - ustot = "N/A " + ustot = 'N/A ' usfree = parts[2] usperc = parts[3] break f.close() - os.remove("/tmp/memoryinfo.tmp") + os.remove('/tmp/memoryinfo.tmp') - try: + try: perc = int(usperc[0:-1]) - except BaseException: + except: perc = int() # jak czasami robi error to odhaszowac i zahaszowac wyzej - self["progreso"].setValue(perc) - green = "#00389416" - red = "#00ff2525" - yellow = "#00ffe875" - orange = "#00ff7f50" + self['progreso'].setValue(perc) + green = '#00389416' + red = '#00ff2525' + yellow = '#00ffe875' + orange = '#00ff7f50' if perc < 30: - color = green + color = green elif perc < 60: - color = yellow + color = yellow elif perc < 80: - color = orange + color = orange else: - color = red + color = red try: from skin import parseColor - - self["label13"].instance.setForegroundColor(parseColor(color)) - self["label15"].instance.setForegroundColor(parseColor(color)) - self["progreso"].instance.setForegroundColor(parseColor(color)) - except BaseException: + self['label13'].instance.setForegroundColor(parseColor(color)) + self['label15'].instance.setForegroundColor(parseColor(color)) + self['progreso'].instance.setForegroundColor(parseColor(color)) + except: pass self.availablespace = usfree[0:-3] - strview = _("Used: ") + usperc + \ - _(" \n Available: ") + usfree[0:-3] + " MB" - self["label3"].setText(strview) + strview = _('Used: ') + usperc + _(' \n Available: ') + usfree[0:-3] + ' MB' + self['label3'].setText(strview) - strview2 = _("Free Space : ") + usfree[0:-3] + " MB" - self["label11"].setText(strview2) + strview2 = _('Free Space : ') + usfree[0:-3] + ' MB' + self['label11'].setText(strview2) - strview1 = _("Capacity : ") + usperc + _(" Full") - self["label18"].setText(strview1) + strview1 = _('Capacity : ') + usperc + _(' Full') + self['label18'].setText(strview1) try: - f2 = open("%sImageBoot/.neonextboot" % getNeoLocation(), "r") + f2 = open('%sImageBoot/.neonextboot', 'r' % getNeoLocation()) mypath2 = f2.readline().strip() f2.close() - except BaseException: - mypath2 = "Flash" + except: + mypath2 = 'Flash' - if mypath2 == "Flash": + if mypath2 == 'Flash': image = getImageDistroN() - writefile = open("%sImageBoot/.Flash" % getNeoLocation(), "w") + writefile = open('%sImageBoot/.Flash' % getNeoLocation(), 'w') writefile.write(image) writefile.close() - image = " [" + image + "]" - self.list.append("Flash" + image) + image = ' [' + image + ']' + self.list.append('Flash' + image) - elif fileExists("%sImageBoot/.Flash" % getNeoLocation()): - f = open("%sImageBoot/.Flash" % getNeoLocation(), "r") + elif fileExists('%sImageBoot/.Flash' % getNeoLocation()): + f = open('%sImageBoot/.Flash', 'r' % getNeoLocation()) image = f.readline().strip() f.close() - image = " [" + image + "]" - self.list.append("Flash" + image) - self["label5"].setText(mypath) + image = ' [' + image + ']' + self.list.append('Flash' + image) + self['label5'].setText(mypath) - if fileExists("/.multinfo"): - f2 = open("/.multinfo", "r") + if fileExists('/.multinfo'): + f2 = open('/.multinfo', 'r') mypath3 = f2.readline().strip() f2.close() - self["label6"].setText(mypath3) + self['label6'].setText(mypath3) else: - f2 = open("%sImageBoot/.neonextboot" % getNeoLocation(), "r") + f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') mypath3 = f2.readline().strip() f2.close() - self["label6"].setText(mypath3) + self['label6'].setText(mypath3) - mypath = "%sImageBoot" % getNeoLocation() + # Retrieve the list of images and ignore the "Flash" image + mypath = ('%sImageBoot' % getNeoLocation()) myimages = listdir(mypath) - self.list = [ - fil - for fil in myimages - if os.path.isdir(os.path.join(mypath, fil)) and fil != "Flash" - ] # Ignore the "Flash" image + self.list = [fil for fil in myimages if os.path.isdir(os.path.join(mypath, fil)) and fil != 'Flash'] # Ignore the "Flash" image + # Sort the list before setting it to config (case-insensitive) self.list = sorted(self.list, key=lambda x: x.lower()) - if fileExists("%sImageBoot/.Flash" % getNeoLocation()): - f = open("%sImageBoot/.Flash" % getNeoLocation(), "r") + # Add the "Flash [egami]" image to the list + if fileExists('%sImageBoot/.Flash' % getNeoLocation()): + f = open('%sImageBoot/.Flash' % getNeoLocation(), 'r') image = f.readline().strip() f.close() - image = " [" + image + "]" - self.list.insert(0, "Flash" + image) + image = ' [' + image + ']' + self.list.insert(0, 'Flash' + image) # Insert the "Flash" image at the beginning of the list - self["config"].setList(self.list) + self['config'].setList(self.list) - self["label7"].setText(str(len(self.list) - 1)) - self["config"].setList(self.list) + self['label7'].setText(str(len(self.list) - 1)) + self['config'].setList(self.list) strview = PLUGINVERSION - self["label9"].setText(strview) + self['label9'].setText(strview) KERNELVERSION = getKernelImageVersion() strview = KERNELVERSION - self["label20"].setText(strview) + self['label20'].setText(strview) - self["label17"].setText(readline("/etc/hostname")) - self["label19"].setText( - readline( - "%sImagesUpload/.kernel/used_flash_kernel" % - getNeoLocation())) + self['label17'].setText(readline('/etc/hostname')) + self['label19'].setText(readline('%sImagesUpload/.kernel/used_flash_kernel' % getNeoLocation())) strview = UPDATEVERSION - self["label10"].setText(strview) + self['label10'].setText(strview) def mytools(self): - if getCheckActivateVip() == getBoxMacAddres() and fileExists( - "/usr/lib/periodon/.kodn" - ): - try: - from Plugins.Extensions.NeoBoot.files.tools import MBTools - - self.session.open(MBTools) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() - elif not fileExists("/.multinfo"): - if getTestIn() == getTestOut(): - if ("1234%s" % getTestToTest()) == getAccessN(): - if (getSupportedTuners()) == (getBoxHostName()): + if getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn'): try: from Plugins.Extensions.NeoBoot.files.tools import MBTools - self.session.open(MBTools) except Exception as e: loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() + elif not fileExists('/.multinfo'): + if getTestIn() == getTestOut() : + if ('1234%s' % getTestToTest()) == getAccessN(): + if (getSupportedTuners()) == (getBoxHostName()): + try: + from Plugins.Extensions.NeoBoot.files.tools import MBTools + self.session.open(MBTools) + #except: + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) self.CRASHlogNeo() else: - mess = _("Sorry cannot open neo menu. Open Error Menu.") - self.session.open( - MessageBox, mess, MessageBox.TYPE_INFO) + mess = _('Sorry cannot open neo menu. Open Error Menu.') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) else: - myerror = _( - "Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button." - ) - self.session.open( - MessageBox, myerror, MessageBox.TYPE_INFO) + myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button.') + self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) else: - myerror = _( - "Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button or try to update." - ) - myerror += _("\nVIP - Try entering the pin code again.") + myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button or try to update.') + myerror += _('\nVIP - Try entering the pin code again.') self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) else: - try: - from Plugins.Extensions.NeoBoot.files.tools import MBTools - - self.session.open(MBTools) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + try: + from Plugins.Extensions.NeoBoot.files.tools import MBTools + self.session.open(MBTools) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() def removeIMG(self): - self.mysel = self["config"].getCurrent() - if "Flash" in self.mysel: - self.mysel = "Flash" + self.mysel = self['config'].getCurrent() + if 'Flash' in self.mysel: + self.mysel = 'Flash' if self.mysel: - f = open("%sImageBoot/.neonextboot" % getNeoLocation(), "r") + f = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') mypath = f.readline().strip() f.close() try: - if fileExists("/.multinfo"): - self.session.open( - MessageBox, - _("Sorry you can delete only from the image Flash."), - MessageBox.TYPE_INFO, - 5, - ) - elif self.mysel == "Flash": - self.session.open( - MessageBox, - _("Sorry you cannot delete Flash image"), - MessageBox.TYPE_INFO, - 5, - ) + if fileExists('/.multinfo'): + self.session.open(MessageBox, _('Sorry you can delete only from the image Flash.'), MessageBox.TYPE_INFO, 5) + elif self.mysel == 'Flash': + self.session.open(MessageBox, _('Sorry you cannot delete Flash image'), MessageBox.TYPE_INFO, 5) elif mypath == self.mysel: - self.session.open( - MessageBox, - _("Sorry you cannot delete the image currently booted from."), - MessageBox.TYPE_INFO, - 5, - ) + self.session.open(MessageBox, _('Sorry you cannot delete the image currently booted from.'), MessageBox.TYPE_INFO, 5) else: - out = open( - "%sImageBoot/.neonextboot" % - getNeoLocation(), "w") - out.write("Flash") + out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w') + out.write('Flash') out.close() - message = ( - _("Delete the selected image - ") + - self.mysel + - _("\nDelete ?")) - ybox = self.session.openWithCallback( - self.RemoveIMAGE, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_("Delete Confirmation")) - except BaseException: + message = _('Delete the selected image - ') + self.mysel + _('\nDelete ?') + ybox = self.session.openWithCallback(self.RemoveIMAGE, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Delete Confirmation')) + except: print("no image to remove") else: @@ -2391,185 +1477,111 @@ class NeoBootImageChoose(Screen): def up(self): self.list = [] - self["config"].setList(self.list) + self['config'].setList(self.list) self.updateList() def up2(self): try: self.list = [] - self["config"].setList(self.list) + self['config'].setList(self.list) self.updateList() - except BaseException: + except: print(" ") def RemoveIMAGE(self, yesno): if yesno: cmd = _("echo -e 'Deleting in progress...\n'") - cmd1 = "chattr -i %sImageBoot/" % getNeoLocation() + self.mysel - if fileExists( - "%sImageBoot/" % getNeoLocation() - + self.mysel - + "/usr/lib/periodon/.activatedmac" - ): - cmd2 = ( - "chattr -i %sImageBoot/" % getNeoLocation() - + self.mysel - + "/usr/lib/periodon/.activatedmac" - ) - if fileExists( - "%sImageBoot/" % getNeoLocation() - + self.mysel - + "" - + LinkNeoBoot - + "/plugin.py" - ): - cmd3 = ( - "chattr -i %sImageBoot/ " % getNeoLocation() - + self.mysel - + "" - + LinkNeoBoot - + "/plugin.py" - ) - if fileExists( - "%sImageBoot/" % getNeoLocation() - + self.mysel - + "" - + LinkNeoBoot - + "/plugin.pyo" - ): - cmd4 = ( - "chattr -i %sImageBoot > /dev/null 2>&1/" % - getNeoLocation() + - self.mysel + - "" + - LinkNeoBoot + - "/plugin.pyo") - cmd5 = "rm -r %sImageBoot/" % getNeoLocation() + self.mysel - self.session.openWithCallback(self.up, Console, _( - "NeoBoot: Deleting Image"), [cmd, cmd1, cmd5]) + cmd1 = 'chattr -i %sImageBoot/' % getNeoLocation() + self.mysel + if fileExists('%sImageBoot/' % getNeoLocation() + self.mysel + '/usr/lib/periodon/.activatedmac'): + cmd2 = 'chattr -i %sImageBoot/' % getNeoLocation() + self.mysel + '/usr/lib/periodon/.activatedmac' + if fileExists('%sImageBoot/' % getNeoLocation() + self.mysel + '' + LinkNeoBoot +'/plugin.py'): + cmd3 = 'chattr -i %sImageBoot/ ' % getNeoLocation() + self.mysel + '' + LinkNeoBoot +'/plugin.py' + if fileExists('%sImageBoot/' % getNeoLocation() + self.mysel + '' + LinkNeoBoot +'/plugin.pyo'): + cmd4 = 'chattr -i %sImageBoot > /dev/null 2>&1/' % getNeoLocation() + self.mysel + '' + LinkNeoBoot +'/plugin.pyo' + cmd5 = 'rm -r %sImageBoot/' % getNeoLocation() + self.mysel + self.session.openWithCallback(self.up, Console, _('NeoBoot: Deleting Image'), [cmd, cmd1, cmd5]) else: - self.session.open( - MessageBox, - _("Removing canceled!"), - MessageBox.TYPE_INFO) + self.session.open(MessageBox, _('Removing canceled!'), MessageBox.TYPE_INFO) def ImageInstall(self): - if getCheckActivateVip() == getBoxMacAddres() and fileExists( - "/usr/lib/periodon/.kodn" - ): - self.ImageInstallTestOK() - elif not fileExists("/.multinfo"): - if ("1234%s" % getTestToTest()) != getAccessN(): + if getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn'): + self.ImageInstallTestOK() + elif not fileExists('/.multinfo'): + if ('1234%s' % getTestToTest()) != getAccessN(): count = 0 - for fn in listdir("" + getNeoLocation() + "/ImageBoot"): - dirfile = "" + getNeoLocation() + "/ImageBoot/" + fn + for fn in listdir('' + getNeoLocation() + '/ImageBoot'): + dirfile = '' + getNeoLocation() + '/ImageBoot/' + fn if os_isdir(dirfile): count = count + 1 if count > 1: - myerror = _( - "Sorry, you can install up to 2 images, this is not neoboot vip version.\nGet unlimited image installations in VIP version" - ) - self.session.open( - MessageBox, myerror, MessageBox.TYPE_INFO) + myerror = _('Sorry, you can install up to 2 images, this is not neoboot vip version.\nGet unlimited image installations in VIP version') + self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) elif int(self.availablespace) < 500: - myerror = _( - "Not enough free space on /media/ !!\nYou need at least 500Mb free space.\n\nExit plugin." - ) - self.session.open( - MessageBox, myerror, MessageBox.TYPE_INFO) + myerror = _('Not enough free space on /media/ !!\nYou need at least 500Mb free space.\n\nExit plugin.') + self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) else: - self.ImageInstallTestOK() + self.ImageInstallTestOK() else: - if ( - getTestIn() == getTestOut() - and getCheckActivateVip() == getBoxMacAddres() - ): + if getTestIn() == getTestOut() and getCheckActivateVip() == getBoxMacAddres(): self.ImageInstallTestOK() else: - myerror = _( - "Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button or try to update." - ) - self.session.open( - MessageBox, myerror, MessageBox.TYPE_INFO) + myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button or try to update.') + self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) else: - self.ImageInstallTestOK() + self.ImageInstallTestOK() def ImageInstallTestOK(self): - if int(self.availablespace) < 500: - myerror = _( - "Not enough free space on /media/ !!\nYou need at least 500Mb free space.\n\nExit plugin." - ) - self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) - else: - if (getSupportedTuners()) == (getBoxHostName()): - try: - self.GOImageInstall() - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + if int(self.availablespace) < 500: + myerror = _('Not enough free space on /media/ !!\nYou need at least 500Mb free space.\n\nExit plugin.') + self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) else: - mess = _( - "Your receiver is not on the list of supported tuners.\nAccess stb error." - ) - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + if (getSupportedTuners()) == (getBoxHostName()): + try: + self.GOImageInstall() + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() + else: + mess = _('Your receiver is not on the list of supported tuners.\nAccess stb error.') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) def GOImageInstall(self): - if fileExists("/.multinfo"): - message = _( - "Installing new neoboot software, only recommended from Flash!!!\n---Continue ?---" - ) - ybox = self.session.openWithCallback( - self.installation_image, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_("Installation")) + if fileExists('/.multinfo'): + message = _('Installing new neoboot software, only recommended from Flash!!!\n---Continue ?---') + ybox = self.session.openWithCallback(self.installation_image, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Installation')) else: - message = _("Installation from Flash!!!\n---Continue ?---") - ybox = self.session.openWithCallback( - self.installation_image, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_("Installation new image. ")) + message = _('Installation from Flash!!!\n---Continue ?---') + ybox = self.session.openWithCallback(self.installation_image, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Installation new image. ')) def installation_image(self, yesno): if yesno: - self.extractImage() + self.extractImage() else: - self.messagebox = self.session.open( - MessageBox, - _("It is recommended to install new software only from a flash system.\n---NEOBOOT EXIT---"), - MessageBox.TYPE_INFO, - 10, - ) - self.close() + self.messagebox = self.session.open(MessageBox, _('It is recommended to install new software only from a flash system.\n---NEOBOOT EXIT---'), MessageBox.TYPE_INFO, 10) + self.close() def extractImage(self): - if fileExists("%sImageBoot/.without_copying" % getNeoLocation()): - system("rm -f %sImageBoot/.without_copying" % getNeoLocation()) + if fileExists('%sImageBoot/.without_copying' % getNeoLocation()): + system('rm -f %sImageBoot/.without_copying' % getNeoLocation()) - if not os.path.exists("%sImagesUpload" % getNeoLocation()): - system("mkdir %sImagesUpload" % getNeoLocation()) + if not os.path.exists('%sImagesUpload' % getNeoLocation()): + system('mkdir %sImagesUpload' % getNeoLocation()) images = False - myimages = listdir("%sImagesUpload" % getNeoLocation()) + myimages = listdir('%sImagesUpload' % getNeoLocation()) print(myimages) for fil in myimages: if fil.endswith(".zip"): images = True break - if os.path.exists("%sImagesUpload/*zip" % getNeoLocation()): + if os.path.exists('%sImagesUpload/*zip' % getNeoLocation()): images = True break - if os.path.exists("%sImagesUpload/*.tar.bz2" % getNeoLocation()): + if os.path.exists('%sImagesUpload/*.tar.bz2' % getNeoLocation()): images = True break if fil.endswith(".tar.xz"): @@ -2580,7 +1592,7 @@ class NeoBootImageChoose(Screen): break if fil.endswith(".tar.gz"): images = True - break + break if fil.endswith(".nfi"): images = True break @@ -2589,233 +1601,133 @@ class NeoBootImageChoose(Screen): if images is True: self.ImageTrue() else: - self.DownloaderImage() + self.DownloaderImage() def ImageTrue(self): - try: - from Plugins.Extensions.NeoBoot.unpack import InstallImage - - self.session.open(InstallImage) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - os.system( - 'echo "Cannot open command, error in line ^:" >> ' - + getNeoLocation() - + "ImageBoot/neoboot.log" - ) - showlog = "cat " + getNeoLocation() + "ImageBoot/neoboot.log" - self.session.openWithCallback( - self.close, Console, _("NeoBoot ERROR !!!"), [showlog] - ) + try: + from Plugins.Extensions.NeoBoot.unpack import InstallImage + self.session.open(InstallImage) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + os.system('echo "Cannot open command, error in line ^:" >> ' + getNeoLocation() + 'ImageBoot/neoboot.log') + showlog = 'cat ' + getNeoLocation() + 'ImageBoot/neoboot.log' + self.session.openWithCallback(self.close, Console, _('NeoBoot ERROR !!!'), [showlog]) def DownloaderImage(self): - if not os.path.exists( - "/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py" - ): - message = ( - _("The %sImagesUpload directory is EMPTY!!!\nInstall the plugin to download new image online ?\n --- Continue? ---") % - getNeoLocation()) - ybox = self.session.openWithCallback( - self.ImageDownloader, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_("Installation")) - elif not fileExists("/usr/lib/python2.7") and fileExists("/.multinfo"): - self.session.open( - MessageBox, - _("Sorry, cannot open neo menu install image."), - type=MessageBox.TYPE_ERROR, - ) - else: - message = ( - _("Catalog %sImagesUpload directory is empty\nPlease upload the image files in zip or nfi formats to install") % - getNeoLocation()) - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + if not os.path.exists('/usr/lib/enigma2/python/Plugins/Extensions/ImageDownloader/download.py'): + message = (_('The %sImagesUpload directory is EMPTY!!!\nInstall the plugin to download new image online ?\n --- Continue? ---') % getNeoLocation()) + ybox = self.session.openWithCallback(self.ImageDownloader, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Installation')) + elif not fileExists('/usr/lib/python2.7') and fileExists('/.multinfo'): + self.session.open(MessageBox, _('Sorry, cannot open neo menu install image.'), type=MessageBox.TYPE_ERROR) + else: + message = (_('Catalog %sImagesUpload directory is empty\nPlease upload the image files in zip or nfi formats to install') % getNeoLocation()) + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) def ImageDownloader(self, yesno): if checkInternet(): if yesno: - cmd = "mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk" + cmd = 'mkdir /tmp/install; touch /tmp/install/plugin.txt; rm -rf /tmp/*.ipk' system(cmd) - if fileExists("/usr/bin/fullwget"): - os.system( - "cd /tmp; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ImageDownloader.tar.gz" - ) - if not fileExists("/tmp/ImageDownloader.tar.gz"): - if fileExists("/usr/bin/curl"): - os.system( - "sync; cd /tmp; curl -O --ftp-ssl -k https://raw.githubusercontent.com/gutosie/neoboot/master/ImageDownloader.tar.gz" - ) - if not fileExists("/tmp/ImageDownloader.tar.gz"): - if fileExists("/usr/bin/wget"): - os.system( - "cd /tmp;rm ./*.zip; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ImageDownloader.tar.gz" - ) - if not fileExists("/tmp/ImageDownloader.tar.gz"): - self.session.open( - MessageBox, - _("Unfortunately, at the moment not found an update, try again later."), - MessageBox.TYPE_INFO, - 10, - ) + if fileExists('/usr/bin/fullwget'): + os.system('cd /tmp; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ImageDownloader.tar.gz') + if not fileExists('/tmp/ImageDownloader.tar.gz'): + if fileExists('/usr/bin/curl'): + os.system('sync; cd /tmp; curl -O --ftp-ssl -k https://raw.githubusercontent.com/gutosie/neoboot/master/ImageDownloader.tar.gz') + if not fileExists('/tmp/ImageDownloader.tar.gz'): + if fileExists('/usr/bin/wget'): + os.system('cd /tmp;rm ./*.zip; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ImageDownloader.tar.gz') + if not fileExists('/tmp/ImageDownloader.tar.gz'): + self.session.open(MessageBox, _('Unfortunately, at the moment not found an update, try again later.'), MessageBox.TYPE_INFO, 10) else: - cmd2 = "/bin/tar -xzvf /tmp/ImageDownloader.tar.gz -C /" + cmd2 = '/bin/tar -xzvf /tmp/ImageDownloader.tar.gz -C /' system(cmd2) - self.session.open( - MessageBox, - _("The plug-in has been successfully installed."), - MessageBox.TYPE_INFO, - 5, - ) + self.session.open(MessageBox, _('The plug-in has been successfully installed.'), MessageBox.TYPE_INFO, 5) self.close() else: - mess = ( - _("Directory %sImagesUpload is empty\nPlease upload the image files in zip or nfi formats to install") % - getNeoLocation()) + mess = (_('Directory %sImagesUpload is empty\nPlease upload the image files in zip or nfi formats to install') % getNeoLocation()) self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) else: - mess = _("Geen internet") - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + mess = _('Geen internet') + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) def bootIMG(self): if getCheckActivateVip() == getBoxMacAddres(): - self.bootIMG2() - elif not fileExists("/.multinfo"): - if ("1234%s" % getTestToTest()) == getAccessN(): + self.bootIMG2() + elif not fileExists('/.multinfo'): + if ('1234%s' % getTestToTest()) == getAccessN(): self.bootIMG2() else: count = 0 - for fn in listdir("" + getNeoLocation() + "/ImageBoot"): - dirfile = "" + getNeoLocation() + "/ImageBoot/" + fn + for fn in listdir('' + getNeoLocation() + '/ImageBoot'): + dirfile = '' + getNeoLocation() + '/ImageBoot/' + fn if os_isdir(dirfile): count = count + 1 if count > 1: - myerror = _( - "Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button." - ) - self.session.open( - MessageBox, myerror, MessageBox.TYPE_INFO) + myerror = _('Sorry, this is not neoboot vip version.\nGet NEO-VIP version, more info press blue button.') + self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) else: - self.bootIMG2() + self.bootIMG2() else: - self.bootIMG2() - + self.bootIMG2() + def bootIMG2(self): - self.mysel = self["config"].getCurrent() - if "Flash" in self.mysel: - self.mysel = "Flash" - if self.mysel: - out = open("" + getNeoLocation() + "ImageBoot/.neonextboot", "w") - out.write(self.mysel) - out.close() + self.mysel = self['config'].getCurrent() + if 'Flash' in self.mysel: + self.mysel = 'Flash' + if self.mysel: + out = open('' + getNeoLocation() + 'ImageBoot/.neonextboot', 'w') + out.write(self.mysel) + out.close() - if getImageNeoBoot() != "Flash": - if not fileExists( - "%sImageBoot/%s/.control_ok" % - (getNeoLocation(), getImageNeoBoot())): - message = _( - "After successful launch of the selected software\nyou must run the neoboot plugin\nif the software does not start or neoboot is not confirmed\nthe system will return to the internal flash memory\n\nPress OK or exit on the remote control to continue..." - ) - ybox = self.session.openWithCallback( - self.StartReboot, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_("First start of software")) - else: - try: - from Plugins.Extensions.NeoBoot.run import StartImage - - self.session.open(StartImage) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() - else: - try: - from Plugins.Extensions.NeoBoot.run import StartImage - - self.session.open(StartImage) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + if getImageNeoBoot() != "Flash": + if not fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): + message = _('After successful launch of the selected software\nyou must run the neoboot plugin\nif the software does not start or neoboot is not confirmed\nthe system will return to the internal flash memory\n\nPress OK or exit on the remote control to continue...') + ybox = self.session.openWithCallback(self.StartReboot, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('First start of software')) + else: + try: + from Plugins.Extensions.NeoBoot.run import StartImage + self.session.open(StartImage) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() + else: + try: + from Plugins.Extensions.NeoBoot.run import StartImage + self.session.open(StartImage) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() def StartReboot(self, yesno): if yesno: - try: - from Plugins.Extensions.NeoBoot.run import StartImage - - self.session.open(StartImage) - except Exception as e: - loggscrash = time.localtime(time.time()) - LogCrashGS( - "%02d:%02d:%d %02d:%02d:%02d - %s\r\n" - % ( - loggscrash.tm_mday, - loggscrash.tm_mon, - loggscrash.tm_year, - loggscrash.tm_hour, - loggscrash.tm_min, - loggscrash.tm_sec, - str(e), - ) - ) - self.CRASHlogNeo() + try: + from Plugins.Extensions.NeoBoot.run import StartImage + self.session.open(StartImage) + except Exception as e: + loggscrash = time.localtime(time.time()) + LogCrashGS('%02d:%02d:%d %02d:%02d:%02d - %s\r\n' % (loggscrash.tm_mday, loggscrash.tm_mon, loggscrash.tm_year, loggscrash.tm_hour, loggscrash.tm_min, loggscrash.tm_sec, str(e))) + self.CRASHlogNeo() else: self.close() def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) self.close() - + def CRASHlogNeo(self): - showlog = ( - 'echo "\nCRARSH LOG-neoboot startup error!" >> ' - + getNeoLocation() - + "ImageBoot/neoboot.log; cat " - + getNeoLocation() - + "ImageBoot/neoboot.log" - ) - self.session.openWithCallback( - self.close, Console, _("NeoBoot ERROR !!!"), [showlog] - ) + showlog = 'echo "\nCRARSH LOG-neoboot startup error!" >> ' + getNeoLocation() + 'ImageBoot/neoboot.log; cat ' + getNeoLocation() + 'ImageBoot/neoboot.log' + self.session.openWithCallback(self.close, Console, _('NeoBoot ERROR !!!'), [showlog]) - -def readline(filename, iferror=""): - if iferror[:3] == "or:": - data = iferror[3:] +def readline(filename, iferror=''): + if iferror[:3] == 'or:': + data = iferror[3:] else: - data = iferror + data = iferror try: if os.path.exists(filename): with open(filename) as f: @@ -2827,10 +1739,9 @@ def readline(filename, iferror=""): def checkInternet(): - if fileExists("/usr/lib/python2.7"): + if fileExists('/usr/lib/python2.7'): import urllib2 import urllib - try: response = urllib2.urlopen("http://google.com", None, 5) response.close() @@ -2841,23 +1752,12 @@ def checkInternet(): else: return True else: - try: - import urllib.request - - urllib.request.urlopen("http://google.com", timeout=5) - return True - except BaseException: - return False - + return True + def checkimage(): mycheck = False - if ( - not fileExists("/proc/stb/info") - or not fileExists("" + LinkNeoBoot + "/neoskins/neo/neo_skin.py") - or not fileExists("" + LinkNeoBoot + "/bin/utilsbh") - or not fileExists("" + LinkNeoBoot + "/stbinfo.cfg") - ): + if not fileExists('/proc/stb/info') or not fileExists('' + LinkNeoBoot + '/neoskins/neo/neo_skin.py') or not fileExists('' + LinkNeoBoot + '/bin/utilsbh') or not fileExists('' + LinkNeoBoot + '/stbinfo.cfg'): mycheck = False else: mycheck = True @@ -2867,236 +1767,117 @@ def checkimage(): def main(session, **kwargs): vip = checkimage() if vip == 1: - if not fileExists("" + LinkNeoBoot + "/.location"): + if not fileExists('' + LinkNeoBoot + '/.location'): pass else: - if not fileExists("%sImageBoot/.version" % getNeoLocation()): - if fileExists("" + LinkNeoBoot + "/files/neo.sh"): - os.system( - "chmod 0755 " - + LinkNeoBoot - + "/files/neo.sh; " - + LinkNeoBoot - + "/files/neo.sh" - ) - if not fileExists( - "%sImageBoot/.version" % - getNeoLocation()): - os.system( - "chmod 0755 " - + LinkNeoBoot - + "/files/mountpoint.sh; " - + LinkNeoBoot - + "/files/mountpoint.sh" - ) - - if not fileExists("/.multinfo") and fileExists("" + - LinkNeoBoot + "/.location"): + if not fileExists('%sImageBoot/.version' % getNeoLocation()): + if fileExists('' + LinkNeoBoot + '/files/neo.sh'): + os.system('chmod 0755 ' + LinkNeoBoot + '/files/neo.sh; ' + LinkNeoBoot + '/files/neo.sh') + if not fileExists('%sImageBoot/.version' % getNeoLocation()): + os.system('chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh; ' + LinkNeoBoot + '/files/mountpoint.sh') + + if not fileExists('/.multinfo') and fileExists('' + LinkNeoBoot + '/.location'): if checkInternet(): - if not os.path.exists("/tmp/.finishdate"): - os.system('date "+%Y%m%d" > /tmp/.finishdate') - if fileExists("/tmp/.nkod"): - pass + if not os.path.exists('/tmp/.finishdate'): + os.system('date "+%Y%m%d" > /tmp/.finishdate') + if fileExists('/tmp/.nkod') : + pass else: - if not fileExists("/tmp/ver.txt"): - if fileExists("/usr/bin/curl"): - os.system( - "cd /tmp; curl -O --ftp-ssl -k https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; curl -O --ftp-ssl -k https://raw.githubusercontent.com/gutosie/neoscript/master/.neouser; cd /" - ) - if not fileExists("/tmp/ver.txt"): - if fileExists("/usr/bin/wget"): - os.system( - "cd /tmp; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoscript/master/.neouser; cd /" - ) - if not fileExists("/tmp/ver.txt"): - if fileExists("/usr/bin/fullwget"): - os.system( - "cd /tmp; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoscript/master/.neouser; cd /" - ) - if fileExists("/tmp/ver.txt"): - os.system( - "mv /tmp/ver.txt /tmp/.nkod; mv /tmp/.neouser /usr/lib/periodon/.activatedmac; cd /" - ) - else: - os.system(_("echo %s > /tmp/.nkod") % UPDATEVERSION) - from Plugins.Extensions.NeoBoot.files.stbbranding import ( - getCheckInstal1, - getCheckInstal2, - getCheckInstal3, - ) - - if fileExists("/tmp/error_neo"): - if fileExists("/tmp/error_neo"): - os.system("rm -f /tmp/error_neo") - if getCheckInstal1() == "1": - os.system( - 'echo "\nNeoboot installation errors 1:\nfile install is error - 1\n" >> /tmp/error_neo' - ) - session.open( - MessageBox, - _("Neoboot plugin installed with ERRORS! Not work properly! The error number is 1"), - type=MessageBox.TYPE_ERROR, - ) - if getCheckInstal2() == "2": - os.system( - 'echo "\nNeoboot installation errors 2:\nfile .location is error - 2\n" >> /tmp/error_neo' - ) - session.open( - MessageBox, - _("Neoboot plugin installed with ERRORS! Not work properly! The error number is 2"), - type=MessageBox.TYPE_ERROR, - ) - if getCheckInstal3() == "3": - os.system( - 'echo "\nNeoboot installation errors 3:\nfile neo.sh is error - 3\n" >> /tmp/error_neo' - ) - session.open( - MessageBox, - _("Neoboot plugin installed with ERRORS! Not work properly! The error number is 3"), - type=MessageBox.TYPE_ERROR, - ) + if not fileExists('/tmp/ver.txt'): + if fileExists('/usr/bin/curl'): + os.system('cd /tmp; curl -O --ftp-ssl -k https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; curl -O --ftp-ssl -k https://raw.githubusercontent.com/gutosie/neoscript/master/.neouser; cd /') + if not fileExists('/tmp/ver.txt'): + if fileExists('/usr/bin/wget'): + os.system('cd /tmp; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; wget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoscript/master/.neouser; cd /') + if not fileExists('/tmp/ver.txt'): + if fileExists('/usr/bin/fullwget'): + os.system('cd /tmp; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoboot/master/ver.txt; fullwget --no-check-certificate https://raw.githubusercontent.com/gutosie/neoscript/master/.neouser; cd /') + if fileExists('/tmp/ver.txt'): + os.system('mv /tmp/ver.txt /tmp/.nkod; mv /tmp/.neouser /usr/lib/periodon/.activatedmac; cd /') + else: + os.system(_('echo %s > /tmp/.nkod') % UPDATEVERSION) + from Plugins.Extensions.NeoBoot.files.stbbranding import getCheckInstal1, getCheckInstal2, getCheckInstal3 + if fileExists('/tmp/error_neo'): + if fileExists('/tmp/error_neo'): + os.system('rm -f /tmp/error_neo') + if getCheckInstal1() == '1': + os.system('echo "\nNeoboot installation errors 1:\nfile install is error - 1\n" >> /tmp/error_neo') + session.open(MessageBox, _('Neoboot plugin installed with ERRORS! Not work properly! The error number is 1'), type=MessageBox.TYPE_ERROR) + if getCheckInstal2() == '2': + os.system('echo "\nNeoboot installation errors 2:\nfile .location is error - 2\n" >> /tmp/error_neo') + session.open(MessageBox, _('Neoboot plugin installed with ERRORS! Not work properly! The error number is 2'), type=MessageBox.TYPE_ERROR) + if getCheckInstal3() == '3': + os.system('echo "\nNeoboot installation errors 3:\nfile neo.sh is error - 3\n" >> /tmp/error_neo') + session.open(MessageBox, _('Neoboot plugin installed with ERRORS! Not work properly! The error number is 3'), type=MessageBox.TYPE_ERROR) if getCheckActivateVip() == getBoxMacAddres(): - if checkInternet(): - if getTestToTest() != UPDATEVERSION: - session.open( - MessageBox, - _("New version update neoboot is available!\nPlease upgrade your flash plugin."), - type=MessageBox.TYPE_ERROR, - ) - else: - session.open( - MessageBox, - _("Geen internet"), - type=MessageBox.TYPE_ERROR) - else: - if not fileExists("/usr/lib/periodon/.kodn"): - session.open( - MessageBox, - _("Get a free test to the full vip version."), - type=MessageBox.TYPE_ERROR, - ) - elif fileExists("/usr/lib/periodon/.kodn") and fileExists("/tmp/.nkod"): if checkInternet(): if getTestToTest() != UPDATEVERSION: - session.open( - MessageBox, - _("New version update neoboot is available!\nPlease upgrade your flash plugin."), - type=MessageBox.TYPE_ERROR, - ) + session.open(MessageBox, _('New version update neoboot is available!\nPlease upgrade your flash plugin.'), type=MessageBox.TYPE_ERROR) else: - session.open( - MessageBox, - _("Geen internet"), - type=MessageBox.TYPE_ERROR) - if not fileExists("/usr/lib/periodon/.accessdate"): # timeoff - session.open( - MessageBox, - _("VIP access error. Reinstall the plugin."), - type=MessageBox.TYPE_ERROR, - ) - if getAccesDate() == "timeoff": # timeoff - session.open( - MessageBox, - _("Neoboot vip version has expired, please re-access."), - type=MessageBox.TYPE_ERROR, - ) + session.open(MessageBox, _('Geen internet'), type=MessageBox.TYPE_ERROR) + else: + if not fileExists('/usr/lib/periodon/.kodn'): + session.open(MessageBox, _('Get a free test to the full vip version.'), type=MessageBox.TYPE_ERROR) + elif fileExists('/usr/lib/periodon/.kodn') and fileExists('/tmp/.nkod'): + if checkInternet(): + if getTestToTest() != UPDATEVERSION: + session.open(MessageBox, _('New version update neoboot is available!\nPlease upgrade your flash plugin.'), type=MessageBox.TYPE_ERROR) + else: + session.open(MessageBox, _('Geen internet'), type=MessageBox.TYPE_ERROR) + if not fileExists('/usr/lib/periodon/.accessdate'): #timeoff + session.open(MessageBox, _('VIP access error. Reinstall the plugin.'), type=MessageBox.TYPE_ERROR) + if getAccesDate() == 'timeoff': #timeoff + session.open(MessageBox, _('Neoboot vip version has expired, please re-access.'), type=MessageBox.TYPE_ERROR) version = 0 - if fileExists("%sImageBoot/.version" % getNeoLocation()): - try: - f = open("%sImageBoot/.version" % getNeoLocation()) - version = float(f.read()) - f.close() - except BaseException: - version = 0.0 # Handle potential read errors + if fileExists('%sImageBoot/.version' % getNeoLocation()): + f = open('%sImageBoot/.version' % getNeoLocation()) + version = float(f.read()) + f.close() - if fileExists("" + LinkNeoBoot + "/.location") and fileExists( - "%sImageBoot/.neonextboot" % getNeoLocation() - ): - f2 = open("%sImageBoot/.neonextboot" % getNeoLocation(), "r") - mypath2 = f2.readline().strip() - f2.close() - if mypath2 != "Flash" or mypath2 == "Flash" and checkimage(): - if fileExists("/.multinfo") or fileExists( - "/usr/lib/periodon/.fullaccess" - ): - session.open(NeoBootImageChoose) - else: - if float(PLUGINVERSION) != version: - session.open(MyUpgrade) + if fileExists('' + LinkNeoBoot + '/.location') and fileExists('%sImageBoot/.neonextboot' % getNeoLocation()): + f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') + mypath2 = f2.readline().strip() + f2.close() + if mypath2 != 'Flash' or mypath2 == 'Flash' and checkimage() : #and getCheckActivateVip() == getBoxMacAddres(): + if fileExists('/.multinfo') or fileExists('/usr/lib/periodon/.fullaccess'): + session.open(NeoBootImageChoose) else: - session.open(NeoBootImageChoose) - else: - session.open( - MessageBox, - _("Sorry, Unable to install, bad satellite receiver or you do not have the full plug-in version\n The full version of the NEO VIP plugin is on address:\nkrzysztofgutosie@.gmail.com"), - type=MessageBox.TYPE_ERROR, - ) + if float(PLUGINVERSION) != version: + session.open(MyUpgrade) + else: + session.open(NeoBootImageChoose) + else: + session.open(MessageBox, _('Sorry, Unable to install, bad satellite receiver or you do not have the full plug-in version\n The full version of the NEO VIP plugin is on address:\nkrzysztofgutosie@.gmail.com'), type=MessageBox.TYPE_ERROR) else: if (getSupportedTuners()) == (getBoxHostName()): - session.open(NeoBootInstallation) + session.open(NeoBootInstallation) else: - session.open( - MessageBox, - _("Sorry cannot open neo menu. Not supported tuners. "), - type=MessageBox.TYPE_ERROR, - ) + session.open(MessageBox, _('Sorry cannot open neo menu. Not supported tuners. '), type=MessageBox.TYPE_ERROR) else: - session.open( - MessageBox, - (_("Sorry, Unable to install, bad satellite receiver or you do not have the full plug-in version\n\nThe full version of the NEO VIP plugin is on address:\nkrzysztofgutosie@.gmail.com")), - type=MessageBox.TYPE_ERROR, - ) + session.open(MessageBox, (_('Sorry, Unable to install, bad satellite receiver or you do not have the full plug-in version\n\nThe full version of the NEO VIP plugin is on address:\nkrzysztofgutosie@.gmail.com')), type=MessageBox.TYPE_ERROR) def menu(menuid, **kwargs): - if menuid == "mainmenu": - return [(_("NeoBOOT"), main, "neo_boot", 1)] + if menuid == 'mainmenu': + return [(_('NeoBOOT'), + main, + 'neo_boot', + 1)] return [] +from Plugins.Plugin import PluginDescriptor + + def Plugins(**kwargs): if isFHD(): - list = [ - PluginDescriptor( - name="NeoBoot", - description="NeoBoot", - where=PluginDescriptor.WHERE_MENU, - fnc=menu, - ), - PluginDescriptor( - name="NeoBoot", - description=_("Installing multiple images"), - icon="neo_fhd.png", - where=PluginDescriptor.WHERE_PLUGINMENU, - fnc=main, - ), - ] - list.append( - PluginDescriptor( - name=_("NEOBOOT"), - where=PluginDescriptor.WHERE_EXTENSIONSMENU, - fnc=main)) + list = [PluginDescriptor(name='NeoBoot', description='NeoBoot', where=PluginDescriptor.WHERE_MENU, fnc=menu), PluginDescriptor(name='NeoBoot', description=_('Installing multiple images'), icon='neo_fhd.png', where=PluginDescriptor.WHERE_PLUGINMENU, fnc=main)] + list.append(PluginDescriptor(name=_('NEOBOOT'), where=PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main)) else: - list = [ - PluginDescriptor( - name="NeoBoot", - description="NeoBoot", - where=PluginDescriptor.WHERE_MENU, - fnc=menu, - ), - PluginDescriptor( - name="NeoBoot", - description=_("Installing multiple images"), - icon="neo_hd.png", - where=PluginDescriptor.WHERE_PLUGINMENU, - fnc=main, - ), - ] - list.append( - PluginDescriptor( - name=_("NEOBOOT"), - where=PluginDescriptor.WHERE_EXTENSIONSMENU, - fnc=main)) + list = [PluginDescriptor(name='NeoBoot', description='NeoBoot', where=PluginDescriptor.WHERE_MENU, fnc=menu), PluginDescriptor(name='NeoBoot', description=_('Installing multiple images'), icon='neo_hd.png', where=PluginDescriptor.WHERE_PLUGINMENU, fnc=main)] + list.append(PluginDescriptor(name=_('NEOBOOT'), where=PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main)) return list + +####################### _q(-_-)p_ gutosie _q(-_-)p_ ####################### diff --git a/NeoBoot/stbinfo.cfg b/NeoBoot/stbinfo.cfg index 335cf11..a029d4f 100644 --- a/NeoBoot/stbinfo.cfg +++ b/NeoBoot/stbinfo.cfg @@ -101,10 +101,6 @@ "maxytecmulti" "multibox" "multiboxse" -"multiboxpro" -"novaler4k" -"novaler4kse" -"novaler4kpro" "viper4k" "et1x000" "gbquad4k"quad4k" @@ -177,5 +173,6 @@ WWIO BRE2ZE 4K : bcm7251s Axas HIS Twin : Hisilicon 3716MV410 (ARM v7) Qviart Lunix 4K : 72604 gigablue X3 4k : BCM 72604 + #END diff --git a/NeoBoot/unpack.py b/NeoBoot/unpack.py index 4971ea9..1901061 100644 --- a/NeoBoot/unpack.py +++ b/NeoBoot/unpack.py @@ -1,15 +1,10 @@ +# -*- coding: utf-8 -*- + +#from __init__ import _ +from __future__ import absolute_import +from __future__ import print_function from Plugins.Extensions.NeoBoot.__init__ import _ -from Plugins.Extensions.NeoBoot.files.stbbranding import ( - getNeoLocation, - getKernelVersionString, - getKernelImageVersion, - getCPUtype, - getCPUSoC, - getImageNeoBoot, - getBoxVuModel, - getBoxHostName, - getTunerModel, -) +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 @@ -32,36 +27,16 @@ 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 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 ( - not fileExists("/etc/vtiversion.info") - and not fileExists("/etc/bhversion") - and fileExists("/usr/lib/python2.7") -): +if not fileExists('/etc/vtiversion.info') and not fileExists('/etc/bhversion') and fileExists('/usr/lib/python2.7'): from Plugins.Extensions.NeoBoot.files.neoconsole import Console else: from Screens.Console import Console -LinkNeoBoot = "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot" +LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' def getDS(): @@ -102,7 +77,7 @@ class InstallImage(Screen, ConfigListScreen): \ """ else: - skin = """ + skin = """ @@ -121,60 +96,60 @@ class InstallImage(Screen, ConfigListScreen): def __init__(self, session): Screen.__init__(self, session) - fn = "NewImage" + fn = 'NewImage' sourcelist = [] - for fn in os.listdir("%sImagesUpload" % getNeoLocation()): - if fn.find(".zip") != -1: - fn = fn.replace(".zip", "") + for fn in os.listdir('%sImagesUpload' % getNeoLocation()): + if fn.find('.zip') != -1: + fn = fn.replace('.zip', '') sourcelist.append((fn, fn)) continue - if fn.find(".rar") != -1: - fn = fn.replace(".rar", "") + if fn.find('.rar') != -1: + fn = fn.replace('.rar', '') sourcelist.append((fn, fn)) continue - if fn.find(".tar.xz") != -1: - fn = fn.replace(".tar.xz", "") + if fn.find('.tar.xz') != -1: + fn = fn.replace('.tar.xz', '') sourcelist.append((fn, fn)) continue - if fn.find(".tar.gz") != -1: - fn = fn.replace(".tar.gz", "") + if fn.find('.tar.gz') != -1: + fn = fn.replace('.tar.gz', '') sourcelist.append((fn, fn)) continue - if fn.find(".tar.bz2") != -1: - fn = fn.replace(".tar.bz2", "") + if fn.find('.tar.bz2') != -1: + fn = fn.replace('.tar.bz2', '') sourcelist.append((fn, fn)) continue - if fn.find(".tar") != -1: - fn = fn.replace(".tar", "") + if fn.find('.tar') != -1: + fn = fn.replace('.tar', '') sourcelist.append((fn, fn)) continue - if fn.find(".tar") != -1: - fn = fn.replace(".tar.gz", "") + if fn.find('.tar') != -1: + fn = fn.replace('.tar.gz', '') + sourcelist.append((fn, fn)) + continue + if fn.find('.mb') != -1: + fn = fn.replace('.mb', '') sourcelist.append((fn, fn)) continue - if fn.find(".mb") != -1: - fn = fn.replace(".mb", "") - sourcelist.append((fn, fn)) - continue - if fn.find(".nfi") != -1: - fn = fn.replace(".nfi", "") + if fn.find('.nfi') != -1: + fn = fn.replace('.nfi', '') sourcelist.append((fn, fn)) continue if len(sourcelist) == 0: - sourcelist = [("None", "None")] + sourcelist = [('None', 'None')] self.source = ConfigSelection(choices=sourcelist) self.target = ConfigText(fixed_size=False) - self.CopyFiles = ConfigYesNo(default=True) + self.CopyFiles = ConfigYesNo(default=True) if "vu" + getBoxVuModel() == getBoxHostName(): - self.CopyKernel = ConfigYesNo(default=True) + self.CopyKernel = ConfigYesNo(default=True) else: self.CopyKernel = ConfigYesNo(default=False) self.TvList = ConfigYesNo(default=False) self.LanWlan = ConfigYesNo(default=False) - if "vu" + getBoxVuModel() == getBoxHostName(): + if "vu" + getBoxVuModel() == getBoxHostName(): self.Sterowniki = ConfigYesNo(default=False) else: - self.Sterowniki = ConfigYesNo(default=True) + self.Sterowniki = ConfigYesNo(default=True) self.Montowanie = ConfigYesNo(default=False) self.InstallSettings = ConfigYesNo(default=False) self.ZipDelete = ConfigYesNo(default=False) @@ -182,227 +157,139 @@ class InstallImage(Screen, ConfigListScreen): self.SoftCam = ConfigYesNo(default=False) self.MediaPortal = ConfigYesNo(default=False) self.PiconR = ConfigYesNo(default=False) - self.Kodi = ConfigYesNo(default=False) + self.Kodi = ConfigYesNo(default=False) self.BlackHole = ConfigYesNo(default=False) for line in open("/etc/hostname"): - if ( - getCPUtype() == "MIPS" - and "dm500hd" not in line - and "dm800se" not in line - and "dm800" not in line - and "dm8000" not in line - ): + if getCPUtype() == 'MIPS' and not "dm500hd" in line and not "dm800se" in line and not "dm800" in line and not "dm8000" in line : self.Nandsim = ConfigYesNo(default=True) - else: - self.Nandsim = ConfigYesNo(default=False) - self.target.value = "" - self.curselimage = "" + else: + self.Nandsim = 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 BaseException: + 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() + 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( - _("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 network settings LAN-WLAN ?"), - self.LanWlan)) - self.list.append( - getConfigListEntry( - _("Copy the drivers ? (Recommended only other image.)"), - self.Sterowniki)) - self.list.append( - getConfigListEntry( - _("Copy mounting disks ? (Recommended)"), self.Montowanie - ) - ) - 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( - _("Copy picon flash to image install ?"), - self.PiconR)) - self.list.append( - getConfigListEntry( - _("Transfer kodi settings ?"), - self.Kodi)) - self.list.append( - getConfigListEntry( - _("Path BlackHole ? (Not recommended for VuPlus)"), - self.BlackHole)) - if getCPUtype() == "MIPS": - self.list.append( - getConfigListEntry( - _("Use Nandsim to install image ?"), - self.Nandsim)) + self.list.append(getConfigListEntry(_('Source Image file'), self.source)) + self.list.append(getConfigListEntry(_('Image Name'), self.target)) + 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 network settings LAN-WLAN ?'), self.LanWlan)) + self.list.append(getConfigListEntry(_('Copy the drivers ? (Recommended only other image.)'), self.Sterowniki)) + self.list.append(getConfigListEntry(_('Copy mounting disks ? (Recommended)'), self.Montowanie)) + 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(_('Copy picon flash to image install ?'), self.PiconR)) + self.list.append(getConfigListEntry(_('Transfer kodi settings ?'), self.Kodi)) + self.list.append(getConfigListEntry(_('Path BlackHole ? (Not recommended for VuPlus)'), self.BlackHole)) + if getCPUtype() == 'MIPS': + self.list.append(getConfigListEntry(_('Use Nandsim to install image ?'), self.Nandsim)) def HelpInstall(self): - self.session.open(HelpInstall) + self.session.open(HelpInstall) def typeChange(self, value): self.createSetup() - self["config"].l.setList(self.list) + 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() + 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() + 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, - ) + 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()) + self['config'].getCurrent()[1].setValue(callback) + self['config'].invalidate(self['config'].getCurrent()) return def imageInstall(self): - pluginpath = "" + LinkNeoBoot + "" - myerror = "" - source = self.source.value.replace(" ", "") - target = self.target.value.replace(" ", "") - for fn in os.listdir("%sImageBoot" % getNeoLocation()): - if fn == target: - myerror = ( - _("Sorry, an Image with the name ") - + target - + _(" is already installed.\n Please try another name.") - ) - continue + pluginpath = '' + LinkNeoBoot + '' + myerror = '' + source = self.source.value.replace(' ', '') + target = self.target.value.replace(' ', '') + for fn in os.listdir('%sImageBoot' % getNeoLocation()): + if fn == target: + myerror = _('Sorry, an Image with the name ') + target + _(' is already installed.\n Please try another name.') + continue - if source == "None": - myerror = _( - "You have to select one Image to install.\nPlease, upload your zip file in the folder: %sImagesUpload and select the image to install." - ) - if target == "": - myerror = _("You have to provide a name for the new Image.") - if target == "Flash": - myerror = _( - "Sorry this name is reserved. Choose another name for the new Image." - ) - if len(target) > 30: - myerror = _("Sorry the name of the new Image is too long.") - if myerror: - myerror - self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) - else: - myerror - message = "echo -e '" - message += _("NeoBot started installing new image.\n") - message += _("The installation process may take a few minutes.\n") - message += _("Please: DO NOT reboot your STB and turn off the power.\n") - message += _("Please, wait...\n") - message += "'" - cmd1 = "python " + pluginpath + "/ex_init.py" - cmd = "%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s " % ( - cmd1, - source, - target.replace(" ", "."), - str(self.CopyFiles.value), - str(self.CopyKernel.value), - str(self.TvList.value), - str(self.LanWlan.value), - str(self.Sterowniki.value), - str(self.Montowanie.value), - str(self.InstallSettings.value), - str(self.ZipDelete.value), - str(self.RepairFTP.value), - str(self.SoftCam.value), - str(self.MediaPortal.value), - str(self.PiconR.value), - str(self.Kodi.value), - str(self.BlackHole.value), - str(self.Nandsim.value), - ) - print("[MULTI-BOOT]: "), cmd - from Plugins.Extensions.NeoBoot.plugin import PLUGINVERSION - - self.session.open( - Console, - _("NeoBoot v.%s - Install new image") % PLUGINVERSION, - [message, cmd], - ) + if source == 'None': + myerror = _('You have to select one Image to install.\nPlease, upload your zip file in the folder: %sImagesUpload and select the image to install.') + if target == '': + myerror = _('You have to provide a name for the new Image.') + if target == 'Flash': + myerror = _('Sorry this name is reserved. Choose another name for the new Image.') + if len(target) > 30: + myerror = _('Sorry the name of the new Image is too long.') + if myerror: + myerror + self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) + else: + myerror + message = "echo -e '" + message += _('NeoBot started installing new image.\n') + message += _('The installation process may take a few minutes.\n') + message += _('Please: DO NOT reboot your STB and turn off the power.\n') + message += _('Please, wait...\n') + message += "'" + cmd1 = 'python ' + pluginpath + '/ex_init.py' + cmd = '%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s ' % (cmd1, + source, + target.replace(' ', '.'), + str(self.CopyFiles.value), + str(self.CopyKernel.value), + str(self.TvList.value), + str(self.LanWlan.value), + str(self.Sterowniki.value), + str(self.Montowanie.value), + str(self.InstallSettings.value), + str(self.ZipDelete.value), + str(self.RepairFTP.value), + str(self.SoftCam.value), + str(self.MediaPortal.value), + str(self.PiconR.value), + str(self.Kodi.value), + str(self.BlackHole.value), + str(self.Nandsim.value)) + print("[MULTI-BOOT]: "), cmd + from Plugins.Extensions.NeoBoot.plugin import PLUGINVERSION + self.session.open(Console, _('NeoBoot v.%s - Install new image') % PLUGINVERSION, [message, cmd]) def cancel(self): self.close() @@ -423,86 +310,59 @@ class HelpInstall(Screen): 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['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 = _('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 += _('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 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 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 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 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 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 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 += _('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 += _('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 += _('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 += _('Copy config SoftCam ?') + message += _(' - the option copies oscam configi and cccam, openpli default.\n\n') - message += _("Copy picon flash to image install ?") - message += _(" - cpuy picon from flash to image install in neoboot\n\n") + message += _('Copy picon flash to image install ?') + message += _(' - cpuy picon from flash to image install in neoboot\n\n') - message += _("Path BlackHole ? (Not recommended for VuPlus)") - message += _(" - option for image blackhole, helps to run BH in neoboot\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) + self['lab1'].show() + self['lab1'].setText(message) diff --git a/NeoBoot/usedskin.py b/NeoBoot/usedskin.py index ea387af..0ee115f 100644 --- a/NeoBoot/usedskin.py +++ b/NeoBoot/usedskin.py @@ -1,8 +1,36 @@ +# skin = ./meoskins/defaul_skin - gutosie + from Screens.Screen import Screen from Components.Pixmap import Pixmap import os +#Colors (#AARRGGBB) +#____Recommended colors - Zalecane kolory : +#color name="white" value="#ffffff" +#color name="darkwhite" value="#00dddddd" +#color name="red" value="#f23d21" +#color name="green" value="#389416" +#color name="blue" value="#0064c7" +#color name="yellow" value="#bab329" +#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 + +# + +###____ Skin Ultra HD - ImageChooseFULLHD ___ mod. gutosie___ ImageChooseFULLHD = """ @@ -60,6 +88,7 @@ ImageChooseFULLHD = """ """ +###____ Skin Ultra HD - ImageChooseULTRAHD ___ mod. gutosie___ ImageChooseULTRAHD = """ @@ -108,6 +137,7 @@ ImageChooseULTRAHD = """ """ +###____ Skin HD - ImageChoose ___mod. gutosie ___ ImageChooseHD = """ @@ -154,6 +184,7 @@ ImageChooseHD = """ """ +###____ Skin FULLHD - MyUpgradeFULLHD ___mod. gutosie ___ MyUpgradeFULLHD = """ @@ -172,6 +203,7 @@ MyUpgradeFULLHD = """ """ +###____ Skin UltraHD - MyUpgradeUltraHD ___mod. gutosie ___ MyUpgradeUltraHD = """ @@ -188,6 +220,7 @@ MyUpgradeUltraHD = """ """ +###____ Skin MyUpgradeHD - MyUpgradeHD ___mod. gutosie ___ MyUpgradeHD = """ @@ -206,6 +239,7 @@ MyUpgradeHD = """ """ +###____ Skin NeoBootInstallationFULLHD - NeoBootInstallationFULLHD ___mod. gutosie ___ NeoBootInstallationFULLHD = """ @@ -230,6 +264,7 @@ NeoBootInstallationFULLHD = """ """ +###____ Skin NeoBootInstallationUltraHD - NeoBootInstallationUltraHD ___mod. gutosie ___ NeoBootInstallationUltraHD = """ @@ -261,6 +296,7 @@ NeoBootInstallationUltraHD = """ """ +###____ Skin NeoBootInstallationHD - NeoBootInstallationHD ___mod. gutosie ___ NeoBootInstallationHD = """