diff --git a/NeoBoot/__init__.py b/NeoBoot/__init__.py index 9f8891e..a76ce93 100644 --- a/NeoBoot/__init__.py +++ b/NeoBoot/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from __future__ import print_function + from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE import os @@ -13,7 +13,8 @@ def localeInit(): lang = language.getLanguage()[:2] 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): diff --git a/NeoBoot/ex_init.py b/NeoBoot/ex_init.py index d30f3c5..c8f64c5 100644 --- a/NeoBoot/ex_init.py +++ b/NeoBoot/ex_init.py @@ -1,8 +1,9 @@ #!/usr/bin/python import sys -import extract +from . import extract if len(sys.argv) < 17: pass 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 2867b71..76511de 100644 --- a/NeoBoot/extract.py +++ b/NeoBoot/extract.py @@ -1,18 +1,19 @@ #!/usr/bin/python # -*- coding: utf-8 -*- -from __future__ import absolute_import -from __future__ import print_function + import sys import os import struct import shutil # ver. gutosie -#--------------------------------------------- 2024 ---------------------------------------------# +# --------------------------------------------- 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) + NEOBootR(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterowniki, Montowanie, + InstallSettings, ZipDelete, RepairFTP, SoftCam, MediaPortal, PiconR, Kodi, BlackHole, Nandsim) def LanguageUsed(): @@ -73,23 +74,23 @@ 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 os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm520') or os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm525'): try: result = popen('uname -r', 'r').read().strip('\n').split('-') kernel_version = result[0] return kernel_version except: - os.system('uname -r > /tmp/.uname_r') + os.system('uname -r > /tmp/.uname_r') return open('/tmp/.uname_r').read().strip().upper() - else: + else: try: return open('/proc/version', 'r').read().split(' ', 4)[2].split('-', 2)[0] except: - os.system('uname -r > /tmp/.uname_r') + 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'): @@ -108,7 +109,8 @@ 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] + 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) @@ -119,202 +121,264 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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)) + 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)) - + 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] + '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': 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': - #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) + # 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 = 'cp -af /lib/modules %s/ImageBoot/%s/lib > /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) + 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) - 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"') + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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)) + 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) + 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."') + 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."') + 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."') + 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) + 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) + 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) + 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) + 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) + 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) + 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) 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 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) + 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) + 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) 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) + 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': if os.path.exists('%s/ImageBoot/%s/etc/vsftpd.conf' % (media, target)): @@ -337,43 +401,59 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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'): @@ -381,14 +461,16 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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) + 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'): 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) + 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."') @@ -410,9 +492,11 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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-', '') try: @@ -423,7 +507,8 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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 + 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 f = open(fail, 'r') @@ -431,94 +516,116 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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.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) + 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/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) - cmd1 = 'cp -aRf /run/resolvconf/interfaces/tailscale ' + getNeoLocation() + 'ImageBoot/%s/run/tailscale/' % target - rc = os.system(cmd1) - + 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) - + 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 "/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 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: + else: if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)): - cmd = 'mkdir -p %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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + cmd6 = 'grep "UUID=" /etc/fstab >> %s/ImageBoot/%s/etc/fstab' % ( + media, target) rc = os.system(cmd6) ##################################### @@ -543,7 +650,8 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow if os.path.exists(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' out = open(fname2, 'w') @@ -571,7 +679,8 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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) + 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/' @@ -583,7 +692,8 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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') + line = line.replace( + '/boot', '/boot > /dev/null 2>\\&1; exit 0') out.write(line) if f.close(): @@ -598,7 +708,8 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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') + line = line.replace( + '/boot', '/boot > /dev/null 2>\\&1; exit 0') out.write(line) f.close() @@ -613,7 +724,8 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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') + line = line.replace( + '/boot', '/boot > /dev/null 2>\\&1; exit 0') out.write(line) f.close() @@ -628,7 +740,8 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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') + line = line.replace( + '/boot', '/boot > /dev/null 2>\\&1; exit 0') out.write(line) f.close() @@ -643,7 +756,8 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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') + line = line.replace( + '/boot', '/boot > /dev/null 2>\\&1; exit 0') out.write(line) f.close() @@ -651,10 +765,11 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow os.rename(filename2, filename) cmd = 'chmod -R 0755 %s' % filename rc = os.system(cmd) - - #_______________________________________________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 + + # _______________________________________________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) fail = '' + getNeoLocation() + 'ImageBoot/%s/var/lib/opkg/status-or' % target f = open(fail, 'r') @@ -662,46 +777,54 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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.write(content.replace( + 'kernel-image', '#kernel-image')) temp_file2.close() - + 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) + rc = os.system(cmd) # 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 + 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 + cmd = 'mkdir -p ' + getNeoLocation() + \ + 'ImageBoot/%s/usr/lib/enigma2/python/Tools/' % target rc = os.system(cmd) - - #delet dir tmp + cmd = 'cp -af /usr/lib/enigma2/python/Tools/Testinout.py ' + \ + getNeoLocation() + 'ImageBoot/%s/usr/lib/enigma2/python/Tools/' % target + rc = os.system(cmd) + + # 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) + 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) + 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) + 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') @@ -713,13 +836,15 @@ def NEOBootMainEx(source, target, CopyFiles, CopyKernel, TvList, LanWlan, Sterow 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') + 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'): @@ -731,7 +856,8 @@ def RemoveUnpackDirs(): 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') + 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'): @@ -747,7 +873,8 @@ def RemoveUnpackDirs(): 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') + 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'): @@ -757,7 +884,8 @@ def RemoveUnpackDirs(): 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') + 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'): @@ -767,7 +895,8 @@ def RemoveUnpackDirs(): 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') + 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*'): @@ -775,7 +904,7 @@ def RemoveUnpackDirs(): 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') + 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'): @@ -783,11 +912,11 @@ def RemoveUnpackDirs(): 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') + 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') + 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'): @@ -801,65 +930,88 @@ def RemoveUnpackDirs(): 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') + 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') + 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') + 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') + 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('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('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('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('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('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('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('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('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') + 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('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') + 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('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('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') + 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') + 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'): @@ -868,53 +1020,67 @@ def RemoveUnpackDirs(): 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/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') + 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') + 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') + 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') + 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') + 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') + 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') + 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') + 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') + 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') + 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') + 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') + 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') + 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') + 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 + # Finish + def NEOBootExtract(source, target, ZipDelete, Nandsim): RemoveUnpackDirs() @@ -924,13 +1090,13 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): 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 + + # Instalacja *.nfi if os.path.exists(sourcefile2) is True: if sourcefile2.endswith('.nfi'): os.system('echo "Instalacja systemu skapowanego w plik nfi..."') @@ -940,48 +1106,53 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): 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 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) - #Instalacja *.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) else: - os.system('echo "NeoBoot keep the file: %s for reinstallation."' % sourcefile3) + os.system( + 'echo "NeoBoot keep the file: %s for reinstallation."' % sourcefile3) - #Instalacja *.zip + # 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 = [] 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 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') - #Instalacja MIPS + # 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') @@ -992,17 +1163,17 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): rc = os.system(cmd) 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()): + + # 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 os.path.exists(mtdfile) is False: - break + mtdfile = '/dev/mtd' + str(i) + if os.path.exists(mtdfile) is False: + break mtd = str(i) os.chdir(media + '/ImagesUpload') - - #zgemma + + # zgemma if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma'): os.chdir('zgemma') brand = 'zgemma' @@ -1020,7 +1191,7 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): if os.path.exists('' + getNeoLocation() + 'ImagesUpload/zgemma/h7'): os.chdir('h7') - #miraclebox + # miraclebox if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox'): os.chdir('miraclebox') brand = 'miraclebox' @@ -1039,22 +1210,22 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): os.chdir('micro') if os.path.exists('' + getNeoLocation() + 'ImagesUpload/miraclebox/twinplus'): os.chdir('twinplus') - #atemio + # 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 + 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' @@ -1079,7 +1250,7 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): if os.path.exists('' + getNeoLocation() + 'ImagesUpload/et4x00'): os.chdir('et4x00') brand = 'et4x00' - #formuler + # formuler if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler1'): os.chdir('formuler1') brand = 'formuler1' @@ -1092,21 +1263,21 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): if os.path.exists('' + getNeoLocation() + 'ImagesUpload/formuler4turbo'): os.chdir('formuler4turbo') brand = 'formuler4turbo' - # Golden Interstar + # 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 + # 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 + # VuPlus if os.path.exists('' + getNeoLocation() + 'ImagesUpload/vuplus'): os.chdir('vuplus') brand = 'vuplus' @@ -1132,7 +1303,7 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): os.chdir('zero') rootfname = 'root_cfe_auto.bin' - #os_Edision + # os_Edision if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmini'): os.chdir('osmini') brand = 'osmini' @@ -1140,11 +1311,11 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osminiplus'): os.chdir('osminiplus') brand = 'osmini' - rootfname = 'rootfs.bin' + rootfname = 'rootfs.bin' if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osmega'): os.chdir('osmega') brand = 'osmini' - rootfname = 'rootfs.bin' + rootfname = 'rootfs.bin' if os.path.exists('' + getNeoLocation() + 'ImagesUpload/osnino'): os.chdir('osnino') brand = 'osnino' @@ -1157,40 +1328,46 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): os.chdir('osninopro') brand = 'osnino' rootfname = 'rootfs.bin' - #Vimastec + # 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') + os.chdir('sf3038') if os.path.exists('' + getNeoLocation() + 'ImagesUpload/xp1000'): os.chdir('xp1000') brand = 'xp1000' - - #Dreambox + + # 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 + + # 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"') - #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()) + 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() + + # % getKernelVersion()) + 'image_cache first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15;sleep 5') 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()) + rc = os.system('insmod /lib/modules/' + getKernelVersion() + '/kernel/drivers/mtd/nand/nandsim.ko cache_file=' + getNeoLocation( + # % getKernelVersion()) + ) + 'image_cache first_id_byte=0x20 second_id_byte=0xaa third_id_byte=0x00 fourth_id_byte=0x15;sleep 5') cmd = 'dd if=%s of=/dev/mtdblock%s bs=2048' % (rootfname, mtd) rc = os.system(cmd) cmd = 'ubiattach /dev/ubi_ctrl -m %s -O 2048' % mtd rc = os.system(cmd) rc = os.system('mount -t ubifs ubi1_0 ' + getNeoLocation() + 'ubi') os.chdir('/home/root') - cmd = 'cp -af ' + getNeoLocation() + 'ubi/* ' + getNeoLocation() + 'ImageBoot/' + target + cmd = 'cp -af ' + getNeoLocation() + 'ubi/* ' + getNeoLocation() + \ + 'ImageBoot/' + target rc = os.system(cmd) rc = os.system('umount ' + getNeoLocation() + 'ubi') cmd = 'ubidetach -m %s' % mtd @@ -1198,238 +1375,247 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): 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') + 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)): 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('rm -f /tmp/dm_image') os.system('sleep 5; init 4; sleep 5; init 3 ') - #UBI_READER + # 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'): + 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/hdp'): + if os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz/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') + 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') - 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') + 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') - #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') + 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') - #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) + # 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."') -#ARM +# 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'): @@ -1438,17 +1624,22 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): 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 ' + 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") + 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 + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + \ + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) @@ -1460,13 +1651,17 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): 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") + 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 + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + \ + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) @@ -1477,157 +1672,230 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): 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") + 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 + cmd = 'cp -af ' + getNeoLocation() + 'ubi/rootfs/* ' + \ + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'rm -rf ' + getNeoLocation() + 'ubi' rc = os.system(cmd) - + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/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.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") + 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 + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + \ + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'rm -rf ' + getNeoLocation() + 'ubi' - rc = os.system(cmd) - - #vuplus________________________ + 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' + 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'): 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'): 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'): 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'): 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'): 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'): 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) + 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'): 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'): 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' + 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) + 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'): 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' + 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'): 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'): 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'): 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/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' + 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'): 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/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' + 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'): 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'): 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'): 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'): 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'): 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'): 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'): @@ -1636,83 +1904,129 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): 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") + 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 + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + \ + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'rm -rf ' + getNeoLocation() + 'ubi' - rc = os.system(cmd) + 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'): 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) + 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'): 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' + 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'): 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'): 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' - rc = os.system(cmd) + 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' + 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/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' + 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/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' + 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/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) + 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' + 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/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' + 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/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) + 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' + 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' + 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') @@ -1722,184 +2036,269 @@ def NEOBootExtract(source, target, ZipDelete, Nandsim): os.system('echo "[NeoBoot] Extracting image HITUBE4k"') 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 + cmd = 'cp -af -p ' + getNeoLocation() + 'ubi/rootfs/* ' + \ + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target rc = os.system(cmd) cmd = 'rm -rf ' + getNeoLocation() + 'ubi' rc = os.system(cmd) - + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/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' + 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' + 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' + 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' - rc = os.system(cmd) + 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' + 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'): 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' + 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' + 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'): 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' + 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'): 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'): 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) + 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' + 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' + 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'): 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) - #Vimastec + # 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' + 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."') - - #Instalacja other image: + 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 = [] 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' - 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(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(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(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(cmd) - rc = os.system('rm -r ' + getNeoLocation() + '/ImagesUpload/rootfs.tar.bz2') + 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' + rc = os.system(cmd) + rc = os.system('rm -r ' + getNeoLocation() + + '/ImagesUpload/rootfs.tar.xz') - 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('.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) - - 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' + 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) - cmd = 'python ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o ' + getNeoLocation() + 'ubi' + 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) - os.chdir('/home/root') - cmd = 'cp -af ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target + 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) - cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target + 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' + 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') + os.system('echo "Instalacja - ubi_reader w toku..."') + print( + "[NeoBoot] Extracting UBIFS image and moving extracted image to our target") + cmd = 'chmod 777 ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py' + rc = os.system(cmd) + cmd = 'python ' + extensions_path + \ + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o ' + getNeoLocation() + \ + 'ubi' + rc = os.system(cmd) + os.chdir('/home/root') + cmd = 'cp -af ' + getNeoLocation() + 'ubi/rootfs/* ' + \ + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' + rc = os.system(cmd) + + elif 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) - cmd = 'rm -rf ' + getNeoLocation() + 'ubi' + 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' 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' - 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(cmd) - cmd = 'rm -f ' + getNeoLocation() + 'ImagesUpload/*.jpg ' ' > /dev/null 2>&1' - rc = os.system(cmd) else: os.system('echo "Image %s not installed "' % source) - return - + # ver. gutosie -#--------------------------------------------- 2023 ---------------------------------------------# -#END +# --------------------------------------------- 2023 ---------------------------------------------# +# END diff --git a/NeoBoot/files/Harddisk.py b/NeoBoot/files/Harddisk.py index a44f791..55b753f 100644 --- a/NeoBoot/files/Harddisk.py +++ b/NeoBoot/files/Harddisk.py @@ -7,7 +7,7 @@ from Tools.Directories import fileExists, pathExists from Tools.CList import CList from Components.SystemInfo import SystemInfo from Components.Console import Console -#from Plugins.Extensions.NeoBoot.files import Task +# from Plugins.Extensions.NeoBoot.files import Task if fileExists('/usr/lib/python2.7'): from Plugins.Extensions.NeoBoot.files import Task else: @@ -35,7 +35,7 @@ def getProcMounts(): try: mounts = open('/proc/mounts', 'r') except IOError as ex: - print(("[Harddisk] Failed to open /proc/mounts"), ex) + print((("[Harddisk] Failed to open /proc/mounts"), ex)) return [] result = [line.strip().split(' ') for line in mounts] @@ -57,7 +57,7 @@ def isFileSystemSupported(filesystem): return False except Exception as ex: - print(("[Harddisk] Failed to read /proc/filesystems:'"), ex) + print((("[Harddisk] Failed to read /proc/filesystems:'"), ex)) def findMountPoint(path): @@ -98,7 +98,8 @@ class Harddisk(): self.removable = removable self.internal = 'pci' in self.phys_path or 'ahci' in self.phys_path or 'sata' in self.phys_path try: - data = open('/sys/block/%s/queue/rotational' % device, 'r').read().strip() + data = open('/sys/block/%s/queue/rotational' % + device, 'r').read().strip() self.rotational = int(data) except: self.rotational = True @@ -125,7 +126,8 @@ class Harddisk(): break self.card = self.device[:2] == 'hd' and 'host0' not in self.dev_path - print("[Harddisk] new device"), self.device, '->', self.dev_path, '->', self.disk_path + print(("[Harddisk] new device"), self.device, + '->', self.dev_path, '->', self.disk_path) if not removable and not self.card: self.startIdle() return @@ -201,9 +203,9 @@ class Harddisk(): return vendor + '(' + model + ')' if self.device.startswith('mmcblk0'): return readFile(self.sysfsPath('device/name')) - raise (Exception, ("[Harddisk] no hdX or sdX or mmcX")) + raise Exception except Exception as e: - print("[Harddisk] Failed to get model:"), e + print(("[Harddisk] Failed to get model:"), e) return '-?-' def free(self): @@ -269,7 +271,7 @@ class Harddisk(): return 0 else: cmd = 'umount ' + dev - print("[Harddisk]"), cmd + print(("[Harddisk]"), cmd) res = os.system(cmd) return res >> 8 @@ -297,7 +299,7 @@ class Harddisk(): parts = line.strip().split(' ') fspath = os.path.realpath(parts[0]) if fspath == dev: - print("[Harddisk] mounting:"), fspath + print(("[Harddisk] mounting:"), fspath) cmd = 'mount -t auto ' + fspath res = os.system(cmd) return res >> 8 @@ -332,7 +334,7 @@ class Harddisk(): def createInitializeJob(self): job = Task.Job(_('Initializing storage device...')) size = self.diskSize() - print("[HD] size: %s MB") % size + print(("[HD] size: %s MB") % size) task = UnmountTask(job, self) task = Task.PythonTask(job, _('Removing partition table')) task.work = self.killPartitionTable @@ -342,7 +344,8 @@ class Harddisk(): task.setTool('hdparm') task.args.append('-z') task.args.append(self.disk_path) - task = Task.ConditionTask(job, _('Waiting for partition'), timeoutCount=20) + task = Task.ConditionTask( + job, _('Waiting for partition'), timeoutCount=20) task.check = lambda: not os.path.exists(self.partitionPath('1')) task.weighting = 1 if os.path.exists('/usr/sbin/parted'): @@ -365,15 +368,15 @@ class Harddisk(): else: parttype = 'msdos' task.args += ['-a', - alignment, - '-s', - self.disk_path, - 'mklabel', - parttype, - 'mkpart', - 'primary', - '0%', - '100%'] + alignment, + '-s', + self.disk_path, + 'mklabel', + parttype, + 'mkpart', + 'primary', + '0%', + '100%'] else: task.setTool('sfdisk') task.args.append('-f') @@ -390,7 +393,7 @@ class Harddisk(): task = MkfsTask(job, _('Creating filesystem')) big_o_options = ['dir_index'] -###__blokada hash dla ext4 >>> +# __blokada hash dla ext4 >>> # if isFileSystemSupported('ext4'): # task.setTool('mkfs.ext4') # if size > 20000: @@ -407,22 +410,22 @@ class Harddisk(): task.setTool('mkfs.ext3') if size > 250000: task.args += ['-T', - 'largefile', - '-N', - '262144'] + 'largefile', + '-N', + '262144'] big_o_options.append('sparse_super') elif size > 16384: task.args += ['-T', 'largefile'] big_o_options.append('sparse_super') elif size > 2048: task.args += ['-T', - 'largefile', - '-N', - str(size * 32)] + 'largefile', + '-N', + str(size * 32)] task.args += ['-m0', - '-O', - ','.join(big_o_options), - self.partitionPath('1')] + '-O', + ','.join(big_o_options), + self.partitionPath('1')] task = MountTask(job, self) task.weighting = 3 task = Task.ConditionTask(job, _('Waiting for mount'), timeoutCount=20) @@ -472,14 +475,14 @@ class Harddisk(): from enigma import eTimer if self.bus() == _('External'): Console().ePopen(('sdparm', - 'sdparm', - '--set=SCT=0', - self.disk_path)) + 'sdparm', + '--set=SCT=0', + self.disk_path)) else: Console().ePopen(('hdparm', - 'hdparm', - '-S0', - self.disk_path)) + 'hdparm', + '-S0', + self.disk_path)) self.timer = eTimer() self.timer.callback.append(self.runIdle) self.idle_running = True @@ -504,16 +507,16 @@ class Harddisk(): def setSleep(self): if self.bus() == _('External'): Console().ePopen(('sdparm', - 'sdparm', - '--flexible', - '--readonly', - '--command=stop', - self.disk_path)) + 'sdparm', + '--flexible', + '--readonly', + '--command=stop', + self.disk_path)) else: Console().ePopen(('hdparm', - 'hdparm', - '-y', - self.disk_path)) + 'hdparm', + '-y', + self.disk_path)) def setIdleTime(self, idle): self.max_idle_time = idle @@ -614,25 +617,27 @@ class HarddiskManager(): self.on_partition_list_change = CList() self.enumerateBlockDevices() p = (('/media/hdd', _('Hard disk')), - ('/media/card', _('Card')), - ('/media/cf', _('Compact flash')), - ('/media/mmc1', _('MMC card')), - ('/media/net', _('Network mount')), - ('/media/net1', _('Network mount %s') % '1'), - ('/media/net2', _('Network mount %s') % '2'), - ('/media/net3', _('Network mount %s') % '3'), - ('/media/ram', _('Ram disk')), - ('/media/usb', _('USB stick')), - ('/media/usb1', _('USB1 stick')), - ('/media/usb2', _('USB2 stick')), - ('/', _('Internal flash'))) - known = set([os.path.normpath(a.mountpoint) for a in self.partitions if a.mountpoint]) + ('/media/card', _('Card')), + ('/media/cf', _('Compact flash')), + ('/media/mmc1', _('MMC card')), + ('/media/net', _('Network mount')), + ('/media/net1', _('Network mount %s') % '1'), + ('/media/net2', _('Network mount %s') % '2'), + ('/media/net3', _('Network mount %s') % '3'), + ('/media/ram', _('Ram disk')), + ('/media/usb', _('USB stick')), + ('/media/usb1', _('USB1 stick')), + ('/media/usb2', _('USB2 stick')), + ('/', _('Internal flash'))) + known = set([os.path.normpath(a.mountpoint) + for a in self.partitions if a.mountpoint]) for m, d in p: if m not in known and os.path.ismount(m): self.partitions.append(Partition(mountpoint=m, description=d)) def getBlockDevInfo(self, blockdev): - HasMMC = fileExists('/proc/cmdline') and 'root=/dev/mmcblk' in open('/proc/cmdline', 'r').read() + HasMMC = fileExists( + '/proc/cmdline') and 'root=/dev/mmcblk' in open('/proc/cmdline', 'r').read() devpath = '/sys/block/' + blockdev error = False removable = False @@ -647,10 +652,10 @@ class HarddiskManager(): else: dev = None blacklisted = dev in [1, - 7, - 31, - 253, - 254] + (['HasMMC'] and [179] or []) + 7, + 31, + 253, + 254] + (['HasMMC'] and [179] or []) if blockdev[0:2] == 'sr': is_cdrom = True if blockdev[0:2] == 'hd': @@ -680,24 +685,25 @@ class HarddiskManager(): medium_found = False return (error, - blacklisted, - removable, - is_cdrom, - partitions, - medium_found) + blacklisted, + removable, + is_cdrom, + partitions, + medium_found) def enumerateBlockDevices(self): print("[Harddisk] enumerating block devices...") for blockdev in os.listdir('/sys/block'): - error, blacklisted, removable, is_cdrom, partitions, medium_found = self.addHotplugPartition(blockdev) + error, blacklisted, removable, is_cdrom, partitions, medium_found = self.addHotplugPartition( + blockdev) if not error and not blacklisted and medium_found: for part in partitions: self.addHotplugPartition(part) self.devices_scanned_on_init.append((blockdev, - removable, - is_cdrom, - medium_found)) + removable, + is_cdrom, + medium_found)) def getAutofsMountpoint(self, device): r = self.getMountpoint(device) @@ -721,12 +727,14 @@ class HarddiskManager(): physdev = os.path.realpath('/sys/block/' + dev + '/device')[4:] except OSError: physdev = dev - print(("couldn't determine blockdev physdev for device"), device) + print((("couldn't determine blockdev physdev for device"), device)) - error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(device) + error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo( + device) if not blacklisted and medium_found: description = self.getUserfriendlyDeviceName(device, physdev) - p = Partition(mountpoint=self.getMountpoint(device), description=description, force_mounted=True, device=device) + p = Partition(mountpoint=self.getMountpoint( + device), description=description, force_mounted=True, device=device) self.partitions.append(p) if p.mountpoint: self.on_partition_list_change('add', p) @@ -736,11 +744,11 @@ class HarddiskManager(): self.hdd.sort() SystemInfo['Harddisk'] = True return (error, - blacklisted, - removable, - is_cdrom, - partitions, - medium_found) + blacklisted, + removable, + is_cdrom, + partitions, + medium_found) def addHotplugAudiocd(self, device, physdev=None): if not physdev: @@ -749,21 +757,23 @@ class HarddiskManager(): physdev = os.path.realpath('/sys/block/' + dev + '/device')[4:] except OSError: physdev = dev - print(("couldn't determine blockdev physdev for device"), device) + print((("couldn't determine blockdev physdev for device"), device)) - error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo(device) + error, blacklisted, removable, is_cdrom, partitions, medium_found = self.getBlockDevInfo( + device) if not blacklisted and medium_found: description = self.getUserfriendlyDeviceName(device, physdev) - p = Partition(mountpoint='/media/audiocd', description=description, force_mounted=True, device=device) + p = Partition(mountpoint='/media/audiocd', + description=description, force_mounted=True, device=device) self.partitions.append(p) self.on_partition_list_change('add', p) SystemInfo['Harddisk'] = False return (error, - blacklisted, - removable, - is_cdrom, - partitions, - medium_found) + blacklisted, + removable, + is_cdrom, + partitions, + medium_found) def removeHotplugPartition(self, device): for x in self.partitions[:]: @@ -802,7 +812,8 @@ class HarddiskManager(): def getMountedPartitions(self, onlyhotplug=False, mounts=None): if mounts is None: mounts = getProcMounts() - parts = [x for x in self.partitions if (x.is_hotplug or not onlyhotplug) and x.mounted(mounts)] + parts = [x for x in self.partitions if ( + x.is_hotplug or not onlyhotplug) and x.mounted(mounts)] devs = set([x.device for x in parts]) for devname in devs.copy(): if not devname: @@ -828,7 +839,7 @@ class HarddiskManager(): try: description = readFile('/sys' + phys + '/model') except IOError as s: - print(("couldn't read model: "), s) + print((("couldn't read model: "), s)) if part and part != 1: description += _(' (Partition %d)') % part @@ -857,7 +868,8 @@ class HarddiskManager(): ioctl(cd.fileno(), ioctl_flag, speed) cd.close() except Exception as ex: - print("[Harddisk] Failed to set %s speed to %s") % (device, speed), ex + print(("[Harddisk] Failed to set %s speed to %s") % + (device, speed), ex) class UnmountTask(Task.LoggingTask): @@ -872,7 +884,7 @@ class UnmountTask(Task.LoggingTask): dev = self.hdd.disk_path.split('/')[-1] open('/dev/nomount.%s' % dev, 'wb').close() except Exception as e: - print("ERROR: Failed to create /dev/nomount file:"), e + print(("ERROR: Failed to create /dev/nomount file:"), e) self.setTool('umount') self.args.append('-f') @@ -891,7 +903,7 @@ class UnmountTask(Task.LoggingTask): try: os.rmdir(path) except Exception as ex: - print("Failed to remove path '%s':") % path, ex + print(("Failed to remove path '%s':") % path, ex) class MountTask(Task.LoggingTask): @@ -905,7 +917,7 @@ class MountTask(Task.LoggingTask): dev = self.hdd.disk_path.split('/')[-1] os.unlink('/dev/nomount.%s' % dev) except Exception as e: - print("ERROR: Failed to remove /dev/nomount file:"), e + print(("ERROR: Failed to remove /dev/nomount file:"), e) if self.hdd.mount_device is None: dev = self.hdd.partitionPath('1') @@ -935,7 +947,7 @@ class MkfsTask(Task.LoggingTask): return def processOutput(self, data): - print("[Mkfs]"), data + print(("[Mkfs]"), data) if 'Writing inode tables:' in data: self.fsck_state = 'inode' elif 'Creating journal' in data: @@ -951,13 +963,13 @@ class MkfsTask(Task.LoggingTask): d[1] = d[1].split('\x08', 1)[0] self.setProgress(80 * int(d[0]) / int(d[1])) except Exception as e: - print("[Mkfs] E:"), e + print(("[Mkfs] E:"), e) return self.log.append(data) -###########################__From HarddiskSetup_################################ +########################### __From HarddiskSetup_################################ class HarddiskSetup(Screen): def __init__(self, session, hdd, action, text, question): @@ -971,19 +983,20 @@ class HarddiskSetup(Screen): self['key_red'] = Label(_('Cancel')) self['key_green'] = Label(text) self['actions'] = ActionMap(['OkCancelActions'], {'ok': self.hddQuestion, - 'cancel': self.close}) + 'cancel': self.close}) self['shortcuts'] = ActionMap(['ShortcutActions'], {'red': self.close, - 'green': self.hddQuestion}) + 'green': self.hddQuestion}) def hddQuestion(self): - message = self.question + '\n' + _('You can continue watching TV etc. while this is running.') + message = self.question + '\n' + \ + _('You can continue watching TV etc. while this is running.') self.session.openWithCallback(self.hddConfirmed, MessageBox, message) def hddConfirmed(self, confirmed): if not confirmed: return try: - from Task import job_manager + from .Task import job_manager except: from Components.Task import job_manager try: @@ -992,7 +1005,8 @@ class HarddiskSetup(Screen): from Screens.TaskView import JobView self.session.open(JobView, job, afterEventChangeable=False) except Exception as ex: - self.session.open(MessageBox, str(ex), type=MessageBox.TYPE_ERROR, timeout=10) + self.session.open(MessageBox, str( + ex), type=MessageBox.TYPE_ERROR, timeout=10) self.close() @@ -1011,12 +1025,13 @@ class HarddiskSelection(Screen): self['key_red'] = Label(_('Cancel')) self['key_green'] = Label(_('Select')) self['actions'] = ActionMap(['OkCancelActions'], {'ok': self.okbuttonClick, - 'cancel': self.close}) + 'cancel': self.close}) self['shortcuts'] = ActionMap(['ShortcutActions'], {'red': self.close, - 'green': self.okbuttonClick}) + 'green': self.okbuttonClick}) def doIt(self, selection): - self.session.openWithCallback(self.close, HarddiskSetup, selection, action=selection.createInitializeJob, text=_('Initialize'), question=_('Do you really want to initialize the device?\nAll data on the disk will be lost!')) + self.session.openWithCallback(self.close, HarddiskSetup, selection, action=selection.createInitializeJob, text=_( + 'Initialize'), question=_('Do you really want to initialize the device?\nAll data on the disk will be lost!')) def okbuttonClick(self): selection = self['hddlist'].getCurrent() @@ -1027,8 +1042,9 @@ class HarddiskSelection(Screen): class HarddiskFsckSelection(HarddiskSelection): def doIt(self, selection): - self.session.openWithCallback(self.close, HarddiskSetup, selection, action=selection.createCheckJob, text=_('Check'), question=_('Do you really want to check the filesystem?\nThis could take lots of time!')) -###########################__end HarddiskSetup_################################ + self.session.openWithCallback(self.close, HarddiskSetup, selection, action=selection.createCheckJob, text=_( + 'Check'), question=_('Do you really want to check the filesystem?\nThis could take lots of time!')) +########################### __end HarddiskSetup_################################ harddiskmanager = HarddiskManager() @@ -1058,4 +1074,5 @@ def internalHDDNotSleeping(external=False): harddiskmanager = HarddiskManager() -SystemInfo['ext4'] = isFileSystemSupported('ext4') or isFileSystemSupported('ext3') +SystemInfo['ext4'] = isFileSystemSupported( + 'ext4') or isFileSystemSupported('ext3') diff --git a/NeoBoot/files/Task.py b/NeoBoot/files/Task.py index 8bc5642..229e118 100644 --- a/NeoBoot/files/Task.py +++ b/NeoBoot/files/Task.py @@ -4,7 +4,7 @@ from Tools.CList import CList class Job(object): - NOT_STARTED, IN_PROGRESS, FINISHED, FAILED = range(4) + NOT_STARTED, IN_PROGRESS, FINISHED, FAILED = list(range(4)) def __init__(self, name): self.tasks = [] @@ -33,16 +33,18 @@ class Job(object): if self.current_task == len(self.tasks): return self.end t = self.tasks[self.current_task] - jobprogress = t.weighting * t.progress / float(t.end) + sum([task.weighting for task in self.tasks[:self.current_task]]) + jobprogress = t.weighting * t.progress / \ + float(t.end) + \ + sum([task.weighting for task in self.tasks[:self.current_task]]) return int(jobprogress * self.weightScale) progress = property(getProgress) def getStatustext(self): return {self.NOT_STARTED: _('Waiting'), - self.IN_PROGRESS: _('In progress'), - self.FINISHED: _('Finished'), - self.FAILED: _('Failed')}[self.status] + self.IN_PROGRESS: _('In progress'), + self.FINISHED: _('Finished'), + self.FAILED: _('Failed')}[self.status] def task_progress_changed_CB(self): self.state_changed() @@ -71,7 +73,8 @@ class Job(object): self.callback(self, None, []) self.callback = None else: - print("still waiting for %d resident task(s) %s to finish") % (len(self.resident_tasks), str(self.resident_tasks)) + print(("still waiting for %d resident task(s) %s to finish") % + (len(self.resident_tasks), str(self.resident_tasks))) else: self.tasks[self.current_task].run(self.taskCallback) self.state_changed() @@ -82,18 +85,18 @@ class Job(object): if stay_resident: if cb_idx not in self.resident_tasks: self.resident_tasks.append(self.current_task) - print("task going resident:"), task + print(("task going resident:"), task) else: - print("task keeps staying resident:"), task + print(("task keeps staying resident:"), task) return if len(res): - print(">>> Error:"), res + print((">>> Error:"), res) self.status = self.FAILED self.state_changed() self.callback(self, task, res) if cb_idx != self.current_task: if cb_idx in self.resident_tasks: - print("resident task finished:"), task + print(("resident task finished:"), task) self.resident_tasks.remove(cb_idx) if res == []: self.state_changed() @@ -177,16 +180,19 @@ class Task(object): if self.cwd is not None: self.container.setCWD(self.cwd) if not self.cmd and self.cmdline: - print("execute:"), self.container.execute(self.cmdline), self.cmdline + print(("execute:"), self.container.execute( + self.cmdline), self.cmdline) else: - print("execute:"), self.container.execute(self.cmd, *self.args), ' '.join(self.args) + print(("execute:"), self.container.execute( + self.cmd, *self.args), ' '.join(self.args)) if self.initial_input: self.writeInput(self.initial_input) return return def run(self, callback): - failed_preconditions = self.checkPreconditions(True) + self.checkPreconditions(False) + failed_preconditions = self.checkPreconditions( + True) + self.checkPreconditions(False) if failed_preconditions: print("[Task] preconditions failed") callback(self, failed_preconditions) @@ -196,7 +202,7 @@ class Task(object): self.prepare() self._run() except Exception as ex: - print("[Task] exception:"), ex + print(("[Task] exception:"), ex) self.postconditions = [FailedPostcondition(ex)] self.finish() @@ -222,7 +228,7 @@ class Task(object): self.output_line = self.output_line[i + 1:] def processOutputLine(self, line): - print("[Task %s]") % self.name, line[:-1] + print(("[Task %s]") % self.name, line[:-1]) def processFinished(self, returncode): self.returncode = returncode @@ -277,7 +283,7 @@ class LoggingTask(Task): self.log = [] def processOutput(self, data): - print("[%s]") % self.name, data, + print(("[%s]") % self.name, data, end=' ') self.log.append(data) @@ -294,7 +300,7 @@ class PythonTask(Task): self.timer.start(5) def work(self): - raise (NotImplemented, "work") + raise NotImplemented def abort(self): self.aborted = True @@ -339,7 +345,7 @@ class ConditionTask(Task): self.triggerCount += 1 try: if self.timeoutCount is not None and self.triggerCount > self.timeoutCount: - raise (Exception, "Timeout elapsed, sorry") + raise Exception res = self.check() except Exception as e: self.postconditions.append(FailedPostcondition(e)) @@ -382,14 +388,16 @@ class JobManager: from Tools import Notifications from Screens.MessageBox import MessageBox if problems[0].RECOVERABLE: - Notifications.AddNotificationWithCallback(self.errorCB, MessageBox, _('Error: %s\nRetry?') % problems[0].getErrorMessage(task)) + Notifications.AddNotificationWithCallback(self.errorCB, MessageBox, _( + 'Error: %s\nRetry?') % problems[0].getErrorMessage(task)) return True else: - Notifications.AddNotification(MessageBox, job.name + '\n' + _('Error') + ': %s' % problems[0].getErrorMessage(task), type=MessageBox.TYPE_ERROR) + Notifications.AddNotification(MessageBox, job.name + '\n' + _( + 'Error') + ': %s' % problems[0].getErrorMessage(task), type=MessageBox.TYPE_ERROR) return False def jobDone(self, job, task, problems): - print("job"), job, ("completed with"), problems, ("in"), task + print(("job"), job, ("completed with"), problems, ("in"), task) if problems: if not job.onFail(job, task, problems): self.errorCB(False) @@ -464,12 +472,14 @@ class ToolExistsPrecondition(Condition): import os if task.cmd[0] == '/': self.realpath = task.cmd - print("[Task.py][ToolExistsPrecondition] WARNING: usage of absolute paths for tasks should be avoided!") + print( + "[Task.py][ToolExistsPrecondition] WARNING: usage of absolute paths for tasks should be avoided!") return os.access(self.realpath, os.X_OK) self.realpath = task.cmd path = os.environ.get('PATH', '').split(os.pathsep) path.append(task.cwd + '/') - absolutes = filter(lambda file: os.access(file, os.X_OK), map(lambda directory, file=task.cmd: os.path.join(directory, file), path)) + absolutes = [file for file in map(lambda directory, file=task.cmd: os.path.join( + directory, file), path) if os.access(file, os.X_OK)] if absolutes: self.realpath = absolutes[0] return True diff --git a/NeoBoot/files/__init__.py b/NeoBoot/files/__init__.py index 9f8891e..a76ce93 100644 --- a/NeoBoot/files/__init__.py +++ b/NeoBoot/files/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from __future__ import print_function + from Components.Language import language from Tools.Directories import resolveFilename, SCOPE_PLUGINS, SCOPE_LANGUAGE import os @@ -13,7 +13,8 @@ def localeInit(): lang = language.getLanguage()[:2] 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): diff --git a/NeoBoot/files/__init__.pyo b/NeoBoot/files/__init__.pyo deleted file mode 100644 index a102baf..0000000 Binary files a/NeoBoot/files/__init__.pyo and /dev/null differ diff --git a/NeoBoot/files/devices.py b/NeoBoot/files/devices.py index 3c9350d..bd121f4 100644 --- a/NeoBoot/files/devices.py +++ b/NeoBoot/files/devices.py @@ -29,11 +29,8 @@ import os from Screens.VirtualKeyBoard import VirtualKeyBoard import gettext from Plugins.Extensions.NeoBoot.files.stbbranding import getTunerModel, getCheckExt, getBoxHostName, getMyUUID -if not fileExists('/usr/lib/python2.7'): - open = file - getoutput = "os.system" -else: - from commands import getoutput +import subprocess + LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' class ManagerDevice(Screen): @@ -605,29 +602,37 @@ class SetDiskLabel(Screen): def sprDev(self): global lista lista = [''] - if getTunerModel() in ('sf8008', 'sf8008s', 'sf8008t'): + tuner_model = getTunerModel() + blackL = '' + if tuner_model in ('sf8008', 'sf8008s', 'sf8008t'): blackL = 'mmcblk0' - if getTunerModel() in ('h9se'): + elif tuner_model in ('h9se'): blackL = 'mmcblk1' else: - blackL = getoutput('cat /etc/udev/mount-helper.sh | grep "BLACKLISTED="') - blackL = blackL[13:-1] - devL = getoutput('cat /proc/partitions | grep "sd\\|mmc" | awk \'{print $4}\'') - devL = devL.split('\n') + try: + blackL_output = subprocess.getoutput('cat /etc/udev/mount-helper.sh | grep "BLACKLISTED="') + blackL = blackL_output[13:-1] + except Exception: + blackL = '' + try: + devL_output = subprocess.getoutput('cat /proc/partitions | grep "sd\\|mmc" | awk \'{print $4}\'') + devL = devL_output.split('\n') + except Exception: + devL = [] + ilosc = len(devL) i = 0 while i < ilosc: if len(devL[i]) == 9 or len(devL[i]) == 4: if devL[i][:7] != blackL: - if self.sprLinux(devL[i]) == True: + if self.sprLinux(devL[i]) is True: lista.append(devL[i]) i += 1 - if ilosc > 0: + if ilosc > 0 and '' in lista: lista.remove('') - elif lista[0] == '': - lista.remove('') - lista.insert(0, 'No Disk') + elif not lista and not ilosc: + lista.append('No Disk') def cancel(self): self.close() @@ -676,20 +681,26 @@ class SetDiskLabel(Screen): return def sprLabel(self): - lab = getoutput('blkid /dev/' + self['devlist'].getCurrent()) - lab1 = lab.split(' ') - licz1 = len(lab1) - i = 0 - while i < licz1: - if lab1[i][:5] == 'LABEL': - self['disklabel'].setText(lab1[i][7:-1]) - break - else: - self['disklabel'].setText(_('No label')) - i += 1 + current_device = self['devlist'].getCurrent() + if not current_device: + self['disklabel'].setText(_('No device selected')) + return + try: + lab_output = subprocess.getoutput('blkid /dev/' + current_device) + except Exception: + lab_output = '' + if lab_output: + lab1 = lab_output.split(' ') + for item in lab1: + if item.startswith('LABEL='): + label = item.split('"')[1] + self['disklabel'].setText(label) + return + + self['disklabel'].setText(_('No label')) def sprLinux(self, dev): - lab = getoutput('blkid /dev/' + dev) + lab = subprocess.getoutput('blkid /dev/' + dev) lab1 = lab.split(' ') licz1 = len(lab1) jest = False @@ -700,7 +711,6 @@ class SetDiskLabel(Screen): return jest jest = False j += 1 - return jest def MyClose(self): diff --git a/NeoBoot/files/neoconsole.py b/NeoBoot/files/neoconsole.py index 7c201dc..6ce98bb 100644 --- a/NeoBoot/files/neoconsole.py +++ b/NeoBoot/files/neoconsole.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from Plugins.Extensions.NeoBoot.__init__ import _ -#from __future__ import print_function +# from __future__ import print_function from enigma import eConsoleAppContainer from Screens.Screen import Screen from Components.ActionMap import ActionMap @@ -29,11 +29,11 @@ class Console(Screen): self['text'] = ScrollLabel('') self['summary_description'] = StaticText('') self['actions'] = ActionMap(['WizardActions', 'DirectionActions', 'ColorActions'], {'ok': self.cancel, - 'back': self.cancel, - 'up': self.key_up, - 'down': self.key_down, - 'green': self.key_green, - 'red': self.key_red}, -1) + 'back': self.cancel, + 'up': self.key_up, + 'down': self.key_down, + 'green': self.key_green, + 'red': self.key_red}, -1) self.cmdlist = cmdlist self.newtitle = title self.screen_hide = False @@ -59,7 +59,8 @@ class Console(Screen): def startRun(self): self['text'].setText(_('Execution progress:') + '\n\n') self['summary_description'].setText(_('Execution progress:')) - print("[Console] executing in run"), self.run, (" the command:"), self.cmdlist[self.run] + print(("[Console] executing in run"), self.run, + (" the command:"), self.cmdlist[self.run]) if self.doExec(self.cmdlist[self.run]): self.runFinished(-1) @@ -72,8 +73,8 @@ class Console(Screen): if self.doExec(self.cmdlist[self.run]): self.runFinished(-1) else: -# self['key_red'].setText(_('Close')) -# self['key_green'].setText(_('Save')) + # self['key_red'].setText(_('Close')) + # self['key_green'].setText(_('Save')) self.toggleScreenHide(True) if self.cancel_msg: self.cancel_msg.close() @@ -81,7 +82,8 @@ class Console(Screen): if not fileExists('/etc/vtiversion.info'): lastpage = self['text'].isAtLastPage() self['text'].appendText('\n' + _('Execution finished!!')) - self['summary_description'].setText('\n' + _('Execution finished!!')) + self['summary_description'].setText( + '\n' + _('Execution finished!!')) if self.finishedCallback is not None: self.finishedCallback() if not self.errorOcurred and self.closeOnSuccess: @@ -113,7 +115,7 @@ class Console(Screen): self.output_file = 'end' elif self.run == len(self.cmdlist): self.saveOutputText() - #self.toggleScreenHide() + # self.toggleScreenHide() else: self.toggleScreenHide() @@ -124,7 +126,8 @@ class Console(Screen): if self.run == len(self.cmdlist): self.cancel() else: - self.cancel_msg = self.session.openWithCallback(self.cancelCB, MessageBox, _('Cancel execution?'), type=MessageBox.TYPE_YESNO, default=False) + self.cancel_msg = self.session.openWithCallback(self.cancelCB, MessageBox, _( + 'Cancel execution?'), type=MessageBox.TYPE_YESNO, default=False) def cancelCB(self, ret=None): self.cancel_msg = None @@ -135,8 +138,10 @@ class Console(Screen): def saveOutputText(self): from time import time, localtime lt = localtime(time()) - self.output_file = '/tmp/%02d%02d%02d_console.txt' % (lt[3], lt[4], lt[5]) - self.session.openWithCallback(self.saveOutputTextCB, MessageBox, _("Save the commands and the output to a file?\n('%s')") % self.output_file, type=MessageBox.TYPE_YESNO, default=True) + self.output_file = '/tmp/%02d%02d%02d_console.txt' % ( + lt[3], lt[4], lt[5]) + self.session.openWithCallback(self.saveOutputTextCB, MessageBox, _( + "Save the commands and the output to a file?\n('%s')") % self.output_file, type=MessageBox.TYPE_YESNO, default=True) def formatCmdList(self, source): if isinstance(source, (list, tuple)): @@ -164,13 +169,16 @@ class Console(Screen): break if script and path.isfile(script): - text += 'script listing: %s\n\n%s\n\n' % (script, self.readFile(script)) + text += 'script listing: %s\n\n%s\n\n' % ( + script, self.readFile(script)) if len(cmdlist) > 1: - text += 'next commands:\n\n' + '\n'.join(cmdlist[1:]) + '\n\n' + text += 'next commands:\n\n' + \ + '\n'.join(cmdlist[1:]) + '\n\n' except: text += 'error read commands!!!\n\n' - text += '-' * 50 + '\n\noutputs ...\n\n%s' % self['text'].getText() + text += '-' * 50 + \ + '\n\noutputs ...\n\n%s' % self['text'].getText() try: f = open(self.output_file, 'w') f.write(text) diff --git a/NeoBoot/files/stbbranding.py b/NeoBoot/files/stbbranding.py index eff8602..53539af 100644 --- a/NeoBoot/files/stbbranding.py +++ b/NeoBoot/files/stbbranding.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -#from Plugins.Extensions.NeoBoot.__init__ import _ +# from Plugins.Extensions.NeoBoot.__init__ import _ import sys import os import time @@ -9,9 +9,10 @@ LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' LogFileObj = None + def Log(param=''): global LogFileObj - #first close object if exists + # first close object if exists if param.lower() in ['open', 'write', 'append', 'close']: if LogFileObj is not None: LogFileObj.close() @@ -25,7 +26,7 @@ def Log(param=''): print("ERROR closing LogFile!!!") else: print("ERROR closing LogFile!!!") - #second create object if does not exist + # second create object if does not exist if LogFileObj is None: if param.lower() in ['open', 'write']: LogFileObj = open(LogFile, "w") @@ -45,39 +46,39 @@ def clearMemory(): def LogCrashGS(line): - if os.path.isfile('' + getNeoLocation() + 'ImageBoot/neoboot.log'): - os.system(' rm -f ' + getNeoLocation() + 'ImageBoot/neoboot.log;') - log_file = open('%sImageBoot/neoboot.log' % getNeoLocation(), 'a') - log_file.write(line) - log_file.close() - - + if os.path.isfile('' + getNeoLocation() + 'ImageBoot/neoboot.log'): + os.system(' rm -f ' + getNeoLocation() + 'ImageBoot/neoboot.log;') + log_file = open('%sImageBoot/neoboot.log' % getNeoLocation(), 'a') + log_file.write(line) + log_file.close() + + def fileCheck(f, mode='r'): return fileExists(f, mode) and f -# if not IsImageName(): -# from Components.PluginComponent import plugins -# plugins.reloadPlugins() +# if not IsImageName(): +# from Components.PluginComponent import plugins +# plugins.reloadPlugins() def IsImageName(): - if fileExists("/etc/issue"): - for line in open("/etc/issue"): - if "BlackHole" in line or "vuplus" in line: - return True - return False + if fileExists("/etc/issue"): + for line in open("/etc/issue"): + if "BlackHole" in line or "vuplus" in line: + return True + return False def mountp(): - pathmp = [] - if os.path.isfile('/proc/mounts'): - for line in open('/proc/mounts'): - if '/dev/sd' in line or '/dev/disk/by-uuid/' in line or '/dev/mmc' in line or '/dev/mtdblock' in line: - pathmp.append(line.split()[1].replace('\\040', ' ') + '/') - pathmp.append('/usr/share/enigma2/') - pathmp.append('/etc/enigma2/') - pathmp.append('/tmp/') - return pathmp + pathmp = [] + if os.path.isfile('/proc/mounts'): + for line in open('/proc/mounts'): + if '/dev/sd' in line or '/dev/disk/by-uuid/' in line or '/dev/mmc' in line or '/dev/mtdblock' in line: + pathmp.append(line.split()[1].replace('\\040', ' ') + '/') + pathmp.append('/usr/share/enigma2/') + pathmp.append('/etc/enigma2/') + pathmp.append('/tmp/') + return pathmp def getSupportedTuners(): @@ -94,10 +95,10 @@ def getSupportedTuners(): def getFreespace(dev): statdev = os.statvfs(dev) space = statdev.f_bavail * statdev.f_frsize / 1024 - print("[NeoBoot] Free space on %s = %i kilobytes") % (dev, space) + print(("[NeoBoot] Free space on %s = %i kilobytes") % (dev, space)) return space -#check install +# check install def getCheckInstal1(): @@ -133,7 +134,7 @@ def getCheckInstal3(): return neocheckinstal -#check imageATV +# check imageATV def getImageATv(): @@ -146,7 +147,7 @@ def getImageATv(): atvimage = 'okfeedCAMatv' return atvimage -#check install +# check install def getNeoLocation(): @@ -160,11 +161,11 @@ def getNeoLocation(): elif os.path.exists('/media/usb/ImageBoot'): locatinoneo = '/media/usb/' else: - locatinoneo = locatino + locatinoneo = locatino return locatinoneo -#check ext +# check ext def getFormat(): neoformat = 'UNKNOWN' if os.path.exists('/proc/mounts'): @@ -200,7 +201,7 @@ def getNEO_filesystems(): return neo_filesystems -#typ procesora arm lub mips +# typ procesora arm lub mips def getCPUtype(): @@ -215,7 +216,7 @@ def getCPUtype(): cpu = 'MIPS' return cpu -#check install +# check install def getFSTAB(): @@ -282,44 +283,44 @@ def getINSTALLNeo(): neoinstall = '/dev/sdh1' elif lines.find('/dev/sdh2') != -1: neoinstall = '/dev/sdh2' - + return neoinstall def getLocationMultiboot(): LocationMultiboot = 'UNKNOWN' if os.path.exists('/media/sda1/ImageBoot'): - LocationMultiboot = '/dev/sda1' + LocationMultiboot = '/dev/sda1' if os.path.exists('/media/sda2/ImageBoot'): - LocationMultiboot = '/dev/sda2' + LocationMultiboot = '/dev/sda2' if os.path.exists('/media/sdb1/ImageBoot'): - LocationMultiboot = '/dev/sdb1' + LocationMultiboot = '/dev/sdb1' if os.path.exists('/media/sdb2/ImageBoot'): - LocationMultiboot = '/dev/sdb2' + LocationMultiboot = '/dev/sdb2' if os.path.exists('/media/sdc1/ImageBoot'): - LocationMultiboot = '/dev/sdc1' + LocationMultiboot = '/dev/sdc1' if os.path.exists('/media/sdc2/ImageBoot'): - LocationMultiboot = '/dev/sdc2' + LocationMultiboot = '/dev/sdc2' if os.path.exists('/media/sdd1/ImageBoot'): - LocationMultiboot = '/dev/sdd1' + LocationMultiboot = '/dev/sdd1' if os.path.exists('/media/sdd2/ImageBoot'): - LocationMultiboot = '/dev/sdd2' + LocationMultiboot = '/dev/sdd2' if os.path.exists('/media/sde1/ImageBoot'): - LocationMultiboot = '/dev/sde1' + LocationMultiboot = '/dev/sde1' if os.path.exists('/media/sde2/ImageBoot'): - LocationMultiboot = '/dev/sde2' + LocationMultiboot = '/dev/sde2' if os.path.exists('/media/sdf1/ImageBoot'): - LocationMultiboot = '/dev/sdf1' + LocationMultiboot = '/dev/sdf1' if os.path.exists('/media/sdf2/ImageBoot'): - LocationMultiboot = '/dev/sdf2' + LocationMultiboot = '/dev/sdf2' if os.path.exists('/media/sdg1/ImageBoot'): - LocationMultiboot = '/dev/sdg1' + LocationMultiboot = '/dev/sdg1' if os.path.exists('/media/sdg2/ImageBoot'): - LocationMultiboot = '/dev/sdg2' + LocationMultiboot = '/dev/sdg2' if os.path.exists('/media/sdh1/ImageBoot'): - LocationMultiboot = '/dev/sdh1' + LocationMultiboot = '/dev/sdh1' if os.path.exists('/media/sdh2/ImageBoot'): - LocationMultiboot = '/dev/sdh2' + LocationMultiboot = '/dev/sdh2' return LocationMultiboot @@ -334,7 +335,7 @@ def getLabelDisck(): label = 'LABEL=' return label -#checking device neo +# checking device neo def getNeoMountDisc(): @@ -345,7 +346,7 @@ def getNeoMountDisc(): f.close() return lines_mount - + def getNeoMount(): neo = 'UNKNOWN' @@ -385,8 +386,8 @@ def getNeoMount(): neo = 'hdd_install_/dev/sdh2' return neo - - + + def getNeoMount2(): neo = 'UNKNOWN' if os.path.exists('/proc/mounts'): @@ -428,7 +429,7 @@ def getNeoMount2(): elif lines.find('/dev/sdg1 /media/usb2') != -1: neo = 'usb_install_/dev/sdg1' elif lines.find('/dev/sdh1 /media/usb2') != -1: - neo = 'usb_install_/dev/sdh1' + neo = 'usb_install_/dev/sdh1' return neo @@ -472,7 +473,7 @@ def getNeoMount5(): return neo -#zwraca typ chipa prcesora +# zwraca typ chipa prcesora def getCPUSoC(): chipset = 'UNKNOWN' if os.path.exists('/proc/stb/info/chipset'): @@ -480,7 +481,7 @@ def getCPUSoC(): chipset = f.readline().strip() f.close() if chipset == '7405(with 3D)': - chipset = '7405' + chipset = '7405' return chipset @@ -492,7 +493,7 @@ def getCPUSoCModel(): f.close() return devicetree -#zwraca wybrane image w neoboot do uruchomienia +# zwraca wybrane image w neoboot do uruchomienia def getImageNeoBoot(): @@ -503,7 +504,7 @@ def getImageNeoBoot(): f.close() return imagefile -#zwraca model vuplus +# zwraca model vuplus def getBoxVuModel(): @@ -525,10 +526,11 @@ def getVuModel(): f = open("/proc/stb/info/vumodel", 'r') procmodel = f.readline().strip() f.close() - model = procmodel.title().replace("olose", "olo SE").replace("olo2se", "olo2 SE").replace("2", "²") + model = procmodel.title().replace("olose", "olo SE").replace( + "olo2se", "olo2 SE").replace("2", "²") return model -#zwraca nazwe stb z pliku hostname +# zwraca nazwe stb z pliku hostname def getBoxHostName(): @@ -538,10 +540,10 @@ def getBoxHostName(): f.close() return myboxname -#zwraca vuplus/vumodel +# zwraca vuplus/vumodel -def getTunerModel(): #< neoboot.py +def getTunerModel(): # < neoboot.py BOX_NAME = '' if os.path.isfile('/proc/stb/info/vumodel') and not os.path.isfile("/proc/stb/info/boxtype"): BOX_NAME = open('/proc/stb/info/vumodel').read().strip() @@ -552,7 +554,7 @@ def getTunerModel(): #< neoboot.py BOX_NAME = open('/proc/stb/info/model').read().strip() return BOX_NAME -#zwraca strukture folderu zip - vuplus/vumodel +# zwraca strukture folderu zip - vuplus/vumodel def getImageFolder(): @@ -561,7 +563,7 @@ def getImageFolder(): ImageFolder = 'vuplus/' + BOX_NAME return ImageFolder -#zwraca nazwe kernela z /lib/modules +# zwraca nazwe kernela z /lib/modules def getKernelVersion(): @@ -576,7 +578,7 @@ def getKernelVersion(): def runCMDS(cmdsList): clearMemory() if isinstance(cmdsList, (list, tuple)): - myCMD = '\n'.join(cmdsList)# + '\n' + myCMD = '\n'.join(cmdsList) # + '\n' ret = os.system(myCMD) return rett @@ -585,47 +587,47 @@ def getImageDistroN(): image = 'Internal storage' if fileExists('/.multinfo') and fileExists('%sImageBoot/.imagedistro' % getNeoLocation()): - with open('%sImageBoot/.imagedistro' % getNeoLocation(), 'r') as f: - image = f.readline().strip() - f.close() + with open('%sImageBoot/.imagedistro' % getNeoLocation(), 'r') as f: + image = f.readline().strip() + f.close() elif not fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'): - f = open("/etc/vtiversion.info", 'r') - imagever = f.readline().strip().replace("Release ", " ") - f.close() - image = imagever + f = open("/etc/vtiversion.info", 'r') + imagever = f.readline().strip().replace("Release ", " ") + f.close() + image = imagever elif not fileExists('/.multinfo') and fileExists('/etc/bhversion'): - f = open("/etc/bhversion", 'r') - imagever = f.readline().strip() - f.close() - image = imagever + f = open("/etc/bhversion", 'r') + imagever = f.readline().strip() + f.close() + image = imagever # elif not fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'): # image = 'VTI Team Image ' elif fileExists('/.multinfo') and fileExists('/etc/bhversion'): - image = 'Flash ' + ' ' + getBoxHostName() + image = 'Flash ' + ' ' + getBoxHostName() elif fileExists('/.multinfo') and fileExists('/etc/vtiversion.info'): - image = 'Flash ' + ' ' + getBoxHostName() + image = 'Flash ' + ' ' + getBoxHostName() elif fileExists('/usr/lib/enigma2/python/boxbranding.so') and not fileExists('/.multinfo'): - from boxbranding import getImageDistro - image = getImageDistro() + from boxbranding import getImageDistro + image = getImageDistro() elif fileExists('/media/InternalFlash/etc/issue.net') and fileExists('/.multinfo') and not fileExists('%sImageBoot/.imagedistro' % getNeoLocation()): - obraz = open('/media/InternalFlash/etc/issue.net', 'r').readlines() - imagetype = obraz[0][:-3] - image = imagetype + obraz = open('/media/InternalFlash/etc/issue.net', 'r').readlines() + imagetype = obraz[0][:-3] + image = imagetype elif fileExists('/etc/issue.net') and not fileExists('/.multinfo'): - obraz = open('/etc/issue.net', 'r').readlines() - imagetype = obraz[0][:-3] - image = imagetype + obraz = open('/etc/issue.net', 'r').readlines() + imagetype = obraz[0][:-3] + image = imagetype else: - image = 'Inernal Flash ' + ' ' + getBoxHostName() + image = 'Inernal Flash ' + ' ' + getBoxHostName() return image @@ -644,7 +646,8 @@ def getKernelVersionString(): def getKernelImageVersion(): try: from glob import glob - lines = open(glob('/var/lib/opkg/info/kernel-*.control')[0], 'r').readlines() + lines = open(glob('/var/lib/opkg/info/kernel-*.control') + [0], 'r').readlines() kernelimage = lines[1][:-1] except: kernelimage = getKernelVersionString @@ -909,146 +912,198 @@ def getMachineProcModel(): def getMountPointAll(): - os.system('touch ' + LinkNeoBoot + '/files/mountpoint.sh; echo "#!/bin/sh\n" >> ' + LinkNeoBoot + '/files/mountpoint.sh; chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh') - if getNeoMount() == 'hdd_install_/dev/sda1': - os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/hdd\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount() == 'hdd_install_/dev/sdb1': - os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/hdd\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount() == 'hdd_install_/dev/sda2': - os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sda2\n/bin/mount /dev/sda2 /media/hdd\n/bin/mount /dev/sda2 /media/sda2" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount() == 'hdd_install_/dev/sdb2': - os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sdb2\n/bin/mount /dev/sdb2 /media/hdd\n/bin/mount /dev/sdb2 /media/sdb2" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - #--------------------------------------------- - if getNeoMount2() == 'usb_install_/dev/sdb1': - os.system('echo "\numount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/usb\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sda1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/sda1\n/bin/mount /dev/sda1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdb2': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdb2\n/bin/mount /dev/sdb2 /media/sdb2\n/bin/mount /dev/sdb2 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdc1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdc1\n/bin/mount /dev/sdc1 /media/sdb2\n/bin/mount /dev/sdc1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdd1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdd1\n/bin/mount /dev/sdd1 /media/sdd1\n/bin/mount /dev/sdd1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sde1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sde1\n/bin/mount /dev/sde1 /media/sde1\n/bin/mount /dev/sde1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdf1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdf1\n/bin/mount /dev/sdf1 /media/sdf1\n/bin/mount /dev/sdf1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdg1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdg1\n/bin/mount /dev/sdg1 /media/sdg1\n/bin/mount /dev/sdg1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdh1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdh1\n/bin/mount /dev/sdh1 /media/sdh1\n/bin/mount /dev/sdh1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - #--------------------------------------------- - elif getNeoMount3() == 'cf_install_/dev/sda1': - os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\nmkdir -p /media/sdb1\n/bin/mount /dev/sda1 /media/cf\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount3() == 'cf_install_/dev/sdb1': - os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/cf\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - #--------------------------------------------- - elif getNeoMount4() == 'card_install_/dev/sda1': - os.system('echo "umount -l /media/card\nmkdir -p /media/card\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/card\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount4() == 'card_install_/dev/sdb1': - os.system('echo "umount -l /media/card\nmkdir -p /media/card\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/card\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - #--------------------------------------------- - elif getNeoMount5() == 'mmc_install_/dev/sda1': - os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/mmc\n/bin/mount /dev/sda1 /media/sda1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount5() == 'mmc_install_/dev/sdb1': - os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/mmc\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - os.system('echo "\n\nexit 0" >> ' + LinkNeoBoot + '/files/mountpoint.sh') + os.system('touch ' + LinkNeoBoot + '/files/mountpoint.sh; echo "#!/bin/sh\n" >> ' + + LinkNeoBoot + '/files/mountpoint.sh; chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh') + if getNeoMount() == 'hdd_install_/dev/sda1': + os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/hdd\n/bin/mount /dev/sda1 /media/sda1" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount() == 'hdd_install_/dev/sdb1': + os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/hdd\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount() == 'hdd_install_/dev/sda2': + os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sda2\n/bin/mount /dev/sda2 /media/hdd\n/bin/mount /dev/sda2 /media/sda2" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount() == 'hdd_install_/dev/sdb2': + os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\nmkdir -p /media/sdb2\n/bin/mount /dev/sdb2 /media/hdd\n/bin/mount /dev/sdb2 /media/sdb2" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + # --------------------------------------------- + if getNeoMount2() == 'usb_install_/dev/sdb1': + os.system('echo "\numount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/usb\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sda1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/sda1\n/bin/mount /dev/sda1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdb2': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdb2\n/bin/mount /dev/sdb2 /media/sdb2\n/bin/mount /dev/sdb2 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdc1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdc1\n/bin/mount /dev/sdc1 /media/sdb2\n/bin/mount /dev/sdc1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdd1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdd1\n/bin/mount /dev/sdd1 /media/sdd1\n/bin/mount /dev/sdd1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sde1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sde1\n/bin/mount /dev/sde1 /media/sde1\n/bin/mount /dev/sde1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdf1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdf1\n/bin/mount /dev/sdf1 /media/sdf1\n/bin/mount /dev/sdf1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdg1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdg1\n/bin/mount /dev/sdg1 /media/sdg1\n/bin/mount /dev/sdg1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdh1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\nmkdir -p /media/sdh1\n/bin/mount /dev/sdh1 /media/sdh1\n/bin/mount /dev/sdh1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + # --------------------------------------------- + elif getNeoMount3() == 'cf_install_/dev/sda1': + os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\nmkdir -p /media/sdb1\n/bin/mount /dev/sda1 /media/cf\n/bin/mount /dev/sda1 /media/sda1" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount3() == 'cf_install_/dev/sdb1': + os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/cf\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + # --------------------------------------------- + elif getNeoMount4() == 'card_install_/dev/sda1': + os.system('echo "umount -l /media/card\nmkdir -p /media/card\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/card\n/bin/mount /dev/sda1 /media/sda1" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount4() == 'card_install_/dev/sdb1': + os.system('echo "umount -l /media/card\nmkdir -p /media/card\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/card\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + # --------------------------------------------- + elif getNeoMount5() == 'mmc_install_/dev/sda1': + os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\nmkdir -p /media/sda1\n/bin/mount /dev/sda1 /media/mmc\n/bin/mount /dev/sda1 /media/sda1" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount5() == 'mmc_install_/dev/sdb1': + os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\nmkdir -p /media/sdb1\n/bin/mount /dev/sdb1 /media/mmc\n/bin/mount /dev/sdb1 /media/sdb1" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + os.system('echo "\n\nexit 0" >> ' + LinkNeoBoot + '/files/mountpoint.sh') def getMountPointNeo(): - os.system('' + LinkNeoBoot + '/files/mountpoint.sh') - os.system('echo ' + getLocationMultiboot() + ' > ' + LinkNeoBoot + '/bin/install; chmod 0755 ' + LinkNeoBoot + '/bin/install') - if getLocationMultiboot() == '/dev/sda1': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sda1 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - elif getLocationMultiboot() == '/dev/sdb1': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sdb1 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - elif getLocationMultiboot() == '/dev/sda2': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sda2 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - elif getLocationMultiboot() == '/dev/sdb2': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sdb2 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - elif getLocationMultiboot() == '/dev/sdc1': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sdc1 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - elif getLocationMultiboot() == '/dev/sdd1': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sdd1 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - elif getLocationMultiboot() == '/dev/sde1': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sde1 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - elif getLocationMultiboot() == '/dev/sdf1': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sdf1 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - elif getLocationMultiboot() == '/dev/sdg1': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sdg1 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - elif getLocationMultiboot() == '/dev/sdh1': - out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') - out.write('#!/bin/sh\n\n/bin/mount /dev/sdh1 ' + getNeoLocation() + ' \n\nexit 0') - out.close() - - os.system('chmod 755 ' + LinkNeoBoot + '/files/neo.sh') + os.system('' + LinkNeoBoot + '/files/mountpoint.sh') + os.system('echo ' + getLocationMultiboot() + ' > ' + LinkNeoBoot + + '/bin/install; chmod 0755 ' + LinkNeoBoot + '/bin/install') + if getLocationMultiboot() == '/dev/sda1': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sda1 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + elif getLocationMultiboot() == '/dev/sdb1': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sdb1 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + elif getLocationMultiboot() == '/dev/sda2': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sda2 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + elif getLocationMultiboot() == '/dev/sdb2': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sdb2 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + elif getLocationMultiboot() == '/dev/sdc1': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sdc1 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + elif getLocationMultiboot() == '/dev/sdd1': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sdd1 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + elif getLocationMultiboot() == '/dev/sde1': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sde1 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + elif getLocationMultiboot() == '/dev/sdf1': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sdf1 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + elif getLocationMultiboot() == '/dev/sdg1': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sdg1 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + elif getLocationMultiboot() == '/dev/sdh1': + out = open('' + LinkNeoBoot + '/files/neo.sh', 'w') + out.write('#!/bin/sh\n\n/bin/mount /dev/sdh1 ' + + getNeoLocation() + ' \n\nexit 0') + out.close() + + os.system('chmod 755 ' + LinkNeoBoot + '/files/neo.sh') def getMountPointNeo2(): - #--------------------------------------------- - os.system('touch ' + LinkNeoBoot + '/files/mountpoint.sh; echo "#!/bin/sh" > ' + LinkNeoBoot + '/files/mountpoint.sh; chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh') - if getNeoMount() == 'hdd_install_/dev/sda1': - os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda1 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount() == 'hdd_install_/dev/sdb1': - os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sdb1 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount() == 'hdd_install_/dev/sda2': - os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount() == 'hdd_install_/dev/sdb2': - os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - #--------------------------------------------- - if getNeoMount2() == 'usb_install_/dev/sdb1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sda1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sda1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdb2': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb2 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdc1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdc1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdd1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdd1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sde1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sde1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdf1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdf1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdg1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdg1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount2() == 'usb_install_/dev/sdh1': - os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdh1 /media/usb" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - #--------------------------------------------- - elif getNeoMount3() == 'cf_install_/dev/sda1': - os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sda1 /media/cf" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount3() == 'cf_install_/dev/sdb1': - os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sdb1 /media/cf" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - #--------------------------------------------- - elif getNeoMount4() == 'card_install_/dev/sda1': - os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sda1 /media/card" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount4() == 'card_install_/dev/sdb1': - os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sdb1 /media/card" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - #--------------------------------------------- - elif getNeoMount5() == 'mmc_install_/dev/sda1': - os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sda1 /media/mmc" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - elif getNeoMount5() == 'mmc_install_/dev/sdb1': - os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sdb1 /media/mmc" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - os.system('echo "\n\nexit 0" >> ' + LinkNeoBoot + '/files/mountpoint.sh') - + # --------------------------------------------- + os.system('touch ' + LinkNeoBoot + '/files/mountpoint.sh; echo "#!/bin/sh" > ' + + LinkNeoBoot + '/files/mountpoint.sh; chmod 0755 ' + LinkNeoBoot + '/files/mountpoint.sh') + if getNeoMount() == 'hdd_install_/dev/sda1': + os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda1 /media/hdd" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount() == 'hdd_install_/dev/sdb1': + os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sdb1 /media/hdd" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount() == 'hdd_install_/dev/sda2': + os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount() == 'hdd_install_/dev/sdb2': + os.system('echo "umount -l /media/hdd\nmkdir -p /media/hdd\n/bin/mount /dev/sda2 /media/hdd" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + # --------------------------------------------- + if getNeoMount2() == 'usb_install_/dev/sdb1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sda1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sda1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdb2': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdb2 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdc1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdc1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdd1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdd1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sde1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sde1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdf1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdf1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdg1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdg1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount2() == 'usb_install_/dev/sdh1': + os.system('echo "umount -l /media/usb\nmkdir -p /media/usb\n/bin/mount /dev/sdh1 /media/usb" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + # --------------------------------------------- + elif getNeoMount3() == 'cf_install_/dev/sda1': + os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sda1 /media/cf" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount3() == 'cf_install_/dev/sdb1': + os.system('echo "umount -l /media/cf\nmkdir -p /media/cf\n/bin/mount /dev/sdb1 /media/cf" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + # --------------------------------------------- + elif getNeoMount4() == 'card_install_/dev/sda1': + os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sda1 /media/card" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount4() == 'card_install_/dev/sdb1': + os.system('echo "umount -l /media/card\nmkdir -p /media/card\n/bin/mount /dev/sdb1 /media/card" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + # --------------------------------------------- + elif getNeoMount5() == 'mmc_install_/dev/sda1': + os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sda1 /media/mmc" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + elif getNeoMount5() == 'mmc_install_/dev/sdb1': + os.system('echo "umount -l /media/mmc\nmkdir -p /media/mmc\n/bin/mount /dev/sdb1 /media/mmc" >> ' + + LinkNeoBoot + '/files/mountpoint.sh') + os.system('echo "\n\nexit 0" >> ' + LinkNeoBoot + '/files/mountpoint.sh') + + def getBoxMacAddres(): ethernetmac = 'UNKNOWN' if not fileExists('/etc/.nameneo'): @@ -1058,19 +1113,21 @@ def getBoxMacAddres(): ethernetmac = f.readline().strip() f.close() os.system('cp -r /etc/.nameneo /tmp/.mymac') - #return ethernetmac + # return ethernetmac elif fileExists('/tmp/.mymac'): - f = open("/tmp/.mymac", 'r') - myboxmac = f.readline().strip().replace("eth0 Link encap:Ethernet HWaddr ", "") - f.close() - ethernetmac = myboxmac - writefile = open('/tmp/.mymac' , 'w') - writefile.write(myboxmac) - writefile.close() + f = open("/tmp/.mymac", 'r') + myboxmac = f.readline().strip().replace( + "eth0 Link encap:Ethernet HWaddr ", "") + f.close() + ethernetmac = myboxmac + writefile = open('/tmp/.mymac', 'w') + writefile.write(myboxmac) + writefile.close() elif not fileExists('/tmp/.mymac'): - ethernetmac = '12:34:56:78:91:02' - return ethernetmac + ethernetmac = '12:34:56:78:91:02' + return ethernetmac + def getCheckActivateVip(): supportedvip = '' @@ -1081,56 +1138,78 @@ def getCheckActivateVip(): if lines.find("%s" % getBoxMacAddres()) != -1: supportedvip = '%s' % getBoxMacAddres() return supportedvip - + + def getMountDiskSTB(): neo_disk = ' ' if os.path.exists('/proc/mounts'): with open('/proc/mounts', 'r') as f: lines = f.read() - f.close() + f.close() if lines.find('/dev/sda1 /media/hdd') != -1: - os.system('touch /tmp/disk/sda1; touch /tmp/disk/#---Select_the_disk_HDD:') + os.system( + 'touch /tmp/disk/sda1; touch /tmp/disk/#---Select_the_disk_HDD:') if lines.find('/dev/sdb1 /media/hdd') != -1: - os.system('touch /tmp/disk/sdb1; touch /tmp/disk/#---Select_the_disk_HDD:') + os.system( + 'touch /tmp/disk/sdb1; touch /tmp/disk/#---Select_the_disk_HDD:') if lines.find('/dev/sda2 /media/hdd') != -1: - os.system('touch /tmp/disk/sda2; touch /tmp/disk/#---Select_the_disk_HDD:') + os.system( + 'touch /tmp/disk/sda2; touch /tmp/disk/#---Select_the_disk_HDD:') if lines.find('/dev/sdb2 /media/hdd') != -1: - os.system('touch /tmp/disk/sdb2; touch /tmp/disk/#---Select_the_disk_HDD:') + os.system( + 'touch /tmp/disk/sdb2; touch /tmp/disk/#---Select_the_disk_HDD:') if lines.find('/dev/sdc1 /media/hdd') != -1: - os.system('touch /tmp/disk/sdc1; touch /tmp/disk/#---Select_the_disk_HDD:') + os.system( + 'touch /tmp/disk/sdc1; touch /tmp/disk/#---Select_the_disk_HDD:') if lines.find('/dev/sdd1 /media/hdd') != -1: - os.system('touch /tmp/disk/sdd1; touch /tmp/disk/#---Select_the_disk_HDD:') + os.system( + 'touch /tmp/disk/sdd1; touch /tmp/disk/#---Select_the_disk_HDD:') if lines.find('/dev/sde1 /media/hdd') != -1: - os.system('touch /tmp/disk/sde1; touch /tmp/disk/#---Select_the_disk_HDD:') + os.system( + 'touch /tmp/disk/sde1; touch /tmp/disk/#---Select_the_disk_HDD:') if lines.find('/dev/sdf1 /media/hdd') != -1: - os.system('touch /tmp/disk/sdf1; touch /tmp/disk/#---Select_the_disk_HDD:') + os.system( + 'touch /tmp/disk/sdf1; touch /tmp/disk/#---Select_the_disk_HDD:') if lines.find('/dev/sdg1 /media/hdd') != -1: - os.system('touch /tmp/disk/sdg1; touch /tmp/disk/#---Select_the_disk_HDD:') + os.system( + 'touch /tmp/disk/sdg1; touch /tmp/disk/#---Select_the_disk_HDD:') if lines.find('/dev/sdh1 /media/hdd') != -1: - os.system('touch /tmp/disk/sdh1; touch /tmp/disk/#---Select_the_disk_HDD:') - #--------------------------------------------- + os.system( + 'touch /tmp/disk/sdh1; touch /tmp/disk/#---Select_the_disk_HDD:') + # --------------------------------------------- if lines.find('/dev/sda1 /media/usb') != -1: - os.system('touch /tmp/disk/sda1; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sda1; touch /tmp/disk/#---Select_the_disk_USB:') if lines.find('/dev/sdb1 /media/usb') != -1: - os.system('touch /tmp/disk/sdb1; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sdb1; touch /tmp/disk/#---Select_the_disk_USB:') if lines.find('/dev/sda2 /media/usb') != -1: - os.system('touch /tmp/disk/sda2; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sda2; touch /tmp/disk/#---Select_the_disk_USB:') if lines.find('/dev/sdb2 /media/usb') != -1: - os.system('touch /tmp/disk/sdb2; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sdb2; touch /tmp/disk/#---Select_the_disk_USB:') if lines.find('/dev/sdc1 /media/usb') != -1: - os.system('touch /tmp/disk/sdc1; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sdc1; touch /tmp/disk/#---Select_the_disk_USB:') if lines.find('/dev/sdd1 /media/usb') != -1: - os.system('touch /tmp/disk/sdd1; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sdd1; touch /tmp/disk/#---Select_the_disk_USB:') if lines.find('/dev/sde1 /media/usb') != -1: - os.system('touch /tmp/disk/sde1; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sde1; touch /tmp/disk/#---Select_the_disk_USB:') if lines.find('/dev/sdf1 /media/usb') != -1: - os.system('touch /tmp/disk/sdf1; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sdf1; touch /tmp/disk/#---Select_the_disk_USB:') if lines.find('/dev/sdg1 /media/usb') != -1: - os.system('touch /tmp/disk/sdg1; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sdg1; touch /tmp/disk/#---Select_the_disk_USB:') if lines.find('/dev/sdh1 /media/usb') != -1: - os.system('touch /tmp/disk/sdh1; touch /tmp/disk/#---Select_the_disk_USB:') + os.system( + 'touch /tmp/disk/sdh1; touch /tmp/disk/#---Select_the_disk_USB:') + + return neo_disk - return neo_disk def getCheckExtDisk(): os.system("cat /proc/mounts | egrep -o '.ext.' | sort | uniq > /tmp/.myext") @@ -1138,8 +1217,9 @@ def getCheckExtDisk(): with open('/tmp/.myext', 'r') as f: myboxEXT = f.readline().strip() f.close() - return myboxEXT - + return myboxEXT + + def getCheckExt(): neoExt = 'UNKNOWN' if os.path.exists('/proc/mounts'): @@ -1157,9 +1237,10 @@ def getCheckExt(): elif lines.find('/media/usb ext3') != -1: neoExt = 'ext3' elif lines.find('/media/usb ext4') != -1: - neoExt = 'ext4' + neoExt = 'ext4' return neoExt + def getExtCheckHddUsb(): neoExt = 'UNKNOWN' if os.path.exists('/proc/mounts'): @@ -1169,12 +1250,13 @@ def getExtCheckHddUsb(): if lines.find('/media/hdd ext4') != -1 or lines.find('/media/hdd type ext4') != -1 and os.path.exists('/media/hdd/ImageBoot'): neoExt = 'ext4' if lines.find('/media/usb ext4') != -1 or lines.find('/media/usb type ext4') != -1 and os.path.exists('/media/usb/ImageBoot'): - neoExt = 'ext4' + neoExt = 'ext4' return neoExt + def getNandWrite(): NandWrite = 'NandWrite' - if fileExists('/usr/lib/python2.7'): + if fileExists('/usr/lib/python2.7'): if os.path.exists('/usr/sbin/nandwrite'): with open('/usr/sbin/nandwrite', 'r') as f: lines = f.read() @@ -1183,12 +1265,14 @@ def getNandWrite(): NandWrite = 'nandwrite' else: NandWrite = 'no_nandwrite' - + return NandWrite + def getMyUUID(): - #os.system("tune2fs -l /dev/sd?? | awk '/UUID/ {print $NF}' > /tmp/.myuuid") - os.system("tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.myuuid" % (getLocationMultiboot())) + # os.system("tune2fs -l /dev/sd?? | awk '/UUID/ {print $NF}' > /tmp/.myuuid") + os.system( + "tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.myuuid" % (getLocationMultiboot())) try: if os.path.isfile('/tmp/.myuuid'): return open('/tmp/.myuuid').read().strip().upper() @@ -1197,27 +1281,30 @@ def getMyUUID(): return _('unavailable') + def getImageBootNow(): imagefile = 'UNKNOWN' if os.path.exists('/.multinfo'): - with open('/.multinfo' , 'r') as f: + with open('/.multinfo', 'r') as f: imagefile = f.readline().strip() f.close() return imagefile -def getNeoActivatedtest(): - neoactivated = 'NEOBOOT MULTIBOOT' - if not fileExists('/.multinfo'): - if getCheckActivateVip() != getBoxMacAddres(): - neoactivated = 'Ethernet MAC not found.' - elif not fileExists('/usr/lib/periodon/.kodn'): - neoactivated = 'VIP Pin code missing.' - elif getTestToTest() != UPDATEVERSION : - neoactivated = _('Update %s is available.') % getTestToTest() - else: - if getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn') and getTestToTest() == UPDATEVERSION : - neoactivated = 'NEOBOOT VIP ACTIVATED' - return neoactivated +def getNeoActivatedtest(): + neoactivated = 'NEOBOOT MULTIBOOT' + if not fileExists('/.multinfo'): + if getCheckActivateVip() != getBoxMacAddres(): + neoactivated = 'Ethernet MAC not found.' + elif not fileExists('/usr/lib/periodon/.kodn'): + neoactivated = 'VIP Pin code missing.' + elif getTestToTest() != UPDATEVERSION: + neoactivated = _('Update %s is available.') % getTestToTest() + else: + if getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn') and getTestToTest() == UPDATEVERSION: + neoactivated = 'NEOBOOT VIP ACTIVATED' + + return neoactivated + boxbrand = sys.modules[__name__] diff --git a/NeoBoot/files/testinout b/NeoBoot/files/testinout index 80eb8e4..2ff3289 100644 --- a/NeoBoot/files/testinout +++ b/NeoBoot/files/testinout @@ -10,8 +10,8 @@ from Tools.Directories import fileExists, SCOPE_PLUGINS def getAccesDate(): timego = '' - dana = getTestOutTime() # etc Nie! Szukana liczba jest wieksza! - strzal = getTestInTime() # tmp Nie! Szukana liczba jest mniejsza! + dana = getTestOutTime() # etc Nie! Szukana liczba jest wieksza! + strzal = getTestInTime() # tmp Nie! Szukana liczba jest mniejsza! if strzal == dana: timego = 'access' elif strzal < dana: diff --git a/NeoBoot/files/tools.py b/NeoBoot/files/tools.py index f743315..ed1221c 100644 --- a/NeoBoot/files/tools.py +++ b/NeoBoot/files/tools.py @@ -2,8 +2,7 @@ # -*- coding: utf-8 -*- # system modules -from __future__ import absolute_import -from __future__ import print_function + from Plugins.Extensions.NeoBoot.__init__ import _ import codecs from enigma import getDesktop @@ -52,28 +51,34 @@ neoboot = getNeoLocation() media = getNeoLocation() mediahome = media + '/ImageBoot/' + def getDS(): s = getDesktop(0).size() return (s.width(), s.height()) + def isFHD(): desktopSize = getDS() return desktopSize[0] == 1920 + def isHD(): desktopSize = getDS() return desktopSize[0] >= 1280 and desktopSize[0] < 1920 + def isUHD(): desktopSize = getDS() return desktopSize[0] >= 1920 and desktopSize[0] < 3840 + def getKernelVersion(): try: return open('/proc/version', 'r').read().split(' ', 4)[2].split('-', 2)[0] except: return _('unknown') - + + def getCPUtype(): cpu = 'UNKNOWN' if os.path.exists('/proc/cpuinfo'): @@ -86,20 +91,22 @@ def getCPUtype(): cpu = 'MIPS' return cpu -def getNeoActivatedtest(): - neoactivated = 'NEOBOOT MULTIBOOT' - if not fileExists('/.multinfo'): - if getCheckActivateVip() != getBoxMacAddres(): - neoactivated = 'Ethernet MAC not found.' - elif not fileExists('/usr/lib/periodon/.kodn'): - neoactivated = 'VIP Pin code missing.' - elif getTestToTest() != UPDATEVERSION : - neoactivated = _('Update %s is available.') % getTestToTest() - else: - if getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn') and getTestToTest() == UPDATEVERSION : - neoactivated = 'NEOBOOT VIP ACTIVATED' - return neoactivated +def getNeoActivatedtest(): + neoactivated = 'NEOBOOT MULTIBOOT' + if not fileExists('/.multinfo'): + if getCheckActivateVip() != getBoxMacAddres(): + neoactivated = 'Ethernet MAC not found.' + elif not fileExists('/usr/lib/periodon/.kodn'): + neoactivated = 'VIP Pin code missing.' + elif getTestToTest() != UPDATEVERSION: + neoactivated = _('Update %s is available.') % getTestToTest() + else: + if getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn') and getTestToTest() == UPDATEVERSION: + neoactivated = 'NEOBOOT VIP ACTIVATED' + + return neoactivated + if os.path.exists('/etc/hostname'): with open('/etc/hostname', 'r') as f: @@ -116,6 +123,7 @@ if os.path.exists('/proc/stb/info/boxtype'): boxtype = f.readline().strip() f.close() + class BoundFunction: __module__ = __name__ @@ -126,6 +134,7 @@ class BoundFunction: def __call__(self): self.fnc(*self.args) + class MBTools(Screen): if isFHD(): skin = """ @@ -150,12 +159,12 @@ class MBTools(Screen): self['list'] = List(self.list) self.updateList() self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk, - 'back': self.close}) + 'back': self.close}) def updateList(self): self.list = [] mypath = '' + LinkNeoBoot + '' -# if not fileExists('/tmp/.testneo') and getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn'): +# if not fileExists('/tmp/.testneo') and getCheckActivateVip() == getBoxMacAddres() and fileExists('/usr/lib/periodon/.kodn'): # os.system(("mv /tmp/.mymac /usr/lib/periodon/.activatedmac; touch /tmp/.testneo ")) if not fileExists(mypath + 'icons'): mypixmap = '' + LinkNeoBoot + '/images/ok.png' @@ -175,7 +184,7 @@ class MBTools(Screen): res = (_('Set the disk label and uuid'), png, 3) self.list.append(res) - self['list']. list = self.list + self['list']. list = self.list res = (_('Delete image ZIP from the ImagesUpload directory'), png, 4) self.list.append(res) @@ -244,32 +253,32 @@ class MBTools(Screen): res = (_('Supported sat tuners'), png, 20) self.list.append(res) self['list']. list = self.list - + res = (_('Install IPTVPlayer'), png, 21) self.list.append(res) - self['list']. list = self.list - + self['list']. list = self.list + res = (_('Install Multi Stalker'), png, 22) self.list.append(res) self['list']. list = self.list - + res = (_('Install Multiboot Flash Online'), png, 23) self.list.append(res) self['list']. list = self.list - + res = (_('Install Dream Sat Panel'), png, 24) self.list.append(res) self['list']. list = self.list - + res = (_('Initialization - formatting disk for neoboot.'), png, 25) self.list.append(res) - self['list']. list = self.list - - if "vu" + getBoxVuModel() == getBoxHostName() or getBoxHostName() == "et5x00" and getCPUtype() == "MIPS" and not fileExists('/.multinfo'): + self['list']. list = self.list + + if "vu" + getBoxVuModel() == getBoxHostName() or getBoxHostName() == "et5x00" and getCPUtype() == "MIPS" and not fileExists('/.multinfo'): res = (_('Boot Managers.'), png, 26) self.list.append(res) - self['list']. list = self.list - + self['list']. list = self.list + res = (_('NeoBoot Information'), png, 27) self.list.append(res) self['list']. list = self.list @@ -277,7 +286,7 @@ class MBTools(Screen): res = (_('NeoBoot donate'), png, 28) self.list.append(res) self['list']. list = self.list - + def KeyOk(self): self.sel = self['list'].getCurrent() if self.sel: @@ -289,7 +298,7 @@ class MBTools(Screen): if self.sel == 2 and self.session.open(MenagerDevices): pass if self.sel == 3 and self.session.open(SetDiskLabel): - pass + pass if self.sel == 4 and self.session.open(MBDeleUpload): pass if self.sel == 5 and self.session.open(BackupMultiboot): @@ -325,24 +334,25 @@ class MBTools(Screen): if self.sel == 20 and self.session.open(TunerInfo): pass if self.sel == 21 and self.session.open(IPTVPlayerInstall): - pass + pass if self.sel == 22 and self.session.open(MultiStalker): pass if self.sel == 23 and self.session.open(MultibootFlashonline): - pass + pass if self.sel == 24 and self.session.open(DreamSatPanel): - pass + pass if self.sel == 25 and self.session.open(InitializationFormattingDisk): - pass + pass if self.sel == 26 and self.session.open(BootManagers): - pass + pass if self.sel == 27 and self.session.open(MultiBootMyHelp): pass if self.sel == 28 and self.session.open(neoDONATION): - pass + pass # if self.sel == 28and self.session.open(CheckInternet): # pass + class MBBackup(Screen): if isFHD(): skin = """ @@ -374,8 +384,8 @@ class MBBackup(Screen): self['key_red'] = Label(_('Backup')) self['list'] = List([]) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'ok': self.backupImage, - 'red': self.backupImage}) + 'ok': self.backupImage, + 'red': self.backupImage}) if pathExists('/media/usb/ImageBoot'): neoboot = 'usb' elif pathExists('/media/hdd/ImageBoot'): @@ -386,46 +396,46 @@ class MBBackup(Screen): # def updateInfo(self): # if pathExists('/media/usb/ImageBoot'): - # neoboot = 'usb' + # neoboot = 'usb' # elif pathExists('/media/hdd/ImageBoot'): - # neoboot = 'hdd' + # neoboot = 'hdd' # device = '/media/' + neoboot + '' # usfree = '0' # devicelist = ['cf', - # 'hdd', - # 'card', - # 'usb', - # 'usb2'] + # 'hdd', + # 'card', + # 'usb', + # 'usb2'] # for d in devicelist: - # test = '/media/' + d + '/ImageBoot/.neonextboot' - # if fileExists(test): - # device = '/media/' + d + # test = '/media/' + d + '/ImageBoot/.neonextboot' + # if fileExists(test): + # device = '/media/' + d # rc = system('df > /tmp/ninfo.tmp') # f = open('/proc/mounts', 'r') # for line in f.readlines(): - # if line.find('/hdd') != -1: - # self.backupdir = '/media/' + neoboot + '/CopyImageNEO' - # device = '/media/' + neoboot + '' + # if line.find('/hdd') != -1: + # self.backupdir = '/media/' + neoboot + '/CopyImageNEO' + # device = '/media/' + neoboot + '' # f.close() # if pathExists(self.backupdir) == 0 and createDir(self.backupdir): - # pass + # pass # if fileExists('/tmp/ninfo.tmp'): - # f = open('/tmp/ninfo.tmp', 'r') - # for line in f.readlines(): - # line = line.replace('part1', ' ') - # parts = line.strip().split() - # totsp = len(parts) - 1 - # if parts[totsp] == device: - # if totsp == 5: - # usfree = parts[3] - # else: - # usfree = parts[2] - # break + # f = open('/tmp/ninfo.tmp', 'r') + # for line in f.readlines(): + # line = line.replace('part1', ' ') + # parts = line.strip().split() + # totsp = len(parts) - 1 + # if parts[totsp] == device: + # if totsp == 5: + # usfree = parts[3] + # else: + # usfree = parts[2] + # break - # f.close() - # os_remove('/tmp/ninfo.tmp') + # f.close() + # os_remove('/tmp/ninfo.tmp') # self.availablespace = usfree[0:-3] # strview = _('You have the following images installed') # self['lab1'].setText(strview) @@ -433,9 +443,9 @@ class MBBackup(Screen): # self['lab2'].setText(strview) # imageslist = ['Flash'] # for fn in listdir('/media/' + neoboot + '/ImageBoot'): - # dirfile = '/media/' + neoboot + '/ImageBoot/' + fn - # if os_isdir(dirfile) and imageslist.append(fn): - # pass + # dirfile = '/media/' + neoboot + '/ImageBoot/' + fn + # if os_isdir(dirfile) and imageslist.append(fn): + # pass # self['list'].list = imageslist @@ -482,23 +492,23 @@ class MBBackup(Screen): self['lab1'].setText(strview) strview = _('You still have free: ') + self.availablespace + ' MB' self['lab2'].setText(strview) - + imageslist = ['Flash'] for fn in listdir('/media/' + neoboot + '/ImageBoot'): dirfile = '/media/' + neoboot + '/ImageBoot/' + fn if os_isdir(dirfile): imageslist.append(fn) - - imageslist[1:] = sorted(imageslist[1:]) - - self['list'].list = imageslist + imageslist[1:] = sorted(imageslist[1:]) + + self['list'].list = imageslist def backupImage(self): if not fileExists('/.multinfo'): self.backupImage2() else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) def backupImage2(self): image = self['list'].getCurrent() @@ -506,12 +516,15 @@ class MBBackup(Screen): self.backimage = image.strip() myerror = '' if self.backimage == 'Flash': - myerror = _('Unfortunately you cannot backup from flash with this plugin. \nInstall backupsuite to a copy of the image from flash memory.') + myerror = _( + 'Unfortunately you cannot backup from flash with this plugin. \nInstall backupsuite to a copy of the image from flash memory.') if int(self.availablespace) < 150: - myerror = _('There is no space to make a copy of the image. You need 150 Mb of free space for copying the image.') + myerror = _( + 'There is no space to make a copy of the image. You need 150 Mb of free space for copying the image.') if myerror == '': message = (_('Make copies of the image: %s now ?') % image) - ybox = self.session.openWithCallback(self.dobackupImage, MessageBox, message, MessageBox.TYPE_YESNO) + ybox = self.session.openWithCallback( + self.dobackupImage, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Backup confirmation')) else: self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) @@ -522,21 +535,24 @@ class MBBackup(Screen): neoboot = 'usb' elif pathExists('/media/hdd/ImageBoot'): neoboot = 'hdd' - cmd = "echo -e '\n\n%s '" % _('Please wait, NeoBoot is working, the backup may take a few moments, the process is in progress ...') - cmd1 = '/bin/tar -cf ' + self.backupdir + '/' + self.backimage + '.tar /media/' + neoboot + '/ImageBoot/' + self.backimage + ' > /dev/null 2>&1' - cmd2 = 'mv -f ' + self.backupdir + '/' + self.backimage + '.tar ' + self.backupdir + '/' + self.backimage + '.mb' + cmd = "echo -e '\n\n%s '" % _( + 'Please wait, NeoBoot is working, the backup may take a few moments, the process is in progress ...') + cmd1 = '/bin/tar -cf ' + self.backupdir + '/' + self.backimage + \ + '.tar /media/' + neoboot + '/ImageBoot/' + self.backimage + ' > /dev/null 2>&1' + cmd2 = 'mv -f ' + self.backupdir + '/' + self.backimage + \ + '.tar ' + self.backupdir + '/' + self.backimage + '.mb' cmd3 = "echo -e '\n\n%s '" % _('NeoBoot: COMPLETE Backup!') self.session.open(Console, _('NeoBoot: Image Backup'), [cmd, - cmd1, - cmd2, - cmd3]) + cmd1, + cmd2, + cmd3]) self.close() else: self.close() def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() class MBRestore(Screen): @@ -559,9 +575,9 @@ class MBRestore(Screen): self['key_green'] = Label(_('Restore')) self['list'] = List([]) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'ok': self.restoreImage, - 'red': self.deleteback, - 'green': self.restoreImage}) + 'ok': self.restoreImage, + 'red': self.deleteback, + 'green': self.restoreImage}) self.backupdir = '' + getNeoLocation() + 'CopyImageNEO' self.onShow.append(self.updateInfo) @@ -571,14 +587,14 @@ class MBRestore(Screen): device = deviceneo usfree = '0' devicelist = ['cf', - 'CF', - 'hdd', - 'card', - 'sd', - 'SD', - 'usb', - 'USB', - 'usb2'] + 'CF', + 'hdd', + 'card', + 'sd', + 'SD', + 'usb', + 'USB', + 'usb2'] for d in devicelist: test = '/media/' + d + '/ImageBoot/.neonextboot' if fileExists(test): @@ -626,21 +642,25 @@ class MBRestore(Screen): if not fileExists('/.multinfo'): self.deleteback2() else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) def deleteback2(self): image = self['list'].getCurrent() if image: self.delimage = image.strip() message = (_('Software selected: %s remove ?') % image) - ybox = self.session.openWithCallback(self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO) + ybox = self.session.openWithCallback( + self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Confirmation of Deletion...')) def dodeleteback(self, answer): if answer is True: - cmd = "echo -e '\n\n%s '" % _('NeoBoot - deleting backup files .....') + cmd = "echo -e '\n\n%s '" % _( + 'NeoBoot - deleting backup files .....') cmd1 = 'rm ' + self.backupdir + '/' + self.delimage - self.session.open(Console, _('NeoBoot: Backup files deleted!'), [cmd, cmd1]) + self.session.open(Console, _( + 'NeoBoot: Backup files deleted!'), [cmd, cmd1]) self.updateInfo() else: self.close() @@ -649,7 +669,8 @@ class MBRestore(Screen): if not fileExists('/.multinfo'): self.restoreImage2() else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) def restoreImage2(self): image = self['list'].getCurrent() @@ -663,10 +684,13 @@ class MBRestore(Screen): imagename = self.backimage[0:-3] myerror = '' if curimage == imagename: - myerror = _('Sorry you cannot overwrite the image currently booted from. Please, boot from Flash to restore this backup.') + myerror = _( + 'Sorry you cannot overwrite the image currently booted from. Please, boot from Flash to restore this backup.') if myerror == '': - message = (_('The required space on the device is 300 MB.\nDo you want to take this image: %s \nnow ?') % image) - ybox = self.session.openWithCallback(self.dorestoreImage, MessageBox, message, MessageBox.TYPE_YESNO) + message = ( + _('The required space on the device is 300 MB.\nDo you want to take this image: %s \nnow ?') % image) + ybox = self.session.openWithCallback( + self.dorestoreImage, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Restore Confirmation')) else: self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) @@ -674,25 +698,28 @@ class MBRestore(Screen): def dorestoreImage(self, answer): if answer is True: imagename = self.backimage[0:-3] - cmd = "echo -e '\n\n%s '" % _('Wait please, NeoBoot is working: ....Restore in progress....') - cmd1 = 'mv -f ' + self.backupdir + '/' + self.backimage + ' ' + self.backupdir + '/' + imagename + '.tar' + cmd = "echo -e '\n\n%s '" % _( + 'Wait please, NeoBoot is working: ....Restore in progress....') + cmd1 = 'mv -f ' + self.backupdir + '/' + self.backimage + \ + ' ' + self.backupdir + '/' + imagename + '.tar' cmd2 = '/bin/tar -xf ' + self.backupdir + '/' + imagename + '.tar -C /' - cmd3 = 'mv -f ' + self.backupdir + '/' + imagename + '.tar ' + self.backupdir + '/' + imagename + '.mb' + cmd3 = 'mv -f ' + self.backupdir + '/' + imagename + \ + '.tar ' + self.backupdir + '/' + imagename + '.mb' cmd4 = 'sync' cmd5 = "echo -e '\n\n%s '" % _('Neoboot: Restore COMPLETE !') self.session.open(Console, _('NeoBoot: Restore Image'), [cmd, - cmd1, - cmd2, - cmd3, - cmd4, - cmd5]) + cmd1, + cmd2, + cmd3, + cmd4, + cmd5]) self.close() else: self.close() def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() class MenagerDevices(Screen): @@ -708,19 +735,21 @@ class MenagerDevices(Screen): self['lab1'] = Label(_('Start the device manager')) self['key_red'] = Label(_('Run')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.MD}) + 'red': self.MD}) def MD(self): try: - from Plugins.Extensions.NeoBoot.files.devices import ManagerDevice - self.session.open(ManagerDevice) + from Plugins.Extensions.NeoBoot.files.devices import ManagerDevice + self.session.open(ManagerDevice) except: - self.myClose(_('Sorry, the operation is not possible from Flash or not supported.')) + self.myClose( + _('Sorry, the operation is not possible from Flash or not supported.')) def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() + class SetDiskLabel(Screen): __module__ = __name__ @@ -735,22 +764,24 @@ class SetDiskLabel(Screen): self['lab1'] = Label(_('Start the set disk label')) self['key_red'] = Label(_('Run')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.MD}) + 'red': self.MD}) def MD(self): try: if fileExists('/usr/lib/python2.7'): - from Plugins.Extensions.NeoBoot.files.devices import SetDiskLabel - self.session.open(SetDiskLabel) + 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) + from Plugins.Extensions.NeoBoot.files.tools import DiskLabelSet + self.session.open(DiskLabelSet) except: - self.myClose(_('Sorry, the operation is not possible from Flash or not supported.')) + self.myClose( + _('Sorry, the operation is not possible from Flash or not supported.')) def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() + class MBDeleUpload(Screen): __module__ = __name__ @@ -762,21 +793,24 @@ class MBDeleUpload(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('Are you sure you want to delete the image from the ImagesUpload directory\nIf you choose the red button on the remote control then you will delete all zip images from the ImagesUpload directory')) + self['lab1'] = Label( + _('Are you sure you want to delete the image from the ImagesUpload directory\nIf you choose the red button on the remote control then you will delete all zip images from the ImagesUpload directory')) self['key_red'] = Label(_('Clear')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.usunup}) + 'red': self.usunup}) def usunup(self): message = _('Do you really want to clear') - ybox = self.session.openWithCallback(self.pedeleup, MessageBox, message, MessageBox.TYPE_YESNO) + ybox = self.session.openWithCallback( + self.pedeleup, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Do you really want to clear')) def pedeleup(self, answer): if answer is True: cmd = "echo -e '\n\n%s '" % _('Wait, deleting .....') cmd1 = 'rm -r ' + getNeoLocation() + 'ImagesUpload/*.zip' - self.session.open(Console, _('Deleting downloaded image zip files ....'), [cmd, cmd1]) + self.session.open(Console, _( + 'Deleting downloaded image zip files ....'), [cmd, cmd1]) self.close() else: self.close() @@ -803,12 +837,13 @@ class BackupMultiboot(Screen): self['lab1'] = Label(_('Make complete copy NeoBoot')) self['key_red'] = Label(_('Run')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.gobackupneobootplugin}) + 'red': self.gobackupneobootplugin}) def gobackupneobootplugin(self): - cmd = 'sh ' + LinkNeoBoot + '/files/neobackup.sh -i' - self.session.open(Console, _('The backup will be saved to /media/neoboot. Performing ...'), [cmd]) - self.close() + cmd = 'sh ' + LinkNeoBoot + '/files/neobackup.sh -i' + self.session.open(Console, _( + 'The backup will be saved to /media/neoboot. Performing ...'), [cmd]) + self.close() class UnistallMultiboot(Screen): @@ -824,21 +859,24 @@ class UnistallMultiboot(Screen): self['lab1'] = Label(_('Remove the plug')) self['key_red'] = Label(_('Uninstall')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.checkNeo, - 'red': self.usun}) + 'red': self.usun}) def usun(self): if not fileExists('/.multinfo'): self.usun2() else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() def usun2(self): - message = _('If you choose Yes, the Multibot image settings will be restored and only uninstalled. You can reinstall it') - ybox = self.session.openWithCallback(self.reinstallneoboot, MessageBox, message, MessageBox.TYPE_YESNO) + message = _( + 'If you choose Yes, the Multibot image settings will be restored and only uninstalled. You can reinstall it') + ybox = self.session.openWithCallback( + self.reinstallneoboot, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Delete Confirmation')) def reinstallneoboot(self, answer): @@ -851,38 +889,42 @@ class UnistallMultiboot(Screen): cmd3 = 'ln -sfn /sbin/init.sysvinit /sbin/init' cmd4 = 'chmod 777 /sbin/init; sleep 2' cmd4a = "echo -e 'NeoBoot restoring media mounts...\n'" - cmd6 = 'rm -f ' + getNeoLocation() + 'ImageBoot/initneo.log ' + getNeoLocation() + 'ImageBoot/.imagedistro ' + getNeoLocation() + 'ImageBoot/.neonextboot ' + getNeoLocation() + 'ImageBoot/.updateversion ' + getNeoLocation() + 'ImageBoot/.Flash ' + getNeoLocation() + 'ImageBoot/.version ' + getNeoLocation() + 'ImageBoot/NeoInit.log ; sleep 2' - cmd7 = 'rm -f ' + LinkNeoBoot + '/.location ' + LinkNeoBoot + '/bin/install ' + LinkNeoBoot + '/bin/reading_blkid ' + LinkNeoBoot + '/files/mountpoint.sh ' + LinkNeoBoot + '/files/neo.sh ' + LinkNeoBoot + '/files/neom ' + LinkNeoBoot + '/.neo_info ' + cmd6 = 'rm -f ' + getNeoLocation() + 'ImageBoot/initneo.log ' + getNeoLocation() + 'ImageBoot/.imagedistro ' + getNeoLocation() + 'ImageBoot/.neonextboot ' + getNeoLocation() + \ + 'ImageBoot/.updateversion ' + getNeoLocation() + 'ImageBoot/.Flash ' + getNeoLocation() + \ + 'ImageBoot/.version ' + getNeoLocation() + 'ImageBoot/NeoInit.log ; sleep 2' + cmd7 = 'rm -f ' + LinkNeoBoot + '/.location ' + LinkNeoBoot + '/bin/install ' + LinkNeoBoot + '/bin/reading_blkid ' + LinkNeoBoot + \ + '/files/mountpoint.sh ' + LinkNeoBoot + '/files/neo.sh ' + \ + LinkNeoBoot + '/files/neom ' + LinkNeoBoot + '/.neo_info ' cmd7a = "echo -e '\n\nUninstalling neoboot...\n'" cmd8 = "echo -e '\n\nRestore mount.'" cmd9 = "echo -e '\n\nNeoBoot uninstalled, you can do reinstallation.'" cmd10 = "echo -e '\n\nNEOBoot Exit or Back - RESTART GUI NOW !!!'" self.session.open(Console, _('NeoBoot is reinstall...'), [cmd0, - cmd, - cmd1, - cmd1a, - cmd2, - cmd3, - cmd4, - cmd4a, - cmd6, - cmd7, - cmd7a, - cmd8, - cmd9, - cmd10]) + cmd, + cmd1, + cmd1a, + cmd2, + cmd3, + cmd4, + cmd4a, + cmd6, + cmd7, + cmd7a, + cmd8, + cmd9, + cmd10]) else: self.close() def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() def checkNeo(self): - if not fileCheck('' + LinkNeoBoot + '/.location') and not fileCheck(' ' + getNeoLocation() + 'ImageBoot/.neonextboot'): - self.restareE2() - else: - self.close() + if not fileCheck('' + LinkNeoBoot + '/.location') and not fileCheck(' ' + getNeoLocation() + 'ImageBoot/.neonextboot'): + self.restareE2() + else: + self.close() def restareE2(self): self.session.open(TryQuitMainloop, 3) @@ -901,10 +943,10 @@ class ReinstllNeoBoot(Screen): self['lab1'] = Label(_('Restore copy NeoBoot')) self['key_red'] = Label(_('Backup')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.reinstallMB}) + 'red': self.reinstallMB}) def reinstallMB(self): - self.session.open(ReinstllNeoBoot2) + self.session.open(ReinstllNeoBoot2) class ReinstllNeoBoot2(Screen): @@ -927,9 +969,9 @@ class ReinstllNeoBoot2(Screen): self['key_green'] = Label(_('Restore')) self['list'] = List([]) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'ok': self.restoreImage, - 'green': self.restoreImage, - 'red': self.deleteback}) + 'ok': self.restoreImage, + 'green': self.restoreImage, + 'red': self.deleteback}) self.backupdir = '' + getNeoLocation() + 'CopyNEOBoot' self.onShow.append(self.updateInfo) @@ -949,14 +991,17 @@ class ReinstllNeoBoot2(Screen): if image: self.delimage = image.strip() message = (_('Software selected: %s remove ?') % image) - ybox = self.session.openWithCallback(self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO) + ybox = self.session.openWithCallback( + self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Confirmation of Deletion...')) def dodeleteback(self, answer): if answer is True: - cmd = "echo -e '\n\n%s '" % _('NeoBoot - deleting backup files .....') + cmd = "echo -e '\n\n%s '" % _( + 'NeoBoot - deleting backup files .....') cmd1 = 'rm ' + self.backupdir + '/' + self.delimage - self.session.open(Console, _('NeoBoot: Backup files deleted!'), [cmd, cmd1]) + self.session.open(Console, _( + 'NeoBoot: Backup files deleted!'), [cmd, cmd1]) self.updateInfo() else: self.close() @@ -965,23 +1010,26 @@ class ReinstllNeoBoot2(Screen): image = self['list'].getCurrent() myerror = '' if myerror == '': - message = (_('The required space on the device is 300 MB.\nDo you want to take this image: %s \nnow ?') % image) - ybox = self.session.openWithCallback(self.dorestoreImage, MessageBox, message, MessageBox.TYPE_YESNO) - ybox.setTitle(_('Restore Confirmation')) + message = ( + _('The required space on the device is 300 MB.\nDo you want to take this image: %s \nnow ?') % image) + ybox = self.session.openWithCallback( + self.dorestoreImage, MessageBox, message, MessageBox.TYPE_YESNO) + ybox.setTitle(_('Restore Confirmation')) else: - self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) + self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) def dorestoreImage(self, answer): image = self['list'].getCurrent() if answer is True: self.backimage = image.strip() imagename = self.backimage[0:-3] - cmd = "echo -e '\n\n%s '" % _('Wait please, NeoBoot is working: ....Restore in progress....') + cmd = "echo -e '\n\n%s '" % _( + 'Wait please, NeoBoot is working: ....Restore in progress....') cmd1 = '/bin/tar -xf ' + self.backupdir + '/' + imagename + '.gz -C /' cmd2 = "echo -e '\n\n%s '" % _('Neoboot: Restore COMPLETE !') self.session.open(Console, _('NeoBoot: Restore Image'), [cmd, - cmd1, - cmd2]) + cmd1, + cmd2]) self.close() else: self.close() @@ -997,117 +1045,123 @@ class UpdateNeoBoot(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('Install neobot from flash memory to all images')) + self['lab1'] = Label( + _('Install neobot from flash memory to all images')) self['key_red'] = Label(_('Install')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.mbupload}) + 'red': self.mbupload}) def mbupload(self): if not fileExists('/.multinfo'): self.session.open(MyUpgrade2) else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() class MyUpgrade2(Screen): - if isFHD(): - skin = """ + if isFHD(): + skin = """ """ - else: - skin = '\n\t\t\n\t' + else: + skin = '\n\t\t\n\t' - def __init__(self, session): - Screen.__init__(self, session) - self['lab1'] = Label(_('[NeoBoot]Please wait, updating in progress ...')) - self.activityTimer = eTimer() - self.activityTimer.timeout.get().append(self.updateInfo) - self.onShow.append(self.startShow) + def __init__(self, session): + Screen.__init__(self, session) + self['lab1'] = Label( + _('[NeoBoot]Please wait, updating in progress ...')) + self.activityTimer = eTimer() + self.activityTimer.timeout.get().append(self.updateInfo) + self.onShow.append(self.startShow) - def startShow(self): - self.activityTimer.start(10) + def startShow(self): + self.activityTimer.start(10) - def updateInfo(self): - if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh'): - os.system('mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local') - periodo = '/usr/lib/periodon' - testinout = '/usr/lib/enigma2/python/Tools/Testinout.p*' - zerotier = '/var/lib/zerotier-one/identity.secret' - S99neo = '/etc/rcS.d/S99neo.local' - self.activityTimer.stop() - f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') - mypath2 = f2.readline().strip() - f2.close() - if mypath2 != 'Flash': - self.myClose(_('Sorry, NeoBoot can installed or upgraded only when booted from Flash STB')) - self.close() - else: - for fn in listdir('%sImageBoot' % getNeoLocation()): - dirfile = '%sImageBoot/' % getNeoLocation() + fn - if isdir(dirfile): - target = dirfile + '' + LinkNeoBoot + '' - target1 = dirfile + '/usr/lib/' - target2 = dirfile + '/usr/lib/enigma2/python/Tools/' - target3 = dirfile + '/var/lib/zerotier-one/' - target4 = dirfile + '/etc/rcS.d/S99neo.local' - target5 = dirfile + '/etc/init.d/rcS.local' - target6 = dirfile + '/etc/init.d/rc.local' - - cmd = 'rm -r ' + target + ' > /dev/null 2>&1' - system(cmd) - cmd1 = 'cp -af ' + periodo + ' ' + target1 - system(cmd1) - cmd2 = 'cp -af ' + testinout + ' ' + target2 - system(cmd2) - #cmd3 - if fileExists('%s' % target3): - if fileExists('/var/lib/zerotier-one/identity.secret'): - cmd = 'cp -aRf ' + zerotier + ' ' + target3 - system(cmd) - - cmd4 = 'cp -aRf ' + S99neo + ' ' + target4 - system(cmd4) - - if fileExists('%s' % target5): - cmd5 = 'rm -r ' + target5 + ' > /dev/null 2>&1' - system(cmd5) - if fileExists('%s' % target6): - cmd6 = 'rm -r ' + target6 + ' > /dev/null 2>&1' - system(cmd6) - - if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local'): - os.system('mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh; sleep 2') - - #przenoszenie wtyczki neoboot - cmd = 'cp -af ' + LinkNeoBoot + ' ' + target - system(cmd) - - #multiboot_vu+ - if fileExists('/linuxrootfs1'): - cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs1' + LinkNeoBoot + ' ' - system(cmd) - if fileExists('/linuxrootfs2'): - cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs2' + LinkNeoBoot + ' ' - system(cmd) - if fileExists('/linuxrootfs3'): - cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs3' + LinkNeoBoot + ' ' - system(cmd) - if fileExists('/linuxrootfs4'): - cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs4' + LinkNeoBoot + ' ' - system(cmd) - - out = open('%sImageBoot/.version' % getNeoLocation(), 'w') - out.write(PLUGINVERSION) - out.close() - self.myClose(_('NeoBoot successfully updated. You can restart the plugin now.\nHave fun !!')) - - def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + def updateInfo(self): + if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh'): + os.system('mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local') + periodo = '/usr/lib/periodon' + testinout = '/usr/lib/enigma2/python/Tools/Testinout.p*' + zerotier = '/var/lib/zerotier-one/identity.secret' + S99neo = '/etc/rcS.d/S99neo.local' + self.activityTimer.stop() + f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') + mypath2 = f2.readline().strip() + f2.close() + if mypath2 != 'Flash': + self.myClose( + _('Sorry, NeoBoot can installed or upgraded only when booted from Flash STB')) self.close() + else: + for fn in listdir('%sImageBoot' % getNeoLocation()): + dirfile = '%sImageBoot/' % getNeoLocation() + fn + if isdir(dirfile): + target = dirfile + '' + LinkNeoBoot + '' + target1 = dirfile + '/usr/lib/' + target2 = dirfile + '/usr/lib/enigma2/python/Tools/' + target3 = dirfile + '/var/lib/zerotier-one/' + target4 = dirfile + '/etc/rcS.d/S99neo.local' + target5 = dirfile + '/etc/init.d/rcS.local' + target6 = dirfile + '/etc/init.d/rc.local' + + cmd = 'rm -r ' + target + ' > /dev/null 2>&1' + system(cmd) + cmd1 = 'cp -af ' + periodo + ' ' + target1 + system(cmd1) + cmd2 = 'cp -af ' + testinout + ' ' + target2 + system(cmd2) + # cmd3 + if fileExists('%s' % target3): + if fileExists('/var/lib/zerotier-one/identity.secret'): + cmd = 'cp -aRf ' + zerotier + ' ' + target3 + system(cmd) + + cmd4 = 'cp -aRf ' + S99neo + ' ' + target4 + system(cmd4) + + if fileExists('%s' % target5): + cmd5 = 'rm -r ' + target5 + ' > /dev/null 2>&1' + system(cmd5) + if fileExists('%s' % target6): + cmd6 = 'rm -r ' + target6 + ' > /dev/null 2>&1' + system(cmd6) + + if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local'): + os.system( + 'mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/S99neo.local /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh; sleep 2') + + # przenoszenie wtyczki neoboot + cmd = 'cp -af ' + LinkNeoBoot + ' ' + target + system(cmd) + + # multiboot_vu+ + if fileExists('/linuxrootfs1'): + cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs1' + LinkNeoBoot + ' ' + system(cmd) + if fileExists('/linuxrootfs2'): + cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs2' + LinkNeoBoot + ' ' + system(cmd) + if fileExists('/linuxrootfs3'): + cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs3' + LinkNeoBoot + ' ' + system(cmd) + if fileExists('/linuxrootfs4'): + cmd = 'cp -af ' + LinkNeoBoot + ' /linuxrootfs4' + LinkNeoBoot + ' ' + system(cmd) + + out = open('%sImageBoot/.version' % getNeoLocation(), 'w') + out.write(PLUGINVERSION) + out.close() + self.myClose( + _('NeoBoot successfully updated. You can restart the plugin now.\nHave fun !!')) + + def myClose(self, message): + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() class ListTv(Screen): @@ -1123,20 +1177,21 @@ class ListTv(Screen): self['lab1'] = Label(_('Copy the tv list with flash on all image')) self['key_red'] = Label(_('Install')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.listupload}) + 'red': self.listupload}) def listupload(self): if not fileExists('/.multinfo'): self.listupload2() else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) def listupload2(self): self.session.open(ListTv2) def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() class ListTv2(Screen): @@ -1151,7 +1206,8 @@ class ListTv2(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('NeoBoot: Upgrading in progress\nPlease wait...')) + self['lab1'] = Label( + _('NeoBoot: Upgrading in progress\nPlease wait...')) self.activityTimer = eTimer() self.activityTimer.timeout.get().append(self.updateInfo) self.onShow.append(self.startShow) @@ -1165,7 +1221,8 @@ class ListTv2(Screen): mypath2 = f2.readline().strip() f2.close() if mypath2 != 'Flash': - self.myClose(_('Sorry, NeoBoot can installed or upgraded only when booted from Flash.')) + self.myClose( + _('Sorry, NeoBoot can installed or upgraded only when booted from Flash.')) self.close() else: os.system('mv /etc/enigma2 /etc/enigma2.tmp') @@ -1188,7 +1245,8 @@ class ListTv2(Screen): os.system('rm -f -R /etc/enigma2') os.system('mv /etc/enigma2.tmp /etc/enigma2/') - self.myClose(_('NeoBoot successfully updated list tv.\nHave fun !!')) + self.myClose( + _('NeoBoot successfully updated list tv.\nHave fun !!')) def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) @@ -1205,23 +1263,25 @@ class IPTVPlayer(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('Copy the IPTV Player plugin from flash to all images')) + self['lab1'] = Label( + _('Copy the IPTV Player plugin from flash to all images')) self['key_red'] = Label(_('Install')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.IPTVPlayerUpload}) + 'red': self.IPTVPlayerUpload}) def IPTVPlayerUpload(self): if not fileExists('/.multinfo'): self.IPTVPlayerUpload2() else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) def IPTVPlayerUpload2(self): self.session.open(IPTVPlayer2) def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() class IPTVPlayer2(Screen): @@ -1236,7 +1296,8 @@ class IPTVPlayer2(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('NeoBoot: Upgrading in progress\nPlease wait...')) + self['lab1'] = Label( + _('NeoBoot: Upgrading in progress\nPlease wait...')) self.activityTimer = eTimer() self.activityTimer.timeout.get().append(self.updateInfo) self.onShow.append(self.startShow) @@ -1250,7 +1311,8 @@ class IPTVPlayer2(Screen): mypath2 = f2.readline().strip() f2.close() if mypath2 != 'Flash': - self.myClose(_('Sorry, NeoBoot can installed or upgraded only when booted from Flash.')) + self.myClose( + _('Sorry, NeoBoot can installed or upgraded only when booted from Flash.')) self.close() elif not fileExists('/usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer'): self.myClose(_('Sorry, IPTVPlayer not found.')) @@ -1265,7 +1327,8 @@ class IPTVPlayer2(Screen): cmd = 'cp -af /usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer ' + target system(cmd) - self.myClose(_('NeoBoot successfully updated IPTVPlayer.\nHave fun !!')) + self.myClose( + _('NeoBoot successfully updated IPTVPlayer.\nHave fun !!')) def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) @@ -1282,23 +1345,25 @@ class FeedExtra(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('Copy the FeedExtra Player plugin from flash to all images')) + self['lab1'] = Label( + _('Copy the FeedExtra Player plugin from flash to all images')) self['key_red'] = Label(_('Install')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.FeedExtraUpload}) + 'red': self.FeedExtraUpload}) def FeedExtraUpload(self): if not fileExists('/.multinfo'): self.FeedExtraUpload2() else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) def FeedExtraUpload2(self): self.session.open(FeedExtra2) def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() class FeedExtra2(Screen): @@ -1313,7 +1378,8 @@ class FeedExtra2(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('NeoBoot: Upgrading in progress\nPlease wait...')) + self['lab1'] = Label( + _('NeoBoot: Upgrading in progress\nPlease wait...')) self.activityTimer = eTimer() self.activityTimer.timeout.get().append(self.updateInfo) self.onShow.append(self.startShow) @@ -1327,7 +1393,8 @@ class FeedExtra2(Screen): mypath2 = f2.readline().strip() f2.close() if mypath2 != 'Flash': - self.myClose(_('Sorry, NeoBoot can installed or upgraded only when booted from Flash.')) + self.myClose( + _('Sorry, NeoBoot can installed or upgraded only when booted from Flash.')) self.close() elif not fileExists('/usr/lib/enigma2/python/Plugins/Extensions/FeedExtra'): self.myClose(_('Sorry, FeedExtra not found.')) @@ -1342,7 +1409,8 @@ class FeedExtra2(Screen): cmd = 'cp -r /usr/lib/enigma2/python/Plugins/Extensions/FeedExtra ' + target system(cmd) - self.myClose(_('NeoBoot successfully updated FeedExtra.\nHave fun !!')) + self.myClose( + _('NeoBoot successfully updated FeedExtra.\nHave fun !!')) def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) @@ -1362,11 +1430,12 @@ class SetPasswd(Screen): self['lab1'] = Label(_('Delete password')) self['key_red'] = Label(_('Start')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.passwd}) + 'red': self.passwd}) def passwd(self): os.system('passwd -d root') - restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _('GUI needs a restart.\nDo you want to Restart the GUI now?'), MessageBox.TYPE_YESNO) + restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _( + 'GUI needs a restart.\nDo you want to Restart the GUI now?'), MessageBox.TYPE_YESNO) restartbox.setTitle(_('Restart GUI now?')) def restartGUI(self, answer): @@ -1389,61 +1458,85 @@ class CheckInstall(Screen): self['lab1'] = Label(_('Checking filesystem...')) self['key_red'] = Label(_('Start')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.neocheck}) + 'red': self.neocheck}) def neocheck(self): if not fileExists('/.multinfo'): self.neocheck2() else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) def neocheck2(self): - os.system(_('rm -f ' + LinkNeoBoot + '/files/modulecheck; echo %s - %s > ' + LinkNeoBoot + '/files/modulecheck') % (getBoxHostName(), getCPUSoC())) - os.system('echo "Devices:" >> ' + LinkNeoBoot + '/files/modulecheck; cat /sys/block/sd*/device/vendor | sed "s/ *$//" >> ' + LinkNeoBoot + '/files/modulecheck; cat /sys/block/sd*/device/model | sed "s/ *$//" >> ' + LinkNeoBoot + '/files/modulecheck') - os.system('echo "\n====================================================>\nCheck result:" >> ' + LinkNeoBoot + '/files/modulecheck') - os.system('echo "* neoboot location:" >> ' + LinkNeoBoot + '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location" >> ' + LinkNeoBoot + '/files/modulecheck') - os.system('echo "\n* neoboot location install:" >> ' + LinkNeoBoot + '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install" >> ' + LinkNeoBoot + '/files/modulecheck') - os.system('echo "\n* neoboot location mount:" >> ' + LinkNeoBoot + '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo.sh" >> ' + LinkNeoBoot + '/files/modulecheck') - if getCPUtype() == 'ARMv7' and getCPUtype() != 'MIPS': - if os.system('opkg update; opkg list-installed | grep python-subprocess') != 0: - os.system('echo "\n* python-subprocess not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep python-argparse') != 0: - os.system('echo "* python-argparse not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep curl') != 0: - os.system('echo "* curl not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - else: - os.system('echo "\n* opkg packed everything is OK !" >> ' + LinkNeoBoot + '/files/modulecheck') - elif getCPUtype() != 'ARMv7' and getCPUtype() == 'MIPS': - if os.system('opkg list-installed | grep kernel-module-nandsim') != 0: - os.system('echo "\n* kernel-module-nandsim not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep mtd-utils-jffs2') != 0: - os.system('echo "* mtd-utils-jffs2 not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep lzo') != 0: - os.system('echo "* lzo not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep python-setuptools') != 0: - os.system('echo "* python-setuptools not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep util-linux-sfdisk') != 0: - os.system('echo "* util-linux-sfdisk not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep packagegroup-base-nfs') != 0: - os.system('echo "* packagegroup-base-nfs not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep ofgwrite') != 0: - os.system('echo "* ofgwrite not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep bzip2') != 0: - os.system('echo "* bzip2 not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep mtd-utils') != 0: - os.system('echo "* mtd-utils not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - if os.system('opkg list-installed | grep mtd-utils-ubifs') != 0: - os.system('echo "* mtd-utils-ubifs not installed" >> ' + LinkNeoBoot + '/files/modulecheck') - else: - os.system('echo "\n* opkg packed everything is OK !" >> ' + LinkNeoBoot + '/files/modulecheck') + os.system(_('rm -f ' + LinkNeoBoot + '/files/modulecheck; echo %s - %s > ' + + LinkNeoBoot + '/files/modulecheck') % (getBoxHostName(), getCPUSoC())) + os.system('echo "Devices:" >> ' + LinkNeoBoot + '/files/modulecheck; cat /sys/block/sd*/device/vendor | sed "s/ *$//" >> ' + + LinkNeoBoot + '/files/modulecheck; cat /sys/block/sd*/device/model | sed "s/ *$//" >> ' + LinkNeoBoot + '/files/modulecheck') + os.system('echo "\n====================================================>\nCheck result:" >> ' + + LinkNeoBoot + '/files/modulecheck') + os.system('echo "* neoboot location:" >> ' + LinkNeoBoot + + '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/.location" >> ' + LinkNeoBoot + '/files/modulecheck') + os.system('echo "\n* neoboot location install:" >> ' + LinkNeoBoot + + '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/install" >> ' + LinkNeoBoot + '/files/modulecheck') + os.system('echo "\n* neoboot location mount:" >> ' + LinkNeoBoot + + '/files/modulecheck; cat "/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo.sh" >> ' + LinkNeoBoot + '/files/modulecheck') + if getCPUtype() == 'ARMv7' and getCPUtype() != 'MIPS': + if os.system('opkg update; opkg list-installed | grep python-subprocess') != 0: + os.system('echo "\n* python-subprocess not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep python-argparse') != 0: + os.system('echo "* python-argparse not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep curl') != 0: + os.system('echo "* curl not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') else: - os.system('echo "\n* STB is not ARMv7 or MIPS" >> ' + LinkNeoBoot + '/files/modulecheck') + os.system('echo "\n* opkg packed everything is OK !" >> ' + + LinkNeoBoot + '/files/modulecheck') + elif getCPUtype() != 'ARMv7' and getCPUtype() == 'MIPS': + if os.system('opkg list-installed | grep kernel-module-nandsim') != 0: + os.system('echo "\n* kernel-module-nandsim not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep mtd-utils-jffs2') != 0: + os.system('echo "* mtd-utils-jffs2 not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep lzo') != 0: + os.system('echo "* lzo not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep python-setuptools') != 0: + os.system('echo "* python-setuptools not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep util-linux-sfdisk') != 0: + os.system('echo "* util-linux-sfdisk not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep packagegroup-base-nfs') != 0: + os.system('echo "* packagegroup-base-nfs not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep ofgwrite') != 0: + os.system('echo "* ofgwrite not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep bzip2') != 0: + os.system('echo "* bzip2 not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep mtd-utils') != 0: + os.system('echo "* mtd-utils not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + if os.system('opkg list-installed | grep mtd-utils-ubifs') != 0: + os.system('echo "* mtd-utils-ubifs not installed" >> ' + + LinkNeoBoot + '/files/modulecheck') + else: + os.system('echo "\n* opkg packed everything is OK !" >> ' + + LinkNeoBoot + '/files/modulecheck') + else: + os.system('echo "\n* STB is not ARMv7 or MIPS" >> ' + + LinkNeoBoot + '/files/modulecheck') - cmd = 'echo "\n<====================================================" >> ' + LinkNeoBoot + '/files/modulecheck; cat ' + LinkNeoBoot + '/files/modulecheck' - cmd1 = '' - self.session.openWithCallback(self.close, Console, _('NeoBoot....'), [cmd, - cmd1]) - self.close() + cmd = 'echo "\n<====================================================" >> ' + \ + LinkNeoBoot + '/files/modulecheck; cat ' + LinkNeoBoot + '/files/modulecheck' + cmd1 = '' + self.session.openWithCallback(self.close, Console, _('NeoBoot....'), [cmd, + cmd1]) + self.close() def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) @@ -1474,9 +1567,9 @@ class SkinChange(Screen): self['key_red'] = Label(_('Change')) self['list'] = List([]) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.checkimageskin, - 'ok': self.SkinGO, - 'red': self.SkinGO, - '9': self.restareE2}) + 'ok': self.SkinGO, + 'red': self.SkinGO, + '9': self.restareE2}) self.onShow.append(self.updateInfo) @@ -1503,91 +1596,123 @@ class SkinChange(Screen): self.DefaultSkin() elif myerror == '': message = (_('Skin Change: %s now ?') % skin) - ybox = self.session.openWithCallback(self.doSkinChange, MessageBox, message, MessageBox.TYPE_YESNO) + ybox = self.session.openWithCallback( + self.doSkinChange, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Skin Change confirmation')) else: self.session.open(MessageBox, myerror, MessageBox.TYPE_INFO) -#ln -sf "neoskins/default.py" "/usr/lib/enigma2/python/Plugins /Extensions/NeoBoot/skin.py" +# ln -sf "neoskins/default.py" "/usr/lib/enigma2/python/Plugins /Extensions/NeoBoot/skin.py" def DefaultSkin(self): - cmd = "echo -e '\n\n%s '" % _('Please wait, NeoBot is working, skin change is progress...') - cmd1 = "echo -e '\n\n%s '" % _('NeoBoot: Complete Skin Change!') + cmd = "echo -e '\n\n%s '" % _( + 'Please wait, NeoBot is working, skin change is progress...') + cmd1 = "echo -e '\n\n%s '" % _('NeoBoot: Complete Skin Change!') # cmd2 = 'cp -af ' +LinkNeoBoot+ '/neoskins/default.py ' +LinkNeoBoot+ '/skin.py' - cmd2 = 'rm -f ' + LinkNeoBoot + '/usedskin.p*; sleep 2' - cmd3 = 'ln -sf "neoskins/default.py" "' + LinkNeoBoot + '/usedskin.py"' - self.session.open(Console, _('NeoBoot Skin Change'), [cmd, cmd1, cmd2, cmd3]) + cmd2 = 'rm -f ' + LinkNeoBoot + '/usedskin.p*; sleep 2' + cmd3 = 'ln -sf "neoskins/default.py" "' + LinkNeoBoot + '/usedskin.py"' + self.session.open(Console, _('NeoBoot Skin Change'), + [cmd, cmd1, cmd2, cmd3]) def doSkinChange(self, answer): if answer is True: if isFHD(): if getBoxHostName() == 'vuultimo4k': - system('cp -af ' + LinkNeoBoot + '/images/ultimo4k.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/ultimo4k.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'vusolo4k': - system('cp -af ' + LinkNeoBoot + '/images/solo4k.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/solo4k.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'vuduo4k': - system('cp -af ' + LinkNeoBoot + '/images/duo4k.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/duo4k.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'vuduo4kse': - system('cp -af ' + LinkNeoBoot + '/images/duo4k.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/duo4k.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'vuuno4k': - system('cp -af ' + LinkNeoBoot + '/images/uno4k.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/uno4k.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'vuuno4kse': - system('cp -af ' + LinkNeoBoot + '/images/uno4kse.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/uno4kse.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'vuzero4kse': - system('cp -af ' + LinkNeoBoot + '/images/zero4kse.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/zero4kse.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'sf4008': - system('cp -af ' + LinkNeoBoot + '/images/sf4008.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/sf4008.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'ustym4kpro': - system('cp -af ' + LinkNeoBoot + '/images/ustym4kpro.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/ustym4kpro.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'vusolo2': - system('cp -af ' + LinkNeoBoot + '/images/solo2.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/solo2.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'bre2ze4k': - system('cp -af ' + LinkNeoBoot + '/images/bre2ze4k.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/bre2ze4k.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'lunix4k': - system('cp -af ' + LinkNeoBoot + '/images/lunix4k.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/lunix4k.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'zgemmah9s': - system('cp -af ' + LinkNeoBoot + '/images/zgemmah9se.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/zgemmah9se.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'h7' or getBoxHostName() == 'zgemmah7': - system('cp -af ' + LinkNeoBoot + '/images/zgmmah7.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/zgmmah7.png ' + + LinkNeoBoot + '/images/box.png') elif getBoxHostName() == 'zgemmah9combo': - system('cp -af ' + LinkNeoBoot + '/images/zgmmah9twin.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/zgmmah9twin.png ' + + LinkNeoBoot + '/images/box.png') else: - system('cp -af ' + LinkNeoBoot + '/images/logo.png ' + LinkNeoBoot + '/images/box.png') + system('cp -af ' + LinkNeoBoot + '/images/logo.png ' + + LinkNeoBoot + '/images/box.png') - cmd = "echo -e '\n\n%s '" % _('Please wait, NeoBot is working, skin change is progress...') + cmd = "echo -e '\n\n%s '" % _( + 'Please wait, NeoBot is working, skin change is progress...') cmd1 = 'rm -f ' + LinkNeoBoot + '/usedskin.p*; sleep 2' - cmd2 = 'sleep 2; cp -af ' + self.skindir + '/' + self.selectedskin + '/*.py ' + LinkNeoBoot + '/usedskin.py' - cmd3 = "echo -e '\n\n%s '" % _('NeoBoot: Complete Skin Change!') - cmd4 = "echo -e '\n\n%s '" % _('To use the new skin please restart enigma2') - self.session.open(Console, _('NeoBoot Skin Change'), [cmd, cmd1, cmd2, cmd3, cmd4]) + cmd2 = 'sleep 2; cp -af ' + self.skindir + '/' + \ + self.selectedskin + '/*.py ' + LinkNeoBoot + '/usedskin.py' + cmd3 = "echo -e '\n\n%s '" % _( + 'NeoBoot: Complete Skin Change!') + cmd4 = "echo -e '\n\n%s '" % _( + 'To use the new skin please restart enigma2') + self.session.open(Console, _('NeoBoot Skin Change'), [ + cmd, cmd1, cmd2, cmd3, cmd4]) elif isHD(): - cmd = "echo -e '\n\n%s '" % _('Please wait, NeoBot is working, skin change is progress...') + cmd = "echo -e '\n\n%s '" % _( + 'Please wait, NeoBot is working, skin change is progress...') cmd1 = 'rm -f ' + LinkNeoBoot + '/usedskin.p*; sleep 2' - cmd2 = 'sleep 2; cp -af ' + self.skindir + '/' + self.selectedskin + '/*.py ' + LinkNeoBoot + '/usedskin.py' - cmd3 = "echo -e '\n\n%s '" % _('NeoBoot: Complete Skin Change!') - cmd4 = "echo -e '\n\n%s '" % _('Skin change available only for full hd skin.') - cmd5 = "echo -e '\n\n%s '" % _('Please come back to default skin.') - cmd6 = "echo -e '\n\n%s '" % _('To use the new skin please restart enigma2') - self.session.open(Console, _('NeoBoot Skin Change'), [cmd, cmd1, cmd2, cmd3, cmd4, cmd5, cmd6]) + cmd2 = 'sleep 2; cp -af ' + self.skindir + '/' + \ + self.selectedskin + '/*.py ' + LinkNeoBoot + '/usedskin.py' + cmd3 = "echo -e '\n\n%s '" % _( + 'NeoBoot: Complete Skin Change!') + cmd4 = "echo -e '\n\n%s '" % _( + 'Skin change available only for full hd skin.') + cmd5 = "echo -e '\n\n%s '" % _( + 'Please come back to default skin.') + cmd6 = "echo -e '\n\n%s '" % _( + 'To use the new skin please restart enigma2') + self.session.open(Console, _('NeoBoot Skin Change'), [ + cmd, cmd1, cmd2, cmd3, cmd4, cmd5, cmd6]) else: self.close() def checkimageskin(self): - if fileCheck('/etc/vtiversion.info'): -# fail = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/usedskin.py' -# f = open(fail, 'r') -# content = f.read() -# f.close() -# localfile2 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/usedskin.py' -# temp_file2 = open(localfile2, 'w') -# temp_file2.write(content.replace('selektor.png', 'slekvti.png')) -# temp_file2.close() - self.restareE2() - else: - self.restareE2() + if fileCheck('/etc/vtiversion.info'): + # fail = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/usedskin.py' + # f = open(fail, 'r') + # content = f.read() + # f.close() + # localfile2 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/usedskin.py' + # temp_file2 = open(localfile2, 'w') + # temp_file2.write(content.replace('selektor.png', 'slekvti.png')) + # temp_file2.close() + self.restareE2() + else: + self.restareE2() def restareE2(self): - restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _('GUI needs a restart.\nDo you want to Restart the GUI now?'), MessageBox.TYPE_YESNO) + restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _( + 'GUI needs a restart.\nDo you want to Restart the GUI now?'), MessageBox.TYPE_YESNO) restartbox.setTitle(_('Restart GUI now?')) def restartGUI(self, answer): @@ -1610,11 +1735,12 @@ class BlocUnblockImageSkin(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('Block or unblock the neoboot skin display in the system skin.')) + self['lab1'] = Label( + _('Block or unblock the neoboot skin display in the system skin.')) self['key_red'] = Label(_('Block or unlock skins.')) self['list'] = List([]) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.restareE2, - 'red': self.deleteback}) + 'red': self.deleteback}) self.backupdir = '/usr/share/enigma2' self.onShow.append(self.updateInfo) @@ -1641,32 +1767,37 @@ class BlocUnblockImageSkin(Screen): image = self['list'].getCurrent() if image: self.delimage = image.strip() - message = (_('Select Yes to lock or No to unlock.\n %s ?') % image) - ybox = self.session.openWithCallback(self.Block_Unlock_Skin, MessageBox, message, MessageBox.TYPE_YESNO) + message = ( + _('Select Yes to lock or No to unlock.\n %s ?') % image) + ybox = self.session.openWithCallback( + self.Block_Unlock_Skin, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Confirmation...')) def Block_Unlock_Skin(self, answer): if answer is True: - fail = self.backupdir + '/' + self.delimage + '/skin.xml' - f = open(fail, 'r') - content = f.read() - f.close() - localfile2 = self.backupdir + '/' + self.delimage + '/skin.xml' - temp_file2 = open(localfile2, 'w') - temp_file2.write(content.replace('NeoBootImageChoose', 'neoBootImageChoose')) - temp_file2.close() + fail = self.backupdir + '/' + self.delimage + '/skin.xml' + f = open(fail, 'r') + content = f.read() + f.close() + localfile2 = self.backupdir + '/' + self.delimage + '/skin.xml' + temp_file2 = open(localfile2, 'w') + temp_file2.write(content.replace( + 'NeoBootImageChoose', 'neoBootImageChoose')) + temp_file2.close() else: - fail = self.backupdir + '/' + self.delimage + '/skin.xml' - f = open(fail, 'r') - content = f.read() - f.close() - localfile2 = self.backupdir + '/' + self.delimage + '/skin.xml' - temp_file2 = open(localfile2, 'w') - temp_file2.write(content.replace('neoBootImageChoose', 'NeoBootImageChoose')) - temp_file2.close() + fail = self.backupdir + '/' + self.delimage + '/skin.xml' + f = open(fail, 'r') + content = f.read() + f.close() + localfile2 = self.backupdir + '/' + self.delimage + '/skin.xml' + temp_file2 = open(localfile2, 'w') + temp_file2.write(content.replace( + 'neoBootImageChoose', 'NeoBootImageChoose')) + temp_file2.close() def restareE2(self): - restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _('GUI needs a restart.\nDo you want to Restart the GUI now?'), MessageBox.TYPE_YESNO) + restartbox = self.session.openWithCallback(self.restartGUI, MessageBox, _( + 'GUI needs a restart.\nDo you want to Restart the GUI now?'), MessageBox.TYPE_YESNO) restartbox.setTitle(_('Restart GUI now?')) def restartGUI(self, answer): @@ -1676,8 +1807,8 @@ class BlocUnblockImageSkin(Screen): self.close() def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() class InternalFlash(Screen): @@ -1690,83 +1821,99 @@ class InternalFlash(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('Install software internal flash memory in media')) + self['lab1'] = Label( + _('Install software internal flash memory in media')) self['key_red'] = Label(_('Start - Red')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.mountIF}) + 'red': self.mountIF}) def mountIF(self): if fileExists('/.multinfo') and getCPUtype() != 'MIPS': self.mountinternalflash() else: - self.myClose(_('Sorry, the operation is not possible from Flash or not supported.')) + self.myClose( + _('Sorry, the operation is not possible from Flash or not supported.')) self.close() def mountinternalflash(self): - if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': - if os.path.exists('/proc/stb/info/boxtype'): - if getBoxHostName == 'sf4008': #getCPUSoC() == 'bcm7251' - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') + if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': + if os.path.exists('/proc/stb/info/boxtype'): + if getBoxHostName == 'sf4008': # getCPUSoC() == 'bcm7251' + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') - if os.path.exists('/proc/stb/info/boxtype'): - if getBoxHostName == 'et1x000': #getCPUSoC() == 'bcm7251' or - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') + if os.path.exists('/proc/stb/info/boxtype'): + if getBoxHostName == 'et1x000': # getCPUSoC() == 'bcm7251' or + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') - if os.path.exists('/proc/stb/info/boxtype'): - if getBoxHostName == 'ax51': #getCPUSoC() == 'bcm7251s' or - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') + if os.path.exists('/proc/stb/info/boxtype'): + if getBoxHostName == 'ax51': # getCPUSoC() == 'bcm7251s' or + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') - if os.path.exists('/proc/stb/info/boxtype'): - if getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7' or getBoxHostName() == 'zgemmah7': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p3 /media/InternalFlash') + if os.path.exists('/proc/stb/info/boxtype'): + if getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7' or getBoxHostName() == 'zgemmah7': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p3 /media/InternalFlash') - if os.path.exists('/proc/stb/info/boxtype'): - if getBoxHostName() == 'zgemmah9s': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash') + if os.path.exists('/proc/stb/info/boxtype'): + if getBoxHostName() == 'zgemmah9s': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash') # if os.path.exists('/proc/stb/info/boxtype'): # if getBoxHostName() == 'zgemmah9combo': # os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash') - if getBoxHostName == 'sf8008': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p13 /media/InternalFlash') + if getBoxHostName == 'sf8008': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p13 /media/InternalFlash') - if getBoxHostName == 'ax60': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p21 /media/InternalFlash') + if getBoxHostName == 'ax60': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p21 /media/InternalFlash') - if getBoxHostName() == 'ustym4kpro' or getTunerModel() == 'ustym4kpro': - os.system(' ' + LinkNeoBoot + '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash') - #os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p13 /media/InternalFlash') + if getBoxHostName() == 'ustym4kpro' or getTunerModel() == 'ustym4kpro': + os.system( + ' ' + LinkNeoBoot + '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash') + # os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p13 /media/InternalFlash') - if os.path.exists('/proc/stb/info/model'): - if getTunerModel() == 'dm900' or getCPUSoC() == 'BCM97252SSFF': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p2 /media/InternalFlash') + if os.path.exists('/proc/stb/info/model'): + if getTunerModel() == 'dm900' or getCPUSoC() == 'BCM97252SSFF': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p2 /media/InternalFlash') - if getBoxVuModel() == 'uno4kse' or getBoxVuModel() == 'uno4k' or getBoxVuModel() == 'ultimo4k' or getBoxVuModel() == 'solo4k': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') + if getBoxVuModel() == 'uno4kse' or getBoxVuModel() == 'uno4k' or getBoxVuModel() == 'ultimo4k' or getBoxVuModel() == 'solo4k': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') - if getBoxVuModel() == 'zero4k': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash') + if getBoxVuModel() == 'zero4k': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash') - if getBoxVuModel() == 'duo4k': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash') + if getBoxVuModel() == 'duo4k': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash') - if getBoxVuModel() == 'duo4kse': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash') + if getBoxVuModel() == 'duo4kse': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash') - if getCPUSoC() == 'bcm7252s' or getBoxHostName() == 'gbquad4k': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p5 /media/InternalFlash') + if getCPUSoC() == 'bcm7252s' or getBoxHostName() == 'gbquad4k': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p5 /media/InternalFlash') - #if getBoxHostName == 'osmio4k': - #os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p5 /media/InternalFlash') + # if getBoxHostName == 'osmio4k': + # os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p5 /media/InternalFlash') - else: - self.myClose(_('Your image flash cannot be mounted.')) + else: + self.myClose(_('Your image flash cannot be mounted.')) - if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): - os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') + if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): + os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') - self.myClose(_('Your image flash is mounted in the media location')) + self.myClose(_('Your image flash is mounted in the media location')) def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) @@ -1790,8 +1937,8 @@ class DeletingLanguages(Screen): self['key_red'] = Label(_('Delete file')) self['list'] = List([]) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'ok': self.deleteback, - 'red': self.deleteback}) + 'ok': self.deleteback, + 'red': self.deleteback}) self.backupdir = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/locale' self.onShow.append(self.updateInfo) @@ -1811,14 +1958,17 @@ class DeletingLanguages(Screen): if image: self.delimage = image.strip() message = (_('File: %s remove ?') % image) - ybox = self.session.openWithCallback(self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO) + ybox = self.session.openWithCallback( + self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Confirmation of Deletion...')) def dodeleteback(self, answer): if answer is True: - cmd = "echo -e '\n\n%s '" % _('NeoBoot - deleting backup files .....') + cmd = "echo -e '\n\n%s '" % _( + 'NeoBoot - deleting backup files .....') cmd1 = 'rm -fR ' + self.backupdir + '/' + self.delimage - self.session.open(Console, _('NeoBoot: Backup files deleted!'), [cmd, cmd1]) + self.session.open(Console, _( + 'NeoBoot: Backup files deleted!'), [cmd, cmd1]) self.updateInfo() else: self.close() @@ -1837,13 +1987,14 @@ class ATVcamfeed(Screen): self['lab1'] = Label(_('Add softcam download from feed.')) self['key_red'] = Label(_('Start')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.addcamatv}) + 'red': self.addcamatv}) def addcamatv(self): if getImageATv() == 'okfeedCAMatv': cmd = "echo -e '\n\n%s '" % _('NeoBoot - ATV add cam feed ...') cmd1 = 'wget -O - -q http://updates.mynonpublic.com/oea/feed | bash' - self.session.open(Console, _('NeoBoot: Cams feed add...'), [cmd, cmd1]) + self.session.open(Console, _( + 'NeoBoot: Cams feed add...'), [cmd, cmd1]) elif getImageATv() != 'okfeedCAMatv': self.myClose(_('Sorry, is not image Open ATV !!!')) @@ -1851,8 +2002,8 @@ class ATVcamfeed(Screen): def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) self.close() - - + + class TunerInfo(Screen): __module__ = __name__ skin = """ @@ -1866,19 +2017,19 @@ class TunerInfo(Screen): self['lab1'] = Label(_('List of supported stb.')) self['key_red'] = Label(_('Start - Red')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.iNFO}) - + 'red': self.iNFO}) + def iNFO(self): try: - cmd = ' cat ' +LinkNeoBoot+ '/stbinfo.cfg' + cmd = ' cat ' + LinkNeoBoot + '/stbinfo.cfg' cmd1 = '' self.session.openWithCallback(self.close, Console, _('NeoBoot....'), [cmd, - cmd1]) + cmd1]) self.close() except: False - + class CreateSwap(Screen): __module__ = __name__ @@ -1886,78 +2037,87 @@ class CreateSwap(Screen): - """ + """ - def __init__(self, session): + def __init__(self, session): Screen.__init__(self, session) self['lab1'] = Label(_('Create swap-file.')) - self['key_red'] = Label(_('Remove file swap.')) - self['key_green'] = Label(_('Start create file swap.')) + self['key_red'] = Label(_('Remove file swap.')) + self['key_green'] = Label(_('Start create file swap.')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.RemoveSwap, - 'green': self.CreateSwap}) - + 'red': self.RemoveSwap, + 'green': self.CreateSwap}) + def CreateSwap(self): if not os.path.exists('/media/hdd/swapfile') and not os.path.exists('/media/usb/swapfile') and not os.path.exists('/swapfile'): - self.goCreateSwap() + self.goCreateSwap() else: - self.myClose(_('The file swapfile already exists.')) - + self.myClose(_('The file swapfile already exists.')) + def goCreateSwap(self): supported_filesystems = frozenset(('ext4', 'ext3', 'ext2', 'vfat')) candidates = [] mounts = getProcMounts() for partition in harddiskmanager.getMountedPartitions(False, mounts): if partition.filesystem(mounts) in supported_filesystems: - candidates.append((partition.description, partition.mountpoint)) + candidates.append( + (partition.description, partition.mountpoint)) if len(candidates): - self.session.openWithCallback(self.doCSplace, ChoiceBox, title=_('Please select device to use as swapfile location'), list=candidates) + self.session.openWithCallback(self.doCSplace, ChoiceBox, title=_( + 'Please select device to use as swapfile location'), list=candidates) else: - self.session.open(MessageBox, _("Sorry, no physical devices that supports SWAP attached. Can't create Swapfile on network or fat32 filesystems"), MessageBox.TYPE_INFO, timeout=10) + self.session.open(MessageBox, _( + "Sorry, no physical devices that supports SWAP attached. Can't create Swapfile on network or fat32 filesystems"), MessageBox.TYPE_INFO, timeout=10) def doCSplace(self, name): if name: self.new_place = name[1] myoptions = [[_('8 MB'), '8192'], - [_('16 MB'), '16384'], - [_('32 MB'), '32768'], - [_('64 MB'), '65536'], - [_('96 MB'), '98304'], - [_('128 MB'), '131072'], - [_('256 MB'), '262144'], - [_('512 MB'), '524288'], - [_('1024 MB'), '1048576']] - self.session.openWithCallback(self.doChoiceSize, ChoiceBox, title=_('Select the Swap File Size:'), list=myoptions) - + [_('16 MB'), '16384'], + [_('32 MB'), '32768'], + [_('64 MB'), '65536'], + [_('96 MB'), '98304'], + [_('128 MB'), '131072'], + [_('256 MB'), '262144'], + [_('512 MB'), '524288'], + [_('1024 MB'), '1048576']] + self.session.openWithCallback(self.doChoiceSize, ChoiceBox, title=_( + 'Select the Swap File Size:'), list=myoptions) + def doChoiceSize(self, swapsize): if swapsize: self['actions'].setEnabled(False) swapsize = swapsize[1] myfile = self.new_place + '/swapfile' - cmd0 = "echo -e '\n\n%s '" % _('Creation swap ' + myfile + ', please wait...') - cmd1 = 'dd if=/dev/zero of=' + myfile + ' bs=1024 count=' + swapsize + ' 2>/dev/null' + cmd0 = "echo -e '\n\n%s '" % _('Creation swap ' + + myfile + ', please wait...') + cmd1 = 'dd if=/dev/zero of=' + myfile + \ + ' bs=1024 count=' + swapsize + ' 2>/dev/null' cmd2 = 'mkswap ' + myfile - cmd3 = 'echo "'+ myfile + ' swap swap defaults 0 0" >> /etc/fstab' + cmd3 = 'echo "' + myfile + ' swap swap defaults 0 0" >> /etc/fstab' cmd4 = 'chmod 755 ' + myfile + '; /sbin/swapon ' + myfile + '' - cmd5 = "echo -e '\n\n%s '" % _('Creation complete swap ' + swapsize + '') + cmd5 = "echo -e '\n\n%s '" % _( + 'Creation complete swap ' + swapsize + '') self.session.open(Console, _('NeoBoot....'), [cmd0, - cmd1, - cmd2, - cmd3, - cmd4, - cmd5]) + cmd1, + cmd2, + cmd3, + cmd4, + cmd5]) self.close() - + def RemoveSwap(self): if os.path.exists('/media/hdd/swapfile') or os.path.exists('/media/usb/swapfile') or os.path.exists('/swapfile'): cmd0 = "echo -e '\n%s '" % _('Remove swap, please wait...') if os.path.exists('/media/hdd/swapfile'): - system('/sbin/swapoff -a; sleep 2; rm -rf /media/hdd/swapfile; sleep 2') + system( + '/sbin/swapoff -a; sleep 2; rm -rf /media/hdd/swapfile; sleep 2') if os.path.exists('/media/usb/swapfile'): - system('/sbin/swapoff -a; sleep 2; rm -rf /media/usb/swapfile; sleep 2') + system( + '/sbin/swapoff -a; sleep 2; rm -rf /media/usb/swapfile; sleep 2') if os.path.exists('/swapfile'): system('/sbin/swapoff -a; sleep 2; rm -rf /swapfile; sleep 2') - + swapfileinstall = ' ' if os.path.exists('/etc/fstab'): with open('/etc/fstab', 'r') as f: @@ -1969,35 +2129,41 @@ class CreateSwap(Screen): if swapfileinstall == 'swapfileyes': with open('/etc/fstab', 'r') as f: lines = f.read() - f.close() + f.close() fail = '/etc/fstab' f = open(fail, 'r') content = f.read() f.close() localfile2 = '/etc/fstab' temp_file2 = open(localfile2, 'w') - + if lines.find('/media/hdd/swapfile swap swap defaults 0 0') != -1: - temp_file2.write(content.replace("/media/hdd/swapfile swap swap defaults 0 0","")) + temp_file2.write(content.replace( + "/media/hdd/swapfile swap swap defaults 0 0", "")) elif lines.find('/media/hdd//swapfile swap swap defaults 0 0') != -1: - temp_file2.write(content.replace("/media/hdd//swapfile swap swap defaults 0 0","")) + temp_file2.write(content.replace( + "/media/hdd//swapfile swap swap defaults 0 0", "")) elif lines.find('/media/usb/swapfile swap swap defaults 0 0') != -1: - temp_file2.write(content.replace("/media/usb/swapfile swap swap defaults 0 0","")) + temp_file2.write(content.replace( + "/media/usb/swapfile swap swap defaults 0 0", "")) elif lines.find('/media/usb//swapfile swap swap defaults 0 0') != -1: - temp_file2.write(content.replace("/media/usb//swapfile swap swap defaults 0 0","")) + temp_file2.write(content.replace( + "/media/usb//swapfile swap swap defaults 0 0", "")) elif lines.find('//swapfile swap swap defaults 0 0') != -1: - temp_file2.write(content.replace("/swapfile swap swap defaults 0 0","")) + temp_file2.write(content.replace( + "/swapfile swap swap defaults 0 0", "")) elif lines.find('/swapfile swap swap defaults 0 0') != -1: - temp_file2.write(content.replace("/swapfile swap swap defaults 0 0","")) + temp_file2.write(content.replace( + "/swapfile swap swap defaults 0 0", "")) temp_file2.close() - - cmd1 = "echo -e '\n\n%s '" % _('Swap file has been deleted.') + + cmd1 = "echo -e '\n\n%s '" % _('Swap file has been deleted.') self.session.open(Console, _('NeoBoot....'), [cmd0, - cmd1]) + cmd1]) self.close() else: self.myClose(_('The swap not exists.')) - + def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) self.close() @@ -2014,21 +2180,25 @@ class IPTVPlayerInstall(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('Re-installing IPTVPlayer. \n\nPress red, install and please wait...')) + self['lab1'] = Label( + _('Re-installing IPTVPlayer. \n\nPress red, install and please wait...')) self['key_red'] = Label(_('Installation')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.panel_update}) + 'red': self.panel_update}) def panel_update(self): - os.system('cd /tmp; curl -O --ftp-ssl https://gitlab.com/zadmario/e2iplayer/-/archive/master/e2iplayer-master.tar.gz; sleep 2;') - if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer'): - os.system('rm -rf /usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer') - os.system('tar -xzf /tmp/e2iplayer-master.zip -C /tmp; sleep 2; tar -xzf /tmp/e2iplayer-master.tar.gz -C /tmp; sleep 2; mv -f /tmp/e2iplayer-master/IPTVPlayer /usr/lib/enigma2/python/Plugins/Extensions/') - os.system('opkg update > /dev/null 2>&1 ; opkg install python-html > /dev/null 2>&1 ;opkg install python-json > /dev/null 2>&1 && opkg install python-simplejson > /dev/null 2>&1; opkg install python-compression > /dev/null 2>&1; opkg install openssl-bin > /dev/null 2>&1;opkg install duktape > /dev/null 2>&1;opkg install python3-pycurl > /dev/null 2>&1;opkg install python3-e2icjson > /dev/null 2>&1;opkg install python-e2icjson > /dev/null 2>&1;opkg install cmdwrap > /dev/null 2>&1;opkg install exteplayer3 > /dev/null 2>&1;opkg install gstplayer > /dev/null 2>&1') + os.system('cd /tmp; curl -O --ftp-ssl https://gitlab.com/zadmario/e2iplayer/-/archive/master/e2iplayer-master.tar.gz; sleep 2;') + if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer'): + os.system( + 'rm -rf /usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer') + os.system('tar -xzf /tmp/e2iplayer-master.zip -C /tmp; sleep 2; tar -xzf /tmp/e2iplayer-master.tar.gz -C /tmp; sleep 2; mv -f /tmp/e2iplayer-master/IPTVPlayer /usr/lib/enigma2/python/Plugins/Extensions/') + os.system('opkg update > /dev/null 2>&1 ; opkg install python-html > /dev/null 2>&1 ;opkg install python-json > /dev/null 2>&1 && opkg install python-simplejson > /dev/null 2>&1; opkg install python-compression > /dev/null 2>&1; opkg install openssl-bin > /dev/null 2>&1;opkg install duktape > /dev/null 2>&1;opkg install python3-pycurl > /dev/null 2>&1;opkg install python3-e2icjson > /dev/null 2>&1;opkg install python-e2icjson > /dev/null 2>&1;opkg install cmdwrap > /dev/null 2>&1;opkg install exteplayer3 > /dev/null 2>&1;opkg install gstplayer > /dev/null 2>&1') + + if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer'): + self.session.open(MessageBox, _( + 'The plugin IPTVPlayer installed.'), MessageBox.TYPE_INFO, 10) + self.close() - if fileExists('/usr/lib/enigma2/python/Plugins/Extensions/IPTVPlayer'): - self.session.open(MessageBox, _('The plugin IPTVPlayer installed.'), MessageBox.TYPE_INFO, 10) - self.close() class MultiStalker(Screen): __module__ = __name__ @@ -2044,14 +2214,14 @@ class MultiStalker(Screen): self['lab1'] = Label(_('Re-installing Multi-Stalker. \n\nInstall?')) self['key_red'] = Label(_('Installation')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.MultiStalker_update}) + 'red': self.MultiStalker_update}) def MultiStalker_update(self): - os.system('rm -f /tmp/*.ipk') - cmd1 = 'wget -q "--no-check-certificate" https://raw.githubusercontent.com/ziko-ZR1/Multi-Stalker-install/main/Downloads/installer.sh -O - | /bin/sh' - self.session.open(Console, _('Enigma2 restarting..'), [cmd1]) - self.close() - + os.system('rm -f /tmp/*.ipk') + cmd1 = 'wget -q "--no-check-certificate" https://raw.githubusercontent.com/ziko-ZR1/Multi-Stalker-install/main/Downloads/installer.sh -O - | /bin/sh' + self.session.open(Console, _('Enigma2 restarting..'), [cmd1]) + self.close() + class MultibootFlashonline(Screen): __module__ = __name__ @@ -2064,32 +2234,34 @@ class MultibootFlashonline(Screen): def __init__(self, session): Screen.__init__(self, session) - self['lab1'] = Label(_('Re-installing MultibootFlashonline. \n\nInstall?')) + self['lab1'] = Label( + _('Re-installing MultibootFlashonline. \n\nInstall?')) self['key_red'] = Label(_('Installation')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.MultibootFlashonline_update}) + 'red': self.MultibootFlashonline_update}) def MultibootFlashonline_update(self): - os.system('rm -f /tmp/*.ipk') - os.system('rm -f /tmp/*.ipk') - if fileExists('/usr/bin/curl'): - os.system('cd /tmp; curl -O --ftp-ssl http://178.63.156.75/paneladdons/Pluginsoe20/multiboot/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk') - if not fileExists('/tmp/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk'): - if fileExists('/usr/bin/fullwget'): - cmd1 = 'cd /tmp; fullwget --no-check-certificate http://178.63.156.75/paneladdons/Pluginsoe20/multiboot/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk' - system(cmd1) - if not fileExists('/tmp/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk'): - if fileExists('/usr/bin/wget'): - os.system('cd /tmp; wget --no-check-certificate http://178.63.156.75/paneladdons/Pluginsoe20/multiboot/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk') - if fileExists('/tmp/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk'): - cmd2 = 'opkg install --force-overwrite --force-reinstall --force-downgrade /tmp/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk' - self.session.open(Console, _('Enigma2 restarting..'), [cmd2]) - self.close() - else: - self.session.open(MessageBox, _('The plugin not installed.\nAccess Fails with Error code error-panel_install.'), MessageBox.TYPE_INFO, 10) - self.close() - - + os.system('rm -f /tmp/*.ipk') + os.system('rm -f /tmp/*.ipk') + if fileExists('/usr/bin/curl'): + os.system('cd /tmp; curl -O --ftp-ssl http://178.63.156.75/paneladdons/Pluginsoe20/multiboot/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk') + if not fileExists('/tmp/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk'): + if fileExists('/usr/bin/fullwget'): + cmd1 = 'cd /tmp; fullwget --no-check-certificate http://178.63.156.75/paneladdons/Pluginsoe20/multiboot/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk' + system(cmd1) + if not fileExists('/tmp/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk'): + if fileExists('/usr/bin/wget'): + os.system('cd /tmp; wget --no-check-certificate http://178.63.156.75/paneladdons/Pluginsoe20/multiboot/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk') + if fileExists('/tmp/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk'): + cmd2 = 'opkg install --force-overwrite --force-reinstall --force-downgrade /tmp/enigma2-plugin-extensions-multiboot-flashonline_6.2_all.ipk' + self.session.open(Console, _('Enigma2 restarting..'), [cmd2]) + self.close() + else: + self.session.open(MessageBox, _( + 'The plugin not installed.\nAccess Fails with Error code error-panel_install.'), MessageBox.TYPE_INFO, 10) + self.close() + + class DreamSatPanel(Screen): __module__ = __name__ @@ -2104,15 +2276,15 @@ class DreamSatPanel(Screen): self['lab1'] = Label(_('Re-installing DreamSatPanel \n\nInstall?')) self['key_red'] = Label(_('Installation')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.MultiStalker_update}) + 'red': self.MultiStalker_update}) def MultiStalker_update(self): - os.system('rm -f /tmp/*.ipk') - cmd1 = 'wget -q "--no-check-certificate" http://ipkinstall.ath.cx/ipk-install/DreamSatPanel/installer.sh -O - | /bin/sh' - self.session.open(Console, _('Enigma2 restarting..'), [cmd1]) - self.close() - - + os.system('rm -f /tmp/*.ipk') + cmd1 = 'wget -q "--no-check-certificate" http://ipkinstall.ath.cx/ipk-install/DreamSatPanel/installer.sh -O - | /bin/sh' + self.session.open(Console, _('Enigma2 restarting..'), [cmd1]) + self.close() + + class InitializationFormattingDisk(Screen): __module__ = __name__ @@ -2124,15 +2296,15 @@ class InitializationFormattingDisk(Screen): """ - + def __init__(self, session): Screen.__init__(self, session) self['lab1'] = Label(_('Select disk.')) self['key_red'] = Label(_('Formatting')) self['list'] = List([]) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.myClose, - 'ok': self.deleteback, - 'red': self.deleteback}) + 'ok': self.deleteback, + 'red': self.deleteback}) self.backupdir = '/tmp/disk' self.onShow.append(self.updateInfo) @@ -2153,31 +2325,36 @@ class InitializationFormattingDisk(Screen): image = self['list'].getCurrent() if image: self.diskNeoFormatting = image.strip() - message = (_('Hard disk: %s Formatting ? Attention! All data will be lost !!!') % image) - ybox = self.session.openWithCallback(self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO) + message = ( + _('Hard disk: %s Formatting ? Attention! All data will be lost !!!') % image) + ybox = self.session.openWithCallback( + self.dodeleteback, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Format the disk ???')) def dodeleteback(self, answer): if answer is True: cmd = "echo -e '\n\n%s '" % _('NeoBoot - Formatting disk .....') - cmd1 = "echo -e '\n\n%s '" % _('Please wait and dont disconnect the power !!! ....') - cmd2 = 'umount -f -l /dev/' + self.diskNeoFormatting - cmd3 = 'sleep 2; mkfs.ext3 -i 8400 /dev/' + self.diskNeoFormatting - if not fileExists('/etc/vtiversion.info'): + cmd1 = "echo -e '\n\n%s '" % _( + 'Please wait and dont disconnect the power !!! ....') + cmd2 = 'umount -f -l /dev/' + self.diskNeoFormatting + cmd3 = 'sleep 2; mkfs.ext3 -i 8400 /dev/' + self.diskNeoFormatting + if not fileExists('/etc/vtiversion.info'): cmd4 = 'sleep 2; tune2fs -O extents,uninit_bg,dir_index /dev/' + self.diskNeoFormatting elif fileExists('/etc/vtiversion.info'): cmd4 = 'sleep 5' - cmd5 = "echo -e '\n\n%s '" % _('Receiver reboot in 5 seconds... !!!') - cmd6 = 'rm -r /tmp/disk ;sync; sync; sleep 5; /etc/init.d/reboot' - self.session.open(Console, _('Disk Formatting...!'), [cmd, cmd1, cmd2, cmd3, cmd4, cmd5, cmd6]) + cmd5 = "echo -e '\n\n%s '" % _( + 'Receiver reboot in 5 seconds... !!!') + cmd6 = 'rm -r /tmp/disk ;sync; sync; sleep 5; /etc/init.d/reboot' + self.session.open(Console, _('Disk Formatting...!'), [ + cmd, cmd1, cmd2, cmd3, cmd4, cmd5, cmd6]) self.updateInfo() else: self.close() - + def myClose(self): - self.close() - - + self.close() + + class BootManagers(Screen): __module__ = __name__ skin = """ @@ -2186,50 +2363,56 @@ class BootManagers(Screen): """ - def __init__(self, session): + def __init__(self, session): Screen.__init__(self, session) self['lab1'] = Label(_('Test the Boot Manager.')) self['key_red'] = Label(_('Do not use Boot Manager.')) - self['key_green'] = Label(_('Use Boot Manager.')) + self['key_green'] = Label(_('Use Boot Manager.')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.RemoveBootManagers, - 'green': self.CreateBootManagers}) + 'red': self.RemoveBootManagers, + 'green': self.CreateBootManagers}) def CreateBootManagers(self): - if not fileExists('/.multinfo'): - cmd0 = "echo -e '\n\n%s '" % _('Creation Boot Manager , please wait...') - if getBoxHostName() == "et5x00": - cmd1 = 'cp -af ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmips' - else: - cmd1 = 'cp -af ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmipsvu' - cmd2 = "echo -e '\n\n%s '" % _('Creation Boot Manager complete\nThe boot manager has been activated ! ') - self.session.open(Console, _('NeoBoot....'), [cmd0, - cmd1, - cmd2]) - self.close() + if not fileExists('/.multinfo'): + cmd0 = "echo -e '\n\n%s '" % _( + 'Creation Boot Manager , please wait...') + if getBoxHostName() == "et5x00": + cmd1 = 'cp -af ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmips' else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) - + cmd1 = 'cp -af ' + LinkNeoBoot + '/bin/neoinitmips /sbin/neoinitmipsvu' + cmd2 = "echo -e '\n\n%s '" % _( + 'Creation Boot Manager complete\nThe boot manager has been activated ! ') + self.session.open(Console, _('NeoBoot....'), [cmd0, + cmd1, + cmd2]) + self.close() + else: + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + def RemoveBootManagers(self): if not fileExists('/.multinfo'): - cmd0 = "echo -e '\n\n%s '" % _('Creation Boot Manager , please wait...') - if getBoxHostName() == "et5x00": + cmd0 = "echo -e '\n\n%s '" % _( + 'Creation Boot Manager , please wait...') + if getBoxHostName() == "et5x00": cmd1 = 'cp -af ' + LinkNeoBoot + '/bin/neoinitmipsvu /sbin/neoinitmips' else: cmd1 = 'cp -af ' + LinkNeoBoot + '/bin/neoinitmipsvu /sbin/neoinitmipsvu' - cmd2 = "echo -e '\n\n%s '" % _('Creation Boot Manager complete\nBoot manager has been hidden !') + cmd2 = "echo -e '\n\n%s '" % _( + 'Creation Boot Manager complete\nBoot manager has been hidden !') self.session.open(Console, _('NeoBoot....'), [cmd0, - cmd1, - cmd2]) + cmd1, + cmd2]) self.close() else: - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) - + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + def myClose(self, message): - self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() - - + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() + + class DiskLabelSet(Screen): __module__ = __name__ @@ -2244,68 +2427,71 @@ class DiskLabelSet(Screen): self['lab1'] = Label(_('Label')) self['key_red'] = Label(_('Set Label')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.SetLabelDisk}) + 'red': self.SetLabelDisk}) def SetLabelDisk(self): - #os.system("tune2fs -l /dev/sd?? | awk '/UUID/ {print $NF}' > /tmp/.myuuid") - #os.system("tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.myuuid" % (getLocationMultiboot())) + # os.system("tune2fs -l /dev/sd?? | awk '/UUID/ {print $NF}' > /tmp/.myuuid") + # os.system("tune2fs -l %s | awk '/UUID/ {print $NF}' > /tmp/.myuuid" % (getLocationMultiboot())) if os.path.exists('/media/hdd/ImageBoot'): locatin_neo = '/media/hdd' elif os.path.exists('/media/usb/ImageBoot'): - locatin_neo = '/media/usb' + locatin_neo = '/media/usb' if os.path.exists('/proc/mounts'): with open('/proc/mounts', 'r') as f: lines = f.read() f.close() - cmd = "echo -e '\n\n%s '" % _('NeoBoot - Label disk .....') - cmd1 = "echo -e '\n\n%s'" % _('Please wait') + cmd = "echo -e '\n\n%s '" % _('NeoBoot - Label disk .....') + cmd1 = "echo -e '\n\n%s'" % _('Please wait') if lines.find('/dev/sda1 /media/hdd') != -1: - os.system('tune2fs -L hdd /dev/sda1') + os.system('tune2fs -L hdd /dev/sda1') if lines.find('/dev/sdb1 /media/hdd') != -1: - os.system('tune2fs -L hdd /dev/sdb1') + os.system('tune2fs -L hdd /dev/sdb1') if lines.find('/dev/sda2 /media/hdd') != -1: - os.system('tune2fs -L hdd /dev/sda2') + os.system('tune2fs -L hdd /dev/sda2') if lines.find('/dev/sdb2 /media/hdd') != -1: - os.system('tune2fs -L hdd /dev/sdb2') + os.system('tune2fs -L hdd /dev/sdb2') if lines.find('/dev/sdc1 /media/hdd') != -1: - os.system('tune2fs -L hdd /dev/sdc1') + os.system('tune2fs -L hdd /dev/sdc1') if lines.find('/dev/sdd1 /media/hdd') != -1: - os.system('tune2fs -L hdd /dev/sdd1') + os.system('tune2fs -L hdd /dev/sdd1') if lines.find('/dev/sde1 /media/hdd') != -1: - os.system('tune2fs -L hdd /dev/sde1') + os.system('tune2fs -L hdd /dev/sde1') if lines.find('/dev/sdf1 /media/hdd') != -1: - os.system('tune2fs -L hdd /dev/sdf1') + os.system('tune2fs -L hdd /dev/sdf1') if lines.find('/dev/sda1 /media/usb') != -1: - os.system('tune2fs -L usb /dev/sda1') + os.system('tune2fs -L usb /dev/sda1') if lines.find('/dev/sdb1 /media/usb') != -1: - os.system('tune2fs -L usb /dev/sdb1') + os.system('tune2fs -L usb /dev/sdb1') if lines.find('/dev/sda2 /media/usb') != -1: - os.system('tune2fs -L usb /dev/sda2') + os.system('tune2fs -L usb /dev/sda2') if lines.find('/dev/sdb2 /media/usb') != -1: - os.system('tune2fs -L usb /dev/sdb2') + os.system('tune2fs -L usb /dev/sdb2') if lines.find('/dev/sdc1 /media/usb') != -1: - os.system('tune2fs -L usb /dev/sdc1') + os.system('tune2fs -L usb /dev/sdc1') if lines.find('/dev/sdd1 /media/usb') != -1: - os.system('tune2fs -L usb /dev/sdd1') + os.system('tune2fs -L usb /dev/sdd1') if lines.find('/dev/sde1 /media/usb') != -1: - os.system('tune2fs -L usb /dev/sde1') + os.system('tune2fs -L usb /dev/sde1') if lines.find('/dev/sdf1 /media/usb') != -1: - os.system('tune2fs -L usb /dev/sdf1') + os.system('tune2fs -L usb /dev/sdf1') cmd2 = "echo -e '\n\n%s '" % _('Label set OK') - + with open('/etc/fstab', 'r') as f: flines = f.read() f.close() - + if flines.find('' + getMyUUID() + '') != -1: - cmd3 = "echo -e '\n%s '" % _('UUID exists or neoboot not installed yet\nAfter installing the plugin, give uuid\n\nReboot...') - else: - os.system('echo UUID=' + getMyUUID() + ' ' + locatin_neo + ' auto defaults 0 0 >> /etc/fstab') - cmd3 = "echo -e '\n%s '" % _('UUID set OK\n\nReboot...') - cmd4 = 'sleep 10; reboot -f' - self.session.open(Console, _('Disk Label...!'), [cmd, cmd1, cmd2,cmd3, cmd4]) - - + cmd3 = "echo -e '\n%s '" % _( + 'UUID exists or neoboot not installed yet\nAfter installing the plugin, give uuid\n\nReboot...') + else: + os.system('echo UUID=' + getMyUUID() + ' ' + + locatin_neo + ' auto defaults 0 0 >> /etc/fstab') + cmd3 = "echo -e '\n%s '" % _('UUID set OK\n\nReboot...') + cmd4 = 'sleep 10; reboot -f' + self.session.open(Console, _('Disk Label...!'), + [cmd, cmd1, cmd2, cmd3, cmd4]) + + class MultiBootMyHelp(Screen): if isFHD(): skin = """ @@ -2320,11 +2506,11 @@ class MultiBootMyHelp(Screen): 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}) + 'ok': self.close, + 'up': self['lab1'].pageUp, + 'left': self['lab1'].pageUp, + 'down': self['lab1'].pageDown, + 'right': self['lab1'].pageDown}) self['lab1'].hide() self.updatetext() @@ -2342,7 +2528,7 @@ class MultiBootMyHelp(Screen): self['lab1'].setText(message) -###______\\\\\\----for plugin----////_____### +### ______\\\\\\----for plugin----////_____### class MyHelpNeo(Screen): if isFHD(): @@ -2360,19 +2546,21 @@ class MyHelpNeo(Screen): 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}) + 'ok': self.close, + 'up': self['lab1'].pageUp, + 'left': self['lab1'].pageUp, + 'down': self['lab1'].pageDown, + 'right': self['lab1'].pageDown}) self['lab1'].hide() self.updatetext() def updatetext(self): - message = _('NeoBoot Ver. ' + PLUGINVERSION + ' Enigma2\n\nDuring the entire installation process does not restart the receiver !!!\n\n') + message = _('NeoBoot Ver. ' + PLUGINVERSION + + ' Enigma2\n\nDuring the entire installation process does not restart the receiver !!!\n\n') message += _('NeoBoot Ver. updates ' + UPDATEVERSION + ' \n\n') message += _('NeoBoot Ver. updates ' + UPDATEVERSION + ' \n\n') - message = _('For proper operation NeoBota type device is required USB stick or HDD, formatted on your system files Linux ext3 or ext4..\n\n') + message = _( + 'For proper operation NeoBota type device is required USB stick or HDD, formatted on your system files Linux ext3 or ext4..\n\n') message += _('1. If you do not have a media formatted with the ext3 or ext4 is open to the Device Manager , select the drive and format it.\n\n') message += _('2. Go to the device manager and install correctly hdd and usb ...\n\n') message += _('3. Install NeoBota on the selected device.\n\n') @@ -2422,26 +2610,28 @@ class Opis(Screen): Screen.__init__(self, session) self['key_red'] = Label(_('Remove NeoBoot of STB')) self['key_green'] = Label(_('Install NeoBOOT from github')) - self['lab1'] = ScrollLabel('') - self['lab2'] = Label(_('' + getNeoActivatedtest() + '')) + self['lab1'] = ScrollLabel('') + self['lab2'] = Label(_('' + getNeoActivatedtest() + '')) self['actions'] = ActionMap(['WizardActions', 'ColorActions', 'DirectionActions'], {'back': self.close, - 'red': self.delete, - 'green': self.neoinstallgithub, - 'ok': self.close, - 'up': self['lab1'].pageUp, - 'left': self['lab1'].pageUp, - 'down': self['lab1'].pageDown, - 'right': self['lab1'].pageDown}) + 'red': self.delete, + 'green': self.neoinstallgithub, + 'ok': self.close, + 'up': self['lab1'].pageUp, + 'left': self['lab1'].pageUp, + 'down': self['lab1'].pageDown, + 'right': self['lab1'].pageDown}) self['lab1'].hide() self.updatetext() def updatetext(self): - message = _('\\ NeoBoot Ver. ' + PLUGINVERSION + ' - NeoBoot Ver. updates ' + UPDATEVERSION + '//\n\n') + message = _('\\ NeoBoot Ver. ' + PLUGINVERSION + + ' - NeoBoot Ver. updates ' + UPDATEVERSION + '//\n\n') message += _('\\----------NEOBOOT - VIP FULL VERSION----------/\\n') message += _('Get the full version of the multiboot plugin.\n') message += _('Send an e-mail request for the neoboot vip version.\n') message += _('e-mail: krzysztofgutosie@gmail.com\n\n') - message += _(' ' + getBoxHostName() + ' Ethernet MAC: ' + getBoxMacAddres() + '\n') + message += _(' ' + getBoxHostName() + + ' Ethernet MAC: ' + getBoxMacAddres() + '\n') message += _('----------------Free donate----------------\n') message += _('Spendenbetrag\nDonaco\nDarowizna\nПожертвование\n') message += _('Donate to the project\n') @@ -2468,59 +2658,63 @@ class Opis(Screen): def neoinstallgithub(self): message = _('Are you sure you want to reinstall neoboot from github.') - ybox = self.session.openWithCallback(self.neogithub, MessageBox, message, MessageBox.TYPE_YESNO) + ybox = self.session.openWithCallback( + self.neogithub, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Install.')) def neogithub(self, answer): if fileExists('/.multinfo'): - self.myClose(_('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) + self.myClose( + _('Sorry, Neoboot can be installed or upgraded only when booted from Flash')) self.close() - else: + else: if answer is True: - os.system('touch /tmp/.upneo; rm -r /tmp/.*') + os.system('touch /tmp/.upneo; rm -r /tmp/.*') if fileExists('' + LinkNeoBoot + '/.location'): - system('rm -f ' + LinkNeoBoot + '/.location') + system('rm -f ' + LinkNeoBoot + '/.location') if fileExists('/usr/bin/curl'): - cmd1 = 'rm -f /usr/lib/periodon/.kodn; curl -kLs https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh|sh' - self.session.open(Console, _('NeoBoot....'), [cmd1]) - self.close() - elif fileExists('/usr/bin/wget'): - cmd1 = 'rm -f /usr/lib/periodon/.kodn; 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 = 'rm -f /usr/lib/periodon/.kodn; 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: - pass - else: + cmd1 = 'rm -f /usr/lib/periodon/.kodn; curl -kLs https://raw.githubusercontent.com/gutosie/neoboot/master/iNB.sh|sh' + self.session.open(Console, _('NeoBoot....'), [cmd1]) self.close() + elif fileExists('/usr/bin/wget'): + cmd1 = 'rm -f /usr/lib/periodon/.kodn; 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 = 'rm -f /usr/lib/periodon/.kodn; 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: + pass + else: + self.close() def delete(self): message = _('Are you sure you want to completely remove NeoBoota of your image?\n\nIf you choose so all directories NeoBoota will be removed.\nA restore the original image settings Flash.') - ybox = self.session.openWithCallback(self.mbdelete, MessageBox, message, MessageBox.TYPE_YESNO) + ybox = self.session.openWithCallback( + self.mbdelete, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Removed successfully.')) def mbdelete(self, answer): if answer is True: - for line in open("/etc/hostname"): - if "dm500hd" not in line or "dm800" not in line or "dm800se" not in line or "dm8000" not in line: + for line in open("/etc/hostname"): + if "dm500hd" not in line or "dm800" not in line or "dm800se" not in line or "dm8000" not in line: os.system('touch /tmp/.upneo') - if fileExists('/usr/lib/periodon/.activatedmac'): - os.system(("rm -r /usr/lib/periodon ")) + if fileExists('/usr/lib/periodon/.activatedmac'): + os.system(("rm -r /usr/lib/periodon ")) 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('/usr/lib/libpngneo'): - system('rm -r /usr/lib/libpngneo') + system('rm -r /usr/lib/libpngneo') if fileExists('/etc/fstab.org'): system('rm -r /etc/fstab; mv /etc/fstab.org /etc/fstab') if fileExists('/etc/init.d/volatile-media.sh.org'): system(' mv /etc/init.d/volatile-media.sh.org /etc/init.d/volatile-media.sh; rm -r /etc/init.d/volatile-media.sh.org; chmod 755 /etc/init.d/volatile-media.sh ') if os.path.isfile('%sImageBoot/.neonextboot' % getNeoLocation()): - os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.version; rm -f %sImageBoot/.Flash; ' % (getNeoLocation(), getNeoLocation(), getNeoLocation())) + os.system('rm -f /etc/neoimage; rm -f /etc/imageboot; rm -f %sImageBoot/.neonextboot; rm -f %sImageBoot/.version; rm -f %sImageBoot/.Flash; ' % + (getNeoLocation(), getNeoLocation(), getNeoLocation())) if os.path.isfile('%sImagesUpload/.kernel ' % getNeoLocation()): os.system('rm -r %sImagesUpload/.kernel' % getNeoLocation()) cmd = "echo -e '\n\n%s '" % _('Recovering setting....\n') @@ -2531,18 +2725,20 @@ class Opis(Screen): 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]) + cmd1, + cmd2, + cmd3, + cmd4, + cmd5, + cmd6]) self.close() else: self.close() + def myClose(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) - self.close() + self.close() + class ReinstallKernel(Screen): __module__ = __name__ @@ -2558,7 +2754,7 @@ class ReinstallKernel(Screen): self['lab1'] = Label(_('Re-installing the kernel. \n\nInstall?')) self['key_red'] = Label(_('Installation')) self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'back': self.close, - 'red': self.InfoCheck}) + 'red': self.InfoCheck}) def InfoCheck(self): if fileExists('/.multinfo'): @@ -2580,16 +2776,18 @@ class ReinstallKernel(Screen): self.kernel_update() def kernel_update(self): - if not fileCheck('' + LinkNeoBoot + '/.location'): - pass - else: - os.system('echo "Flash " > ' + getNeoLocation() + 'ImageBoot/.neonextboot') - out = open('' + getNeoLocation() + 'ImagesUpload/.kernel/used_flash_kernel', 'w') - out.write('Used Kernel: Flash') - out.close() - cmd1 = 'rm -f /home/root/*.ipk; opkg download kernel-image; sleep 2; opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade /home/root/*.ipk; opkg configure update-modules; rm -f /home/root/*.ipk' - self.session.open(Console, _('NeoBoot....'), [cmd1]) - self.close() + if not fileCheck('' + LinkNeoBoot + '/.location'): + pass + else: + os.system('echo "Flash " > ' + getNeoLocation() + + 'ImageBoot/.neonextboot') + out = open('' + getNeoLocation() + + 'ImagesUpload/.kernel/used_flash_kernel', 'w') + out.write('Used Kernel: Flash') + out.close() + cmd1 = 'rm -f /home/root/*.ipk; opkg download kernel-image; sleep 2; opkg install --force-maintainer --force-reinstall --force-overwrite --force-downgrade /home/root/*.ipk; opkg configure update-modules; rm -f /home/root/*.ipk' + self.session.open(Console, _('NeoBoot....'), [cmd1]) + self.close() class neoDONATION(Screen): @@ -2608,11 +2806,11 @@ class neoDONATION(Screen): 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}) + 'ok': self.close, + 'up': self['lab1'].pageUp, + 'left': self['lab1'].pageUp, + 'down': self['lab1'].pageDown, + 'right': self['lab1'].pageDown}) self['lab1'].hide() self.updatetext() @@ -2622,7 +2820,8 @@ class neoDONATION(Screen): message += _('If you want to support the neoboot project, you can do so by contacting us by e-mail:\n') message += _(' krzysztofgutosie@gmail.com\n\n') message += _(' PayPal adress: krzysztofgutosie@gmail.com\n') - message += _(' ' + getBoxHostName() + ' Ethernet MAC: ' + getBoxMacAddres() + '\n') + message += _(' ' + getBoxHostName() + + ' Ethernet MAC: ' + getBoxMacAddres() + '\n') message += _('----------------Free donate----------------\n') message += _('Spendenbetrag\nDonaco\nDarowizna\nПожертвование\n') message += _('Donate to the project\n') diff --git a/NeoBoot/neoskins/biko/skin_biko73.py b/NeoBoot/neoskins/biko/skin_biko73.py index 7c0a372..a3f2635 100644 --- a/NeoBoot/neoskins/biko/skin_biko73.py +++ b/NeoBoot/neoskins/biko/skin_biko73.py @@ -4,7 +4,7 @@ from Components.Pixmap import Pixmap import os # biko73 = ./neoskins/biko/skin_biko73.py -### ImageChooseFULLHD - biko73 +# ImageChooseFULLHD - biko73 ImageChooseFULLHD = """ diff --git a/NeoBoot/neoskins/biko2/skin_biko73.py b/NeoBoot/neoskins/biko2/skin_biko73.py index a030b3e..ff66049 100644 --- a/NeoBoot/neoskins/biko2/skin_biko73.py +++ b/NeoBoot/neoskins/biko2/skin_biko73.py @@ -4,7 +4,7 @@ from Components.Pixmap import Pixmap import os # biko73 = ./neoskins/biko/skin_biko73.py -### ImageChooseFULLHD - biko73 +# ImageChooseFULLHD - biko73 ImageChooseFULLHD = """ diff --git a/NeoBoot/neoskins/cobaltfhd/skin_cobaltfhd.py b/NeoBoot/neoskins/cobaltfhd/skin_cobaltfhd.py index 0ec26a4..9f8733c 100644 --- a/NeoBoot/neoskins/cobaltfhd/skin_cobaltfhd.py +++ b/NeoBoot/neoskins/cobaltfhd/skin_cobaltfhd.py @@ -4,7 +4,7 @@ from Screens.Screen import Screen from Components.Pixmap import Pixmap import os -### ImageChooseFULLHD +# ImageChooseFULLHD ImageChooseFULLHD = """ diff --git a/NeoBoot/neoskins/darog69/skin_darog69.py b/NeoBoot/neoskins/darog69/skin_darog69.py index 513062f..95773f3 100644 --- a/NeoBoot/neoskins/darog69/skin_darog69.py +++ b/NeoBoot/neoskins/darog69/skin_darog69.py @@ -4,7 +4,7 @@ from Components.Pixmap import Pixmap import os # darog69 = ./neoskins/darog69/skin_darog69.py -### ImageChooseFULLHD - darog69 +# ImageChooseFULLHD - darog69 ImageChooseFULLHD = """ diff --git a/NeoBoot/neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py b/NeoBoot/neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py index abaa265..a72919b 100644 --- a/NeoBoot/neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py +++ b/NeoBoot/neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py @@ -4,7 +4,7 @@ from Components.Pixmap import Pixmap import os # darog69 = ./neoskins/darog69_Ustym4kpro/skin_darog69_Ustym4kpro.py -### ImageChooseFULLHD - darog69_Ustym4kpro +# ImageChooseFULLHD - darog69_Ustym4kpro ImageChooseFULLHD = """ diff --git a/NeoBoot/neoskins/default.py b/NeoBoot/neoskins/default.py index 64eae1f..e84661c 100644 --- a/NeoBoot/neoskins/default.py +++ b/NeoBoot/neoskins/default.py @@ -4,17 +4,17 @@ 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" +# 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' @@ -23,14 +23,14 @@ import os # jasny-blue = #99FFFF # Zamiast font=Regular ktory nie rozpoznaje polskich znakow np. na VTi, mozesz zmienic na ponizsze font="*: - # font - genel - # font - baslk - # font - tasat - # font - dugme +# font - genel +# font - baslk +# font - tasat +# font - dugme # -###____ Skin Ultra HD - ImageChooseFULLHD ___ mod. gutosie___ +# ____ Skin Ultra HD - ImageChooseFULLHD ___ mod. gutosie___ ImageChooseFULLHD = """ @@ -88,7 +88,7 @@ ImageChooseFULLHD = """ """ -###____ Skin Ultra HD - ImageChooseULTRAHD ___ mod. gutosie___ +# ____ Skin Ultra HD - ImageChooseULTRAHD ___ mod. gutosie___ ImageChooseULTRAHD = """ @@ -137,7 +137,7 @@ ImageChooseULTRAHD = """ """ -###____ Skin HD - ImageChoose ___mod. gutosie ___ +# ____ Skin HD - ImageChoose ___mod. gutosie ___ ImageChooseHD = """ \n \n @@ -189,7 +189,7 @@ ImageChooseHD = """ """ -###____ Skin FULLHD - MyUpgradeFULLHD ___mod. gutosie ___ +# ____ Skin FULLHD - MyUpgradeFULLHD ___mod. gutosie ___ MyUpgradeFULLHD = """ @@ -208,7 +208,7 @@ MyUpgradeFULLHD = """ """ -###____ Skin UltraHD - MyUpgradeUltraHD ___mod. gutosie ___ +# ____ Skin UltraHD - MyUpgradeUltraHD ___mod. gutosie ___ MyUpgradeUltraHD = """ @@ -225,7 +225,7 @@ MyUpgradeUltraHD = """ """ -###____ Skin MyUpgradeHD - MyUpgradeHD ___mod. gutosie ___ +# ____ Skin MyUpgradeHD - MyUpgradeHD ___mod. gutosie ___ MyUpgradeHD = """ @@ -244,7 +244,7 @@ MyUpgradeHD = """ """ -###____ Skin NeoBootInstallationFULLHD - NeoBootInstallationFULLHD ___mod. gutosie ___ +# ____ Skin NeoBootInstallationFULLHD - NeoBootInstallationFULLHD ___mod. gutosie ___ NeoBootInstallationFULLHD = """ @@ -269,7 +269,7 @@ NeoBootInstallationFULLHD = """ """ -###____ Skin NeoBootInstallationUltraHD - NeoBootInstallationUltraHD ___mod. gutosie ___ +# ____ Skin NeoBootInstallationUltraHD - NeoBootInstallationUltraHD ___mod. gutosie ___ NeoBootInstallationUltraHD = """ @@ -305,7 +305,7 @@ NeoBootInstallationUltraHD = """ """ -###____ Skin NeoBootInstallationHD - NeoBootInstallationHD ___mod. gutosie ___ +# ____ Skin NeoBootInstallationHD - NeoBootInstallationHD ___mod. gutosie ___ NeoBootInstallationHD = """ diff --git a/NeoBoot/neoskins/mercus/mercus_skin.py b/NeoBoot/neoskins/mercus/mercus_skin.py index 37128ad..e4ad692 100644 --- a/NeoBoot/neoskins/mercus/mercus_skin.py +++ b/NeoBoot/neoskins/mercus/mercus_skin.py @@ -5,7 +5,7 @@ import os # mercus = /neoskins/mercus/mercus_skin.py -### ImageChooseFULLHD - mercus +# ImageChooseFULLHD - mercus ImageChooseFULLHD = """ diff --git a/NeoBoot/neoskins/metrix/metrix_skin.py b/NeoBoot/neoskins/metrix/metrix_skin.py index d302a40..a11ea23 100644 --- a/NeoBoot/neoskins/metrix/metrix_skin.py +++ b/NeoBoot/neoskins/metrix/metrix_skin.py @@ -5,7 +5,7 @@ import os # skin /neoskins/matrix/matrix_skin.py - mod.gutosie -### ImageChooseFULLHD +# ImageChooseFULLHD ImageChooseFULLHD = """ diff --git a/NeoBoot/neoskins/neo/neo_skin.py b/NeoBoot/neoskins/neo/neo_skin.py index d3034a3..b3c6f22 100644 --- a/NeoBoot/neoskins/neo/neo_skin.py +++ b/NeoBoot/neoskins/neo/neo_skin.py @@ -5,27 +5,27 @@ 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" +# 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" # font genel # font baslk # font tasat # font dugme -#jak by chcial ktos wlasny selektor, to przyklad: +# jak by chcial ktos wlasny selektor, to przyklad: # -### ImageChooseFULLHD +# ImageChooseFULLHD ImageChooseFULLHD = """ @@ -121,4 +121,4 @@ ImageChooseFULLHD = """ """ -###ImageChoose-HD +# ImageChoose-HD diff --git a/NeoBoot/neoskins/nitro/nitro_skin.py b/NeoBoot/neoskins/nitro/nitro_skin.py index a558d95..6d9c257 100644 --- a/NeoBoot/neoskins/nitro/nitro_skin.py +++ b/NeoBoot/neoskins/nitro/nitro_skin.py @@ -4,7 +4,7 @@ from Screens.Screen import Screen from Components.Pixmap import Pixmap import os -### ImageChooseFULLHD +# ImageChooseFULLHD ImageChooseFULLHD = """ diff --git a/NeoBoot/neoskins/oldhd/hd_skin.py b/NeoBoot/neoskins/oldhd/hd_skin.py index 7f4ea4b..9734c91 100644 --- a/NeoBoot/neoskins/oldhd/hd_skin.py +++ b/NeoBoot/neoskins/oldhd/hd_skin.py @@ -4,7 +4,7 @@ from Components.Pixmap import Pixmap import os -###____ Skin HD - ImageChoose ___mod. gutosie ___ +# ____ Skin HD - ImageChoose ___mod. gutosie ___ ImageChooseHD = """ diff --git a/NeoBoot/plugin.py b/NeoBoot/plugin.py index 5564b84..90cfc45 100644 --- a/NeoBoot/plugin.py +++ b/NeoBoot/plugin.py @@ -1,22 +1,23 @@ # -*- coding: utf-8 -*- -#-------------------------------------- _q(-_-)p_ gutosie _q(-_-)p_ --------------------------------------# -#--------------------------------------------- -#[NEOBOOT]#- ---------------------------------------------# +# -------------------------------------- _q(-_-)p_ gutosie _q(-_-)p_ --------------------------------------# +# --------------------------------------------- -#[NEOBOOT]#- ---------------------------------------------# # Copyright (c) , gutosie license -#EN: +# 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: +# 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 +# --------------------------------------------- -#[NEOBOOT]#- ---------------------------------------------# +# neoboot modules + + +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 import Harddisk @@ -121,7 +122,7 @@ class MyUpgrade(Screen): self['list'] = List(self.list) self.wybierz() self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk, - 'back': self.changever}) + 'back': self.changever}) def changever(self): ImageChoose = self.session.open(NeoBootImageChoose) @@ -131,7 +132,8 @@ class MyUpgrade(Screen): 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 @@ -154,17 +156,21 @@ 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(): @@ -185,22 +191,25 @@ class NeoBootInstallation(Screen): 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['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['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}) + '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'): @@ -210,8 +219,8 @@ class NeoBootInstallation(Screen): writefile.close() def SetDiskLabel(self): - #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 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'): @@ -221,20 +230,23 @@ class NeoBootInstallation(Screen): 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: @@ -245,27 +257,32 @@ class NeoBootInstallation(Screen): cmd = '/sbin/blkid ' system(cmd) print("[MULTI-BOOT]: "), cmd - self.session.open(Console, _(' NeoBot - Available media:'), [message, 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 = self.session.openWithCallback( + self.mbdelete, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Removed successfully.')) def mbdelete(self, answer): @@ -275,11 +292,12 @@ class NeoBootInstallation(Screen): if fileExists('/etc/rcS.d/S99neo.local'): system('rm -r /etc/rcS.d/S99neo.local') if fileExists('/etc/name'): - system('rm -r /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())) + 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') @@ -290,18 +308,19 @@ class NeoBootInstallation(Screen): 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]) + 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') @@ -334,7 +353,8 @@ class NeoBootInstallation(Screen): 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')) + 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) @@ -386,7 +406,8 @@ class NeoBootInstallation(Screen): 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 = [] @@ -398,7 +419,8 @@ class NeoBootInstallation(Screen): 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': @@ -406,26 +428,31 @@ class NeoBootInstallation(Screen): 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('/tmp/.upneo'): - #self.session.open(MessageBox, _('Skip this step and install neoboot.\nThis option is available in the neoboot menu.'), type=MessageBox.TYPE_INFO) + # 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) + 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) + self.session.open(InitializationFormattingDisk) elif check == False: - message = _('After selecting OK start Mounting Manager, option Mount - green\n') + 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 = self.session.openWithCallback( + self.device2, MessageBox, message, MessageBox.TYPE_YESNO) ybox.setTitle(_('Device Manager')) def device2(self, yesno): @@ -437,25 +464,29 @@ class NeoBootInstallation(Screen): 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() + 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: - #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) + 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(): @@ -465,39 +496,47 @@ class NeoBootInstallation(Screen): 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: @@ -515,12 +554,15 @@ class NeoBootInstallation(Screen): break if check == False: - self.session.open(MessageBox, _('Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to install NeoBoot!'), MessageBox.TYPE_INFO) + self.session.open(MessageBox, _( + 'Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to install NeoBoot!'), MessageBox.TYPE_INFO) else: self.mysel = self['config'].getCurrent() if self.checkReadWriteDir(self.mysel): - message = _('Do You really want to install NeoBoot in:\n ') + self.mysel + ' ?' - ybox = self.session.openWithCallback(self.install2, MessageBox, message, MessageBox.TYPE_YESNO) + 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() @@ -533,240 +575,305 @@ class NeoBootInstallation(Screen): 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('%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('%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 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 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 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'): - 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() + 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('/usr/lib/enigma2/python/boxbranding.so'): - from boxbranding import getImageDistro - imagedistro = getImageDistro() - writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') - writefile.write(imagedistro) - writefile.close() - elif fileExists('/usr/lib/enigma2/python/Plugins/PLi'): - obraz = open('/etc/issue.net', 'r').readlines() - imagetype = obraz[0][:-3] - image = imagetype - writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') - writefile.write(imagetype) - writefile.close() - elif fileExists('/etc/vtiversion.info'): - f = open("/etc/vtiversion.info", 'r') - imagever = f.readline().strip().replace("Release ", " ") - f.close() - image = imagever - writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') - writefile.write(imagever) - writefile.close() - elif fileExists('/etc/bhversion'): - f = open("/etc/bhversion", 'r') - imagever = f.readline().strip() - f.close() - image = imagever - writefile = open('%sImageBoot/.imagedistro' % getNeoLocation(), 'w') - writefile.write(imagever) - writefile.close() + if 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'): + 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() - 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 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() - 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 /') + 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: - 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) + 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 fileExists('/home/root/vmlinux.gz'): - os.system('mv -f /home/root/vmlinux.gz %sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName())) + 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('' + LinkNeoBoot + '/ubi_reader_mips') or fileExists('' + LinkNeoBoot + '/ubi_reader_arm') and fileExists('' + LinkNeoBoot + '/ubi_reader'): - os.system('rm -r ' + LinkNeoBoot + '/ubi_reader ') + 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 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() == "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 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') + 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: - self.myclose2(_('NeoBoot has not been installed ! :(')) + 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') - if os.path.isfile('/etc/name'): - self.myclose2(_('The plug-in has been successfully installed.')) - self.close() + # 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: - if not fileExists('/etc/name'): - os.system('touch /etc/name') - closereboot = self.rebootSTBE2() - self.session.open(Console, _('NeoBoot Install....'), [cmd]) - self.close(closereboot) + 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) 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) - #os.system('sync && echo 3 > /proc/sys/vm/drop_caches; reboot -d -f') + rc = os.system(cmd) + # os.system('sync && echo 3 > /proc/sys/vm/drop_caches; reboot -d -f') else: self.close() @@ -792,9 +899,10 @@ class NeoBootImageChoose(Screen): def __init__(self, session): Screen.__init__(self, session) - + self.list = [] - self.setTitle(' NeoBoot %s - Menu' % PLUGINVERSION + ' ' + 'Ver. update: %s' % UPDATEVERSION) + self.setTitle(' NeoBoot %s - Menu' % PLUGINVERSION + + ' ' + 'Ver. update: %s' % UPDATEVERSION) self['device_icon'] = Pixmap() self['progreso'] = ProgressBar() self['linea'] = ProgressBar() @@ -823,92 +931,98 @@ class NeoBootImageChoose(Screen): 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-on NeoBoot: ')) + else: self['label14'] = Label(_('VIP-off NeoBoot: ')) self['label15'] = Label(_('Memory disc:')) - self['label16'] = Label(_('Kernel')) + 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!') + 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') + 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}) + '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() + getMountPointAll() if not fileExists('' + LinkNeoBoot + '/files/neo.sh'): - getMountPointNeo() - + 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: + + if fileExists('/media/sda1'): + if len(os.listdir('/media/sda1')) == 0: os.system('rm -r /media/sda1') - #print("Directory sda1 is empty") - + # print("Directory sda1 is empty") + if fileExists('/media/sdb1'): - if len(os.listdir('/media/sdb1') ) == 0: + if len(os.listdir('/media/sdb1')) == 0: os.system('rm -r /media/sdb1') - #print("Directory sdb1 is empty") + # 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 ') + 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') - + 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: @@ -916,63 +1030,74 @@ class NeoBootImageChoose(Screen): 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') + 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') + 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'): + 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) + 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() + 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) + self.session.open(MessageBox, _( + 'The plugin not installed.\nAccess Fails with Error code 0x04.'), MessageBox.TYPE_INFO, 10) self.close() else: 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 = 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...') + 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 @@ -980,24 +1105,25 @@ class NeoBootImageChoose(Screen): 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: False def close_exit(self): - try: - 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() - + try: + 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'): @@ -1005,7 +1131,7 @@ class NeoBootImageChoose(Screen): cmd = 'cat /tmp/error_neo' cmd1 = '' self.session.openWithCallback(self.close, Console, _('NeoBoot....'), [cmd, - cmd1]) + cmd1]) self.close() except: @@ -1015,17 +1141,19 @@ class NeoBootImageChoose(Screen): 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() ) - #out = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'w') - #out.write('Flash') - #out.close() - #self.close() + 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: @@ -1042,24 +1170,25 @@ class NeoBootImageChoose(Screen): 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') + 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'): @@ -1068,7 +1197,7 @@ class NeoBootImageChoose(Screen): if not fileExists('/tmp/guto'): pass else: - system('touch /tmp/gutos') + system('touch /tmp/gutos') def touch6(self): if fileExists('/usr/lib/periodon/.kodn'): @@ -1077,7 +1206,7 @@ class NeoBootImageChoose(Screen): if not fileExists('/tmp/gutos'): pass else: - system('touch /tmp/gutosi') + system('touch /tmp/gutosi') def touch4(self): if fileExists('/usr/lib/periodon/.kodn'): @@ -1090,16 +1219,22 @@ class NeoBootImageChoose(Screen): system('mkdir /usr/lib/periodon') else: if getButtonPin() == 'pinok': - os.system('sleep 2; rm -f /tmp/gut*; date %s > /usr/lib/periodon/.accessdate' % UPDATEDATE) + 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 !!')) + 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) + 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) + 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'): @@ -1108,7 +1243,7 @@ class NeoBootImageChoose(Screen): if not fileExists('/tmp/gutosie'): pass else: - system('touch /tmp/gutosiep') + system('touch /tmp/gutosiep') def touch8(self): if fileExists('/usr/lib/periodon/.kodn'): @@ -1117,7 +1252,7 @@ class NeoBootImageChoose(Screen): if not fileExists('/tmp/gutosiep'): pass else: - system('touch /tmp/gutosiepi') + system('touch /tmp/gutosiepi') def touch0(self): if fileExists('/usr/lib/periodon/.kodn'): @@ -1125,135 +1260,150 @@ class NeoBootImageChoose(Screen): 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 !!')) + 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'): 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 + # Zablokowanie aktualizacji przez zmiane nazwy neoboot_update na neoboot_update2 i likwidacja 3 lini hastagu wyzej def neoboot_update(self): if checkInternet(): - #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 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.')) - else: - mess = _('Geen internet') + 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.')) + else: + 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(MessageBox, _('Canceled update.'), MessageBox.TYPE_INFO, 7) + 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 /') + 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 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('/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) + 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) + 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')) + 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() + 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() + 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() + 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) + 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 = [] @@ -1302,9 +1452,9 @@ class NeoBootImageChoose(Screen): f.close() os.remove('/tmp/memoryinfo.tmp') - try: + try: perc = int(usperc[0:-1]) - except: + except: perc = int() # jak czasami robi error to odhaszowac i zahaszowac wyzej self['progreso'].setValue(perc) green = '#00389416' @@ -1312,13 +1462,13 @@ class NeoBootImageChoose(Screen): 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)) @@ -1329,7 +1479,8 @@ class NeoBootImageChoose(Screen): self.availablespace = usfree[0:-3] - strview = _('Used: ') + usperc + _(' \n Available: ') + usfree[0:-3] + ' MB' + strview = _('Used: ') + usperc + \ + _(' \n Available: ') + usfree[0:-3] + ' MB' self['label3'].setText(strview) strview2 = _('Free Space : ') + usfree[0:-3] + ' MB' @@ -1376,7 +1527,8 @@ class NeoBootImageChoose(Screen): # 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()) @@ -1386,7 +1538,8 @@ class NeoBootImageChoose(Screen): image = f.readline().strip() f.close() image = ' [' + image + ']' - self.list.insert(0, 'Flash' + image) # Insert the "Flash" image at the beginning of the list + # Insert the "Flash" image at the beginning of the list + self.list.insert(0, 'Flash' + image) self['config'].setList(self.list) @@ -1401,51 +1554,59 @@ class NeoBootImageChoose(Screen): self['label20'].setText(strview) self['label17'].setText(readline('/etc/hostname')) - self['label19'].setText(readline('%sImagesUpload/.kernel/used_flash_kernel' % getNeoLocation())) + self['label19'].setText( + readline('%sImagesUpload/.kernel/used_flash_kernel' % getNeoLocation())) strview = UPDATEVERSION 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() + 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 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: 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() 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 = _( + '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() @@ -1457,18 +1618,24 @@ class NeoBootImageChoose(Screen): f.close() try: if fileExists('/.multinfo'): - self.session.open(MessageBox, _('Sorry you can delete only from the image Flash.'), MessageBox.TYPE_INFO, 5) + 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) + 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 = 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) + 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") @@ -1493,20 +1660,25 @@ class NeoBootImageChoose(Screen): 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' + 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]) + 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() + self.ImageInstallTestOK() elif not fileExists('/.multinfo'): if ('1234%s' % getTestToTest()) != getAccessN(): count = 0 @@ -1516,54 +1688,67 @@ class NeoBootImageChoose(Screen): 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(): 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) + 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() 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() - else: - mess = _('Your receiver is not on the list of supported tuners.\nAccess stb error.') - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + 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')) + 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()): @@ -1593,7 +1778,7 @@ class NeoBootImageChoose(Screen): break if fil.endswith(".tar.gz"): images = True - break + break if fil.endswith(".nfi"): images = True break @@ -1602,29 +1787,36 @@ 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(): @@ -1632,30 +1824,36 @@ class NeoBootImageChoose(Screen): 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') + 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') + 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') + 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) + 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 /' 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() + self.bootIMG2() elif not fileExists('/.multinfo'): if ('1234%s' % getTestToTest()) == getAccessN(): self.bootIMG2() @@ -1666,69 +1864,78 @@ class NeoBootImageChoose(Screen): 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() - - 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.bootIMG2() - 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 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() + + 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:] + data = iferror[3:] else: - data = iferror + data = iferror try: if os.path.exists(filename): with open(filename) as f: @@ -1741,21 +1948,25 @@ def readline(filename, iferror=''): def checkInternet(): if fileExists('/usr/lib/python2.7'): - import urllib2 - import urllib + import urllib.request + import urllib.error + import urllib.parse + import urllib.request + import urllib.parse + import urllib.error try: - response = urllib2.urlopen("http://google.com", None, 5) + response = urllib.request.urlopen("http://google.com", None, 5) response.close() - except urllib2.HTTPError: + except urllib.error.HTTPError: return False - except urllib2.URLError: + except urllib.error.URLError: return False else: return True else: - return True + 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'): @@ -1773,63 +1984,80 @@ def main(session, **kwargs): 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') + 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') - + 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 + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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()): @@ -1838,47 +2066,51 @@ def main(session, **kwargs): 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() : #and getCheckActivateVip() == getBoxMacAddres(): - if fileExists('/.multinfo') or fileExists('/usr/lib/periodon/.fullaccess'): - session.open(NeoBootImageChoose) - else: - if float(PLUGINVERSION) != version: - session.open(MyUpgrade) - else: - session.open(NeoBootImageChoose) + f2 = open('%sImageBoot/.neonextboot' % getNeoLocation(), 'r') + mypath2 = f2.readline().strip() + f2.close() + # and getCheckActivateVip() == getBoxMacAddres(): + if mypath2 != 'Flash' or mypath2 == 'Flash' and checkimage(): + if fileExists('/.multinfo') or fileExists('/usr/lib/periodon/.fullaccess'): + 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)] + 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 a029d4f..add12a0 100644 --- a/NeoBoot/stbinfo.cfg +++ b/NeoBoot/stbinfo.cfg @@ -101,6 +101,9 @@ "maxytecmulti" "multibox" "multiboxse" +"novaler4k" +"novaler4kse" +"novaler4kpro" "viper4k" "et1x000" "gbquad4k"quad4k" @@ -173,6 +176,5 @@ 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/tmpfiles/arm_run.py b/NeoBoot/tmpfiles/arm_run.py index 5a563ab..8d74e3f 100644 --- a/NeoBoot/tmpfiles/arm_run.py +++ b/NeoBoot/tmpfiles/arm_run.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -#from __init__ import _ +# from __init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.files.stbbranding import getSupportedTuners, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxHostName, getTunerModel, getNeoLocation, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from enigma import getDesktop @@ -70,7 +70,7 @@ class StartImage(Screen): self['list'] = List(self.list) self.select() self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk, - 'back': self.close}) + 'back': self.close}) self['label1'] = Label(_('Start the chosen system now ?')) self['label2'] = Label(_('Select OK to run the image.')) @@ -86,25 +86,29 @@ class StartImage(Screen): def KeyOk(self): if getImageNeoBoot() != 'Flash': - os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) - self.StartImageInNeoBoot() + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % + (getNeoLocation(), getImageNeoBoot())) + self.StartImageInNeoBoot() else: - os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % + (getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() - #--------------------------------------------- + # --------------------------------------------- getMountPointNeo2() system('touch /tmp/.init_reboot') - #--------------------------------------------- + # --------------------------------------------- def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: - system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) + system('touch %sImageBoot/%s/.control_boot_new_image ' % + (getNeoLocation(), getImageNeoBoot())) if fileExists('/.multinfo') and getCPUtype() == 'ARMv7': - os.system(' ' + LinkNeoBoot + '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash; sleep 1') + os.system(' ' + LinkNeoBoot + + '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash; sleep 1') self.sel = self['list'].getCurrent() if self.sel: @@ -113,78 +117,91 @@ class StartImage(Screen): if not fileExists('/bin/busybox.nosuid'): os.system('ln -sf "busybox" "/bin/busybox.nosuid" ') if fileExists('/media/InternalFlash/etc/init.d/neomountboot.sh'): - os.system('rm -f /media/InternalFlash/etc/init.d/neomountboot.sh;') + os.system( + 'rm -f /media/InternalFlash/etc/init.d/neomountboot.sh;') if fileExists('/media/InternalFlash/linuxrootfs1/etc/init.d/neomountboot.sh'): - os.system('rm -f /media/InternalFlash/linuxrootfs1/etc/init.d/neomountboot.sh;') + os.system( + 'rm -f /media/InternalFlash/linuxrootfs1/etc/init.d/neomountboot.sh;') if fileExists('/media/InternalFlash/linuxrootfs2/etc/init.d/neomountboot.sh'): - os.system('rm -f /media/InternalFlash/linuxrootfs2/etc/init.d/neomountboot.sh;') + os.system( + 'rm -f /media/InternalFlash/linuxrootfs2/etc/init.d/neomountboot.sh;') if fileExists('/media/InternalFlash/linuxrootfs3/etc/init.d/neomountboot.sh'): - os.system('rm -f /media/InternalFlash/linuxrootfs3/etc/init.d/neomountboot.sh;') + os.system( + 'rm -f /media/InternalFlash/linuxrootfs3/etc/init.d/neomountboot.sh;') if fileExists('/media/InternalFlash/linuxrootfs4/etc/init.d/neomountboot.sh'): - os.system('rm -f /media/InternalFlash/linuxrootfs4/etc/init.d/neomountboot.sh;') + os.system( + 'rm -f /media/InternalFlash/linuxrootfs4/etc/init.d/neomountboot.sh;') # else: # pass - #_____ARM procesor____ + # _____ARM procesor____ if (getSupportedTuners()): - if getImageNeoBoot() == 'Flash': - if fileExists('/.multinfo'): - if fileExists('/media/InternalFlash/linuxrootfs1/sbin/neoinitarm'): - os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs1/sbin/init"') - if fileExists('/media/InternalFlash/linuxrootfs2/sbin/neoinitarm'): - os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs2/sbin/init"') - if fileExists('/media/InternalFlash/linuxrootfs3/sbin/neoinitarm'): - os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs3/sbin/init"') - if fileExists('/media/InternalFlash/linuxrootfs4/sbin/neoinitarm'): - os.system('ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs4/sbin/init"') - if fileExists('/media/InternalFlash/sbin/init'): - os.system('ln -sfn "init.sysvinit" "/media/InternalFlash/sbin/init"') - if fileExists('/media/InternalFlash'): - self.session.open(TryQuitMainloop, 2) - else: - self.session.open(TryQuitMainloop, 2) - elif not fileExists('/.multinfo'): - cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' - rc = os.system(cmd) - self.session.open(TryQuitMainloop, 2) - else: - cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' - rc = os.system(cmd) - self.session.open(TryQuitMainloop, 2) - elif getImageNeoBoot() != 'Flash': - if fileExists('/.multinfo'): - if fileExists('/media/InternalFlash/linuxrootfs1/sbin/neoinitarm'): - cmd = 'cd /media/InternalFlash/linuxrootfs1; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs1/sbin/init' - rc = os.system(cmd) - self.session.open(TryQuitMainloop, 2) - elif fileExists('/media/InternalFlash/linuxrootfs2/sbin/neoinitarm'): - cmd = 'cd /media/InternalFlash/linuxrootfs2; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs2/sbin/init' - rc = os.system(cmd) - self.session.open(TryQuitMainloop, 2) - elif fileExists('/media/InternalFlash/linuxrootfs3/sbin/neoinitarm'): - cmd = 'cd /media/InternalFlash/linuxrootfs3; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs3/sbin/init' - rc = os.system(cmd) - self.session.open(TryQuitMainloop, 2) - elif fileExists('/media/InternalFlash/linuxrootfs4/sbin/neoinitarm'): - cmd = 'cd /media/InternalFlash/linuxrootfs4; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs4/sbin/init' - rc = os.system(cmd) - self.session.open(TryQuitMainloop, 2) - else: - self.session.open(TryQuitMainloop, 2) - elif not fileExists('/.multinfo'): - cmd = 'ln -sfn /sbin/neoinitarm /sbin/init' - rc = os.system(cmd) - self.session.open(TryQuitMainloop, 2) - else: - cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' - rc = os.system(cmd) - self.session.open(TryQuitMainloop, 2) + if getImageNeoBoot() == 'Flash': + if fileExists('/.multinfo'): + if fileExists('/media/InternalFlash/linuxrootfs1/sbin/neoinitarm'): + os.system( + 'ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs1/sbin/init"') + if fileExists('/media/InternalFlash/linuxrootfs2/sbin/neoinitarm'): + os.system( + 'ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs2/sbin/init"') + if fileExists('/media/InternalFlash/linuxrootfs3/sbin/neoinitarm'): + os.system( + 'ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs3/sbin/init"') + if fileExists('/media/InternalFlash/linuxrootfs4/sbin/neoinitarm'): + os.system( + 'ln -sf "init.sysvinit" "/media/InternalFlash/linuxrootfs4/sbin/init"') + if fileExists('/media/InternalFlash/sbin/init'): + os.system( + 'ln -sfn "init.sysvinit" "/media/InternalFlash/sbin/init"') + if fileExists('/media/InternalFlash'): + self.session.open(TryQuitMainloop, 2) else: - os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') - self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) - self.close() + self.session.open(TryQuitMainloop, 2) + elif not fileExists('/.multinfo'): + cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' + rc = os.system(cmd) + self.session.open(TryQuitMainloop, 2) + else: + cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' + rc = os.system(cmd) + self.session.open(TryQuitMainloop, 2) + elif getImageNeoBoot() != 'Flash': + if fileExists('/.multinfo'): + if fileExists('/media/InternalFlash/linuxrootfs1/sbin/neoinitarm'): + cmd = 'cd /media/InternalFlash/linuxrootfs1; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs1/sbin/init' + rc = os.system(cmd) + self.session.open(TryQuitMainloop, 2) + elif fileExists('/media/InternalFlash/linuxrootfs2/sbin/neoinitarm'): + cmd = 'cd /media/InternalFlash/linuxrootfs2; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs2/sbin/init' + rc = os.system(cmd) + self.session.open(TryQuitMainloop, 2) + elif fileExists('/media/InternalFlash/linuxrootfs3/sbin/neoinitarm'): + cmd = 'cd /media/InternalFlash/linuxrootfs3; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs3/sbin/init' + rc = os.system(cmd) + self.session.open(TryQuitMainloop, 2) + elif fileExists('/media/InternalFlash/linuxrootfs4/sbin/neoinitarm'): + cmd = 'cd /media/InternalFlash/linuxrootfs4; ln -sfn /sbin/neoinitarm /media/InternalFlash/linuxrootfs4/sbin/init' + rc = os.system(cmd) + self.session.open(TryQuitMainloop, 2) + else: + self.session.open(TryQuitMainloop, 2) + elif not fileExists('/.multinfo'): + cmd = 'ln -sfn /sbin/neoinitarm /sbin/init' + rc = os.system(cmd) + self.session.open(TryQuitMainloop, 2) + else: + cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' + rc = os.system(cmd) + self.session.open(TryQuitMainloop, 2) + else: + os.system('echo "Flash " >> ' + + getNeoLocation() + 'ImageBoot/.neonextboot') + self.messagebox = self.session.open(MessageBox, _( + 'It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) + self.close() else: - os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') - self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) - self.close() - + os.system('echo "Flash " >> ' + getNeoLocation() + + 'ImageBoot/.neonextboot') + self.messagebox = self.session.open(MessageBox, _( + 'It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) + self.close() diff --git a/NeoBoot/tmpfiles/mips_run.py b/NeoBoot/tmpfiles/mips_run.py index 23813b6..a82f97e 100644 --- a/NeoBoot/tmpfiles/mips_run.py +++ b/NeoBoot/tmpfiles/mips_run.py @@ -69,7 +69,7 @@ class StartImage(Screen): self['list'] = List(self.list) self.select() self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk, - 'back': self.close}) + 'back': self.close}) self['label1'] = Label(_('Start the chosen system now ?')) self['label2'] = Label(_('Select OK to run the image.')) @@ -85,60 +85,70 @@ class StartImage(Screen): def KeyOk(self): if getImageNeoBoot() != 'Flash': - os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) - self.StartImageInNeoBoot() - else: - os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % + (getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() - #--------------------------------------------- + else: + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % + (getNeoLocation(), getImageNeoBoot())) + self.StartImageInNeoBoot() + # --------------------------------------------- getMountPointNeo2() system('touch /tmp/.init_reboot') - #--------------------------------------------- + # --------------------------------------------- def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: - system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) + system('touch %sImageBoot/%s/.control_boot_new_image ' % + (getNeoLocation(), getImageNeoBoot())) - #system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh') + # system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh') self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): - os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') + os.system( + 'rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') if (getSupportedTuners()): - if getImageNeoBoot() == 'Flash': - cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' - rc = os.system(cmd) - getTurnOffOnSystem() - elif getImageNeoBoot() != 'Flash': - if fileExists('/.multinfo'): - getTurnOffOnSystem() - elif not fileExists('/.multinfo'): - cmd = 'ln -sfn /sbin/neoinitmips /sbin/init' - rc = os.system(cmd) - getTurnOffOnSystem() - else: - os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') - getTurnOffOnSystem() - else: - os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') - self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) - self.close() + if getImageNeoBoot() == 'Flash': + cmd = 'ln -sfn /sbin/init.sysvinit /sbin/init' + rc = os.system(cmd) + getTurnOffOnSystem() + elif getImageNeoBoot() != 'Flash': + if fileExists('/.multinfo'): + getTurnOffOnSystem() + elif not fileExists('/.multinfo'): + cmd = 'ln -sfn /sbin/neoinitmips /sbin/init' + rc = os.system(cmd) + getTurnOffOnSystem() + else: + os.system('echo "Flash " >> ' + + getNeoLocation() + 'ImageBoot/.neonextboot') + getTurnOffOnSystem() + else: + os.system('echo "Flash " >> ' + + getNeoLocation() + 'ImageBoot/.neonextboot') + self.messagebox = self.session.open(MessageBox, _( + 'It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) + self.close() else: - os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') - self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) - self.close() - -def getTurnOffOnSystem(): - for line in open("/etc/hostname"): - if "dm500hd" in line or "dm800se" in line or "dm800" in line or "dm800se" in line or "dm8000" in line: - if fileExists('%sImageBoot/%s/squashfs-images' % (getNeoLocation(), getImageNeoBoot())): - os.system('ln -sf "%sImageBoot/%s/squashfs-images" "//squashfs-images"' % (getNeoLocation(), getImageNeoBoot())) - os.system('echo 3 > /proc/sys/vm/drop_caches; shutdown now -r; reboot -f -d -h -i') - - + os.system('echo "Flash " >> ' + getNeoLocation() + + 'ImageBoot/.neonextboot') + self.messagebox = self.session.open(MessageBox, _( + 'It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) + self.close() + + +def getTurnOffOnSystem(): + for line in open("/etc/hostname"): + if "dm500hd" in line or "dm800se" in line or "dm800" in line or "dm800se" in line or "dm8000" in line: + if fileExists('%sImageBoot/%s/squashfs-images' % (getNeoLocation(), getImageNeoBoot())): + os.system('ln -sf "%sImageBoot/%s/squashfs-images" "//squashfs-images"' % + (getNeoLocation(), getImageNeoBoot())) + os.system( + 'echo 3 > /proc/sys/vm/drop_caches; shutdown now -r; reboot -f -d -h -i') diff --git a/NeoBoot/tmpfiles/vu4k_run.py b/NeoBoot/tmpfiles/vu4k_run.py index 66a8cd6..223e79d 100644 --- a/NeoBoot/tmpfiles/vu4k_run.py +++ b/NeoBoot/tmpfiles/vu4k_run.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -#from __init__ import _ +# from __init__ import _ from Plugins.Extensions.NeoBoot.__init__ import _ -#from __future__ import print_function +# from __future__ import print_function from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getNeoMount, getNeoMount2, getNeoMount3, getNeoMount4, getNeoMount5, getMountPointNeo2 from enigma import getDesktop from enigma import eTimer @@ -33,15 +33,17 @@ import os import time LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' + def getMmcBlockDevice(): mmcblockdevice = 'UNKNOWN' if getBoxHostName() == 'vuultimo4k' or getBoxHostName() == 'vusolo4k' or getBoxHostName() == 'vuuno4kse' or getBoxHostName() == 'vuuno4k' and getBoxHostName() != "ustym4kpro": - mmcblockdevice = 'mmcblk0p1' + mmcblockdevice = 'mmcblk0p1' elif getBoxHostName() == 'vuzero4k' and getBoxVuModel() == 'zero4k' and getCPUSoC() == '72604' and getBoxHostName() != "ustym4kpro": - mmcblockdevice = 'mmcblk0p4' + mmcblockdevice = 'mmcblk0p4' elif getBoxHostName() == 'vuduo4k' or getBoxHostName() == 'vuduo4kse' and getBoxHostName() != "vuultimo4k" and getBoxHostName() != "ustym4kpro": - mmcblockdevice = 'mmcblk0p6' - return mmcblockdevice + mmcblockdevice = 'mmcblk0p6' + return mmcblockdevice + class StartImage(Screen): screenwidth = getDesktop(0).size().width() @@ -80,7 +82,7 @@ class StartImage(Screen): self['list'] = List(self.list) self.select() self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk, - 'back': self.close}) + 'back': self.close}) self['label1'] = Label(_('Start the chosen system now ?')) self['label2'] = Label(_('Select OK to run the image.')) @@ -96,105 +98,141 @@ class StartImage(Screen): def KeyOk(self): if getImageNeoBoot() != "Flash": - os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) - self.StartImageInNeoBoot() - else: - os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % + (getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() - #--------------------------------------------- + else: + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % + (getNeoLocation(), getImageNeoBoot())) + self.StartImageInNeoBoot() + # --------------------------------------------- getMountPointNeo2() system('touch /tmp/.init_reboot') - #--------------------------------------------- + # --------------------------------------------- def StartImageInNeoBoot(self): if getImageNeoBoot() != "Flash": if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: - system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) + system('touch %sImageBoot/%s/.control_boot_new_image ' % + (getNeoLocation(), getImageNeoBoot())) if fileExists('/.multinfo') and getCPUtype() == "ARMv7": - if getBoxVuModel() == "uno4kse" or getBoxVuModel() == "uno4k" or getBoxVuModel() == "ultimo4k" or getBoxVuModel() == "solo4k": - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') - elif getBoxVuModel() == 'duo4kse' or getBoxVuModel() == 'duo4k': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash') - elif getBoxVuModel() == 'zero4k': - os.system('mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash') - else: - os.system(' ' + LinkNeoBoot + '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash') - #elif fileExists('/boot/STARTUP') and getCPUtype() == "ARMv7": - #os.system('ln -sf "neoinitarmvu" "/boot/sbin/init"') - + if getBoxVuModel() == "uno4kse" or getBoxVuModel() == "uno4k" or getBoxVuModel() == "ultimo4k" or getBoxVuModel() == "solo4k": + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p4 /media/InternalFlash') + elif getBoxVuModel() == 'duo4kse' or getBoxVuModel() == 'duo4k': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p9 /media/InternalFlash') + elif getBoxVuModel() == 'zero4k': + os.system( + 'mkdir -p /media/InternalFlash; mount /dev/mmcblk0p7 /media/InternalFlash') + else: + os.system( + ' ' + LinkNeoBoot + '/files/findsk.sh; mkdir -p /media/InternalFlash; mount /tmp/root /media/InternalFlash') + # elif fileExists('/boot/STARTUP') and getCPUtype() == "ARMv7": + # os.system('ln -sf "neoinitarmvu" "/boot/sbin/init"') + self.sel = self['list'].getCurrent() if self.sel: self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): - os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') + os.system( + 'rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') if not fileExists('/bin/busybox.nosuid'): os.system('ln -sf "busybox" "/bin/busybox.nosuid" ') # VUPLUS Arm mmc block device - if getCPUtype() == "ARMv7" and "vu" + getBoxVuModel() == getBoxHostName(): - if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())): - mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % (getNeoLocation(), getBoxHostName())) - self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) - else: - if getImageNeoBoot() == "Flash": - if fileExists("/.multinfo"): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash; ln -sf "init.sysvinit" "/media/InternalFlash/sbin/init"' - #Vu+ Real Multiboot - if fileExists('/media/InternalFlash/STARTUP') and fileExists('/media/InternalFlash/zImage') : - cmd2 = 'dd if=/media/InternalFlash/zImage of=/dev/' + getMmcBlockDevice() + '' - else: - cmd2 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/' + getMmcBlockDevice() + '' - #cmd2 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/' + getMmcBlockDevice() + '' - cmd3 = "echo -e '\n%s '" % _('Start image FLASH - kernel flash !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____\n\n ------------ N E O B O O T ------------') - cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; cat /dev/' + getMmcBlockDevice() + ' | grep "kernel"; echo "Used Kernel: " ' + getImageNeoBoot() + ' > ' + getNeoLocation() + 'ImagesUpload/.kernel/used_flash_kernel; sleep 8; reboot -d -f' - elif not fileExists("/.multinfo"): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"' - cmd2 = 'echo "Used Kernel: " ' + getImageNeoBoot() + ' > ' + getNeoLocation() + 'ImagesUpload/.kernel/used_flash_kernel' - cmd3 = "echo -e '\n%s '" % _('Start image FLASH - kernel flash !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____\n\n ------------ N E O B O O T ------------') - cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sleep 8; reboot -d -f' - elif getImageNeoBoot() != "Flash": - if not fileExists("/.multinfo"): - if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init' - cmd2 = 'echo "Used Kernel: " ' + getImageNeoBoot() + ' > ' + getNeoLocation() + 'ImagesUpload/.kernel/used_flash_kernel' - cmd3 = "echo -e '\n%s '" % _('Reboot system E2 now !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will REBOOT in 5 seconds !____\n\n ------------ N E O B O O T ------------') - cmd4 = 'sleep 8; reboot -d -f ' - elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init' - cmd2 = 'dd if=' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/zImage.' + getBoxHostName() + ' of=/dev/' + getMmcBlockDevice() + '' - cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUtype() + ' ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____\n\n ------------ N E O B O O T ------------') - cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; echo "Used Kernel: " ' + getImageNeoBoot() + ' > ' + getNeoLocation() + 'ImagesUpload/.kernel/used_flash_kernel; sleep 8; reboot -d -f' - elif fileExists("/.multinfo"): - if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/' + getMmcBlockDevice() + '' - cmd2 = 'cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init"' - cmd3 = "echo -e '\n%s '" % _('Start image without changing the kernel!\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____\n\n ------------ N E O B O O T ------------') - cmd4 = 'echo "Used Kernel: " ' + getImageNeoBoot() + ' > ' + getNeoLocation() + 'ImagesUpload/.kernel/used_flash_kernel; sleep 8; reboot -d -f' - elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): - cmd = "echo -e '\n\n%s '" % _('...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"' - cmd2 = 'dd if=' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/zImage.' + getBoxHostName() + ' of=/dev/' + getMmcBlockDevice() + '' - cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ \n\n ------------ N E O B O O T ------------') - cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; echo "Used Kernel: " ' + getImageNeoBoot() + ' > ' + getNeoLocation() + 'ImagesUpload/.kernel/used_flash_kernel; sleep 8; reboot -d -f' - - self.session.open(Console, _('NeoBoot ARM VU+....'), [cmd, cmd1, cmd2, cmd3, cmd4]) - self.close() - + if getCPUtype() == "ARMv7" and "vu" + getBoxVuModel() == getBoxHostName(): + if not fileExists('%sImagesUpload/.kernel/flash-kernel-%s.bin' % (getNeoLocation(), getBoxHostName())): + mess = (_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash-kernel-%s.bin') % + (getNeoLocation(), getBoxHostName())) + self.session.open(MessageBox, mess, MessageBox.TYPE_INFO) + else: + if getImageNeoBoot() == "Flash": + if fileExists("/.multinfo"): + cmd = "echo -e '\n\n%s '" % _( + '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'cd /media/InternalFlash; ln -sf "init.sysvinit" "/media/InternalFlash/sbin/init"' + # Vu+ Real Multiboot + if fileExists('/media/InternalFlash/STARTUP') and fileExists('/media/InternalFlash/zImage'): + cmd2 = 'dd if=/media/InternalFlash/zImage of=/dev/' + getMmcBlockDevice() + '' + else: + cmd2 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + \ + getBoxHostName() + '.bin of=/dev/' + getMmcBlockDevice() + '' + # cmd2 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + getBoxHostName() + '.bin of=/dev/' + getMmcBlockDevice() + '' + cmd3 = "echo -e '\n%s '" % _('Start image FLASH - kernel flash !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____\n\n ------------ N E O B O O T ------------') + cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; cat /dev/' + getMmcBlockDevice() + ' | grep "kernel"; echo "Used Kernel: " ' + \ + getImageNeoBoot() + ' > ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/used_flash_kernel; sleep 8; reboot -d -f' + elif not fileExists("/.multinfo"): + cmd = "echo -e '\n\n%s '" % _( + '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'sleep 5; ln -sf "init.sysvinit" "/sbin/init"' + cmd2 = 'echo "Used Kernel: " ' + getImageNeoBoot() + ' > ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/used_flash_kernel' + cmd3 = "echo -e '\n%s '" % _('Start image FLASH - kernel flash !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____\n\n ------------ N E O B O O T ------------') + cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sleep 8; reboot -d -f' + elif getImageNeoBoot() != "Flash": + if not fileExists("/.multinfo"): + if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): + cmd = "echo -e '\n\n%s '" % _( + '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'sleep 5; ln -sfn /sbin/neoinitarm /sbin/init' + cmd2 = 'echo "Used Kernel: " ' + getImageNeoBoot() + ' > ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/used_flash_kernel' + cmd3 = "echo -e '\n%s '" % _('Reboot system E2 now !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will REBOOT in 5 seconds !____\n\n ------------ N E O B O O T ------------') + cmd4 = 'sleep 8; reboot -d -f ' + elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): + cmd = "echo -e '\n\n%s '" % _( + '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'ln -sfn /sbin/neoinitarmvu /sbin/init' + cmd2 = 'dd if=' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + \ + '/boot/zImage.' + getBoxHostName() + ' of=/dev/' + getMmcBlockDevice() + '' + cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUtype() + ' ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____\n\n ------------ N E O B O O T ------------') + cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; echo "Used Kernel: " ' + \ + getImageNeoBoot() + ' > ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/used_flash_kernel; sleep 8; reboot -d -f' + elif fileExists("/.multinfo"): + if not fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): + cmd = "echo -e '\n\n%s '" % _( + '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'dd if=' + getNeoLocation() + 'ImagesUpload/.kernel/flash-kernel-' + \ + getBoxHostName() + '.bin of=/dev/' + getMmcBlockDevice() + '' + cmd2 = 'cd /media/InternalFlash; ln -sf "neoinitarm" "/media/InternalFlash/sbin/init"' + cmd3 = "echo -e '\n%s '" % _('Start image without changing the kernel!\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____\n\n ------------ N E O B O O T ------------') + cmd4 = 'echo "Used Kernel: " ' + getImageNeoBoot() + ' > ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/used_flash_kernel; sleep 8; reboot -d -f' + elif fileExists('%sImageBoot/%s/boot/zImage.%s' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): + cmd = "echo -e '\n\n%s '" % _( + '...............NEOBOOT - REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'cd /media/InternalFlash; ln -sf "neoinitarmvu" "/media/InternalFlash/sbin/init"' + cmd2 = 'dd if=' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + \ + '/boot/zImage.' + getBoxHostName() + ' of=/dev/' + getMmcBlockDevice() + '' + cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE !\nSTB NAME: ' + getBoxHostName() + '\nMODEL: ' + getBoxVuModel() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ \n\n ------------ N E O B O O T ------------') + cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; echo "Used Kernel: " ' + \ + getImageNeoBoot() + ' > ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/used_flash_kernel; sleep 8; reboot -d -f' + + self.session.open(Console, _( + 'NeoBoot ARM VU+....'), [cmd, cmd1, cmd2, cmd3, cmd4]) + self.close() + else: - os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') - self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) - self.close() - + os.system('echo "Flash " >> ' + getNeoLocation() + + 'ImageBoot/.neonextboot') + self.messagebox = self.session.open(MessageBox, _( + 'It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) + self.close() + def myclose2(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) self.close() - diff --git a/NeoBoot/tmpfiles/vu_run.py b/NeoBoot/tmpfiles/vu_run.py index de7ac36..dde5dd2 100644 --- a/NeoBoot/tmpfiles/vu_run.py +++ b/NeoBoot/tmpfiles/vu_run.py @@ -31,16 +31,19 @@ import os import time LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' + def getMmcBlockDevice(): if getBoxHostName() == 'vuultimo' or getBoxHostName() == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName() == 'vuuno' or getBoxHostName() == 'vusolo' or getBoxHostName() == 'vuduo': - mmcblockdevice = 'mtd1' - if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/etc/vtiversion.info') and getExtCheckHddUsb() == 'ext4': - if fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): - os.system('rm -r %sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())) + mmcblockdevice = 'mtd1' + if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/etc/vtiversion.info') and getExtCheckHddUsb() == 'ext4': + if fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): + os.system('rm -r %sImageBoot/%s/boot/%s.vmlinux.gz' % + (getNeoLocation(), getImageNeoBoot(), getBoxHostName())) elif getBoxHostName() == 'vusolo2' or getBoxHostName() == 'vusolose' or getBoxHostName() == 'vuduo2' or getBoxHostName() == 'vuzero': - mmcblockdevice = 'mtd2' + mmcblockdevice = 'mtd2' return mmcblockdevice + class StartImage(Screen): screenwidth = getDesktop(0).size().width() if screenwidth and screenwidth == 1920: @@ -78,7 +81,7 @@ class StartImage(Screen): self['list'] = List(self.list) self.select() self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk, - 'back': self.close}) + 'back': self.close}) self['label1'] = Label(_('Start the chosen system now ?')) self['label2'] = Label(_('Select OK to run the image.')) @@ -94,26 +97,29 @@ class StartImage(Screen): def KeyOk(self): if getImageNeoBoot() != 'Flash': - os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) - self.StartImageInNeoBoot() - else: - os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % (getNeoLocation(), getImageNeoBoot())) + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % + (getNeoLocation(), getImageNeoBoot())) self.StartImageInNeoBoot() - - if getNandWrite() == 'nandwrite': - os.system('echo "nandwrite" > /tmp/check_nandwrite') - #--------------------------------------------- + else: + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % + (getNeoLocation(), getImageNeoBoot())) + self.StartImageInNeoBoot() + + if getNandWrite() == 'nandwrite': + os.system('echo "nandwrite" > /tmp/check_nandwrite') + # --------------------------------------------- getMountPointNeo2() system('touch /tmp/.init_reboot') - #--------------------------------------------- + # --------------------------------------------- def StartImageInNeoBoot(self): if getImageNeoBoot() != 'Flash': if fileExists('%sImageBoot/%s/.control_ok' % (getNeoLocation(), getImageNeoBoot())): system('touch /tmp/.control_ok ') else: - system('touch %sImageBoot/%s/.control_boot_new_image ' % (getNeoLocation(), getImageNeoBoot())) - + system('touch %sImageBoot/%s/.control_boot_new_image ' % + (getNeoLocation(), getImageNeoBoot())) + system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/*') self.sel = self['list'].getCurrent() @@ -121,91 +127,123 @@ class StartImage(Screen): self.sel = self.sel[2] if self.sel == 0: if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'): - os.system('rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') + os.system( + 'rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;') if not fileExists('/bin/busybox.nosuid'): os.system('ln -sf "busybox" "/bin/busybox.nosuid" ') -#################_____mips___########################## +################# _____mips___########################## - #VUPLUS MIPS vu_dev_mtd1.sh + # VUPLUS MIPS vu_dev_mtd1.sh if "vu" + getBoxVuModel() == getBoxHostName(): - getMmcBlockDevice() - if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName())): - self.myclose2(_('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash kernel vmlinux.gz ' % getNeoLocation())) - else: - if getImageNeoBoot() == 'Flash': - if fileExists('/.multinfo'): - cmd = "echo -e '\n%s '" % _('...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'flash_erase /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1 ; flash_eraseall /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1' - if getNandWrite() == 'nandwrite': - cmd2 = 'nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' - else: - cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' - cmd3 = "echo -e '\n%s '" % _('Start image FLASH - kernel flash !\n' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') - cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' - - elif not fileExists('/.multinfo'): - cmd = "echo -e '\n%s '" % _('...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init' - cmd2 = 'sync' - cmd3 = "echo -e '\n%s '" % _('Start image flash !\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') - cmd4 = 'sleep 8; reboot -d -f' + getMmcBlockDevice() + if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' % (getNeoLocation(), getBoxHostName())): + self.myclose2( + _('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash kernel vmlinux.gz ' % getNeoLocation())) + else: + if getImageNeoBoot() == 'Flash': + if fileExists('/.multinfo'): + cmd = "echo -e '\n%s '" % _( + '...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'flash_erase /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1 ; flash_eraseall /dev/' + \ + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1' + if getNandWrite() == 'nandwrite': + cmd2 = 'nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' + else: + cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' + cmd3 = "echo -e '\n%s '" % _('Start image FLASH - kernel flash !\n' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') + cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' + + elif not fileExists('/.multinfo'): + cmd = "echo -e '\n%s '" % _( + '...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init' + cmd2 = 'sync' + cmd3 = "echo -e '\n%s '" % _('Start image flash !\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') + cmd4 = 'sleep 8; reboot -d -f' + + elif getImageNeoBoot() != 'Flash': + if fileExists('/.multinfo') and getImageNeoBoot() == getImageBootNow(): + cmd = "echo -e '\n%s '" % _( + '...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init' + cmd2 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true' + cmd3 = "echo -e '\n%s '" % _('Reboot system E2 now !\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will REBOOT in 5 seconds !____ ') + cmd4 = 'sync; sleep 8; reboot -d -f ' + + elif not fileExists('/.multinfo'): + if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz'): + cmd = "echo -e '\n%s '" % _( + '...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'flash_erase /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1; flash_eraseall /dev/' + \ + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1' + if getNandWrite() == 'nandwrite': + cmd2 = 'nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImageBoot/' + \ + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' + else: + cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + \ + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + \ + '.vmlinux.gz > /dev/null 2>&1' + cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE ! ' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUtype() + ' ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') + cmd4 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' + + elif not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): + cmd = "echo -e '\n%s '" % _( + '...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init' + cmd2 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true' + cmd3 = "echo -e '\n%s '" % _('Start image without changing the kernel!\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') + cmd4 = 'sync; sleep 8; reboot -d -f' + + elif fileExists('/.multinfo'): + if not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): + cmd = "echo -e '\n%s '" % _( + '...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'flash_erase /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1 ; flash_eraseall /dev/' + \ + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1' + if getNandWrite() == 'nandwrite': + cmd2 = 'nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' + else: + cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + \ + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' + cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE ! ' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') + cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' + + elif fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): + cmd = "echo -e '\n%s '" % _( + '...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...') + cmd1 = 'flash_erase /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1 ; flash_eraseall /dev/' + \ + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1 ' + if getNandWrite() == 'nandwrite': + cmd2 = 'nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImageBoot/' + \ + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' + else: + cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + \ + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + \ + '.vmlinux.gz > /dev/null 2>&1' + cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE ! ' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation( + ) + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') + cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' + + self.session.open(Console, _('NeoBoot MIPS....'), [ + cmd, cmd1, cmd2, cmd3, cmd4]) + self.close() - elif getImageNeoBoot() != 'Flash': - if fileExists('/.multinfo') and getImageNeoBoot() == getImageBootNow(): - cmd = "echo -e '\n%s '" % _('...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init' - cmd2 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true' - cmd3 = "echo -e '\n%s '" % _('Reboot system E2 now !\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will REBOOT in 5 seconds !____ ') - cmd4 = 'sync; sleep 8; reboot -d -f ' - - elif not fileExists('/.multinfo'): - if fileExists('' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz'): - cmd = "echo -e '\n%s '" % _('...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'flash_erase /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1; flash_eraseall /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1' - if getNandWrite() == 'nandwrite': - cmd2 = 'nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' - else: - cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' - cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE ! ' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUtype() + ' ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') - cmd4 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' - - elif not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): - cmd = "echo -e '\n%s '" % _('...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init' - cmd2 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true' - cmd3 = "echo -e '\n%s '" % _('Start image without changing the kernel!\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') - cmd4 = 'sync; sleep 8; reboot -d -f' - - elif fileExists('/.multinfo'): - if not fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): - cmd = "echo -e '\n%s '" % _('...............NeoBoot REBOOT...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'flash_erase /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1 ; flash_eraseall /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1' - if getNandWrite() == 'nandwrite': - cmd2 = 'nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' - else: - cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImagesUpload/.kernel/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' - cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE ! ' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') - cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' - - elif fileExists('%sImageBoot/%s/boot/%s.vmlinux.gz' % (getNeoLocation(), getImageNeoBoot(), getBoxHostName())): - cmd = "echo -e '\n%s '" % _('...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...') - cmd1 = 'flash_erase /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1 ; flash_eraseall /dev/' + getMmcBlockDevice() + ' 0 0 > /dev/null 2>&1 ' - if getNandWrite() == 'nandwrite': - cmd2 = 'nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' - else: - cmd2 = '' + LinkNeoBoot + '/bin/nandwrite -p /dev/' + getMmcBlockDevice() + ' ' + getNeoLocation() + 'ImageBoot/' + getImageNeoBoot() + '/boot/' + getBoxHostName() + '.vmlinux.gz > /dev/null 2>&1' - cmd3 = "echo -e '\n%s '" % _('Changed kernel COMPLETE ! ' + getNandWrite() + '\nSTB NAME: ' + getBoxHostName() + '\nNeoBoot location:' + getNeoLocation() + '\nCPU: ' + getCPUSoC() + '\nImage boot: ' + getImageNeoBoot() + '\n____Your device will reboot in 5 seconds !____ ') - cmd4 = 'update-alternatives --remove vmlinux vmlinux-`uname -r` || true; sync; sleep 8; reboot -d -f' - - self.session.open(Console, _('NeoBoot MIPS....'), [cmd, cmd1, cmd2, cmd3, cmd4]) - self.close() - else: - os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') - self.messagebox = self.session.open(MessageBox, _('It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) - self.close() + os.system('echo "Flash " >> ' + getNeoLocation() + + 'ImageBoot/.neonextboot') + self.messagebox = self.session.open(MessageBox, _( + 'It looks like it that multiboot does not support this STB.'), MessageBox.TYPE_INFO, 8) + self.close() def myclose2(self, message): self.session.open(MessageBox, message, MessageBox.TYPE_INFO) self.close() - diff --git a/NeoBoot/ubi_reader_arm/argparse_neo.py b/NeoBoot/ubi_reader_arm/argparse_neo.py index 696480d..74824dc 100644 --- a/NeoBoot/ubi_reader_arm/argparse_neo.py +++ b/NeoBoot/ubi_reader_arm/argparse_neo.py @@ -1,21 +1,21 @@ __version__ = '1.1' __all__ = ['ArgumentParser', - 'ArgumentError', - 'ArgumentTypeError', - 'FileType', - 'HelpFormatter', - 'ArgumentDefaultsHelpFormatter', - 'RawDescriptionHelpFormatter', - 'RawTextHelpFormatter', - 'Namespace', - 'Action', - 'ONE_OR_MORE', - 'OPTIONAL', - 'PARSER', - 'REMAINDER', - 'SUPPRESS', - 'ZERO_OR_MORE'] + 'ArgumentError', + 'ArgumentTypeError', + 'FileType', + 'HelpFormatter', + 'ArgumentDefaultsHelpFormatter', + 'RawDescriptionHelpFormatter', + 'RawTextHelpFormatter', + 'Namespace', + 'Action', + 'ONE_OR_MORE', + 'OPTIONAL', + 'PARSER', + 'REMAINDER', + 'SUPPRESS', + 'ZERO_OR_MORE'] import collections as _collections import copy as _copy import os as _os @@ -122,9 +122,9 @@ class HelpFormatter(object): else: heading = '' return join(['\n', - heading, - item_help, - '\n']) + heading, + item_help, + '\n']) return def _add_item(self, func, args): @@ -148,9 +148,9 @@ class HelpFormatter(object): def add_usage(self, usage, actions, groups, prefix=None): if usage is not SUPPRESS: args = (usage, - actions, - groups, - prefix) + actions, + groups, + prefix) self._add_item(self._format_usage, args) def add_argument(self, action): @@ -162,7 +162,8 @@ class HelpFormatter(object): invocation_length = max([len(s) for s in invocations]) action_length = invocation_length + self._current_indent - self._action_max_length = max(self._action_max_length, action_length) + self._action_max_length = max( + self._action_max_length, action_length) self._add_item(self._format_action, [action]) def add_arguments(self, actions): @@ -325,7 +326,8 @@ class HelpFormatter(object): return self._fill_text(text, text_width, indent) + '\n\n' def _format_action(self, action): - help_position = min(self._action_max_length + 2, self._max_help_position) + help_position = min(self._action_max_length + + 2, self._max_help_position) help_width = self._width - help_position action_width = help_position - self._current_indent - 2 action_header = self._format_action_invocation(action) @@ -334,9 +336,9 @@ class HelpFormatter(object): action_header = '%*s%s\n' % tup elif len(action_header) <= action_width: tup = (self._current_indent, - '', - action_width, - action_header) + '', + action_width, + action_header) action_header = '%*s%-*s ' % tup indent_first = 0 else: @@ -521,14 +523,14 @@ class Action(_AttributeHolder): def _get_kwargs(self): names = ['option_strings', - 'dest', - 'nargs', - 'const', - 'default', - 'type', - 'choices', - 'help', - 'metavar'] + 'dest', + 'nargs', + 'const', + 'default', + 'type', + 'choices', + 'help', + 'metavar'] return [(name, getattr(self, name)) for name in names] def __call__(self, parser, namespace, values, option_string=None): @@ -539,10 +541,12 @@ class _StoreAction(Action): def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None): if nargs == 0: - raise ValueError('nargs for store actions must be > 0; if you have nothing to store, actions such as store true or store const may be more appropriate') + raise ValueError( + 'nargs for store actions must be > 0; if you have nothing to store, actions such as store true or store const may be more appropriate') if const is not None and nargs != OPTIONAL: raise ValueError('nargs must be %r to supply const' % OPTIONAL) - super(_StoreAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, default=default, type=type, choices=choices, required=required, help=help, metavar=metavar) + super(_StoreAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, + default=default, type=type, choices=choices, required=required, help=help, metavar=metavar) return def __call__(self, parser, namespace, values, option_string=None): @@ -552,7 +556,8 @@ class _StoreAction(Action): class _StoreConstAction(Action): def __init__(self, option_strings, dest, const, default=None, required=False, help=None, metavar=None): - super(_StoreConstAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, const=const, default=default, required=required, help=help) + super(_StoreConstAction, self).__init__(option_strings=option_strings, + dest=dest, nargs=0, const=const, default=default, required=required, help=help) def __call__(self, parser, namespace, values, option_string=None): setattr(namespace, self.dest, self.const) @@ -561,23 +566,27 @@ class _StoreConstAction(Action): class _StoreTrueAction(_StoreConstAction): def __init__(self, option_strings, dest, default=False, required=False, help=None): - super(_StoreTrueAction, self).__init__(option_strings=option_strings, dest=dest, const=True, default=default, required=required, help=help) + super(_StoreTrueAction, self).__init__(option_strings=option_strings, + dest=dest, const=True, default=default, required=required, help=help) class _StoreFalseAction(_StoreConstAction): def __init__(self, option_strings, dest, default=True, required=False, help=None): - super(_StoreFalseAction, self).__init__(option_strings=option_strings, dest=dest, const=False, default=default, required=required, help=help) + super(_StoreFalseAction, self).__init__(option_strings=option_strings, + dest=dest, const=False, default=default, required=required, help=help) class _AppendAction(Action): def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None): if nargs == 0: - raise ValueError('nargs for append actions must be > 0; if arg strings are not supplying the value to append, the append const action may be more appropriate') + raise ValueError( + 'nargs for append actions must be > 0; if arg strings are not supplying the value to append, the append const action may be more appropriate') if const is not None and nargs != OPTIONAL: raise ValueError('nargs must be %r to supply const' % OPTIONAL) - super(_AppendAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, default=default, type=type, choices=choices, required=required, help=help, metavar=metavar) + super(_AppendAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, + default=default, type=type, choices=choices, required=required, help=help, metavar=metavar) return def __call__(self, parser, namespace, values, option_string=None): @@ -589,7 +598,8 @@ class _AppendAction(Action): class _AppendConstAction(Action): def __init__(self, option_strings, dest, const, default=None, required=False, help=None, metavar=None): - super(_AppendConstAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, const=const, default=default, required=required, help=help, metavar=metavar) + super(_AppendConstAction, self).__init__(option_strings=option_strings, dest=dest, + nargs=0, const=const, default=default, required=required, help=help, metavar=metavar) def __call__(self, parser, namespace, values, option_string=None): items = _copy.copy(_ensure_value(namespace, self.dest, [])) @@ -600,7 +610,8 @@ class _AppendConstAction(Action): class _CountAction(Action): def __init__(self, option_strings, dest, default=None, required=False, help=None): - super(_CountAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, default=default, required=required, help=help) + super(_CountAction, self).__init__(option_strings=option_strings, + dest=dest, nargs=0, default=default, required=required, help=help) def __call__(self, parser, namespace, values, option_string=None): new_count = _ensure_value(namespace, self.dest, 0) + 1 @@ -610,7 +621,8 @@ class _CountAction(Action): class _HelpAction(Action): def __init__(self, option_strings, dest=SUPPRESS, default=SUPPRESS, help=None): - super(_HelpAction, self).__init__(option_strings=option_strings, dest=dest, default=default, nargs=0, help=help) + super(_HelpAction, self).__init__(option_strings=option_strings, + dest=dest, default=default, nargs=0, help=help) def __call__(self, parser, namespace, values, option_string=None): parser.print_help() @@ -620,7 +632,8 @@ class _HelpAction(Action): class _VersionAction(Action): def __init__(self, option_strings, version=None, dest=SUPPRESS, default=SUPPRESS, help="show program's version number and exit"): - super(_VersionAction, self).__init__(option_strings=option_strings, dest=dest, default=default, nargs=0, help=help) + super(_VersionAction, self).__init__(option_strings=option_strings, + dest=dest, default=default, nargs=0, help=help) self.version = version def __call__(self, parser, namespace, values, option_string=None): @@ -646,7 +659,8 @@ class _SubParsersAction(Action): self._parser_class = parser_class self._name_parser_map = _collections.OrderedDict() self._choices_actions = [] - super(_SubParsersAction, self).__init__(option_strings=option_strings, dest=dest, nargs=PARSER, choices=self._name_parser_map, help=help, metavar=metavar) + super(_SubParsersAction, self).__init__(option_strings=option_strings, dest=dest, + nargs=PARSER, choices=self._name_parser_map, help=help, metavar=metavar) def add_parser(self, name, **kwargs): if kwargs.get('prog') is None: @@ -674,7 +688,8 @@ class _SubParsersAction(Action): msg = _('unknown parser %r (choices: %s)') % tup raise ArgumentError(self, msg) - namespace, arg_strings = parser.parse_known_args(arg_strings, namespace) + namespace, arg_strings = parser.parse_known_args( + arg_strings, namespace) if arg_strings: vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, []) getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings) @@ -799,7 +814,8 @@ class _ActionsContainer(object): try: self._get_formatter()._format_args(action, None) except TypeError: - raise ValueError('length of metavar tuple does not match nargs') + raise ValueError( + 'length of metavar tuple does not match nargs') return self._add_action(action) @@ -841,12 +857,14 @@ class _ActionsContainer(object): group_map = {} for group in container._action_groups: if group.title not in title_group_map: - title_group_map[group.title] = self.add_argument_group(title=group.title, description=group.description, conflict_handler=group.conflict_handler) + title_group_map[group.title] = self.add_argument_group( + title=group.title, description=group.description, conflict_handler=group.conflict_handler) for action in group._group_actions: group_map[action] = title_group_map[group.title] for group in container._mutually_exclusive_groups: - mutex_group = self.add_mutually_exclusive_group(required=group.required) + mutex_group = self.add_mutually_exclusive_group( + required=group.required) for action in group._group_actions: group_map[action] = mutex_group @@ -915,7 +933,8 @@ class _ActionsContainer(object): def _handle_conflict_error(self, action, conflicting_actions): message = _('conflicting option string(s): %s') - conflict_string = ', '.join([option_string for option_string, action in conflicting_actions]) + conflict_string = ', '.join( + [option_string for option_string, action in conflicting_actions]) raise ArgumentError(action, message % conflict_string) def _handle_conflict_resolve(self, action, conflicting_actions): @@ -981,9 +1000,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def __init__(self, prog=None, usage=None, description=None, epilog=None, version=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True): if version is not None: import warnings - warnings.warn('The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action=\'version\', version="N", ...)" instead', DeprecationWarning) + warnings.warn( + 'The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action=\'version\', version="N", ...)" instead', DeprecationWarning) superinit = super(ArgumentParser, self).__init__ - superinit(description=description, prefix_chars=prefix_chars, argument_default=argument_default, conflict_handler=conflict_handler) + superinit(description=description, prefix_chars=prefix_chars, + argument_default=argument_default, conflict_handler=conflict_handler) if prog is None: prog = _os.path.basename(_sys.argv[0]) self.prog = prog @@ -1004,9 +1025,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): self.register('type', None, identity) default_prefix = '-' if '-' in prefix_chars else prefix_chars[0] if self.add_help: - self.add_argument(default_prefix + 'h', default_prefix * 2 + 'help', action='help', default=SUPPRESS, help=_('show this help message and exit')) + self.add_argument(default_prefix + 'h', default_prefix * 2 + 'help', + action='help', default=SUPPRESS, help=_('show this help message and exit')) if self.version: - self.add_argument(default_prefix + 'v', default_prefix * 2 + 'version', action='version', default=SUPPRESS, version=self.version, help=_("show program's version number and exit")) + self.add_argument(default_prefix + 'v', default_prefix * 2 + 'version', action='version', + default=SUPPRESS, version=self.version, help=_("show program's version number and exit")) for parent in parents: self._add_container_actions(parent) try: @@ -1020,12 +1043,12 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def _get_kwargs(self): names = ['prog', - 'usage', - 'description', - 'version', - 'formatter_class', - 'conflict_handler', - 'add_help'] + 'usage', + 'description', + 'version', + 'formatter_class', + 'conflict_handler', + 'add_help'] return [(name, getattr(self, name)) for name in names] def add_subparsers(self, **kwargs): @@ -1079,7 +1102,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): if not hasattr(namespace, action.dest): if action.default is not SUPPRESS: default = action.default - if isinstance(action.default, basestring): + if isinstance(action.default, str): default = self._get_value(action, default) setattr(namespace, action.dest, default) @@ -1213,7 +1236,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): else: max_option_string_index = -1 while start_index <= max_option_string_index: - next_option_string_index = min([index for index in option_string_indices if index >= start_index]) + next_option_string_index = min( + [index for index in option_string_indices if index >= start_index]) if start_index != next_option_string_index: positionals_end_index = consume_positionals(start_index) if positionals_end_index > start_index: @@ -1243,7 +1267,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): if action in seen_non_default_actions: break else: - names = [_get_action_name(action) for action in group._group_actions if action.help is not SUPPRESS] + names = [_get_action_name( + action) for action in group._group_actions if action.help is not SUPPRESS] msg = _('one of the arguments %s is required') self.error(msg % ' '.join(names)) @@ -1282,8 +1307,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): match = _re.match(nargs_pattern, arg_strings_pattern) if match is None: nargs_errors = {None: _('expected one argument'), - OPTIONAL: _('expected at most one argument'), - ONE_OR_MORE: _('expected at least one argument')} + OPTIONAL: _('expected at most one argument'), + ONE_OR_MORE: _('expected at least one argument')} default = _('expected %s argument(s)') % action.nargs msg = nargs_errors.get(action.nargs, default) raise ArgumentError(action, msg) @@ -1293,7 +1318,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): result = [] for i in range(len(actions), 0, -1): actions_slice = actions[:i] - pattern = ''.join([self._get_nargs_pattern(action) for action in actions_slice]) + pattern = ''.join([self._get_nargs_pattern(action) + for action in actions_slice]) match = _re.match(pattern, arg_strings_pattern) if match is not None: result.extend([len(string) for string in match.groups()]) @@ -1319,7 +1345,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): return (action, option_string, explicit_arg) option_tuples = self._get_option_tuples(arg_string) if len(option_tuples) > 1: - options = ', '.join([option_string for action, option_string, explicit_arg in option_tuples]) + options = ', '.join( + [option_string for action, option_string, explicit_arg in option_tuples]) tup = (arg_string, options) self.error(_('ambiguous option: %s could match %s') % tup) elif len(option_tuples) == 1: @@ -1396,7 +1423,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): value = action.const else: value = action.default - if isinstance(value, basestring): + if isinstance(value, str): value = self._get_value(action, value) self._check_value(action, value) elif not arg_strings and action.nargs == ZERO_OR_MORE and not action.option_strings: @@ -1448,12 +1475,14 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def format_usage(self): formatter = self._get_formatter() - formatter.add_usage(self.usage, self._actions, self._mutually_exclusive_groups) + formatter.add_usage(self.usage, self._actions, + self._mutually_exclusive_groups) return formatter.format_help() def format_help(self): formatter = self._get_formatter() - formatter.add_usage(self.usage, self._actions, self._mutually_exclusive_groups) + formatter.add_usage(self.usage, self._actions, + self._mutually_exclusive_groups) formatter.add_text(self.description) for action_group in self._action_groups: formatter.start_section(action_group.title) @@ -1466,7 +1495,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def format_version(self): import warnings - warnings.warn('The format_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning) + warnings.warn( + 'The format_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning) formatter = self._get_formatter() formatter.add_text(self.version) return formatter.format_help() @@ -1488,7 +1518,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def print_version(self, file=None): import warnings - warnings.warn('The print_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning) + warnings.warn( + 'The print_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning) self._print_message(self.format_version(), file) def _print_message(self, message, file=None): diff --git a/NeoBoot/ubi_reader_arm/ubi/__init__.py b/NeoBoot/ubi_reader_arm/ubi/__init__.py index 2ad94bb..d96b797 100644 --- a/NeoBoot/ubi_reader_arm/ubi/__init__.py +++ b/NeoBoot/ubi_reader_arm/ubi/__init__.py @@ -17,16 +17,18 @@ class ubi: self._block_count = len(self.blocks) if self._block_count <= 0: raise Exception('No blocks found.') - layout_list, data_list, int_vol_list, unknown_list = sort.by_type(self.blocks) + layout_list, data_list, int_vol_list, unknown_list = sort.by_type( + self.blocks) self._layout_blocks_list = layout_list self._data_blocks_list = data_list self._int_vol_blocks_list = int_vol_list self._unknown_blocks_list = unknown_list - arbitrary_block = self.blocks.itervalues().next() + arbitrary_block = next(iter(self.blocks.values())) self._min_io_size = arbitrary_block.ec_hdr.vid_hdr_offset self._leb_size = self.file.block_size - arbitrary_block.ec_hdr.data_offset layout_pairs = layout.group_pairs(self.blocks, self.layout_blocks_list) - layout_infos = layout.associate_blocks(self.blocks, layout_pairs, self.first_peb_num) + layout_infos = layout.associate_blocks( + self.blocks, layout_pairs, self.first_peb_num) self._images = [] for i in range(0, len(layout_infos)): self._images.append(image(self.blocks, layout_infos[i])) diff --git a/NeoBoot/ubi_reader_arm/ubi/block/__init__.py b/NeoBoot/ubi_reader_arm/ubi/block/__init__.py index e6575eb..7593f97 100644 --- a/NeoBoot/ubi_reader_arm/ubi/block/__init__.py +++ b/NeoBoot/ubi_reader_arm/ubi/block/__init__.py @@ -17,10 +17,12 @@ class description(object): self.vtbl_recs = [] self.ec_hdr = extract_ec_hdr(block_buf[0:UBI_EC_HDR_SZ]) if not self.ec_hdr.errors: - self.vid_hdr = extract_vid_hdr(block_buf[self.ec_hdr.vid_hdr_offset:self.ec_hdr.vid_hdr_offset + UBI_VID_HDR_SZ]) + self.vid_hdr = extract_vid_hdr( + block_buf[self.ec_hdr.vid_hdr_offset:self.ec_hdr.vid_hdr_offset + UBI_VID_HDR_SZ]) self.is_internal_vol = self.vid_hdr.vol_id >= UBI_INTERNAL_VOL_START if self.vid_hdr.vol_id >= UBI_INTERNAL_VOL_START: - self.vtbl_recs = extract_vtbl_rec(block_buf[self.ec_hdr.data_offset:]) + self.vtbl_recs = extract_vtbl_rec( + block_buf[self.ec_hdr.data_offset:]) self.leb_num = self.vid_hdr.lnum self.is_vtbl = bool(self.vtbl_recs) or False self.is_valid = not self.ec_hdr.errors and not self.vid_hdr.errors diff --git a/NeoBoot/ubi_reader_arm/ubi/block/layout.py b/NeoBoot/ubi_reader_arm/ubi/block/layout.py index 065c669..b61772d 100644 --- a/NeoBoot/ubi_reader_arm/ubi/block/layout.py +++ b/NeoBoot/ubi_reader_arm/ubi/block/layout.py @@ -18,7 +18,8 @@ def group_pairs(blocks, layout_blocks_list): def associate_blocks(blocks, layout_pairs, start_peb_num): seq_blocks = [] for layout_pair in layout_pairs: - seq_blocks = sort.by_image_seq(blocks, blocks[layout_pair[0]].ec_hdr.image_seq) + seq_blocks = sort.by_image_seq( + blocks, blocks[layout_pair[0]].ec_hdr.image_seq) layout_pair.append(seq_blocks) return layout_pairs diff --git a/NeoBoot/ubi_reader_arm/ubi/block/sort.py b/NeoBoot/ubi_reader_arm/ubi/block/sort.py index 3f01628..6d495fd 100644 --- a/NeoBoot/ubi_reader_arm/ubi/block/sort.py +++ b/NeoBoot/ubi_reader_arm/ubi/block/sort.py @@ -18,7 +18,7 @@ def by_image_seq(blocks, image_seq): def by_range(blocks, block_range): - peb_range = range(block_range[0], block_range[1]) + peb_range = list(range(block_range[0], block_range[1])) return [i for i in blocks if i in peb_range] @@ -33,7 +33,7 @@ def by_leb(blocks): slist[blocks[block].leb_num] = block return slist - return sorted(blocks.iterkeys(), key=lambda x: blocks[x].leb_num) + return sorted(iter(blocks.keys()), key=lambda x: blocks[x].leb_num) def by_vol_id(blocks, slist=None): @@ -79,6 +79,6 @@ def by_type(blocks, slist=None): unknown.append(i) return (layout, - data, - int_vol, - unknown) + data, + int_vol, + unknown) diff --git a/NeoBoot/ubi_reader_arm/ubi/defines.py b/NeoBoot/ubi_reader_arm/ubi/defines.py index 668b197..95d5ff7 100644 --- a/NeoBoot/ubi_reader_arm/ubi/defines.py +++ b/NeoBoot/ubi_reader_arm/ubi/defines.py @@ -1,50 +1,50 @@ #!/usr/bin/python import struct -UBI_CRC32_INIT = 4294967295L +UBI_CRC32_INIT = 4294967295 UBI_MAX_VOLUMES = 128 UBI_INTERNAL_VOL_START = 2147479551 UBI_EC_HDR_MAGIC = 'UBI#' EC_HDR_FORMAT = '>4sB3sQIII32sI' EC_HDR_FIELDS = ['magic', - 'version', - 'padding', - 'ec', - 'vid_hdr_offset', - 'data_offset', - 'image_seq', - 'padding2', - 'hdr_crc'] + 'version', + 'padding', + 'ec', + 'vid_hdr_offset', + 'data_offset', + 'image_seq', + 'padding2', + 'hdr_crc'] UBI_EC_HDR_SZ = struct.calcsize(EC_HDR_FORMAT) UBI_VID_HDR_MAGIC = 'UBI!' VID_HDR_FORMAT = '>4sBBBBII4sIIII4sQ12sI' VID_HDR_FIELDS = ['magic', - 'version', - 'vol_type', - 'copy_flag', - 'compat', - 'vol_id', - 'lnum', - 'padding', - 'data_size', - 'used_ebs', - 'data_pad', - 'data_crc', - 'padding2', - 'sqnum', - 'padding3', - 'hdr_crc'] + 'version', + 'vol_type', + 'copy_flag', + 'compat', + 'vol_id', + 'lnum', + 'padding', + 'data_size', + 'used_ebs', + 'data_pad', + 'data_crc', + 'padding2', + 'sqnum', + 'padding3', + 'hdr_crc'] UBI_VID_HDR_SZ = struct.calcsize(VID_HDR_FORMAT) VTBL_REC_FORMAT = '>IIIBBH128sB23sI' VTBL_REC_FIELDS = ['reserved_pebs', - 'alignment', - 'data_pad', - 'vol_type', - 'upd_marker', - 'name_len', - 'name', - 'flags', - 'padding', - 'crc'] + 'alignment', + 'data_pad', + 'vol_type', + 'upd_marker', + 'name_len', + 'name', + 'flags', + 'padding', + 'crc'] UBI_VTBL_REC_SZ = struct.calcsize(VTBL_REC_FORMAT) UBI_VID_DYNAMIC = 1 UBI_VID_STATIC = 2 @@ -55,9 +55,9 @@ UBI_COMPAT_RO = 2 UBI_COMPAT_PRESERVE = 4 UBI_COMPAT_REJECT = 5 PRINT_COMPAT_LIST = [0, - 'Delete', - 'Read Only', - 0, - 'Preserve', - 'Reject'] -FILE_CHUNK_SZ = 5242880 \ No newline at end of file + 'Delete', + 'Read Only', + 0, + 'Preserve', + 'Reject'] +FILE_CHUNK_SZ = 5242880 diff --git a/NeoBoot/ubi_reader_arm/ubi/display.py b/NeoBoot/ubi_reader_arm/ubi/display.py index 5124951..7dc11f9 100644 --- a/NeoBoot/ubi_reader_arm/ubi/display.py +++ b/NeoBoot/ubi_reader_arm/ubi/display.py @@ -3,77 +3,79 @@ from ubi.defines import PRINT_COMPAT_LIST, PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORES def ubi(ubi, tab=''): - print '%sUBI File' % tab - print '%s---------------------' % tab - print '\t%sMin I/O: %s' % (tab, ubi.min_io_size) - print '\t%sLEB Size: %s' % (tab, ubi.leb_size) - print '\t%sPEB Size: %s' % (tab, ubi.peb_size) - print '\t%sTotal Block Count: %s' % (tab, ubi.block_count) - print '\t%sData Block Count: %s' % (tab, len(ubi.data_blocks_list)) - print '\t%sLayout Block Count: %s' % (tab, len(ubi.layout_blocks_list)) - print '\t%sInternal Volume Block Count: %s' % (tab, len(ubi.int_vol_blocks_list)) - print '\t%sUnknown Block Count: %s' % (tab, len(ubi.unknown_blocks_list)) - print '\t%sFirst UBI PEB Number: %s' % (tab, ubi.first_peb_num) + print(('%sUBI File' % tab)) + print(('%s---------------------' % tab)) + print(('\t%sMin I/O: %s' % (tab, ubi.min_io_size))) + print(('\t%sLEB Size: %s' % (tab, ubi.leb_size))) + print(('\t%sPEB Size: %s' % (tab, ubi.peb_size))) + print(('\t%sTotal Block Count: %s' % (tab, ubi.block_count))) + print(('\t%sData Block Count: %s' % (tab, len(ubi.data_blocks_list)))) + print(('\t%sLayout Block Count: %s' % (tab, len(ubi.layout_blocks_list)))) + print(('\t%sInternal Volume Block Count: %s' % + (tab, len(ubi.int_vol_blocks_list)))) + print(('\t%sUnknown Block Count: %s' % (tab, len(ubi.unknown_blocks_list)))) + print(('\t%sFirst UBI PEB Number: %s' % (tab, ubi.first_peb_num))) def image(image, tab=''): - print '%s%s' % (tab, image) - print '%s---------------------' % tab - print '\t%sImage Sequence Num: %s' % (tab, image.image_seq) + print(('%s%s' % (tab, image))) + print(('%s---------------------' % tab)) + print(('\t%sImage Sequence Num: %s' % (tab, image.image_seq))) for volume in image.volumes: - print '\t%sVolume Name:%s' % (tab, volume) + print(('\t%sVolume Name:%s' % (tab, volume))) - print '\t%sPEB Range: %s - %s' % (tab, image.peb_range[0], image.peb_range[1]) + print(('\t%sPEB Range: %s - %s' % + (tab, image.peb_range[0], image.peb_range[1]))) def volume(volume, tab=''): - print '%s%s' % (tab, volume) - print '%s---------------------' % tab - print '\t%sVol ID: %s' % (tab, volume.vol_id) - print '\t%sName: %s' % (tab, volume.name) - print '\t%sBlock Count: %s' % (tab, volume.block_count) - print '\n' - print '\t%sVolume Record' % tab - print '\t%s---------------------' % tab + print(('%s%s' % (tab, volume))) + print(('%s---------------------' % tab)) + print(('\t%sVol ID: %s' % (tab, volume.vol_id))) + print(('\t%sName: %s' % (tab, volume.name))) + print(('\t%sBlock Count: %s' % (tab, volume.block_count))) + print('\n') + print(('\t%sVolume Record' % tab)) + print(('\t%s---------------------' % tab)) vol_rec(volume.vol_rec, '\t\t%s' % tab) - print '\n' + print('\n') def block(block, tab='\t'): - print '%s%s' % (tab, block) - print '%s---------------------' % tab - print '\t%sFile Offset: %s' % (tab, block.file_offset) - print '\t%sPEB #: %s' % (tab, block.peb_num) - print '\t%sLEB #: %s' % (tab, block.leb_num) - print '\t%sBlock Size: %s' % (tab, block.size) - print '\t%sInternal Volume: %s' % (tab, block.is_internal_vol) - print '\t%sIs Volume Table: %s' % (tab, block.is_vtbl) - print '\t%sIs Valid: %s' % (tab, block.is_valid) + print(('%s%s' % (tab, block))) + print(('%s---------------------' % tab)) + print(('\t%sFile Offset: %s' % (tab, block.file_offset))) + print(('\t%sPEB #: %s' % (tab, block.peb_num))) + print(('\t%sLEB #: %s' % (tab, block.leb_num))) + print(('\t%sBlock Size: %s' % (tab, block.size))) + print(('\t%sInternal Volume: %s' % (tab, block.is_internal_vol))) + print(('\t%sIs Volume Table: %s' % (tab, block.is_vtbl))) + print(('\t%sIs Valid: %s' % (tab, block.is_valid))) if not block.ec_hdr.errors: - print '\n' - print '\t%sErase Count Header' % tab - print '\t%s---------------------' % tab + print('\n') + print(('\t%sErase Count Header' % tab)) + print(('\t%s---------------------' % tab)) ec_hdr(block.ec_hdr, '\t\t%s' % tab) if block.vid_hdr and not block.vid_hdr.errors: - print '\n' - print '\t%sVID Header Header' % tab - print '\t%s---------------------' % tab + print('\n') + print(('\t%sVID Header Header' % tab)) + print(('\t%s---------------------' % tab)) vid_hdr(block.vid_hdr, '\t\t%s' % tab) if block.vtbl_recs: - print '\n' - print '\t%sVolume Records' % tab - print '\t%s---------------------' % tab + print('\n') + print(('\t%sVolume Records' % tab)) + print(('\t%s---------------------' % tab)) for vol in block.vtbl_recs: vol_rec(vol, '\t\t%s' % tab) - print '\n' + print('\n') def ec_hdr(ec_hdr, tab=''): for key, value in ec_hdr: if key == 'errors': value = ','.join(value) - print '%s%s: %r' % (tab, key, value) + print(('%s%s: %r' % (tab, key, value))) def vid_hdr(vid_hdr, tab=''): @@ -90,7 +92,7 @@ def vid_hdr(vid_hdr, tab=''): value = PRINT_VOL_TYPE_LIST[value] else: value = -1 - print '%s%s: %s' % (tab, key, value) + print(('%s%s: %s' % (tab, key, value))) def vol_rec(vol_rec, tab=''): @@ -106,4 +108,4 @@ def vol_rec(vol_rec, tab=''): value = 'autoresize' elif key == 'name': value = value.strip('\x00') - print '%s%s: %s' % (tab, key, value) + print(('%s%s: %s' % (tab, key, value))) diff --git a/NeoBoot/ubi_reader_arm/ubi/headers/__init__.py b/NeoBoot/ubi_reader_arm/ubi/headers/__init__.py index 5641b23..1ee4d07 100644 --- a/NeoBoot/ubi_reader_arm/ubi/headers/__init__.py +++ b/NeoBoot/ubi_reader_arm/ubi/headers/__init__.py @@ -7,7 +7,8 @@ from ubi.headers import errors class ec_hdr(object): def __init__(self, buf): - fields = dict(zip(EC_HDR_FIELDS, struct.unpack(EC_HDR_FORMAT, buf))) + fields = dict( + list(zip(EC_HDR_FIELDS, struct.unpack(EC_HDR_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -25,7 +26,8 @@ class ec_hdr(object): class vid_hdr(object): def __init__(self, buf): - fields = dict(zip(VID_HDR_FIELDS, struct.unpack(VID_HDR_FORMAT, buf))) + fields = dict( + list(zip(VID_HDR_FIELDS, struct.unpack(VID_HDR_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -43,7 +45,8 @@ class vid_hdr(object): class vtbl_rec(object): def __init__(self, buf): - fields = dict(zip(VTBL_REC_FIELDS, struct.unpack(VTBL_REC_FORMAT, buf))) + fields = dict( + list(zip(VTBL_REC_FIELDS, struct.unpack(VTBL_REC_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) diff --git a/NeoBoot/ubi_reader_arm/ubi/headers/errors.py b/NeoBoot/ubi_reader_arm/ubi/headers/errors.py index 04b3d46..bc502b4 100644 --- a/NeoBoot/ubi_reader_arm/ubi/headers/errors.py +++ b/NeoBoot/ubi_reader_arm/ubi/headers/errors.py @@ -4,14 +4,14 @@ from ubi.defines import * def ec_hdr(ec_hdr, buf): - if ec_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295L: + if ec_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295: ec_hdr.errors.append('crc') return ec_hdr def vid_hdr(vid_hdr, buf): vid_hdr.errors = [] - if vid_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295L: + if vid_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295: vid_hdr.errors.append('crc') return vid_hdr @@ -22,7 +22,7 @@ def vtbl_rec(vtbl_rec, buf): likely_vtbl = False elif vtbl_rec.vol_type not in (1, 2): likely_vtbl = False - if vtbl_rec.crc != ~crc32(buf[:-4]) & 4294967295L: + if vtbl_rec.crc != ~crc32(buf[:-4]) & 4294967295: vtbl_rec.errors.append('crc') if not likely_vtbl: vtbl_rec.errors = ['False'] diff --git a/NeoBoot/ubi_reader_arm/ubi/image.py b/NeoBoot/ubi_reader_arm/ubi/image.py index 77c0539..b732fe0 100644 --- a/NeoBoot/ubi_reader_arm/ubi/image.py +++ b/NeoBoot/ubi_reader_arm/ubi/image.py @@ -18,7 +18,7 @@ class description(object): return 'Image: %s' % self.image_seq def get_blocks(self, blocks): - return get_blocks_in_list(blocks, range(self._start_peb, self._end_peb + 1)) + return get_blocks_in_list(blocks, list(range(self._start_peb, self._end_peb + 1))) def _get_peb_range(self): return [self._start_peb, self._end_peb] diff --git a/NeoBoot/ubi_reader_arm/ubi/volume/__init__.py b/NeoBoot/ubi_reader_arm/ubi/volume/__init__.py index b9d96e8..f046055 100644 --- a/NeoBoot/ubi_reader_arm/ubi/volume/__init__.py +++ b/NeoBoot/ubi_reader_arm/ubi/volume/__init__.py @@ -63,6 +63,7 @@ def get_volumes(blocks, layout_info): vol_name = vol_rec.name.strip('\x00') if vol_rec.rec_index not in vol_blocks_lists: vol_blocks_lists[vol_rec.rec_index] = [] - volumes[vol_name] = description(vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index]) + volumes[vol_name] = description( + vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index]) return volumes diff --git a/NeoBoot/ubi_reader_arm/ubi_extract_files.py b/NeoBoot/ubi_reader_arm/ubi_extract_files.py index 7d0fb6c..8788602 100644 --- a/NeoBoot/ubi_reader_arm/ubi_extract_files.py +++ b/NeoBoot/ubi_reader_arm/ubi_extract_files.py @@ -2,7 +2,7 @@ import os import sys -#import argparse_neo +# import argparse_neo try: import argparse except: @@ -12,19 +12,26 @@ from ubifs import ubifs from ubi_io import ubi_file, leb_virtual_file from ui.common import extract_files, output_dir if __name__ == '__main__': - os.system('echo "\n[NeoBoot] Zip file unzipped.\nInstallation in progress, please wait ..."') + os.system( + 'echo "\n[NeoBoot] Zip file unzipped.\nInstallation in progress, please wait ..."') description = 'Extract contents of UBI image.' usage = 'ubi_extract_files.py [options] filepath' # parser = argparse_neo.ArgumentParser(usage=usage, description=description) try: parser = argparse.ArgumentParser(usage=usage, description=description) except: - parser = argparse_neo.ArgumentParser(usage=usage, description=description) - parser.add_argument('-l', '--log-file', dest='logpath', help='Log output to file output/LOGPATH. (default: ubifs_output.log)') - parser.add_argument('-k', '--keep-permissions', action='store_true', dest='permissions', help='Maintain file permissions, requires running as root. (default: False)') - parser.add_argument('-q', '--quiet', action='store_true', dest='quiet', help='Suppress warnings and non-fatal errors. (default: False)') - parser.add_argument('-p', '--peb-size', type=int, dest='block_size', help='Specify PEB size.') - parser.add_argument('-o', '--output-dir', dest='output_path', help='Specify output directory path.') + parser = argparse_neo.ArgumentParser( + usage=usage, description=description) + parser.add_argument('-l', '--log-file', dest='logpath', + help='Log output to file output/LOGPATH. (default: ubifs_output.log)') + parser.add_argument('-k', '--keep-permissions', action='store_true', dest='permissions', + help='Maintain file permissions, requires running as root. (default: False)') + parser.add_argument('-q', '--quiet', action='store_true', dest='quiet', + help='Suppress warnings and non-fatal errors. (default: False)') + parser.add_argument('-p', '--peb-size', type=int, + dest='block_size', help='Specify PEB size.') + parser.add_argument('-o', '--output-dir', dest='output_path', + help='Specify output directory path.') parser.add_argument('filepath', help='File to extract contents of.') if len(sys.argv) == 1: parser.print_help() @@ -61,13 +68,14 @@ if __name__ == '__main__': if not os.path.exists(vol_out_path): os.makedirs(vol_out_path) elif os.listdir(vol_out_path): - parser.error('Volume output directory is not empty. %s' % vol_out_path) + parser.error( + 'Volume output directory is not empty. %s' % vol_out_path) ufsfile = leb_virtual_file(uubi, image.volumes[volume]) uubifs = ubifs(ufsfile) uubifs.log.log_file = log_file uubifs.log.log_to_file = log_to_file uubifs.log.quiet = quiet - print "Wait almost over ...\nLoading the image to: %s" % vol_out_path + print("Wait almost over ...\nLoading the image to: %s" % vol_out_path) extract_files(uubifs, vol_out_path, perms) sys.exit(0) diff --git a/NeoBoot/ubi_reader_arm/ubi_io/__init__.py b/NeoBoot/ubi_reader_arm/ubi_io/__init__.py index a7aec6b..936872a 100644 --- a/NeoBoot/ubi_reader_arm/ubi_io/__init__.py +++ b/NeoBoot/ubi_reader_arm/ubi_io/__init__.py @@ -68,7 +68,8 @@ class ubi_file(object): def read_block_data(self, block): self.seek(block.file_offset + block.ec_hdr.data_offset) - buf = self._fhandle.read(block.size - block.ec_hdr.data_offset - block.vid_hdr.data_pad) + buf = self._fhandle.read( + block.size - block.ec_hdr.data_offset - block.vid_hdr.data_pad) return buf @@ -91,7 +92,8 @@ class leb_virtual_file: self.seek(self.tell() + i) return self._last_buf[offset:offset + i] else: - buf = self._ubi.file.read_block_data(self._ubi.blocks[self._blocks[leb]]) + buf = self._ubi.file.read_block_data( + self._ubi.blocks[self._blocks[leb]]) self._last_buf = buf self._last_leb = leb self.seek(self.tell() + i) diff --git a/NeoBoot/ubi_reader_arm/ubifs/defines.py b/NeoBoot/ubi_reader_arm/ubifs/defines.py index a0b3aa9..550fe49 100644 --- a/NeoBoot/ubi_reader_arm/ubifs/defines.py +++ b/NeoBoot/ubi_reader_arm/ubifs/defines.py @@ -1,7 +1,7 @@ #!/usr/bin/python import struct UBIFS_NODE_MAGIC = '1\x18\x10\x06' -UBIFS_CRC32_INIT = 4294967295L +UBIFS_CRC32_INIT = 4294967295 UBIFS_MIN_COMPR_LEN = 128 UBIFS_MIN_COMPRESS_DIFF = 64 UBIFS_ROOT_INO = 1 @@ -88,12 +88,12 @@ UBIFS_FLG_BIGLPT = 2 UBIFS_FLG_SPACE_FIXUP = 4 UBIFS_COMMON_HDR_FORMAT = '> UBIFS_S_KEY_BLOCK_BITS khash = lkey return {'type': key_type, - 'ino_num': ino_num, - 'khash': khash} + 'ino_num': ino_num, + 'khash': khash} def decompress(ctype, unc_len, data): - #if ctype == UBIFS_COMPR_LZO: - #return lzo.decompress(''.join(('\xf0', struct.pack('>I', unc_len), data))) + # if ctype == UBIFS_COMPR_LZO: + # return lzo.decompress(''.join(('\xf0', struct.pack('>I', unc_len), data))) if ctype == UBIFS_COMPR_ZLIB: return zlib.decompress(data, -11) else: diff --git a/NeoBoot/ubi_reader_arm/ubifs/nodes/__init__.py b/NeoBoot/ubi_reader_arm/ubifs/nodes/__init__.py index 244538b..a287505 100644 --- a/NeoBoot/ubi_reader_arm/ubifs/nodes/__init__.py +++ b/NeoBoot/ubi_reader_arm/ubifs/nodes/__init__.py @@ -7,7 +7,8 @@ from ubifs.misc import parse_key class common_hdr(object): def __init__(self, buf): - fields = dict(zip(UBIFS_COMMON_HDR_FIELDS, struct.unpack(UBIFS_COMMON_HDR_FORMAT, buf))) + fields = dict(list(zip(UBIFS_COMMON_HDR_FIELDS, + struct.unpack(UBIFS_COMMON_HDR_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -25,7 +26,8 @@ class common_hdr(object): class sb_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_SB_NODE_FIELDS, struct.unpack(UBIFS_SB_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_SB_NODE_FIELDS, struct.unpack(UBIFS_SB_NODE_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -41,7 +43,8 @@ class sb_node(object): class mst_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_MST_NODE_FIELDS, struct.unpack(UBIFS_MST_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_MST_NODE_FIELDS, struct.unpack(UBIFS_MST_NODE_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -57,7 +60,8 @@ class mst_node(object): class dent_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_DENT_NODE_FIELDS, struct.unpack(UBIFS_DENT_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_DENT_NODE_FIELDS, struct.unpack(UBIFS_DENT_NODE_FORMAT, buf)))) for key in fields: if key == 'key': setattr(self, key, parse_key(fields[key])) @@ -78,7 +82,8 @@ class dent_node(object): class data_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_DATA_NODE_FIELDS, struct.unpack(UBIFS_DATA_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_DATA_NODE_FIELDS, struct.unpack(UBIFS_DATA_NODE_FORMAT, buf)))) for key in fields: if key == 'key': setattr(self, key, parse_key(fields[key])) @@ -100,7 +105,8 @@ class data_node(object): class idx_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_IDX_NODE_FIELDS, struct.unpack(UBIFS_IDX_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_IDX_NODE_FIELDS, struct.unpack(UBIFS_IDX_NODE_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -118,7 +124,8 @@ class idx_node(object): class ino_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_INO_NODE_FIELDS, struct.unpack(UBIFS_INO_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_INO_NODE_FIELDS, struct.unpack(UBIFS_INO_NODE_FORMAT, buf)))) for key in fields: if key == 'key': setattr(self, key, parse_key(fields[key])) @@ -139,7 +146,8 @@ class ino_node(object): class branch(object): def __init__(self, buf): - fields = dict(zip(UBIFS_BRANCH_FIELDS, struct.unpack(UBIFS_BRANCH_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_BRANCH_FIELDS, struct.unpack(UBIFS_BRANCH_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) diff --git a/NeoBoot/ubi_reader_arm/ubifs/output.py b/NeoBoot/ubi_reader_arm/ubifs/output.py index 225e327..96d716a 100644 --- a/NeoBoot/ubi_reader_arm/ubifs/output.py +++ b/NeoBoot/ubi_reader_arm/ubifs/output.py @@ -42,7 +42,8 @@ def dents(ubifs, inodes, dent_node, path='', perms=False): try: os.symlink('%s' % inode['ino'].data, dent_path) except Exception as e: - ubifs.log.write('SYMLINK Fail: %s : %s' % (inode['ino'].data, dent_path)) + ubifs.log.write('SYMLINK Fail: %s : %s' % + (inode['ino'].data, dent_path)) elif dent_node.type in [UBIFS_ITYPE_BLK, UBIFS_ITYPE_CHR]: try: diff --git a/NeoBoot/ubi_reader_arm/ubifs/walk.py b/NeoBoot/ubi_reader_arm/ubifs/walk.py index 4c65114..b9df5a4 100644 --- a/NeoBoot/ubi_reader_arm/ubifs/walk.py +++ b/NeoBoot/ubi_reader_arm/ubifs/walk.py @@ -17,7 +17,8 @@ def index(ubifs, lnum, offset, inodes={}): inodes[ino_num] = {} inodes[ino_num]['ino'] = inon elif chdr.node_type == UBIFS_DATA_NODE: - datn = extract.data_node(ubifs, lnum, offset + UBIFS_COMMON_HDR_SZ, chdr.len) + datn = extract.data_node( + ubifs, lnum, offset + UBIFS_COMMON_HDR_SZ, chdr.len) ino_num = datn.key['ino_num'] if ino_num not in inodes: inodes[ino_num] = {} diff --git a/NeoBoot/ubi_reader_arm/ui/common.py b/NeoBoot/ubi_reader_arm/ui/common.py index 0983692..5d40084 100644 --- a/NeoBoot/ubi_reader_arm/ui/common.py +++ b/NeoBoot/ubi_reader_arm/ui/common.py @@ -4,13 +4,15 @@ from ubi_io import leb_virtual_file from ubifs import ubifs, walk, output from ubifs.defines import PRINT_UBIFS_KEY_HASH, PRINT_UBIFS_COMPR from ubi.defines import PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG -output_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'output') +output_dir = os.path.join(os.path.dirname( + os.path.dirname(os.path.realpath(__file__))), 'output') def extract_files(ubifs, out_path, perms=False): try: inodes = {} - walk.index(ubifs, ubifs.master_node.root_lnum, ubifs.master_node.root_offs, inodes) + walk.index(ubifs, ubifs.master_node.root_lnum, + ubifs.master_node.root_offs, inodes) for dent in inodes[1]['dent']: output.dents(ubifs, inodes, dent, out_path, perms) @@ -22,23 +24,23 @@ def extract_files(ubifs, out_path, perms=False): def get_ubi_params(ubi): ubi_flags = {'min_io_size': '-m', - 'max_bud_bytes': '-j', - 'leb_size': '-e', - 'default_compr': '-x', - 'sub_page_size': '-s', - 'fanout': '-f', - 'key_hash': '-k', - 'orph_lebs': '-p', - 'log_lebs': '-l', - 'max_leb_cnt': '-c', - 'peb_size': '-p', - 'sub_page_size': '-s', - 'vid_hdr_offset': '-O', - 'version': '-x', - 'image_seq': '-Q', - 'alignment': '-a', - 'vol_id': '-n', - 'name': '-N'} + 'max_bud_bytes': '-j', + 'leb_size': '-e', + 'default_compr': '-x', + 'sub_page_size': '-s', + 'fanout': '-f', + 'key_hash': '-k', + 'orph_lebs': '-p', + 'log_lebs': '-l', + 'max_leb_cnt': '-c', + 'peb_size': '-p', + 'sub_page_size': '-s', + 'vid_hdr_offset': '-O', + 'version': '-x', + 'image_seq': '-Q', + 'alignment': '-a', + 'vol_id': '-n', + 'name': '-N'} ubi_params = {} ubi_args = {} ini_params = {} @@ -56,7 +58,8 @@ def get_ubi_params(ubi): else: ini_params[img_seq][volume]['vol_flags'] = image.volumes[volume].vol_rec.flags ini_params[img_seq][volume]['vol_id'] = image.volumes[volume].vol_id - ini_params[img_seq][volume]['vol_name'] = image.volumes[volume].name.rstrip('\x00') + ini_params[img_seq][volume]['vol_name'] = image.volumes[volume].name.rstrip( + '\x00') ini_params[img_seq][volume]['vol_alignment'] = image.volumes[volume].vol_rec.alignment ini_params[img_seq][volume]['vol_size'] = image.volumes[volume].vol_rec.reserved_pebs * ubi.leb_size ufsfile = leb_virtual_file(ubi, image.volumes[volume]) @@ -83,7 +86,7 @@ def get_ubi_params(ubi): ubi_args[img_seq][volume]['peb_size'] = ubi.peb_size ubi_args[img_seq][volume]['vol_id'] = image.volumes[volume].vol_id ubi_params[img_seq][volume] = {'flags': ubi_flags, - 'args': ubi_args[img_seq][volume], - 'ini': ini_params[img_seq][volume]} + 'args': ubi_args[img_seq][volume], + 'ini': ini_params[img_seq][volume]} return ubi_params diff --git a/NeoBoot/ubi_reader_mips/argparse_neo.py b/NeoBoot/ubi_reader_mips/argparse_neo.py index 696480d..74824dc 100644 --- a/NeoBoot/ubi_reader_mips/argparse_neo.py +++ b/NeoBoot/ubi_reader_mips/argparse_neo.py @@ -1,21 +1,21 @@ __version__ = '1.1' __all__ = ['ArgumentParser', - 'ArgumentError', - 'ArgumentTypeError', - 'FileType', - 'HelpFormatter', - 'ArgumentDefaultsHelpFormatter', - 'RawDescriptionHelpFormatter', - 'RawTextHelpFormatter', - 'Namespace', - 'Action', - 'ONE_OR_MORE', - 'OPTIONAL', - 'PARSER', - 'REMAINDER', - 'SUPPRESS', - 'ZERO_OR_MORE'] + 'ArgumentError', + 'ArgumentTypeError', + 'FileType', + 'HelpFormatter', + 'ArgumentDefaultsHelpFormatter', + 'RawDescriptionHelpFormatter', + 'RawTextHelpFormatter', + 'Namespace', + 'Action', + 'ONE_OR_MORE', + 'OPTIONAL', + 'PARSER', + 'REMAINDER', + 'SUPPRESS', + 'ZERO_OR_MORE'] import collections as _collections import copy as _copy import os as _os @@ -122,9 +122,9 @@ class HelpFormatter(object): else: heading = '' return join(['\n', - heading, - item_help, - '\n']) + heading, + item_help, + '\n']) return def _add_item(self, func, args): @@ -148,9 +148,9 @@ class HelpFormatter(object): def add_usage(self, usage, actions, groups, prefix=None): if usage is not SUPPRESS: args = (usage, - actions, - groups, - prefix) + actions, + groups, + prefix) self._add_item(self._format_usage, args) def add_argument(self, action): @@ -162,7 +162,8 @@ class HelpFormatter(object): invocation_length = max([len(s) for s in invocations]) action_length = invocation_length + self._current_indent - self._action_max_length = max(self._action_max_length, action_length) + self._action_max_length = max( + self._action_max_length, action_length) self._add_item(self._format_action, [action]) def add_arguments(self, actions): @@ -325,7 +326,8 @@ class HelpFormatter(object): return self._fill_text(text, text_width, indent) + '\n\n' def _format_action(self, action): - help_position = min(self._action_max_length + 2, self._max_help_position) + help_position = min(self._action_max_length + + 2, self._max_help_position) help_width = self._width - help_position action_width = help_position - self._current_indent - 2 action_header = self._format_action_invocation(action) @@ -334,9 +336,9 @@ class HelpFormatter(object): action_header = '%*s%s\n' % tup elif len(action_header) <= action_width: tup = (self._current_indent, - '', - action_width, - action_header) + '', + action_width, + action_header) action_header = '%*s%-*s ' % tup indent_first = 0 else: @@ -521,14 +523,14 @@ class Action(_AttributeHolder): def _get_kwargs(self): names = ['option_strings', - 'dest', - 'nargs', - 'const', - 'default', - 'type', - 'choices', - 'help', - 'metavar'] + 'dest', + 'nargs', + 'const', + 'default', + 'type', + 'choices', + 'help', + 'metavar'] return [(name, getattr(self, name)) for name in names] def __call__(self, parser, namespace, values, option_string=None): @@ -539,10 +541,12 @@ class _StoreAction(Action): def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None): if nargs == 0: - raise ValueError('nargs for store actions must be > 0; if you have nothing to store, actions such as store true or store const may be more appropriate') + raise ValueError( + 'nargs for store actions must be > 0; if you have nothing to store, actions such as store true or store const may be more appropriate') if const is not None and nargs != OPTIONAL: raise ValueError('nargs must be %r to supply const' % OPTIONAL) - super(_StoreAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, default=default, type=type, choices=choices, required=required, help=help, metavar=metavar) + super(_StoreAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, + default=default, type=type, choices=choices, required=required, help=help, metavar=metavar) return def __call__(self, parser, namespace, values, option_string=None): @@ -552,7 +556,8 @@ class _StoreAction(Action): class _StoreConstAction(Action): def __init__(self, option_strings, dest, const, default=None, required=False, help=None, metavar=None): - super(_StoreConstAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, const=const, default=default, required=required, help=help) + super(_StoreConstAction, self).__init__(option_strings=option_strings, + dest=dest, nargs=0, const=const, default=default, required=required, help=help) def __call__(self, parser, namespace, values, option_string=None): setattr(namespace, self.dest, self.const) @@ -561,23 +566,27 @@ class _StoreConstAction(Action): class _StoreTrueAction(_StoreConstAction): def __init__(self, option_strings, dest, default=False, required=False, help=None): - super(_StoreTrueAction, self).__init__(option_strings=option_strings, dest=dest, const=True, default=default, required=required, help=help) + super(_StoreTrueAction, self).__init__(option_strings=option_strings, + dest=dest, const=True, default=default, required=required, help=help) class _StoreFalseAction(_StoreConstAction): def __init__(self, option_strings, dest, default=True, required=False, help=None): - super(_StoreFalseAction, self).__init__(option_strings=option_strings, dest=dest, const=False, default=default, required=required, help=help) + super(_StoreFalseAction, self).__init__(option_strings=option_strings, + dest=dest, const=False, default=default, required=required, help=help) class _AppendAction(Action): def __init__(self, option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None): if nargs == 0: - raise ValueError('nargs for append actions must be > 0; if arg strings are not supplying the value to append, the append const action may be more appropriate') + raise ValueError( + 'nargs for append actions must be > 0; if arg strings are not supplying the value to append, the append const action may be more appropriate') if const is not None and nargs != OPTIONAL: raise ValueError('nargs must be %r to supply const' % OPTIONAL) - super(_AppendAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, default=default, type=type, choices=choices, required=required, help=help, metavar=metavar) + super(_AppendAction, self).__init__(option_strings=option_strings, dest=dest, nargs=nargs, const=const, + default=default, type=type, choices=choices, required=required, help=help, metavar=metavar) return def __call__(self, parser, namespace, values, option_string=None): @@ -589,7 +598,8 @@ class _AppendAction(Action): class _AppendConstAction(Action): def __init__(self, option_strings, dest, const, default=None, required=False, help=None, metavar=None): - super(_AppendConstAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, const=const, default=default, required=required, help=help, metavar=metavar) + super(_AppendConstAction, self).__init__(option_strings=option_strings, dest=dest, + nargs=0, const=const, default=default, required=required, help=help, metavar=metavar) def __call__(self, parser, namespace, values, option_string=None): items = _copy.copy(_ensure_value(namespace, self.dest, [])) @@ -600,7 +610,8 @@ class _AppendConstAction(Action): class _CountAction(Action): def __init__(self, option_strings, dest, default=None, required=False, help=None): - super(_CountAction, self).__init__(option_strings=option_strings, dest=dest, nargs=0, default=default, required=required, help=help) + super(_CountAction, self).__init__(option_strings=option_strings, + dest=dest, nargs=0, default=default, required=required, help=help) def __call__(self, parser, namespace, values, option_string=None): new_count = _ensure_value(namespace, self.dest, 0) + 1 @@ -610,7 +621,8 @@ class _CountAction(Action): class _HelpAction(Action): def __init__(self, option_strings, dest=SUPPRESS, default=SUPPRESS, help=None): - super(_HelpAction, self).__init__(option_strings=option_strings, dest=dest, default=default, nargs=0, help=help) + super(_HelpAction, self).__init__(option_strings=option_strings, + dest=dest, default=default, nargs=0, help=help) def __call__(self, parser, namespace, values, option_string=None): parser.print_help() @@ -620,7 +632,8 @@ class _HelpAction(Action): class _VersionAction(Action): def __init__(self, option_strings, version=None, dest=SUPPRESS, default=SUPPRESS, help="show program's version number and exit"): - super(_VersionAction, self).__init__(option_strings=option_strings, dest=dest, default=default, nargs=0, help=help) + super(_VersionAction, self).__init__(option_strings=option_strings, + dest=dest, default=default, nargs=0, help=help) self.version = version def __call__(self, parser, namespace, values, option_string=None): @@ -646,7 +659,8 @@ class _SubParsersAction(Action): self._parser_class = parser_class self._name_parser_map = _collections.OrderedDict() self._choices_actions = [] - super(_SubParsersAction, self).__init__(option_strings=option_strings, dest=dest, nargs=PARSER, choices=self._name_parser_map, help=help, metavar=metavar) + super(_SubParsersAction, self).__init__(option_strings=option_strings, dest=dest, + nargs=PARSER, choices=self._name_parser_map, help=help, metavar=metavar) def add_parser(self, name, **kwargs): if kwargs.get('prog') is None: @@ -674,7 +688,8 @@ class _SubParsersAction(Action): msg = _('unknown parser %r (choices: %s)') % tup raise ArgumentError(self, msg) - namespace, arg_strings = parser.parse_known_args(arg_strings, namespace) + namespace, arg_strings = parser.parse_known_args( + arg_strings, namespace) if arg_strings: vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, []) getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings) @@ -799,7 +814,8 @@ class _ActionsContainer(object): try: self._get_formatter()._format_args(action, None) except TypeError: - raise ValueError('length of metavar tuple does not match nargs') + raise ValueError( + 'length of metavar tuple does not match nargs') return self._add_action(action) @@ -841,12 +857,14 @@ class _ActionsContainer(object): group_map = {} for group in container._action_groups: if group.title not in title_group_map: - title_group_map[group.title] = self.add_argument_group(title=group.title, description=group.description, conflict_handler=group.conflict_handler) + title_group_map[group.title] = self.add_argument_group( + title=group.title, description=group.description, conflict_handler=group.conflict_handler) for action in group._group_actions: group_map[action] = title_group_map[group.title] for group in container._mutually_exclusive_groups: - mutex_group = self.add_mutually_exclusive_group(required=group.required) + mutex_group = self.add_mutually_exclusive_group( + required=group.required) for action in group._group_actions: group_map[action] = mutex_group @@ -915,7 +933,8 @@ class _ActionsContainer(object): def _handle_conflict_error(self, action, conflicting_actions): message = _('conflicting option string(s): %s') - conflict_string = ', '.join([option_string for option_string, action in conflicting_actions]) + conflict_string = ', '.join( + [option_string for option_string, action in conflicting_actions]) raise ArgumentError(action, message % conflict_string) def _handle_conflict_resolve(self, action, conflicting_actions): @@ -981,9 +1000,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def __init__(self, prog=None, usage=None, description=None, epilog=None, version=None, parents=[], formatter_class=HelpFormatter, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True): if version is not None: import warnings - warnings.warn('The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action=\'version\', version="N", ...)" instead', DeprecationWarning) + warnings.warn( + 'The "version" argument to ArgumentParser is deprecated. Please use "add_argument(..., action=\'version\', version="N", ...)" instead', DeprecationWarning) superinit = super(ArgumentParser, self).__init__ - superinit(description=description, prefix_chars=prefix_chars, argument_default=argument_default, conflict_handler=conflict_handler) + superinit(description=description, prefix_chars=prefix_chars, + argument_default=argument_default, conflict_handler=conflict_handler) if prog is None: prog = _os.path.basename(_sys.argv[0]) self.prog = prog @@ -1004,9 +1025,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): self.register('type', None, identity) default_prefix = '-' if '-' in prefix_chars else prefix_chars[0] if self.add_help: - self.add_argument(default_prefix + 'h', default_prefix * 2 + 'help', action='help', default=SUPPRESS, help=_('show this help message and exit')) + self.add_argument(default_prefix + 'h', default_prefix * 2 + 'help', + action='help', default=SUPPRESS, help=_('show this help message and exit')) if self.version: - self.add_argument(default_prefix + 'v', default_prefix * 2 + 'version', action='version', default=SUPPRESS, version=self.version, help=_("show program's version number and exit")) + self.add_argument(default_prefix + 'v', default_prefix * 2 + 'version', action='version', + default=SUPPRESS, version=self.version, help=_("show program's version number and exit")) for parent in parents: self._add_container_actions(parent) try: @@ -1020,12 +1043,12 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def _get_kwargs(self): names = ['prog', - 'usage', - 'description', - 'version', - 'formatter_class', - 'conflict_handler', - 'add_help'] + 'usage', + 'description', + 'version', + 'formatter_class', + 'conflict_handler', + 'add_help'] return [(name, getattr(self, name)) for name in names] def add_subparsers(self, **kwargs): @@ -1079,7 +1102,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): if not hasattr(namespace, action.dest): if action.default is not SUPPRESS: default = action.default - if isinstance(action.default, basestring): + if isinstance(action.default, str): default = self._get_value(action, default) setattr(namespace, action.dest, default) @@ -1213,7 +1236,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): else: max_option_string_index = -1 while start_index <= max_option_string_index: - next_option_string_index = min([index for index in option_string_indices if index >= start_index]) + next_option_string_index = min( + [index for index in option_string_indices if index >= start_index]) if start_index != next_option_string_index: positionals_end_index = consume_positionals(start_index) if positionals_end_index > start_index: @@ -1243,7 +1267,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): if action in seen_non_default_actions: break else: - names = [_get_action_name(action) for action in group._group_actions if action.help is not SUPPRESS] + names = [_get_action_name( + action) for action in group._group_actions if action.help is not SUPPRESS] msg = _('one of the arguments %s is required') self.error(msg % ' '.join(names)) @@ -1282,8 +1307,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): match = _re.match(nargs_pattern, arg_strings_pattern) if match is None: nargs_errors = {None: _('expected one argument'), - OPTIONAL: _('expected at most one argument'), - ONE_OR_MORE: _('expected at least one argument')} + OPTIONAL: _('expected at most one argument'), + ONE_OR_MORE: _('expected at least one argument')} default = _('expected %s argument(s)') % action.nargs msg = nargs_errors.get(action.nargs, default) raise ArgumentError(action, msg) @@ -1293,7 +1318,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): result = [] for i in range(len(actions), 0, -1): actions_slice = actions[:i] - pattern = ''.join([self._get_nargs_pattern(action) for action in actions_slice]) + pattern = ''.join([self._get_nargs_pattern(action) + for action in actions_slice]) match = _re.match(pattern, arg_strings_pattern) if match is not None: result.extend([len(string) for string in match.groups()]) @@ -1319,7 +1345,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): return (action, option_string, explicit_arg) option_tuples = self._get_option_tuples(arg_string) if len(option_tuples) > 1: - options = ', '.join([option_string for action, option_string, explicit_arg in option_tuples]) + options = ', '.join( + [option_string for action, option_string, explicit_arg in option_tuples]) tup = (arg_string, options) self.error(_('ambiguous option: %s could match %s') % tup) elif len(option_tuples) == 1: @@ -1396,7 +1423,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): value = action.const else: value = action.default - if isinstance(value, basestring): + if isinstance(value, str): value = self._get_value(action, value) self._check_value(action, value) elif not arg_strings and action.nargs == ZERO_OR_MORE and not action.option_strings: @@ -1448,12 +1475,14 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def format_usage(self): formatter = self._get_formatter() - formatter.add_usage(self.usage, self._actions, self._mutually_exclusive_groups) + formatter.add_usage(self.usage, self._actions, + self._mutually_exclusive_groups) return formatter.format_help() def format_help(self): formatter = self._get_formatter() - formatter.add_usage(self.usage, self._actions, self._mutually_exclusive_groups) + formatter.add_usage(self.usage, self._actions, + self._mutually_exclusive_groups) formatter.add_text(self.description) for action_group in self._action_groups: formatter.start_section(action_group.title) @@ -1466,7 +1495,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def format_version(self): import warnings - warnings.warn('The format_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning) + warnings.warn( + 'The format_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning) formatter = self._get_formatter() formatter.add_text(self.version) return formatter.format_help() @@ -1488,7 +1518,8 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer): def print_version(self, file=None): import warnings - warnings.warn('The print_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning) + warnings.warn( + 'The print_version method is deprecated -- the "version" argument to ArgumentParser is no longer supported.', DeprecationWarning) self._print_message(self.format_version(), file) def _print_message(self, message, file=None): diff --git a/NeoBoot/ubi_reader_mips/ubi/__init__.py b/NeoBoot/ubi_reader_mips/ubi/__init__.py index 2ad94bb..d96b797 100644 --- a/NeoBoot/ubi_reader_mips/ubi/__init__.py +++ b/NeoBoot/ubi_reader_mips/ubi/__init__.py @@ -17,16 +17,18 @@ class ubi: self._block_count = len(self.blocks) if self._block_count <= 0: raise Exception('No blocks found.') - layout_list, data_list, int_vol_list, unknown_list = sort.by_type(self.blocks) + layout_list, data_list, int_vol_list, unknown_list = sort.by_type( + self.blocks) self._layout_blocks_list = layout_list self._data_blocks_list = data_list self._int_vol_blocks_list = int_vol_list self._unknown_blocks_list = unknown_list - arbitrary_block = self.blocks.itervalues().next() + arbitrary_block = next(iter(self.blocks.values())) self._min_io_size = arbitrary_block.ec_hdr.vid_hdr_offset self._leb_size = self.file.block_size - arbitrary_block.ec_hdr.data_offset layout_pairs = layout.group_pairs(self.blocks, self.layout_blocks_list) - layout_infos = layout.associate_blocks(self.blocks, layout_pairs, self.first_peb_num) + layout_infos = layout.associate_blocks( + self.blocks, layout_pairs, self.first_peb_num) self._images = [] for i in range(0, len(layout_infos)): self._images.append(image(self.blocks, layout_infos[i])) diff --git a/NeoBoot/ubi_reader_mips/ubi/block/__init__.py b/NeoBoot/ubi_reader_mips/ubi/block/__init__.py index e6575eb..7593f97 100644 --- a/NeoBoot/ubi_reader_mips/ubi/block/__init__.py +++ b/NeoBoot/ubi_reader_mips/ubi/block/__init__.py @@ -17,10 +17,12 @@ class description(object): self.vtbl_recs = [] self.ec_hdr = extract_ec_hdr(block_buf[0:UBI_EC_HDR_SZ]) if not self.ec_hdr.errors: - self.vid_hdr = extract_vid_hdr(block_buf[self.ec_hdr.vid_hdr_offset:self.ec_hdr.vid_hdr_offset + UBI_VID_HDR_SZ]) + self.vid_hdr = extract_vid_hdr( + block_buf[self.ec_hdr.vid_hdr_offset:self.ec_hdr.vid_hdr_offset + UBI_VID_HDR_SZ]) self.is_internal_vol = self.vid_hdr.vol_id >= UBI_INTERNAL_VOL_START if self.vid_hdr.vol_id >= UBI_INTERNAL_VOL_START: - self.vtbl_recs = extract_vtbl_rec(block_buf[self.ec_hdr.data_offset:]) + self.vtbl_recs = extract_vtbl_rec( + block_buf[self.ec_hdr.data_offset:]) self.leb_num = self.vid_hdr.lnum self.is_vtbl = bool(self.vtbl_recs) or False self.is_valid = not self.ec_hdr.errors and not self.vid_hdr.errors diff --git a/NeoBoot/ubi_reader_mips/ubi/block/layout.py b/NeoBoot/ubi_reader_mips/ubi/block/layout.py index 065c669..b61772d 100644 --- a/NeoBoot/ubi_reader_mips/ubi/block/layout.py +++ b/NeoBoot/ubi_reader_mips/ubi/block/layout.py @@ -18,7 +18,8 @@ def group_pairs(blocks, layout_blocks_list): def associate_blocks(blocks, layout_pairs, start_peb_num): seq_blocks = [] for layout_pair in layout_pairs: - seq_blocks = sort.by_image_seq(blocks, blocks[layout_pair[0]].ec_hdr.image_seq) + seq_blocks = sort.by_image_seq( + blocks, blocks[layout_pair[0]].ec_hdr.image_seq) layout_pair.append(seq_blocks) return layout_pairs diff --git a/NeoBoot/ubi_reader_mips/ubi/block/sort.py b/NeoBoot/ubi_reader_mips/ubi/block/sort.py index 3f01628..6d495fd 100644 --- a/NeoBoot/ubi_reader_mips/ubi/block/sort.py +++ b/NeoBoot/ubi_reader_mips/ubi/block/sort.py @@ -18,7 +18,7 @@ def by_image_seq(blocks, image_seq): def by_range(blocks, block_range): - peb_range = range(block_range[0], block_range[1]) + peb_range = list(range(block_range[0], block_range[1])) return [i for i in blocks if i in peb_range] @@ -33,7 +33,7 @@ def by_leb(blocks): slist[blocks[block].leb_num] = block return slist - return sorted(blocks.iterkeys(), key=lambda x: blocks[x].leb_num) + return sorted(iter(blocks.keys()), key=lambda x: blocks[x].leb_num) def by_vol_id(blocks, slist=None): @@ -79,6 +79,6 @@ def by_type(blocks, slist=None): unknown.append(i) return (layout, - data, - int_vol, - unknown) + data, + int_vol, + unknown) diff --git a/NeoBoot/ubi_reader_mips/ubi/defines.py b/NeoBoot/ubi_reader_mips/ubi/defines.py index 668b197..95d5ff7 100644 --- a/NeoBoot/ubi_reader_mips/ubi/defines.py +++ b/NeoBoot/ubi_reader_mips/ubi/defines.py @@ -1,50 +1,50 @@ #!/usr/bin/python import struct -UBI_CRC32_INIT = 4294967295L +UBI_CRC32_INIT = 4294967295 UBI_MAX_VOLUMES = 128 UBI_INTERNAL_VOL_START = 2147479551 UBI_EC_HDR_MAGIC = 'UBI#' EC_HDR_FORMAT = '>4sB3sQIII32sI' EC_HDR_FIELDS = ['magic', - 'version', - 'padding', - 'ec', - 'vid_hdr_offset', - 'data_offset', - 'image_seq', - 'padding2', - 'hdr_crc'] + 'version', + 'padding', + 'ec', + 'vid_hdr_offset', + 'data_offset', + 'image_seq', + 'padding2', + 'hdr_crc'] UBI_EC_HDR_SZ = struct.calcsize(EC_HDR_FORMAT) UBI_VID_HDR_MAGIC = 'UBI!' VID_HDR_FORMAT = '>4sBBBBII4sIIII4sQ12sI' VID_HDR_FIELDS = ['magic', - 'version', - 'vol_type', - 'copy_flag', - 'compat', - 'vol_id', - 'lnum', - 'padding', - 'data_size', - 'used_ebs', - 'data_pad', - 'data_crc', - 'padding2', - 'sqnum', - 'padding3', - 'hdr_crc'] + 'version', + 'vol_type', + 'copy_flag', + 'compat', + 'vol_id', + 'lnum', + 'padding', + 'data_size', + 'used_ebs', + 'data_pad', + 'data_crc', + 'padding2', + 'sqnum', + 'padding3', + 'hdr_crc'] UBI_VID_HDR_SZ = struct.calcsize(VID_HDR_FORMAT) VTBL_REC_FORMAT = '>IIIBBH128sB23sI' VTBL_REC_FIELDS = ['reserved_pebs', - 'alignment', - 'data_pad', - 'vol_type', - 'upd_marker', - 'name_len', - 'name', - 'flags', - 'padding', - 'crc'] + 'alignment', + 'data_pad', + 'vol_type', + 'upd_marker', + 'name_len', + 'name', + 'flags', + 'padding', + 'crc'] UBI_VTBL_REC_SZ = struct.calcsize(VTBL_REC_FORMAT) UBI_VID_DYNAMIC = 1 UBI_VID_STATIC = 2 @@ -55,9 +55,9 @@ UBI_COMPAT_RO = 2 UBI_COMPAT_PRESERVE = 4 UBI_COMPAT_REJECT = 5 PRINT_COMPAT_LIST = [0, - 'Delete', - 'Read Only', - 0, - 'Preserve', - 'Reject'] -FILE_CHUNK_SZ = 5242880 \ No newline at end of file + 'Delete', + 'Read Only', + 0, + 'Preserve', + 'Reject'] +FILE_CHUNK_SZ = 5242880 diff --git a/NeoBoot/ubi_reader_mips/ubi/display.py b/NeoBoot/ubi_reader_mips/ubi/display.py index 5124951..7c3342b 100644 --- a/NeoBoot/ubi_reader_mips/ubi/display.py +++ b/NeoBoot/ubi_reader_mips/ubi/display.py @@ -3,77 +3,77 @@ from ubi.defines import PRINT_COMPAT_LIST, PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORES def ubi(ubi, tab=''): - print '%sUBI File' % tab - print '%s---------------------' % tab - print '\t%sMin I/O: %s' % (tab, ubi.min_io_size) - print '\t%sLEB Size: %s' % (tab, ubi.leb_size) - print '\t%sPEB Size: %s' % (tab, ubi.peb_size) - print '\t%sTotal Block Count: %s' % (tab, ubi.block_count) - print '\t%sData Block Count: %s' % (tab, len(ubi.data_blocks_list)) - print '\t%sLayout Block Count: %s' % (tab, len(ubi.layout_blocks_list)) - print '\t%sInternal Volume Block Count: %s' % (tab, len(ubi.int_vol_blocks_list)) - print '\t%sUnknown Block Count: %s' % (tab, len(ubi.unknown_blocks_list)) - print '\t%sFirst UBI PEB Number: %s' % (tab, ubi.first_peb_num) + print(('%sUBI File' % tab)) + print(('%s---------------------' % tab)) + print(('\t%sMin I/O: %s' % (tab, ubi.min_io_size))) + print(('\t%sLEB Size: %s' % (tab, ubi.leb_size))) + print(('\t%sPEB Size: %s' % (tab, ubi.peb_size))) + print(('\t%sTotal Block Count: %s' % (tab, ubi.block_count))) + print(('\t%sData Block Count: %s' % (tab, len(ubi.data_blocks_list)))) + print(('\t%sLayout Block Count: %s' % (tab, len(ubi.layout_blocks_list)))) + print(('\t%sInternal Volume Block Count: %s' % (tab, len(ubi.int_vol_blocks_list)))) + print(('\t%sUnknown Block Count: %s' % (tab, len(ubi.unknown_blocks_list)))) + print(('\t%sFirst UBI PEB Number: %s' % (tab, ubi.first_peb_num))) def image(image, tab=''): - print '%s%s' % (tab, image) - print '%s---------------------' % tab - print '\t%sImage Sequence Num: %s' % (tab, image.image_seq) + print(('%s%s' % (tab, image))) + print(('%s---------------------' % tab)) + print(('\t%sImage Sequence Num: %s' % (tab, image.image_seq))) for volume in image.volumes: - print '\t%sVolume Name:%s' % (tab, volume) + print(('\t%sVolume Name:%s' % (tab, volume))) - print '\t%sPEB Range: %s - %s' % (tab, image.peb_range[0], image.peb_range[1]) + print(('\t%sPEB Range: %s - %s' % (tab, image.peb_range[0], image.peb_range[1]))) def volume(volume, tab=''): - print '%s%s' % (tab, volume) - print '%s---------------------' % tab - print '\t%sVol ID: %s' % (tab, volume.vol_id) - print '\t%sName: %s' % (tab, volume.name) - print '\t%sBlock Count: %s' % (tab, volume.block_count) - print '\n' - print '\t%sVolume Record' % tab - print '\t%s---------------------' % tab + print(('%s%s' % (tab, volume))) + print(('%s---------------------' % tab)) + print(('\t%sVol ID: %s' % (tab, volume.vol_id))) + print(('\t%sName: %s' % (tab, volume.name))) + print(('\t%sBlock Count: %s' % (tab, volume.block_count))) + print('\n') + print(('\t%sVolume Record' % tab)) + print(('\t%s---------------------' % tab)) vol_rec(volume.vol_rec, '\t\t%s' % tab) - print '\n' + print('\n') def block(block, tab='\t'): - print '%s%s' % (tab, block) - print '%s---------------------' % tab - print '\t%sFile Offset: %s' % (tab, block.file_offset) - print '\t%sPEB #: %s' % (tab, block.peb_num) - print '\t%sLEB #: %s' % (tab, block.leb_num) - print '\t%sBlock Size: %s' % (tab, block.size) - print '\t%sInternal Volume: %s' % (tab, block.is_internal_vol) - print '\t%sIs Volume Table: %s' % (tab, block.is_vtbl) - print '\t%sIs Valid: %s' % (tab, block.is_valid) + print(('%s%s' % (tab, block))) + print(('%s---------------------' % tab)) + print(('\t%sFile Offset: %s' % (tab, block.file_offset))) + print(('\t%sPEB #: %s' % (tab, block.peb_num))) + print(('\t%sLEB #: %s' % (tab, block.leb_num))) + print(('\t%sBlock Size: %s' % (tab, block.size))) + print(('\t%sInternal Volume: %s' % (tab, block.is_internal_vol))) + print(('\t%sIs Volume Table: %s' % (tab, block.is_vtbl))) + print(('\t%sIs Valid: %s' % (tab, block.is_valid))) if not block.ec_hdr.errors: - print '\n' - print '\t%sErase Count Header' % tab - print '\t%s---------------------' % tab + print('\n') + print(('\t%sErase Count Header' % tab)) + print(('\t%s---------------------' % tab)) ec_hdr(block.ec_hdr, '\t\t%s' % tab) if block.vid_hdr and not block.vid_hdr.errors: - print '\n' - print '\t%sVID Header Header' % tab - print '\t%s---------------------' % tab + print('\n') + print(('\t%sVID Header Header' % tab)) + print(('\t%s---------------------' % tab)) vid_hdr(block.vid_hdr, '\t\t%s' % tab) if block.vtbl_recs: - print '\n' - print '\t%sVolume Records' % tab - print '\t%s---------------------' % tab + print('\n') + print(('\t%sVolume Records' % tab)) + print(('\t%s---------------------' % tab)) for vol in block.vtbl_recs: vol_rec(vol, '\t\t%s' % tab) - print '\n' + print('\n') def ec_hdr(ec_hdr, tab=''): for key, value in ec_hdr: if key == 'errors': value = ','.join(value) - print '%s%s: %r' % (tab, key, value) + print(('%s%s: %r' % (tab, key, value))) def vid_hdr(vid_hdr, tab=''): @@ -90,7 +90,7 @@ def vid_hdr(vid_hdr, tab=''): value = PRINT_VOL_TYPE_LIST[value] else: value = -1 - print '%s%s: %s' % (tab, key, value) + print(('%s%s: %s' % (tab, key, value))) def vol_rec(vol_rec, tab=''): @@ -106,4 +106,4 @@ def vol_rec(vol_rec, tab=''): value = 'autoresize' elif key == 'name': value = value.strip('\x00') - print '%s%s: %s' % (tab, key, value) + print(('%s%s: %s' % (tab, key, value))) diff --git a/NeoBoot/ubi_reader_mips/ubi/headers/__init__.py b/NeoBoot/ubi_reader_mips/ubi/headers/__init__.py index 5641b23..1ee4d07 100644 --- a/NeoBoot/ubi_reader_mips/ubi/headers/__init__.py +++ b/NeoBoot/ubi_reader_mips/ubi/headers/__init__.py @@ -7,7 +7,8 @@ from ubi.headers import errors class ec_hdr(object): def __init__(self, buf): - fields = dict(zip(EC_HDR_FIELDS, struct.unpack(EC_HDR_FORMAT, buf))) + fields = dict( + list(zip(EC_HDR_FIELDS, struct.unpack(EC_HDR_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -25,7 +26,8 @@ class ec_hdr(object): class vid_hdr(object): def __init__(self, buf): - fields = dict(zip(VID_HDR_FIELDS, struct.unpack(VID_HDR_FORMAT, buf))) + fields = dict( + list(zip(VID_HDR_FIELDS, struct.unpack(VID_HDR_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -43,7 +45,8 @@ class vid_hdr(object): class vtbl_rec(object): def __init__(self, buf): - fields = dict(zip(VTBL_REC_FIELDS, struct.unpack(VTBL_REC_FORMAT, buf))) + fields = dict( + list(zip(VTBL_REC_FIELDS, struct.unpack(VTBL_REC_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) diff --git a/NeoBoot/ubi_reader_mips/ubi/headers/errors.py b/NeoBoot/ubi_reader_mips/ubi/headers/errors.py index 04b3d46..bc502b4 100644 --- a/NeoBoot/ubi_reader_mips/ubi/headers/errors.py +++ b/NeoBoot/ubi_reader_mips/ubi/headers/errors.py @@ -4,14 +4,14 @@ from ubi.defines import * def ec_hdr(ec_hdr, buf): - if ec_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295L: + if ec_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295: ec_hdr.errors.append('crc') return ec_hdr def vid_hdr(vid_hdr, buf): vid_hdr.errors = [] - if vid_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295L: + if vid_hdr.hdr_crc != ~crc32(buf[:-4]) & 4294967295: vid_hdr.errors.append('crc') return vid_hdr @@ -22,7 +22,7 @@ def vtbl_rec(vtbl_rec, buf): likely_vtbl = False elif vtbl_rec.vol_type not in (1, 2): likely_vtbl = False - if vtbl_rec.crc != ~crc32(buf[:-4]) & 4294967295L: + if vtbl_rec.crc != ~crc32(buf[:-4]) & 4294967295: vtbl_rec.errors.append('crc') if not likely_vtbl: vtbl_rec.errors = ['False'] diff --git a/NeoBoot/ubi_reader_mips/ubi/image.py b/NeoBoot/ubi_reader_mips/ubi/image.py index 77c0539..b732fe0 100644 --- a/NeoBoot/ubi_reader_mips/ubi/image.py +++ b/NeoBoot/ubi_reader_mips/ubi/image.py @@ -18,7 +18,7 @@ class description(object): return 'Image: %s' % self.image_seq def get_blocks(self, blocks): - return get_blocks_in_list(blocks, range(self._start_peb, self._end_peb + 1)) + return get_blocks_in_list(blocks, list(range(self._start_peb, self._end_peb + 1))) def _get_peb_range(self): return [self._start_peb, self._end_peb] diff --git a/NeoBoot/ubi_reader_mips/ubi/volume/__init__.py b/NeoBoot/ubi_reader_mips/ubi/volume/__init__.py index b9d96e8..f046055 100644 --- a/NeoBoot/ubi_reader_mips/ubi/volume/__init__.py +++ b/NeoBoot/ubi_reader_mips/ubi/volume/__init__.py @@ -63,6 +63,7 @@ def get_volumes(blocks, layout_info): vol_name = vol_rec.name.strip('\x00') if vol_rec.rec_index not in vol_blocks_lists: vol_blocks_lists[vol_rec.rec_index] = [] - volumes[vol_name] = description(vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index]) + volumes[vol_name] = description( + vol_rec.rec_index, vol_rec, vol_blocks_lists[vol_rec.rec_index]) return volumes diff --git a/NeoBoot/ubi_reader_mips/ubi_extract_files.py b/NeoBoot/ubi_reader_mips/ubi_extract_files.py index 6891503..2ffd2d1 100644 --- a/NeoBoot/ubi_reader_mips/ubi_extract_files.py +++ b/NeoBoot/ubi_reader_mips/ubi_extract_files.py @@ -16,12 +16,18 @@ if __name__ == '__main__': try: parser = argparse.ArgumentParser(usage=usage, description=description) except: - parser = argparse_neo.ArgumentParser(usage=usage, description=description) - parser.add_argument('-l', '--log-file', dest='logpath', help='Log output to file output/LOGPATH. (default: ubifs_output.log)') - parser.add_argument('-k', '--keep-permissions', action='store_true', dest='permissions', help='Maintain file permissions, requires running as root. (default: False)') - parser.add_argument('-q', '--quiet', action='store_true', dest='quiet', help='Suppress warnings and non-fatal errors. (default: False)') - parser.add_argument('-p', '--peb-size', type=int, dest='block_size', help='Specify PEB size.') - parser.add_argument('-o', '--output-dir', dest='output_path', help='Specify output directory path.') + parser = argparse_neo.ArgumentParser( + usage=usage, description=description) + parser.add_argument('-l', '--log-file', dest='logpath', + help='Log output to file output/LOGPATH. (default: ubifs_output.log)') + parser.add_argument('-k', '--keep-permissions', action='store_true', dest='permissions', + help='Maintain file permissions, requires running as root. (default: False)') + parser.add_argument('-q', '--quiet', action='store_true', dest='quiet', + help='Suppress warnings and non-fatal errors. (default: False)') + parser.add_argument('-p', '--peb-size', type=int, + dest='block_size', help='Specify PEB size.') + parser.add_argument('-o', '--output-dir', dest='output_path', + help='Specify output directory path.') parser.add_argument('filepath', help='File to extract contents of.') if len(sys.argv) == 1: parser.print_help() @@ -58,13 +64,14 @@ if __name__ == '__main__': if not os.path.exists(vol_out_path): os.makedirs(vol_out_path) elif os.listdir(vol_out_path): - parser.error('Volume output directory is not empty. %s' % vol_out_path) + parser.error( + 'Volume output directory is not empty. %s' % vol_out_path) ufsfile = leb_virtual_file(uubi, image.volumes[volume]) uubifs = ubifs(ufsfile) uubifs.log.log_file = log_file uubifs.log.log_to_file = log_to_file uubifs.log.quiet = quiet - print 'Writing to: %s' % vol_out_path + print(('Writing to: %s' % vol_out_path)) extract_files(uubifs, vol_out_path, perms) sys.exit(0) diff --git a/NeoBoot/ubi_reader_mips/ubi_io/__init__.py b/NeoBoot/ubi_reader_mips/ubi_io/__init__.py index a7aec6b..936872a 100644 --- a/NeoBoot/ubi_reader_mips/ubi_io/__init__.py +++ b/NeoBoot/ubi_reader_mips/ubi_io/__init__.py @@ -68,7 +68,8 @@ class ubi_file(object): def read_block_data(self, block): self.seek(block.file_offset + block.ec_hdr.data_offset) - buf = self._fhandle.read(block.size - block.ec_hdr.data_offset - block.vid_hdr.data_pad) + buf = self._fhandle.read( + block.size - block.ec_hdr.data_offset - block.vid_hdr.data_pad) return buf @@ -91,7 +92,8 @@ class leb_virtual_file: self.seek(self.tell() + i) return self._last_buf[offset:offset + i] else: - buf = self._ubi.file.read_block_data(self._ubi.blocks[self._blocks[leb]]) + buf = self._ubi.file.read_block_data( + self._ubi.blocks[self._blocks[leb]]) self._last_buf = buf self._last_leb = leb self.seek(self.tell() + i) diff --git a/NeoBoot/ubi_reader_mips/ubifs/defines.py b/NeoBoot/ubi_reader_mips/ubifs/defines.py index a0b3aa9..550fe49 100644 --- a/NeoBoot/ubi_reader_mips/ubifs/defines.py +++ b/NeoBoot/ubi_reader_mips/ubifs/defines.py @@ -1,7 +1,7 @@ #!/usr/bin/python import struct UBIFS_NODE_MAGIC = '1\x18\x10\x06' -UBIFS_CRC32_INIT = 4294967295L +UBIFS_CRC32_INIT = 4294967295 UBIFS_MIN_COMPR_LEN = 128 UBIFS_MIN_COMPRESS_DIFF = 64 UBIFS_ROOT_INO = 1 @@ -88,12 +88,12 @@ UBIFS_FLG_BIGLPT = 2 UBIFS_FLG_SPACE_FIXUP = 4 UBIFS_COMMON_HDR_FORMAT = '> UBIFS_S_KEY_BLOCK_BITS khash = lkey return {'type': key_type, - 'ino_num': ino_num, - 'khash': khash} + 'ino_num': ino_num, + 'khash': khash} def decompress(ctype, unc_len, data): diff --git a/NeoBoot/ubi_reader_mips/ubifs/nodes/__init__.py b/NeoBoot/ubi_reader_mips/ubifs/nodes/__init__.py index 244538b..a287505 100644 --- a/NeoBoot/ubi_reader_mips/ubifs/nodes/__init__.py +++ b/NeoBoot/ubi_reader_mips/ubifs/nodes/__init__.py @@ -7,7 +7,8 @@ from ubifs.misc import parse_key class common_hdr(object): def __init__(self, buf): - fields = dict(zip(UBIFS_COMMON_HDR_FIELDS, struct.unpack(UBIFS_COMMON_HDR_FORMAT, buf))) + fields = dict(list(zip(UBIFS_COMMON_HDR_FIELDS, + struct.unpack(UBIFS_COMMON_HDR_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -25,7 +26,8 @@ class common_hdr(object): class sb_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_SB_NODE_FIELDS, struct.unpack(UBIFS_SB_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_SB_NODE_FIELDS, struct.unpack(UBIFS_SB_NODE_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -41,7 +43,8 @@ class sb_node(object): class mst_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_MST_NODE_FIELDS, struct.unpack(UBIFS_MST_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_MST_NODE_FIELDS, struct.unpack(UBIFS_MST_NODE_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -57,7 +60,8 @@ class mst_node(object): class dent_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_DENT_NODE_FIELDS, struct.unpack(UBIFS_DENT_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_DENT_NODE_FIELDS, struct.unpack(UBIFS_DENT_NODE_FORMAT, buf)))) for key in fields: if key == 'key': setattr(self, key, parse_key(fields[key])) @@ -78,7 +82,8 @@ class dent_node(object): class data_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_DATA_NODE_FIELDS, struct.unpack(UBIFS_DATA_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_DATA_NODE_FIELDS, struct.unpack(UBIFS_DATA_NODE_FORMAT, buf)))) for key in fields: if key == 'key': setattr(self, key, parse_key(fields[key])) @@ -100,7 +105,8 @@ class data_node(object): class idx_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_IDX_NODE_FIELDS, struct.unpack(UBIFS_IDX_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_IDX_NODE_FIELDS, struct.unpack(UBIFS_IDX_NODE_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) @@ -118,7 +124,8 @@ class idx_node(object): class ino_node(object): def __init__(self, buf): - fields = dict(zip(UBIFS_INO_NODE_FIELDS, struct.unpack(UBIFS_INO_NODE_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_INO_NODE_FIELDS, struct.unpack(UBIFS_INO_NODE_FORMAT, buf)))) for key in fields: if key == 'key': setattr(self, key, parse_key(fields[key])) @@ -139,7 +146,8 @@ class ino_node(object): class branch(object): def __init__(self, buf): - fields = dict(zip(UBIFS_BRANCH_FIELDS, struct.unpack(UBIFS_BRANCH_FORMAT, buf))) + fields = dict( + list(zip(UBIFS_BRANCH_FIELDS, struct.unpack(UBIFS_BRANCH_FORMAT, buf)))) for key in fields: setattr(self, key, fields[key]) diff --git a/NeoBoot/ubi_reader_mips/ubifs/output.py b/NeoBoot/ubi_reader_mips/ubifs/output.py index 225e327..96d716a 100644 --- a/NeoBoot/ubi_reader_mips/ubifs/output.py +++ b/NeoBoot/ubi_reader_mips/ubifs/output.py @@ -42,7 +42,8 @@ def dents(ubifs, inodes, dent_node, path='', perms=False): try: os.symlink('%s' % inode['ino'].data, dent_path) except Exception as e: - ubifs.log.write('SYMLINK Fail: %s : %s' % (inode['ino'].data, dent_path)) + ubifs.log.write('SYMLINK Fail: %s : %s' % + (inode['ino'].data, dent_path)) elif dent_node.type in [UBIFS_ITYPE_BLK, UBIFS_ITYPE_CHR]: try: diff --git a/NeoBoot/ubi_reader_mips/ubifs/walk.py b/NeoBoot/ubi_reader_mips/ubifs/walk.py index 4c65114..b9df5a4 100644 --- a/NeoBoot/ubi_reader_mips/ubifs/walk.py +++ b/NeoBoot/ubi_reader_mips/ubifs/walk.py @@ -17,7 +17,8 @@ def index(ubifs, lnum, offset, inodes={}): inodes[ino_num] = {} inodes[ino_num]['ino'] = inon elif chdr.node_type == UBIFS_DATA_NODE: - datn = extract.data_node(ubifs, lnum, offset + UBIFS_COMMON_HDR_SZ, chdr.len) + datn = extract.data_node( + ubifs, lnum, offset + UBIFS_COMMON_HDR_SZ, chdr.len) ino_num = datn.key['ino_num'] if ino_num not in inodes: inodes[ino_num] = {} diff --git a/NeoBoot/ubi_reader_mips/ui/common.py b/NeoBoot/ubi_reader_mips/ui/common.py index 0983692..5d40084 100644 --- a/NeoBoot/ubi_reader_mips/ui/common.py +++ b/NeoBoot/ubi_reader_mips/ui/common.py @@ -4,13 +4,15 @@ from ubi_io import leb_virtual_file from ubifs import ubifs, walk, output from ubifs.defines import PRINT_UBIFS_KEY_HASH, PRINT_UBIFS_COMPR from ubi.defines import PRINT_VOL_TYPE_LIST, UBI_VTBL_AUTORESIZE_FLG -output_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'output') +output_dir = os.path.join(os.path.dirname( + os.path.dirname(os.path.realpath(__file__))), 'output') def extract_files(ubifs, out_path, perms=False): try: inodes = {} - walk.index(ubifs, ubifs.master_node.root_lnum, ubifs.master_node.root_offs, inodes) + walk.index(ubifs, ubifs.master_node.root_lnum, + ubifs.master_node.root_offs, inodes) for dent in inodes[1]['dent']: output.dents(ubifs, inodes, dent, out_path, perms) @@ -22,23 +24,23 @@ def extract_files(ubifs, out_path, perms=False): def get_ubi_params(ubi): ubi_flags = {'min_io_size': '-m', - 'max_bud_bytes': '-j', - 'leb_size': '-e', - 'default_compr': '-x', - 'sub_page_size': '-s', - 'fanout': '-f', - 'key_hash': '-k', - 'orph_lebs': '-p', - 'log_lebs': '-l', - 'max_leb_cnt': '-c', - 'peb_size': '-p', - 'sub_page_size': '-s', - 'vid_hdr_offset': '-O', - 'version': '-x', - 'image_seq': '-Q', - 'alignment': '-a', - 'vol_id': '-n', - 'name': '-N'} + 'max_bud_bytes': '-j', + 'leb_size': '-e', + 'default_compr': '-x', + 'sub_page_size': '-s', + 'fanout': '-f', + 'key_hash': '-k', + 'orph_lebs': '-p', + 'log_lebs': '-l', + 'max_leb_cnt': '-c', + 'peb_size': '-p', + 'sub_page_size': '-s', + 'vid_hdr_offset': '-O', + 'version': '-x', + 'image_seq': '-Q', + 'alignment': '-a', + 'vol_id': '-n', + 'name': '-N'} ubi_params = {} ubi_args = {} ini_params = {} @@ -56,7 +58,8 @@ def get_ubi_params(ubi): else: ini_params[img_seq][volume]['vol_flags'] = image.volumes[volume].vol_rec.flags ini_params[img_seq][volume]['vol_id'] = image.volumes[volume].vol_id - ini_params[img_seq][volume]['vol_name'] = image.volumes[volume].name.rstrip('\x00') + ini_params[img_seq][volume]['vol_name'] = image.volumes[volume].name.rstrip( + '\x00') ini_params[img_seq][volume]['vol_alignment'] = image.volumes[volume].vol_rec.alignment ini_params[img_seq][volume]['vol_size'] = image.volumes[volume].vol_rec.reserved_pebs * ubi.leb_size ufsfile = leb_virtual_file(ubi, image.volumes[volume]) @@ -83,7 +86,7 @@ def get_ubi_params(ubi): ubi_args[img_seq][volume]['peb_size'] = ubi.peb_size ubi_args[img_seq][volume]['vol_id'] = image.volumes[volume].vol_id ubi_params[img_seq][volume] = {'flags': ubi_flags, - 'args': ubi_args[img_seq][volume], - 'ini': ini_params[img_seq][volume]} + 'args': ubi_args[img_seq][volume], + 'ini': ini_params[img_seq][volume]} return ubi_params diff --git a/NeoBoot/unpack.py b/NeoBoot/unpack.py index 1901061..90a87a0 100644 --- a/NeoBoot/unpack.py +++ b/NeoBoot/unpack.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- -#from __init__ import _ -from __future__ import absolute_import -from __future__ import print_function +# from __init__ import _ + + from Plugins.Extensions.NeoBoot.__init__ import _ from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getKernelVersionString, getKernelImageVersion, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel from enigma import getDesktop @@ -77,7 +77,7 @@ class InstallImage(Screen, ConfigListScreen): \ """ else: - skin = """ + skin = """ @@ -126,7 +126,7 @@ class InstallImage(Screen, ConfigListScreen): if fn.find('.tar') != -1: fn = fn.replace('.tar.gz', '') sourcelist.append((fn, fn)) - continue + continue if fn.find('.mb') != -1: fn = fn.replace('.mb', '') sourcelist.append((fn, fn)) @@ -139,17 +139,17 @@ class InstallImage(Screen, ConfigListScreen): 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) @@ -157,13 +157,13 @@ 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 not "dm500hd" in line and not "dm800se" in line and not "dm800" in line and not "dm8000" 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) + else: + self.Nandsim = ConfigYesNo(default=False) self.target.value = '' self.curselimage = '' try: @@ -177,13 +177,13 @@ class InstallImage(Screen, ConfigListScreen): 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) + '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')) @@ -193,27 +193,43 @@ class InstallImage(Screen, ConfigListScreen): def createSetup(self): self.list = [] - self.list.append(getConfigListEntry(_('Source Image file'), self.source)) + 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)) + 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( + _('Use Nandsim to install image ?'), self.Nandsim)) def HelpInstall(self): - self.session.open(HelpInstall) + self.session.open(HelpInstall) def typeChange(self, value): self.createSetup() @@ -230,7 +246,8 @@ class InstallImage(Screen, ConfigListScreen): 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) + self.session.openWithCallback(self.VirtualKeyBoardCallback, VirtualKeyBoard, title=self['config'].getCurrent()[ + 0], text=self['config'].getCurrent()[1].value) return def VirtualKeyBoardCallback(self, callback=None): @@ -240,56 +257,62 @@ class InstallImage(Screen, ConfigListScreen): 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() @@ -312,11 +335,11 @@ class HelpInstall(Screen): 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}) + 'ok': self.close, + 'up': self['lab1'].pageUp, + 'left': self['lab1'].pageUp, + 'down': self['lab1'].pageDown, + 'right': self['lab1'].pageDown}) self['lab1'].hide() self.updatetext() diff --git a/NeoBoot/usedskin.py b/NeoBoot/usedskin.py index 0ee115f..2384e97 100644 --- a/NeoBoot/usedskin.py +++ b/NeoBoot/usedskin.py @@ -4,17 +4,17 @@ 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" +# 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' @@ -23,14 +23,14 @@ import os # jasny-blue = #99FFFF # Zamiast font=Regular ktory nie rozpoznaje polskich znakow np. na VTi, mozesz zmienic na ponizsze font="*: - # font - genel - # font - baslk - # font - tasat - # font - dugme +# font - genel +# font - baslk +# font - tasat +# font - dugme # -###____ Skin Ultra HD - ImageChooseFULLHD ___ mod. gutosie___ +# ____ Skin Ultra HD - ImageChooseFULLHD ___ mod. gutosie___ ImageChooseFULLHD = """ @@ -88,7 +88,7 @@ ImageChooseFULLHD = """ """ -###____ Skin Ultra HD - ImageChooseULTRAHD ___ mod. gutosie___ +# ____ Skin Ultra HD - ImageChooseULTRAHD ___ mod. gutosie___ ImageChooseULTRAHD = """ @@ -137,7 +137,7 @@ ImageChooseULTRAHD = """ """ -###____ Skin HD - ImageChoose ___mod. gutosie ___ +# ____ Skin HD - ImageChoose ___mod. gutosie ___ ImageChooseHD = """ @@ -184,7 +184,7 @@ ImageChooseHD = """ """ -###____ Skin FULLHD - MyUpgradeFULLHD ___mod. gutosie ___ +# ____ Skin FULLHD - MyUpgradeFULLHD ___mod. gutosie ___ MyUpgradeFULLHD = """ @@ -203,7 +203,7 @@ MyUpgradeFULLHD = """ """ -###____ Skin UltraHD - MyUpgradeUltraHD ___mod. gutosie ___ +# ____ Skin UltraHD - MyUpgradeUltraHD ___mod. gutosie ___ MyUpgradeUltraHD = """ @@ -220,7 +220,7 @@ MyUpgradeUltraHD = """ """ -###____ Skin MyUpgradeHD - MyUpgradeHD ___mod. gutosie ___ +# ____ Skin MyUpgradeHD - MyUpgradeHD ___mod. gutosie ___ MyUpgradeHD = """ @@ -239,7 +239,7 @@ MyUpgradeHD = """ """ -###____ Skin NeoBootInstallationFULLHD - NeoBootInstallationFULLHD ___mod. gutosie ___ +# ____ Skin NeoBootInstallationFULLHD - NeoBootInstallationFULLHD ___mod. gutosie ___ NeoBootInstallationFULLHD = """ @@ -264,7 +264,7 @@ NeoBootInstallationFULLHD = """ """ -###____ Skin NeoBootInstallationUltraHD - NeoBootInstallationUltraHD ___mod. gutosie ___ +# ____ Skin NeoBootInstallationUltraHD - NeoBootInstallationUltraHD ___mod. gutosie ___ NeoBootInstallationUltraHD = """ @@ -296,7 +296,7 @@ NeoBootInstallationUltraHD = """ """ -###____ Skin NeoBootInstallationHD - NeoBootInstallationHD ___mod. gutosie ___ +# ____ Skin NeoBootInstallationHD - NeoBootInstallationHD ___mod. gutosie ___ NeoBootInstallationHD = """