diff --git a/NeoBoot/extract.py b/NeoBoot/extract.py index a159edd..4f0fb16 100644 --- a/NeoBoot/extract.py +++ b/NeoBoot/extract.py @@ -379,12 +379,15 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Ste cmd = 'chmod 0755 %s/ImageBoot/%s/etc/init.d/rc.local' % (media, target) rc = os.system(cmd) - if not os.path.exists('%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)) and not os.path.exists('%s/ImageBoot/%s/etc/rc.local' % (media, target)) : - cmd = 'ln -s %s/ImageBoot/%s/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/userscript.sh %s/ImageBoot/%s/etc/rcS.d/S99neo.local' % (media, - target, - media, - target) - rc = os.system(cmd) + if not os.path.exists('%s/ImageBoot/%s/etc/init.d/rc.local' % (media, target)) and not os.path.exists('%s/ImageBoot/%s/etc/rc.local' % (media, target)) : + 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) + rc = os.system(cmd) + elif not os.path.exists('%s/ImageBoot/%s/etc/init.d' % (media, target)): + os.system('echo "/etc/init.d not found."') if not os.path.exists('' + getNeoLocation() + 'ImageBoot/.without_copying'): if not os.path.exists('%s/ImageBoot/%s/etc/enigma2' % (media, target)): @@ -701,7 +704,17 @@ def RemoveUnpackDirs(): 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/rootfs.tar.gz'): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.gz') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz') : + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2') : + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et10000') : + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et10000') + + def NEOBootExtract(source, target, ZipDelete, BlackHole): RemoveUnpackDirs() os.system('echo "Press green to hide Console or red to abort the installation\nInstallation started:"; date +%T;echo "Extracting the installation file..."') @@ -1124,6 +1137,23 @@ def NEOBootExtract(source, target, ZipDelete, BlackHole): rc = os.system(cmd) cmd = 'rm -rf ' + getNeoLocation() + 'ubi' rc = os.system(cmd) + + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et10000/rootfs.bin'): + os.chdir('et10000') + os.system('mv -f rootfs.bin rootfs.bin') + os.system('echo "Instalacja - ubi_reader w toku..."') + print '[NeoBoot] Extracting UBIFS image and moving extracted image to our target' + cmd = 'chmod 777 ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py' + rc = os.system(cmd) + cmd = 'python ' + extensions_path + 'NeoBoot/ubi_reader/ubi_extract_files.py rootfs.bin -o ' + getNeoLocation() + 'ubi' + rc = os.system(cmd) + os.chdir('/home/root') + cmd = 'cp -r -p ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' + rc = os.system(cmd) elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/sf4008'): os.system('echo "Please wait. System installation Octagon SF4008."') @@ -1139,13 +1169,12 @@ def NEOBootExtract(source, target, ZipDelete, BlackHole): rc = os.system(cmd) elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm900'): os.system('echo "Please wait. System installation Dreambox DM900."') - cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dm900/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/dm900/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' - rc = os.system(cmd) - elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/%s.tar.xz' % source): - os.system('echo "Please wait. System installation spakowanego w plik tar.xz w toku..."') - os.system('cp -r ' + getNeoLocation() + 'ImagesUpload/%s.tar.xz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz' % source) - cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz; tar -jJxvf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' - rc = os.system(cmd) + 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 -jxvf ' + getNeoLocation() + 'ImagesUpload/dm920/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2'): os.system('echo "Please wait. System installation AX 4K Box HD51 "') cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/hd51/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' @@ -1246,10 +1275,6 @@ def NEOBootExtract(source, target, ZipDelete, BlackHole): os.system('echo "Please wait. System installation Ferguson Ariva 4K Combo w toku..."') cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/e2/update; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/e2/update/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) - elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/e2/update'): - os.system('echo "Please wait. System installation Ferguson Ariva 4K Combo w toku..."') - cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/dm920; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/dm920/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' - rc = os.system(cmd) elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/beyonwiz/v2'): os.system('echo "Please wait. System installation beyonwiz v2 4K w toku..."') cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/beyonwiz/v2; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/beyonwiz/v2/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' @@ -1278,6 +1303,44 @@ def NEOBootExtract(source, target, ZipDelete, BlackHole): os.system('echo "Please wait. System installation multibox..."') cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/multibox; tar -jxvf ' + getNeoLocation() + 'ImagesUpload/multibox/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' rc = os.system(cmd) + + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.xz'): + os.system('echo "Please wait. System installation spakowanego w plik tar.xz w toku..."') + os.system('cp -r ' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.xz ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz; tar -jJxvf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.xz -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.gz'): + os.system('echo "Please wait. System installation spakowanego w plik tar.gz w toku..."') + os.system('cp -r ' + 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) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.bz2'): + os.system('echo "Please wait. System installation spakowanego w plik tar.bz2 w toku..."') + os.system('cp -r ' + getNeoLocation() + 'ImagesUpload/' + source + '.tar.bz2 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2') + cmd = 'chmod 777 ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2; /bin/tar -xzvf ' + getNeoLocation() + 'ImagesUpload/rootfs.tar.bz2 -C ' + getNeoLocation() + 'ImageBoot/' + target + ' > /dev/null 2>&1' + rc = os.system(cmd) + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/' + source + '.mb'): + os.system('echo "Please wait. System installation spakowanego w plik .mb w toku..."') + os.system('cp -r ' + 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'): + 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 -r -p ' + getNeoLocation() + 'ubi/rootfs/* ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + cmd = 'chmod -R +x ' + getNeoLocation() + 'ImageBoot/' + target + rc = os.system(cmd) + cmd = 'rm -rf ' + getNeoLocation() + 'ubi' + rc = os.system(cmd) + else: os.system('echo "NeoBoot wykrył dłąd!!! Prawdopodobnie brak pliku instalacyjnego."') diff --git a/NeoBoot/plugin.py b/NeoBoot/plugin.py index 1584d90..5d11da8 100644 --- a/NeoBoot/plugin.py +++ b/NeoBoot/plugin.py @@ -51,7 +51,7 @@ else: from files.neoconsole import Console PLUGINVERSION = '9.01' -UPDATEVERSION = '9.01' +UPDATEVERSION = '9.02' LinkNeoBoot = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' try: @@ -65,6 +65,17 @@ try: except: print 'ERROR INSERTING FONT' +def neoTranslator(): + neolang = '' + usedlang = open('/etc/enigma2/settings', 'r') + lang = 'config.osd.language=pl_PL' + local = usedlang.read().find(lang) + if local != -1: + neolang = 'islangPL' + else: + neolang = 'isnotlangPL' + return neolang + def getDS(): s = getDesktop(0).size() return (s.width(), s.height()) diff --git a/NeoBoot/unpack.py b/NeoBoot/unpack.py index 417c419..aa0e7ee 100644 --- a/NeoBoot/unpack.py +++ b/NeoBoot/unpack.py @@ -108,6 +108,14 @@ class InstallImage(Screen, ConfigListScreen): fn = fn.replace('.tar.xz', '') sourcelist.append((fn, fn)) continue + if fn.find('.tar.gz') != -1: + fn = fn.replace('.tar.gz', '') + sourcelist.append((fn, fn)) + continue + if fn.find('.mb') != -1: + fn = fn.replace('.mb', '') + sourcelist.append((fn, fn)) + continue if fn.find('.nfi') != -1: fn = fn.replace('.nfi', '') sourcelist.append((fn, fn))