From bcc313766bf04ae6ee786a1da57c150f1d56bd8f Mon Sep 17 00:00:00 2001 From: gutosie Date: Fri, 10 Jan 2020 21:49:51 +0200 Subject: [PATCH] add DM920 --- NeoBoot/arm_run.py | 158 +++++++++++++++++++++++++++++++++++++++++++++ NeoBoot/extract.py | 11 ++++ NeoBoot/plugin.py | 3 +- NeoBoot/unpack.py | 1 + 4 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 NeoBoot/arm_run.py diff --git a/NeoBoot/arm_run.py b/NeoBoot/arm_run.py new file mode 100644 index 0000000..8fbbe48 --- /dev/null +++ b/NeoBoot/arm_run.py @@ -0,0 +1,158 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +#echo "Flash " >> '+ getImageNeoBoot() + 'ImagesUpload/.kernel/used_flash_kernel; + +from __init__ import _ +from Plugins.Extensions.NeoBoot.files.stbbranding import getNeoLocation, getKernelVersionString, getKernelImageVersion, getCPUtype, getCPUSoC, getImageNeoBoot, getBoxVuModel, getBoxHostName, getTunerModel +from enigma import getDesktop +from enigma import eTimer +from Screens.Screen import Screen +from Screens.Console import Console +from Screens.MessageBox import MessageBox +from Screens.ChoiceBox import ChoiceBox +from Screens.VirtualKeyBoard import VirtualKeyBoard +from Screens.Standby import TryQuitMainloop +from Components.About import about +from Components.Sources.List import List +from Components.Button import Button +from Components.ActionMap import ActionMap, NumberActionMap +from Components.GUIComponent import * +from Components.MenuList import MenuList +from Components.Input import Input +from Components.Label import Label +from Components.ProgressBar import ProgressBar +from Components.ScrollLabel import ScrollLabel +from Components.Pixmap import Pixmap, MultiPixmap +from Components.config import * +from Components.ConfigList import ConfigListScreen +from Tools.LoadPixmap import LoadPixmap +from Tools.Directories import fileExists, pathExists, createDir, resolveFilename, SCOPE_PLUGINS +from os import system, listdir, mkdir, chdir, getcwd, rename as os_rename, remove as os_remove, popen +from os.path import dirname, isdir, isdir as os_isdir +import os +import time + + +class StartImage(Screen): + screenwidth = getDesktop(0).size().width() + if screenwidth and screenwidth == 1920: + skin = """ + \n\t\t\t + \n\t\t\t\t + \n \t\t{"template": [ + \n \t\t\tMultiContentEntryText(pos = (90, 1), size = (920, 66), flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER, text = 0), + \n \t\t\tMultiContentEntryPixmapAlphaTest(pos = (8, 4), size = (66, 66), png = 1), + \n \t\t\t], + \n \t\t\t"fonts": [gFont("Regular", 40)],\n \t\t\t"itemHeight": 66\n \t\t} + \n \t\t\n\t\t + \n + \n\t\t + \n\t\t """ + else: + skin = """ + \n\t\t\t + + \n\t\t\t\t + \n \t\t{"template": [ + \n \t\t\tMultiContentEntryText(pos = (180, 0), size = (520, 36), flags = RT_HALIGN_LEFT|RT_VALIGN_CENTER, text = 0), + \n \t\t\tMultiContentEntryPixmapAlphaTest(pos = (4, 2), size = (36, 36), png = 1), + \n \t\t\t],\n \t\t\t"fonts": [gFont("Regular", 22)], + \n \t\t\t"itemHeight": 35\n \t\t}\n \t\t + \n\t\t\n + + \n\t\t """ + + __module__ = __name__ + def __init__(self, session): + Screen.__init__(self, session) + self.list = [] + self['list'] = List(self.list) + self.select() + self['actions'] = ActionMap(['WizardActions', 'ColorActions'], {'ok': self.KeyOk, + 'back': self.close}) + self['label1'] = Label(_('Start the chosen system now ?')) + self['label2'] = Label(_('Select OK to run the image.')) + + def select(self): + self.list = [] + mypath = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot' + if not fileExists(mypath + 'icons'): + mypixmap = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/images/ok.png' + png = LoadPixmap(mypixmap) + res = (_('OK Start image...'), png, 0) + self.list.append(res) + self['list'].list = self.list + + def KeyOk(self): + if getImageNeoBoot() != 'Flash': + if not fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())): + cmd = _("echo -e '[NeoBoot] Uwaga!!! po poprawnym starcie wybranego oprogramowania w neoboot,\nnalezy uruchomic NEOBOOTA by potwierdzic prawidlowy start image.\n\nNacisnij OK lub exit na pilocie by kontynuowac...\n\n\n'") + self.session.openWithCallback(self.StartImageInNeoBoot, Console, _('NeoBoot: Start image...'), [cmd]) + else: + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot())) + self.StartImageInNeoBoot() + else: + os.system('rm -rf %sImageBoot/%s/usr/bin/enigma2_pre_start.sh' % ( getNeoLocation(), getImageNeoBoot())) + self.StartImageInNeoBoot() + + def StartImageInNeoBoot(self): + if getImageNeoBoot() != 'Flash': + if fileExists('%sImageBoot/%s/.control_ok' % ( getNeoLocation(), getImageNeoBoot())): + system('touch /tmp/.control_ok ') + else: + system('touch %sImageBoot/%s/.control_boot_new_image ' % ( getNeoLocation(), getImageNeoBoot() )) + + system('chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/neo_location') + self.sel = self['list'].getCurrent() + if self.sel: + self.sel = self.sel[2] + if self.sel == 0: + if fileExists('/media/mmc/etc/init.d/neobootmount.sh'): + os.system('rm -f /media/mmc/etc/init.d/neobootmount.sh;') + +#################_____ARM____########################## + + #ARM procesor: DM900; AX HD60 4K + if getCPUtype() == 'ARMv7' and getCPUSoC() or getBoxHostName() == ['osmio4k', + 'ax60', + 'sf8008', + 'bcm7251', + 'sf4008', + 'et1x000', + 'dm920', + 'bcm7251s', + 'h7', + 'hi3798mv200' + 'zgemmah9s', + 'bcm7252s', + 'gbquad4k', + 'ustym4kpro', + '3798mv200' + 'dm900'] : + if getImageNeoBoot() == 'Flash': + if fileExists('/.multinfo'): + os.system('cd /media/mmc; ln -sfn /sbin/init.sysvinit /media/mmc/sbin/init; reboot -f ') + elif not fileExists('/.multinfo'): + cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') + cmd1='sleep 5; ln -sfn /sbin/init.sysvinit /sbin/init; reboot -f ' + self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) + + elif getImageNeoBoot() != 'Flash': + cmd = "echo -e '\n\n%s '" % _('NEOBOOT - Restart image flash....\nPlease wait, in a moment the decoder will be restarted...\n') + cmd1='sleep 5; ln -sfn /sbin/neoinitarm /sbin/init; reboot -f ' + self.session.open(Console, _('NeoBoot ....'), [cmd, cmd1]) + + else: + os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') + self.messagebox = self.session.open(MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! '), MessageBox.TYPE_INFO, 8) + self.close() + + + else: + os.system('echo "Flash " >> ' + getNeoLocation() + 'ImageBoot/.neonextboot') + self.messagebox = self.session.open(MessageBox, _('Wygląda na to że multiboot nie wspiera tego modelu STB !!! '), MessageBox.TYPE_INFO, 8) + self.close() + + def myclose2(self, message): + self.session.open(MessageBox, message, MessageBox.TYPE_INFO) + self.close() diff --git a/NeoBoot/extract.py b/NeoBoot/extract.py index 79cee4a..e6897cc 100644 --- a/NeoBoot/extract.py +++ b/NeoBoot/extract.py @@ -147,6 +147,11 @@ def NEOBootMainEx(source, target, stopenigma, CopyFiles, CopyKernel, TvList, Mon os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + getBoxHostName() + '/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) os.system('echo "Skopiowano kernel.bin STB-ARM GI ET-11000 4K."') +#arm Dreambox dm920 + elif getBoxHostName() == 'dm920': + os.system('mv ' + getNeoLocation() + 'ImagesUpload/' + getBoxHostName() + '/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) + os.system('echo "Skopiowano kernel.bin STB-ARM DM920 4K."') + #arm Ariva 4K Combo elif getBoxHostName() == 'et1x000': #getCPUSoC() == 'bcm7251' or os.system('mv ' + getNeoLocation() + 'ImagesUpload/e2/update/kernel.bin ' + media_target + '/boot/zImage.' + getBoxHostName() + '' + dev_null) @@ -648,6 +653,8 @@ def RemoveUnpackDirs(): rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/e2') elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/et1x000'): rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/et1x000') + elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/dm920 '): + rc = os.system('rm -r ' + getNeoLocation() + 'ImagesUpload/dm920 ') elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/octagon/sf8008'): rc = os.system('mv ' + getNeoLocation() + 'ImagesUpload/usb_update.bin ' + getNeoLocation() + 'ImagesUpload/octagon; rm -r ' + getNeoLocation() + 'ImagesUpload/octagon') elif os.path.exists('' + getNeoLocation() + 'ImagesUpload/hd60'): @@ -1184,6 +1191,10 @@ 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) else: os.system('echo "NeoBoot wykrył dłąd!!! Prawdopodobnie brak pliku instalacyjnego."') diff --git a/NeoBoot/plugin.py b/NeoBoot/plugin.py index 0a6be71..c6a65fa 100644 --- a/NeoBoot/plugin.py +++ b/NeoBoot/plugin.py @@ -605,7 +605,7 @@ class NeoBootInstallation(Screen): # ARM - OctagonSF4008 - DM900 - Zgemma h7S - Octagon sf 8008 - AX HD60 4K #gbquad4k arm , #osmio4k arm, #Zgemma h9 arm, #Zgemma h7S arm , #Octagon SF4008 - if getBoxHostName() == 'et1x000' or getBoxHostName() == 'ustym4kpro' or getTunerModel() == 'ustym4kpro' or getCPUSoC() == 'bcm7251' or getBoxHostName() == 'sf4008' or getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7' or getCPUSoC() == 'bcm7252s' or getBoxHostName() == 'gbquad4k' or getBoxHostName == 'osmio4k' or getBoxHostName() == 'zgemmah9s' or getBoxHostName() == 'ax60' or getBoxHostName() == 'sf8008' or getCPUSoC() == 'bcm7251' or getCPUSoC() == 'BCM97252SSFF' or getBoxHostName() == 'dm900': + if getBoxHostName() == 'dm920' or getBoxHostName() == 'et1x000' or getBoxHostName() == 'ustym4kpro' or getTunerModel() == 'ustym4kpro' or getCPUSoC() == 'bcm7251' or getBoxHostName() == 'sf4008' or getCPUSoC() == 'bcm7251s' or getBoxHostName() == 'h7' or getCPUSoC() == 'bcm7252s' or getBoxHostName() == 'gbquad4k' or getBoxHostName == 'osmio4k' or getBoxHostName() == 'zgemmah9s' or getBoxHostName() == 'ax60' or getBoxHostName() == 'sf8008' or getCPUSoC() == 'bcm7251' or getCPUSoC() == 'BCM97252SSFF' or getBoxHostName() == 'dm900': os.system('cp -f /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/bin/neoinitarm /sbin/neoinitarm; chmod 0755 /sbin/neoinitarm; ln -sfn /sbin/neoinitarm /sbin/init; mv /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/target/arm_run.py /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/run.py; cd') @@ -1423,6 +1423,7 @@ valign="center" backgroundColor="black" transparent="1" foregroundColor="white" 'bcm7251', 'sf4008', 'et1x000', + 'dm920', 'bcm7251s', '7241', 'h7', diff --git a/NeoBoot/unpack.py b/NeoBoot/unpack.py index d0987ca..ce12068 100644 --- a/NeoBoot/unpack.py +++ b/NeoBoot/unpack.py @@ -112,6 +112,7 @@ class InstallImage(Screen, ConfigListScreen): 'bcm7251', 'sf4008', 'et1x000', + 'dm920', 'bcm7251s', 'h7', 'hi3798mv200'