Пример #1
0
 def blue(self):
     import boxbranding
     print "getMachineBuild=%s<" % boxbranding.getMachineBuild()
     print "getMachineProcModel=%s<" % boxbranding.getMachineProcModel()
     print "getMachineBrand=%s<" % boxbranding.getMachineBrand()
     print "getMachineName=%s<" % boxbranding.getMachineName()
     print "getMachineMtdKernel=%s<" % boxbranding.getMachineMtdKernel()
     print "getMachineKernelFile=%s<" % boxbranding.getMachineKernelFile()
     print "getMachineMtdRoot=%s<" % boxbranding.getMachineMtdRoot()
     print "getMachineRootFile=%s<" % boxbranding.getMachineRootFile()
     print "getMachineMKUBIFS=%s<" % boxbranding.getMachineMKUBIFS()
     print "getMachineUBINIZE=%s<" % boxbranding.getMachineUBINIZE()
     print "getBoxType=%s<" % boxbranding.getBoxType()
     print "getBrandOEM=%s<" % boxbranding.getBrandOEM()
     print "getOEVersion=%s<" % boxbranding.getOEVersion()
     print "getDriverDate=%s<" % boxbranding.getDriverDate()
     print "getImageVersion=%s<" % boxbranding.getImageVersion()
     print "getImageBuild=%s<" % boxbranding.getImageBuild()
     print "getImageDistro=%s<" % boxbranding.getImageDistro()
     print "getImageFolder=%s<" % boxbranding.getImageFolder()
     print "getImageFileSystem=%s<" % boxbranding.getImageFileSystem()
     if self.check_hdd():
         self.session.open(doFlashImage,
                           online=False,
                           list=self.list[self.selection],
                           multi=self.multi,
                           devrootfs=self.devrootfs)
     else:
         self.close()
Пример #2
0
 def __init__(self, session, updatebackup=False):
     Screen.__init__(self, session)
     self.Console = Console()
     self.BackupDevice = config.imagemanager.backuplocation.value
     print "[ImageManager] Device: " + self.BackupDevice
     self.BackupDirectory = config.imagemanager.backuplocation.value + 'imagebackups/'
     print "[ImageManager] Directory: " + self.BackupDirectory
     self.BackupDate = getImageVersion() + '.' + getImageBuild(
     ) + '-' + strftime('%Y%m%d_%H%M%S', localtime())
     self.WORKDIR = self.BackupDirectory + config.imagemanager.folderprefix.value + '-temp'
     self.TMPDIR = self.BackupDirectory + config.imagemanager.folderprefix.value + '-mount'
     if updatebackup:
         self.MAINDESTROOT = self.BackupDirectory + config.imagemanager.folderprefix.value + '-SoftwareUpdate-' + self.BackupDate
     else:
         self.MAINDESTROOT = self.BackupDirectory + config.imagemanager.folderprefix.value + '-' + self.BackupDate
     self.kernelMTD = getMachineMtdKernel()
     self.kernelFILE = getMachineKernelFile()
     self.rootMTD = getMachineMtdRoot()
     self.rootFILE = getMachineRootFile()
     self.MAINDEST = self.MAINDESTROOT + '/' + getImageFolder() + '/'
     print 'MTD: Kernel:', self.kernelMTD
     print 'MTD: Root:', self.rootMTD
     if getImageFileSystem() == 'ubi':
         self.ROOTFSTYPE = 'ubifs'
     else:
         self.ROOTFSTYPE = 'jffs2'
     self.swapdevice = ""
     self.RamChecked = False
     self.SwapCreated = False
     self.Stage1Completed = False
     self.Stage2Completed = False
     self.Stage3Completed = False
     self.Stage4Completed = False
     self.Stage5Completed = False
Пример #3
0
	def __init__(self, session, updatebackup=False):
		Screen.__init__(self, session)
		self.Console = Console()
		self.BackupDevice = config.imagemanager.backuplocation.value
		print "[ImageManager] Device: " + self.BackupDevice
		self.BackupDirectory = config.imagemanager.backuplocation.value + 'imagebackups/'
		print "[ImageManager] Directory: " + self.BackupDirectory
		self.BackupDate = getImageVersion() + '.' + getImageBuild() + '-' + strftime('%Y%m%d_%H%M%S', localtime())
		self.WORKDIR = self.BackupDirectory + config.imagemanager.folderprefix.value + '-temp'
		self.TMPDIR = self.BackupDirectory + config.imagemanager.folderprefix.value + '-mount'
		if updatebackup:
			self.MAINDESTROOT = self.BackupDirectory + config.imagemanager.folderprefix.value + '-SoftwareUpdate-' + self.BackupDate
		else:
			self.MAINDESTROOT = self.BackupDirectory + config.imagemanager.folderprefix.value + '-' + self.BackupDate
		self.kernelMTD = getMachineMtdKernel()
		self.kernelFILE = getMachineKernelFile()
		self.rootMTD = getMachineMtdRoot()
		self.rootFILE = getMachineRootFile()
		self.MAINDEST = self.MAINDESTROOT + '/' + getImageFolder() + '/'
		print 'MTD: Kernel:',self.kernelMTD
		print 'MTD: Root:',self.rootMTD
		if getImageFileSystem() == 'ubi':
			self.ROOTFSTYPE = 'ubifs'
		else:
			self.ROOTFSTYPE= 'jffs2'
		self.swapdevice = ""
		self.RamChecked = False
		self.SwapCreated = False
		self.Stage1Completed = False
		self.Stage2Completed = False
		self.Stage3Completed = False
		self.Stage4Completed = False
		self.Stage5Completed = False
Пример #4
0
	def __init__(self, session, args = 0):
		Screen.__init__(self, session)
		self.session = session
		self.selection = 0
		self.list = self.list_files("/boot")
		self.MODEL = getBoxType()
		self.OEM = getBrandOEM()
		self.MACHINEBUILD = getMachineBuild()
		self.MACHINENAME = getMachineName()
		self.MACHINEBRAND = getMachineBrand()
		self.IMAGEFOLDER = getImageFolder()
		self.UBINIZE_ARGS = getMachineUBINIZE()
		self.MKUBIFS_ARGS = getMachineMKUBIFS()
		self.MTDKERNEL = getMachineMtdKernel()
		self.MTDROOTFS = getMachineMtdRoot()
		self.ROOTFSBIN = getMachineRootFile()
		self.KERNELBIN = getMachineKernelFile()
		self.ROOTFSTYPE = getImageFileSystem().strip()

		if self.MACHINEBUILD in ("gbmv200"):
			self.MTDBOOT = "none"
			self.EMMCIMG = "usb_update.bin"
		else:
			self.MTDBOOT = "none"
			self.EMMCIMG = "none"

		print "[ImageBackup] BOX MACHINEBUILD = >%s<" %self.MACHINEBUILD
		print "[ImageBackup] BOX MACHINENAME = >%s<" %self.MACHINENAME
		print "[ImageBackup] BOX MACHINEBRAND = >%s<" %self.MACHINEBRAND
		print "[ImageBackup] BOX MODEL = >%s<" %self.MODEL
		print "[ImageBackup] OEM MODEL = >%s<" %self.OEM
		print "[ImageBackup] IMAGEFOLDER = >%s<" %self.IMAGEFOLDER
		print "[ImageBackup] UBINIZE = >%s<" %self.UBINIZE_ARGS
		print "[ImageBackup] MKUBIFS = >%s<" %self.MKUBIFS_ARGS
		print "[ImageBackup] MTDKERNEL = >%s<" %self.MTDKERNEL
		print "[ImageBackup] MTDROOTFS = >%s<" %self.MTDROOTFS
		print "[ImageBackup] ROOTFSTYPE = >%s<" %self.ROOTFSTYPE
		print "[ImageBackup] EMMCIMG = >%s<" %self.EMMCIMG

		self["key_green"] = Button("USB")
		self["key_red"] = Button("HDD")
		self["key_blue"] = Button(_("Exit"))
		if SystemInfo["canMultiBoot"]:
			self["key_yellow"] = StaticText(_("STARTUP"))
			self["info-multi"] = Label(_("You can select with yellow the OnlineFlash Image\n or select Recovery to create a USB Disk Image for clean Install."))
			self.read_current_multiboot()
		else:
			self["key_yellow"] = StaticText("")
			self["info-multi"] = Label(" ")
		self["info-usb"] = Label(_("USB = Do you want to create a fullbackup on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB."))
		self["info-hdd"] = Label(_("HDD = Do you want to create a fullbackup on HDD? \nThis only takes 2 or 10 minutes and is fully automatic."))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"blue": self.quit,
			"yellow": self.yellow,
			"green": self.green,
			"red": self.red,
			"cancel": self.quit,
		}, -2)
Пример #5
0
	def keyResstore4(self, result, retval, extra_args=None):
		if retval == 0:
			kernelMTD = getMachineMtdKernel()
			rootMTD = getMachineMtdRoot()
			MAINDEST = '%s/%s' % (self.TEMPDESTROOT,getImageFolder())
			CMD = '/usr/bin/ofgwrite -r%s -k%s %s/' % (rootMTD, kernelMTD, MAINDEST)
			config.imagemanager.restoreimage.setValue(self.sel)
			print '[ImageManager] running commnd:',CMD
			self.Console.ePopen(CMD)
Пример #6
0
	def keyResstore3(self, result, retval, extra_args=None):
		if retval == 0:
			kernelMTD = getMachineMtdKernel()
			kernelFILE = getMachineKernelFile()
			rootMTD = getMachineMtdRoot()
			rootFILE = getMachineRootFile()
			MAINDEST = '/tmp/imagerestore/' + getImageFolder() + '/'

			config.imagemanager.restoreimage.setValue(self.sel)
			self.Console.ePopen('ofgwrite -r -k -r' + rootMTD + ' -k' + kernelMTD + ' ' + MAINDEST)
Пример #7
0
    def keyResstore3(self, result, retval, extra_args=None):
        if retval == 0:
            kernelMTD = getMachineMtdKernel()
            kernelFILE = getMachineKernelFile()
            rootMTD = getMachineMtdRoot()
            rootFILE = getMachineRootFile()
            MAINDEST = '/tmp/imagerestore/' + getImageFolder() + '/'

            config.imagemanager.restoreimage.setValue(self.sel)
            self.Console.ePopen('ofgwrite -r -k -r' + rootMTD + ' -k' +
                                kernelMTD + ' ' + MAINDEST)
Пример #8
0
    def imageInstall(self):
        if self.check_free_space():
            pluginpath = '/usr/lib/enigma2/python/Plugins/Extensions/NFR4XBoot'
            myerror = ''
            source = self.source.value.replace(' ', '')
            target = self.target.value.replace(' ', '')
            for fn in os.listdir('/media/nfr4xboot/NFR4XBootI'):
                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: /media/nfr4xboot/NFR4XBootUpload 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) > 35:
                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 '\n\n"
                message += _('NFR4XBoot will install the new image.\n\n')
                message += _(
                    'Please: DO NOT reboot your STB and turn off the power.\n\n'
                )
                message += _(
                    'The new image will be installed and auto booted in few minutes.\n\n'
                )
                message += "'"
                if fileExists(pluginpath + '/ex_init.py'):
                    cmd1 = 'python ' + pluginpath + '/ex_init.py'
                elif fileExists(pluginpath + '/ex_init.pyc'):
                    cmd1 = 'python ' + pluginpath + '/ex_init.pyc'
                else:
                    cmd1 = 'python ' + pluginpath + '/ex_init.pyo'
                cmd = '%s %s %s %s %s %s %s %s %s' % (
                    cmd1, source, target.replace(' ', '.'), str(
                        self.sett.value), str(
                            self.bootquest.value), str(self.zipdelete.value),
                    getImageFolder(), getMachineRootFile(), getImageArch())
                print('[NFR4X-BOOT]: ', cmd)
                self.session.open(Console, _('NFR4XBoot: Install new image'),
                                  [message, cmd])
Пример #9
0
	def __init__(self, session, args = 0):
		Screen.__init__(self, session)
		self.session = session
		self.selection = 0
		self.list = self.list_files("/boot")
		self.MODEL = getBoxType()
		self.OEM = getBrandOEM()
		self.MACHINEBUILD = getMachineBuild()
		self.MACHINENAME = getMachineName()
		self.MACHINEBRAND = getMachineBrand()
		self.IMAGEFOLDER = getImageFolder()
		self.UBINIZE_ARGS = getMachineUBINIZE()
		self.MKUBIFS_ARGS = getMachineMKUBIFS()
		self.MTDKERNEL = getMachineMtdKernel()
		self.MTDROOTFS = getMachineMtdRoot()
		self.ROOTFSBIN = getMachineRootFile()
		self.KERNELBIN = getMachineKernelFile()
		self.ROOTFSTYPE = getImageFileSystem()
		print "[FULL BACKUP] BOX MACHINEBUILD = >%s<" %self.MACHINEBUILD
		print "[FULL BACKUP] BOX MACHINENAME = >%s<" %self.MACHINENAME
		print "[FULL BACKUP] BOX MACHINEBRAND = >%s<" %self.MACHINEBRAND
		print "[FULL BACKUP] BOX MODEL = >%s<" %self.MODEL
		print "[FULL BACKUP] OEM MODEL = >%s<" %self.OEM
		print "[FULL BACKUP] IMAGEFOLDER = >%s<" %self.IMAGEFOLDER
		print "[FULL BACKUP] UBINIZE = >%s<" %self.UBINIZE_ARGS
		print "[FULL BACKUP] MKUBIFS = >%s<" %self.MKUBIFS_ARGS
		print "[FULL BACKUP] MTDKERNEL = >%s<" %self.MTDKERNEL
		print "[FULL BACKUP] MTDROOTFS = >%s<" %self.MTDROOTFS
		print "[FULL BACKUP] ROOTFSTYPE = >%s<" %self.ROOTFSTYPE

		self["key_green"] = Button("USB")
		self["key_red"] = Button("HDD")
		self["key_blue"] = Button(_("Exit"))
		if SystemInfo["HaveMultiBoot"]:
			self["key_yellow"] = Button(_("STARTUP"))
			self["info-multi"] = Label(_("You can select with yellow the OnlineFlash Image\n or select Recovery to create a USB Disk Image for clean Install."))
		else:
			self["key_yellow"] = Button("")
			self["info-multi"] = Label(" ")

		self["info-usb"] = Label(_("USB = Do you want to make a back-up on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB."))
		self["info-hdd"] = Label(_("HDD = Do you want to make an USB-back-up image on HDD? \nThis only takes 2 or 10 minutes and is fully automatic."))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"], 
		{
			"blue": self.quit,
			"yellow": self.yellow,
			"green": self.green,
			"red": self.red,
			"cancel": self.quit,
		}, -2)
Пример #10
0
    def __init__(self, session, args=0):
        Screen.__init__(self, session)
        self.session = session
        self.MODEL = getBoxType()
        self.OEM = getBrandOEM()
        self.MACHINEBUILD = getMachineBuild()
        self.MACHINENAME = getMachineName()
        self.MACHINEBRAND = getMachineBrand()
        self.IMAGEFOLDER = getImageFolder()
        self.HDFIMAGEVERSION = getImageVersion()
        self.HDFIMAGEBUILD = getImageBuild()
        self.UBINIZE_ARGS = getMachineUBINIZE()
        self.MKUBIFS_ARGS = getMachineMKUBIFS()
        self.MTDKERNEL = getMachineMtdKernel()
        self.ROOTFSBIN = getMachineRootFile()
        self.KERNELBIN = getMachineKernelFile()
        self.ROOTFSTYPE = getImageFileSystem()
        print "[FULL BACKUP] BOX MACHINEBUILD = >%s<" % self.MACHINEBUILD
        print "[FULL BACKUP] BOX MACHINENAME = >%s<" % self.MACHINENAME
        print "[FULL BACKUP] BOX MACHINEBRAND = >%s<" % self.MACHINEBRAND
        print "[FULL BACKUP] BOX MODEL = >%s<" % self.MODEL
        print "[FULL BACKUP] OEM MODEL = >%s<" % self.OEM
        print "[FULL BACKUP] IMAGEFOLDER = >%s<" % self.IMAGEFOLDER
        print "[FULL BACKUP] UBINIZE = >%s<" % self.UBINIZE_ARGS
        print "[FULL BACKUP] MKUBIFS = >%s<" % self.MKUBIFS_ARGS
        print "[FULL BACKUP] MTDKERNEL = >%s<" % self.MTDKERNEL
        print "[FULL BACKUP] ROOTFSTYPE = >%s<" % self.ROOTFSTYPE

        self["key_green"] = Button("USB")
        self["key_red"] = Button("HDD")
        self["key_blue"] = Button(_("Exit"))
        self["key_yellow"] = Button("")
        self["info-usb"] = Label(
            _("USB = Do you want to make a back-up on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB."
              ))
        self["info-hdd"] = Label(
            _("HDD = Do you want to make an USB-back-up image on HDD? \nThis only takes 2 or 10 minutes and is fully automatic."
              ))
        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "blue": self.quit,
                "yellow": self.yellow,
                "green": self.green,
                "red": self.red,
                "cancel": self.quit,
            }, -2)
Пример #11
0
    def imageInstall(self):
        if self.check_free_space():
            pluginpath = '/usr/lib/enigma2/python/Plugins/Extensions/NFR4XBoot'
            myerror = ''
            source = self.source.value.replace(' ', '')
            target = self.target.value.replace(' ', '')
            for fn in os.listdir('/media/nfr4xboot/NFR4XBootI'):
                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: /media/nfr4xboot/NFR4XBootUpload 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) > 35:
                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 '\n\n"
                message += _('NFR4XBoot will install the new image.\n\n')
                message += _('Please: DO NOT reboot your STB and turn off the power.\n\n')
                message += _('The new image will be installed and auto booted in few minutes.\n\n')
                message += "'"
                if fileExists(pluginpath + '/ex_init.py'):
                    cmd1 = 'python ' + pluginpath + '/ex_init.py'
                else:
                    cmd1 = 'python ' + pluginpath + '/ex_init.pyo'
                cmd = '%s %s %s %s %s %s %s %s' % (cmd1,
                 source,
                 target.replace(' ', '.'),
                 str(self.sett.value),
                 str(self.bootquest.value),
                 str(self.zipdelete.value),
                 getImageFolder(),
                 getMachineRootFile())
                print '[NFR4X-BOOT]: ', cmd
                self.session.open(Console, _('NFR4XBoot: Install new image'), [message, cmd])
Пример #12
0
	def __init__(self, session, args = 0):
		Screen.__init__(self, session)
		self.session = session
		self.MODEL = getBoxType()
		self.OEM = getBrandOEM()
		self.MACHINEBUILD = getMachineBuild()
		self.MACHINENAME = getMachineName()
		self.MACHINEBRAND = getMachineBrand()
		self.IMAGEFOLDER = getImageFolder()
		self.UBINIZE_ARGS = getMachineUBINIZE()
		self.MKUBIFS_ARGS = getMachineMKUBIFS()
		self.MTDKERNEL = getMachineMtdKernel()
		self.ROOTFSBIN = getMachineRootFile()
		self.KERNELBIN = getMachineKernelFile()
		self.ROOTFSTYPE = getImageFileSystem()
		print "[ImageBackup] BOX MACHINEBUILD = >%s<" %self.MACHINEBUILD
		print "[ImageBackup] BOX MACHINENAME = >%s<" %self.MACHINENAME
		print "[ImageBackup] BOX MACHINEBRAND = >%s<" %self.MACHINEBRAND
		print "[ImageBackup] BOX MODEL = >%s<" %self.MODEL
		print "[ImageBackup] OEM MODEL = >%s<" %self.OEM
		print "[ImageBackup] IMAGEFOLDER = >%s<" %self.IMAGEFOLDER
		print "[ImageBackup] UBINIZE = >%s<" %self.UBINIZE_ARGS
		print "[ImageBackup] MKUBIFS = >%s<" %self.MKUBIFS_ARGS
		print "[ImageBackup] MTDKERNEL = >%s<" %self.MTDKERNEL
		print "[ImageBackup] ROOTFSTYPE = >%s<" %self.ROOTFSTYPE

		self["key_green"] = Button("USB")
		self["key_red"] = Button("HDD")
		self["key_blue"] = Button(_("Exit"))
		self["key_yellow"] = Button("")
		self["info-usb"] = Label(_("USB = Do you want to create a fullbackup on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB."))
		self["info-hdd"] = Label(_("HDD = Do you want to create a fullbackup on HDD? \nThis only takes 2 or 10 minutes and is fully automatic."))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"blue": self.quit,
			"yellow": self.yellow,
			"green": self.green,
			"red": self.red,
			"cancel": self.quit,
		}, -2)
Пример #13
0
print 'getMachineMtdKernel=%s<' % boxbranding.getMachineMtdKernel()
print 'getMachineKernelFile=%s<' % boxbranding.getMachineKernelFile()
print 'getMachineMtdRoot=%s<' % boxbranding.getMachineMtdRoot()
print 'getMachineRootFile=%s<' % boxbranding.getMachineRootFile()
print 'getMachineMKUBIFS=%s<' % boxbranding.getMachineMKUBIFS()
print 'getMachineUBINIZE=%s<' % boxbranding.getMachineUBINIZE()
print 'getBoxType=%s<' % boxbranding.getBoxType()
print 'getBrandOEM=%s<' % boxbranding.getBrandOEM()
print 'getOEVersion=%s<' % boxbranding.getOEVersion()
print 'getDriverDate=%s<' % boxbranding.getDriverDate()
print 'getImageVersion=%s<' % boxbranding.getImageVersion()
print 'getImageBuild=%s<' % boxbranding.getImageBuild()
print 'getImageDevBuild=%s<' % boxbranding.getImageDevBuild()
print 'getImageType=%s<' % boxbranding.getImageType()
print 'getImageDistro=%s<' % boxbranding.getImageDistro()
print 'getImageFolder=%s<' % boxbranding.getImageFolder()
print 'getImageFileSystem=%s<' % boxbranding.getImageFileSystem()
print 'getImageDevBuild=%s<' % boxbranding.getImageDevBuild()
print 'getImageType=%s<' % boxbranding.getImageType()
print 'getMachineMake=%s<' % boxbranding.getMachineMake()
print 'getImageArch=%s<' % boxbranding.getImageArch()
print 'getFeedsUrl=%s<' % boxbranding.getFeedsUrl()
print 'getDisplayType=%s<' % boxbranding.getDisplayType()
print 'getHaveHDMI=%s<' % boxbranding.getHaveHDMI()
print 'getHaveYUV=%s<' % boxbranding.getHaveYUV()
print 'getHaveRCA=%s<' % boxbranding.getHaveRCA()
print 'getHaveAVJACK=%s<' % boxbranding.getHaveAVJACK()
print 'getHaveSCART=%s<' % boxbranding.getHaveSCART()
print 'getHaveSCARTYUV=%s<' % boxbranding.getHaveSCARTYUV()
print 'getHaveDVI=%s<' % boxbranding.getHaveDVI()
print 'getHaveMiniTV=%s<' % boxbranding.getHaveMiniTV()
Пример #14
0
    def doFullBackup(self, answer):
        if answer is not None:
            if answer[1]:
                self.RECOVERY = answer[3]
                self.DIRECTORY = "%s/fullbackup" % answer[2]
                if not os.path.exists(self.DIRECTORY):
                    try:
                        os.makedirs(self.DIRECTORY)
                    except:
                        self.session.open(MessageBox,
                                          _("Can't create backup directory"),
                                          MessageBox.TYPE_ERROR,
                                          timeout=10)
                        return
                self.SLOT = answer[1]
                self.MODEL = GetBoxName()
                self.OEM = getBrandOEM()
                self.MACHINEBUILD = getMachineBuild()
                self.MACHINENAME = getMachineName()
                self.MACHINEBRAND = getMachineBrand()
                self.IMAGEFOLDER = getImageFolder()
                self.UBINIZE_ARGS = getMachineUBINIZE()
                self.MKUBIFS_ARGS = getMachineMKUBIFS()
                self.ROOTFSSUBDIR = "none"
                self.ROOTFSBIN = getMachineRootFile()
                self.KERNELBIN = getMachineKernelFile()
                self.ROOTFSTYPE = getImageFileSystem().strip()
                self.IMAGEDISTRO = getImageDistro()
                self.DISTROVERSION = getImageVersion()

                if SystemInfo["canRecovery"]:
                    self.EMMCIMG = SystemInfo["canRecovery"][0]
                    self.MTDBOOT = SystemInfo["canRecovery"][1]
                else:
                    self.EMMCIMG = "none"
                    self.MTDBOOT = "none"

                self.getImageList = self.saveImageList
                if SystemInfo["canMultiBoot"]:
                    self.MTDKERNEL = SystemInfo["canMultiBoot"][
                        self.SLOT]["kernel"].split('/')[2]
                    self.MTDROOTFS = SystemInfo["canMultiBoot"][
                        self.SLOT]["device"].split('/')[2]
                    if 'rootsubdir' in SystemInfo["canMultiBoot"][self.SLOT]:
                        self.ROOTFSSUBDIR = SystemInfo["canMultiBoot"][
                            self.SLOT]['rootsubdir']
                else:
                    self.MTDKERNEL = getMachineMtdKernel()
                    self.MTDROOTFS = getMachineMtdRoot()

                print "[Image Backup] BOX MACHINEBUILD = >%s<" % self.MACHINEBUILD
                print "[Image Backup] BOX MACHINENAME = >%s<" % self.MACHINENAME
                print "[Image Backup] BOX MACHINEBRAND = >%s<" % self.MACHINEBRAND
                print "[Image Backup] BOX MODEL = >%s<" % self.MODEL
                print "[Image Backup] OEM MODEL = >%s<" % self.OEM
                print "[Image Backup] IMAGEFOLDER = >%s<" % self.IMAGEFOLDER
                print "[Image Backup] UBINIZE = >%s<" % self.UBINIZE_ARGS
                print "[Image Backup] MKUBIFS = >%s<" % self.MKUBIFS_ARGS
                print "[Image Backup] MTDBOOT = >%s<" % self.MTDBOOT
                print "[Image Backup] MTDKERNEL = >%s<" % self.MTDKERNEL
                print "[Image Backup] MTDROOTFS = >%s<" % self.MTDROOTFS
                print "[Image Backup] ROOTFSBIN = >%s<" % self.ROOTFSBIN
                print "[Image Backup] KERNELBIN = >%s<" % self.KERNELBIN
                print "[Image Backup] ROOTFSSUBDIR = >%s<" % self.ROOTFSSUBDIR
                print "[Image Backup] ROOTFSTYPE = >%s<" % self.ROOTFSTYPE
                print "[Image Backup] EMMCIMG = >%s<" % self.EMMCIMG
                print "[Image Backup] IMAGEDISTRO = >%s<" % self.IMAGEDISTRO
                print "[Image Backup] DISTROVERSION = >%s<" % self.DISTROVERSION
                print "[Image Backup] MTDBOOT = >%s<" % self.MTDBOOT
                print "[Image Backup] USB RECOVERY = >%s< " % self.RECOVERY
                print "[Image Backup] DESTINATION = >%s< " % self.DIRECTORY
                print "[Image Backup] SLOT = >%s< " % self.SLOT

                self.TITLE = _("Full back-up on %s") % (self.DIRECTORY)
                self.START = time()
                self.DATE = strftime("%Y%m%d_%H%M", localtime(self.START))
                self.IMAGEVERSION = self.imageInfo()
                self.MKFS_UBI = "/usr/sbin/mkfs.ubifs"
                self.MKFS_TAR = "/bin/tar"
                self.BZIP2 = "/usr/bin/bzip2"
                self.MKFS_JFFS2 = "/usr/sbin/mkfs.jffs2"
                self.UBINIZE = "/usr/sbin/ubinize"
                self.NANDDUMP = "/usr/sbin/nanddump"
                self.FASTBOOT = "/usr/bin/ext2simg"
                self.WORKDIR = "%s/bi" % self.DIRECTORY

                self.SHOWNAME = "%s %s" % (self.MACHINEBRAND, self.MODEL)
                self.MAINDEST = "%s/build_%s/%s" % (self.DIRECTORY, self.MODEL,
                                                    self.IMAGEFOLDER)
                self.MAINDESTROOT = "%s/build_%s" % (self.DIRECTORY,
                                                     self.MODEL)

                self.message = "echo -e '\n"
                if getMachineBrand().startswith('A') or getMachineBrand(
                ).startswith('E') or getMachineBrand().startswith(
                        'I') or getMachineBrand().startswith(
                            'O') or getMachineBrand().startswith(
                                'U') or getMachineBrand().startswith('Xt'):
                    self.message += (_('Back-up Tool for an %s\n') %
                                     self.SHOWNAME).upper()
                else:
                    self.message += (_('Back-up Tool for a %s\n') %
                                     self.SHOWNAME).upper()
                self.message += VERSION + '\n'
                self.message += "_________________________________________________\n\n"
                self.message += _(
                    "Please be patient, a backup will now be made,\n")
                self.message += _(
                    "because of the used filesystem the back-up\n")
                if self.RECOVERY:
                    self.message += _(
                        "will take about 30 minutes for this system\n")
                else:
                    self.message += _(
                        "will take about 1-15 minutes for this system\n")
                self.message += "_________________________________________________\n"
                self.message += "'"

                ## PREPARING THE BUILDING ENVIRONMENT
                os.system("rm -rf %s" % self.WORKDIR)
                self.backuproot = "/tmp/bi/root"
                if SystemInfo["canMultiBoot"]:
                    if 'rootsubdir' in SystemInfo["canMultiBoot"][self.SLOT]:
                        self.backuproot = "/tmp/bi/RootSubdir/"
                if not os.path.exists(self.WORKDIR):
                    os.makedirs(self.WORKDIR)
                if not os.path.exists(self.backuproot):
                    os.makedirs(self.backuproot)
                os.system("sync")
                if SystemInfo["canMultiBoot"]:
                    if 'rootsubdir' in SystemInfo["canMultiBoot"][self.SLOT]:
                        os.system("mount /dev/%s /tmp/bi/RootSubdir" %
                                  self.MTDROOTFS)
                        self.backuproot = self.backuproot + self.ROOTFSSUBDIR
                    else:
                        os.system("mount /dev/%s %s" %
                                  (self.MTDROOTFS, self.backuproot))
                else:
                    os.system("mount --bind / %s" % (self.backuproot))

                if "jffs2" in self.ROOTFSTYPE.split():
                    cmd1 = "%s --root=%s --faketime --output=%s/root.jffs2 %s" % (
                        self.MKFS_JFFS2, self.backuproot, self.WORKDIR,
                        self.MKUBIFS_ARGS)
                    cmd2 = None
                    cmd3 = None
                elif "ubi" in self.ROOTFSTYPE.split():
                    f = open("%s/ubinize.cfg" % self.WORKDIR, "w")
                    f.write("[ubifs]\n")
                    f.write("mode=ubi\n")
                    f.write("image=%s/root.ubi\n" % self.WORKDIR)
                    f.write("vol_id=0\n")
                    f.write("vol_type=dynamic\n")
                    f.write("vol_name=rootfs\n")
                    f.write("vol_flags=autoresize\n")
                    f.close()
                    ff = open("%s/root.ubi" % self.WORKDIR, "w")
                    ff.close()
                    cmd1 = "%s -r %s -o %s/root.ubi %s" % (
                        self.MKFS_UBI, self.backuproot, self.WORKDIR,
                        self.MKUBIFS_ARGS)
                    cmd2 = "%s -o %s/root.ubifs %s %s/ubinize.cfg" % (
                        self.UBINIZE, self.WORKDIR, self.UBINIZE_ARGS,
                        self.WORKDIR)
                    cmd3 = "mv %s/root.ubifs %s/root.%s" % (
                        self.WORKDIR, self.WORKDIR, self.ROOTFSTYPE)
                else:
                    if self.EMMCIMG == "usb_update.bin" and self.RECOVERY:
                        cmd1 = None
                        cmd2 = None
                    else:
                        cmd1 = "%s -cf %s/rootfs.tar -C %s --exclude ./var/nmbd --exclude ./.resizerootfs --exclude ./.resize-rootfs --exclude ./.resize-linuxrootfs --exclude ./.resize-userdata --exclude ./var/lib/samba/private/msg.sock --exclude ./var/lib/samba/msg.sock/* --exclude ./run/avahi-daemon/socket ." % (
                            self.MKFS_TAR, self.WORKDIR, self.backuproot)
                        cmd2 = "%s %s/rootfs.tar" % (self.BZIP2, self.WORKDIR)
                    cmd3 = None

                cmdlist = []
                cmdlist.append(self.message)
                if cmd1:
                    cmdlist.append('echo "' + _("Create:") +
                                   ' %s"' % self.ROOTFSBIN)
                    cmdlist.append(cmd1)
                if cmd2:
                    cmdlist.append(cmd2)
                if cmd3:
                    cmdlist.append(cmd3)

                if self.EMMCIMG == "usb_update.bin" and self.RECOVERY:
                    SEEK_CONT = (Harddisk.getFolderSize(self.backuproot) /
                                 1024) + 100000

                    cmdlist.append('echo "' + _("Create:") + " fastboot dump" +
                                   '"')
                    cmdlist.append(
                        'cp -f /usr/share/fastboot.bin %s/fastboot.bin' %
                        (self.WORKDIR))
                    #cmdlist.append("dd if=/dev/mmcblk0p1 of=%s/fastboot.bin" % self.WORKDIR)

                    cmdlist.append('echo "' + _("Create:") + " bootargs dump" +
                                   '"')
                    cmdlist.append(
                        'cp -f /usr/share/bootargs.bin %s/bootargs.bin' %
                        (self.WORKDIR))
                    #cmdlist.append("dd if=/dev/mmcblk0p2 of=%s/bootargs.bin" % self.WORKDIR)

                    cmdlist.append('echo "' + _("Create:") + " boot dump" +
                                   '"')
                    cmdlist.append("dd if=/dev/mmcblk0p3 of=%s/boot.img" %
                                   self.WORKDIR)

                    cmdlist.append('echo "' + _("Create:") +
                                   " baseparam dump" + '"')
                    #cmdlist.append('cp -f /usr/share/bootargs.bin %s/baseparam.img' %(self.WORKDIR))
                    cmdlist.append("dd if=/dev/mmcblk0p4 of=%s/baseparam.img" %
                                   self.WORKDIR)

                    cmdlist.append('echo "' + _("Create:") + " pq_param dump" +
                                   '"')
                    #cmdlist.append('cp -f /usr/share/bootargs.bin %s/pq_param.bin' %(self.WORKDIR))
                    cmdlist.append("dd if=/dev/mmcblk0p5 of=%s/pq_param.bin" %
                                   self.WORKDIR)

                    cmdlist.append('echo "' + _("Create:") + " logo dump" +
                                   '"')
                    cmdlist.append("dd if=/dev/mmcblk0p6 of=%s/logo.img" %
                                   self.WORKDIR)

                    cmdlist.append('echo "' + _("Create:") +
                                   " deviceinfo dump" + '"')
                    #cmdlist.append('cp -f /usr/share/bootargs.bin %s/deviceinfo.bin' %(self.WORKDIR))
                    cmdlist.append(
                        "dd if=/dev/mmcblk0p7 of=%s/deviceinfo.bin" %
                        self.WORKDIR)

                    cmdlist.append('echo "' + _("Create:") +
                                   " apploader dump" + '"')
                    cmdlist.append(
                        'cp -f /usr/share/apploader.bin %s/apploader.bin' %
                        (self.WORKDIR))
                    #cmdlist.append("dd if=/dev/mmcblk0p10 of=%s/apploader.bin" % self.WORKDIR)

                    cmdlist.append('echo "' + _("Create:") + " rootfs dump" +
                                   '"')
                    cmdlist.append(
                        "dd if=/dev/zero of=%s/rootfs.ext4 seek=%s count=60 bs=1024"
                        % (self.WORKDIR, SEEK_CONT))
                    cmdlist.append("mkfs.ext4 -F -i 4096 %s/rootfs.ext4" %
                                   (self.WORKDIR))
                    cmdlist.append("mkdir -p %s/userdata" % self.WORKDIR)
                    cmdlist.append("mount %s/rootfs.ext4 %s/userdata" %
                                   (self.WORKDIR, self.WORKDIR))
                    cmdlist.append("mkdir -p %s/userdata/linuxrootfs1" %
                                   self.WORKDIR)
                    cmdlist.append("mkdir -p %s/userdata/linuxrootfs2" %
                                   self.WORKDIR)
                    cmdlist.append("mkdir -p %s/userdata/linuxrootfs3" %
                                   self.WORKDIR)
                    cmdlist.append("mkdir -p %s/userdata/linuxrootfs4" %
                                   self.WORKDIR)
                    cmdlist.append("rsync -aAX %s/ %s/userdata/linuxrootfs1/" %
                                   (self.backuproot, self.WORKDIR))
                    cmdlist.append("umount %s/userdata" % (self.WORKDIR))

                cmdlist.append('echo "' + _("Create:") + " kerneldump" + '"')
                if SystemInfo["canMultiBoot"] or self.MTDKERNEL.startswith(
                        'mmcblk0'):
                    cmdlist.append(
                        "dd if=/dev/%s of=%s/%s" %
                        (self.MTDKERNEL, self.WORKDIR, self.KERNELBIN))
                else:
                    cmdlist.append("nanddump -a -f %s/vmlinux.gz /dev/%s" %
                                   (self.WORKDIR, self.MTDKERNEL))

                if self.EMMCIMG == "usb_update.bin" and self.RECOVERY:
                    cmdlist.append('echo "' +
                                   _("Create: Recovery Fullbackup %s") %
                                   (self.EMMCIMG) + '"')
                    f = open("%s/emmc_partitions.xml" % self.WORKDIR, "w")
                    f.write('<?xml version="1.0" encoding="GB2312" ?>\n')
                    f.write('<Partition_Info>\n')
                    f.write(
                        '<Part Sel="1" PartitionName="fastboot" FlashType="emmc" FileSystem="none" Start="0" Length="1M" SelectFile="fastboot.bin"/>\n'
                    )
                    f.write(
                        '<Part Sel="1" PartitionName="bootargs" FlashType="emmc" FileSystem="none" Start="1M" Length="1M" SelectFile="bootargs.bin"/>\n'
                    )
                    f.write(
                        '<Part Sel="1" PartitionName="bootoptions" FlashType="emmc" FileSystem="none" Start="2M" Length="1M" SelectFile="boot.img"/>\n'
                    )
                    f.write(
                        '<Part Sel="1" PartitionName="baseparam" FlashType="emmc" FileSystem="none" Start="3M" Length="3M" SelectFile="baseparam.img"/>\n'
                    )
                    f.write(
                        '<Part Sel="1" PartitionName="pqparam" FlashType="emmc" FileSystem="none" Start="6M" Length="4M" SelectFile="pq_param.bin"/>\n'
                    )
                    f.write(
                        '<Part Sel="1" PartitionName="logo" FlashType="emmc" FileSystem="none" Start="10M" Length="4M" SelectFile="logo.img"/>\n'
                    )
                    f.write(
                        '<Part Sel="1" PartitionName="deviceinfo" FlashType="emmc" FileSystem="none" Start="14M" Length="4M" SelectFile="deviceinfo.bin"/>\n'
                    )
                    f.write(
                        '<Part Sel="1" PartitionName="loader" FlashType="emmc" FileSystem="none" Start="26M" Length="32M" SelectFile="apploader.bin"/>\n'
                    )
                    f.write(
                        '<Part Sel="1" PartitionName="linuxkernel1" FlashType="emmc" FileSystem="none" Start="66M" Length="16M" SelectFile="kernel.bin"/>\n'
                    )
                    if self.MACHINENAME in ("sf8008m"):
                        f.write(
                            '<Part Sel="1" PartitionName="userdata" FlashType="emmc" FileSystem="ext3/4" Start="130M" Length="3580M" SelectFile="rootfs.ext4"/>\n'
                        )
                    else:
                        f.write(
                            '<Part Sel="1" PartitionName="userdata" FlashType="emmc" FileSystem="ext3/4" Start="130M" Length="7000M" SelectFile="rootfs.ext4"/>\n'
                        )
                    f.write('</Partition_Info>\n')
                    f.close()
                    cmdlist.append(
                        'mkupdate -s 00000003-00000001-01010101 -f %s/emmc_partitions.xml -d %s/%s'
                        % (self.WORKDIR, self.WORKDIR, self.EMMCIMG))

                self.session.open(Console,
                                  title=self.TITLE,
                                  cmdlist=cmdlist,
                                  finishedCallback=self.doFullBackupCB,
                                  closeOnSuccess=True)

            else:
                self.close()
        else:
            self.close()
Пример #15
0
def getInfo(session=None, need_fullinfo=False):
    # TODO: get webif versione somewhere!
    info = {}
    global STATICBOXINFO

    if not (STATICBOXINFO is None or need_fullinfo):
        return STATICBOXINFO

    info['brand'] = getBoxBrand()
    info['model'] = getBoxType()
    info['platform'] = boxbranding.getMachineBuild()

    try:
        info['procmodel'] = getBoxProc()
    except:  # noqa: E722
        info['procmodel'] = boxbranding.getMachineProcModel()

    try:
        info['procmodeltype'] = getBoxProcType()
    except:  # noqa: E722
        info['procmodeltype'] = None

    try:
        info['lcd'] = getLcd()
    except:  # noqa: E722
        info['lcd'] = 0

    try:
        info['grabpip'] = getGrabPip()
    except:  # noqa: E722
        info['grabpip'] = 0

    cpu = about.getCPUInfoString()
    info['chipset'] = cpu
    info['cpubrand'] = about.getCPUBrand()
    info['socfamily'] = boxbranding.getSoCFamily()
    info['cpuarch'] = about.getCPUArch()
    if config.OpenWebif.about_benchmark.value is True:
        info['cpubenchmark'] = about.getCPUBenchmark()
    else:
        info['cpubenchmark'] = _("Disabled in configuration")
    info['flashtype'] = about.getFlashType()

    memFree = 0
    for line in open("/proc/meminfo", 'r'):
        parts = line.split(':')
        key = parts[0].strip()
        if key == "MemTotal":
            info['mem1'] = parts[1].strip().replace("kB", _("kB"))
        elif key in ("MemFree", "Buffers", "Cached"):
            memFree += int(parts[1].strip().split(' ', 1)[0])
    info['mem2'] = "%s %s" % (memFree, _("kB"))
    info['mem3'] = _("%s free / %s total") % (info['mem2'], info['mem1'])

    info['uptime'] = about.getBoxUptime()

    info["webifver"] = OPENWEBIFVER
    info['imagedistro'] = boxbranding.getImageDistro()
    info['oever'] = boxbranding.getImageBuild()
    info['visionversion'] = boxbranding.getVisionVersion()
    info['visionrevision'] = boxbranding.getVisionRevision()
    info['visionmodule'] = about.getVisionModule()

    if fileExists("/etc/openvision/multiboot"):
        multibootflag = open("/etc/openvision/multiboot", "r").read().strip()
        if multibootflag == "1":
            info['multiboot'] = _("Yes")
        else:
            info['multiboot'] = _("No")
    else:
        info['multiboot'] = _("Yes")

    info['enigmaver'] = getEnigmaVersionString()
    info['driverdate'] = about.getDriverInstalledDate()
    info['kernelver'] = boxbranding.getKernelVersion()
    info['dvbapitype'] = about.getDVBAPI()
    info['gstreamerversion'] = about.getGStreamerVersionString(cpu)
    info['ffmpegversion'] = about.getFFmpegVersionString()
    info['pythonversion'] = about.getPythonVersionString()

    try:
        info['hwserial'] = getHWSerial()
    except:  # noqa: E722
        info['hwserial'] = None

    if (info['hwserial'] is None or info['hwserial'] == "unknown"):
        info['hwserial'] = about.getCPUSerial()

    try:
        info['boxrctype'] = getBoxRCType()
    except:  # noqa: E722
        info['boxrctype'] = None

    if (info['boxrctype'] is None or info['boxrctype'] == "unknown"):
        if fileExists("/usr/bin/remotecfg"):
            info['boxrctype'] = _("Amlogic remote")
        elif fileExists("/usr/sbin/lircd"):
            info['boxrctype'] = _("LIRC remote")

    info['ovrctype'] = boxbranding.getRCType()
    info['ovrcname'] = boxbranding.getRCName()
    info['ovrcidnum'] = boxbranding.getRCIDNum()

    info['transcoding'] = boxbranding.getHaveTranscoding()
    info['multitranscoding'] = boxbranding.getHaveMultiTranscoding()

    info['displaytype'] = boxbranding.getDisplayType()

    info['updatedatestring'] = about.getUpdateDateString()
    info['enigmadebuglvl'] = eGetEnigmaDebugLvl()

    info['imagearch'] = boxbranding.getImageArch()
    info['imagefolder'] = boxbranding.getImageFolder()
    info['imagefilesystem'] = boxbranding.getImageFileSystem()
    info['feedsurl'] = boxbranding.getFeedsUrl()
    info['developername'] = boxbranding.getDeveloperName()
    info['builddatestring'] = about.getBuildDateString()
    info['imagefpu'] = boxbranding.getImageFPU()
    info['havemultilib'] = boxbranding.getHaveMultiLib()

    try:
        info['fp_version'] = getFPVersion()
    except:  # noqa: E722
        info['fp_version'] = None

    info['tuners'] = []
    for i in list(range(0, nimmanager.getSlotCount())):
        print(
            "[OpenWebif] -D- tuner '%d' '%s' '%s'" %
            (i, nimmanager.getNimName(i), nimmanager.getNim(i).getSlotName()))
        info['tuners'].append({
            "name":
            nimmanager.getNim(i).getSlotName(),
            "type":
            nimmanager.getNimName(i) + " (" +
            nimmanager.getNim(i).getFriendlyType() + ")",
            "rec":
            "",
            "live":
            ""
        })

    info['ifaces'] = []
    ifaces = iNetwork.getConfiguredAdapters()
    for iface in ifaces:
        info['ifaces'].append({
            "name":
            iNetwork.getAdapterName(iface),
            "friendlynic":
            getFriendlyNICChipSet(iface),
            "linkspeed":
            getLinkSpeed(iface),
            "mac":
            iNetwork.getAdapterAttribute(iface, "mac"),
            "dhcp":
            iNetwork.getAdapterAttribute(iface, "dhcp"),
            "ipv4method":
            getIPv4Method(iface),
            "ip":
            formatIp(iNetwork.getAdapterAttribute(iface, "ip")),
            "mask":
            formatIp(iNetwork.getAdapterAttribute(iface, "netmask")),
            "v4prefix":
            sum([
                bin(int(x)).count('1') for x in formatIp(
                    iNetwork.getAdapterAttribute(iface, "netmask")).split('.')
            ]),
            "gw":
            formatIp(iNetwork.getAdapterAttribute(iface, "gateway")),
            "ipv6":
            getAdapterIPv6(iface)['addr'],
            "ipmethod":
            getIPMethod(iface),
            "firstpublic":
            getAdapterIPv6(iface)['firstpublic']
        })

    info['hdd'] = []
    for hdd in harddiskmanager.hdd:
        dev = hdd.findMount()
        if dev:
            stat = os.statvfs(dev)
            free = stat.f_bavail * stat.f_frsize / 1048576.
        else:
            free = -1

        if free <= 1024:
            free = "%i %s" % (free, _("MB"))
        else:
            free = free / 1024.
            free = "%.1f %s" % (free, _("GB"))

        size = hdd.diskSize() * 1000000 / 1048576.
        if size > 1048576:
            size = "%.1f %s" % ((size / 1048576.), _("TB"))
        elif size > 1024:
            size = "%.1f %s" % ((size / 1024.), _("GB"))
        else:
            size = "%d %s" % (size, _("MB"))

        iecsize = hdd.diskSize()
        # Harddisks > 1000 decimal Gigabytes are labelled in TB
        if iecsize > 1000000:
            iecsize = (iecsize + 50000) // float(100000) / 10
            # Omit decimal fraction if it is 0
            if (iecsize % 1 > 0):
                iecsize = "%.1f %s" % (iecsize, _("TB"))
            else:
                iecsize = "%d %s" % (iecsize, _("TB"))
        # Round harddisk sizes beyond ~300GB to full tens: 320, 500, 640, 750GB
        elif iecsize > 300000:
            iecsize = "%d %s" % (((iecsize + 5000) // 10000 * 10), _("GB"))
        # ... be more precise for media < ~300GB (Sticks, SSDs, CF, MMC, ...): 1, 2, 4, 8, 16 ... 256GB
        elif iecsize > 1000:
            iecsize = "%d %s" % (((iecsize + 500) // 1000), _("GB"))
        else:
            iecsize = "%d %s" % (iecsize, _("MB"))

        info['hdd'].append({
            "model":
            hdd.model(),
            "capacity":
            size,
            "labelled_capacity":
            iecsize,
            "free":
            free,
            "mount":
            dev,
            "friendlycapacity":
            _("%s free / %s total") % (free, size + ' ("' + iecsize + '")')
        })

    info['shares'] = []
    autofiles = ('/etc/auto.network', '/etc/auto.network_vti')
    for autofs in autofiles:
        if fileExists(autofs):
            method = "autofs"
            for line in open(autofs).readlines():
                if not line.startswith('#'):
                    # Replace escaped spaces that can appear inside credentials with underscores
                    # Not elegant but we wouldn't want to expose credentials on the OWIF anyways
                    tmpline = line.replace("\ ", "_")
                    tmp = tmpline.split()
                    if not len(tmp) == 3:
                        continue
                    name = tmp[0].strip()
                    type = "unknown"
                    if "cifs" in tmp[1]:
                        # Linux still defaults to SMBv1
                        type = "SMBv1.0"
                        settings = tmp[1].split(",")
                        for setting in settings:
                            if setting.startswith("vers="):
                                type = setting.replace("vers=", "SMBv")
                    elif "nfs" in tmp[1]:
                        type = "NFS"

                    # Default is r/w
                    mode = _("r/w")
                    settings = tmp[1].split(",")
                    for setting in settings:
                        if setting == "ro":
                            mode = _("r/o")

                    uri = tmp[2]
                    parts = []
                    parts = tmp[2].split(':')
                    if parts[0] == "":
                        server = uri.split('/')[2]
                        uri = uri.strip()[1:]
                    else:
                        server = parts[0]

                    ipaddress = None
                    if server:
                        # Will fail on literal IPs
                        try:
                            # Try IPv6 first, as will Linux
                            if has_ipv6:
                                tmpaddress = None
                                tmpaddress = getaddrinfo(server, 0, AF_INET6)
                                if tmpaddress:
                                    ipaddress = "[" + list(
                                        tmpaddress)[0][4][0] + "]"
                            # Use IPv4 if IPv6 fails or is not present
                            if ipaddress is None:
                                tmpaddress = None
                                tmpaddress = getaddrinfo(server, 0, AF_INET)
                                if tmpaddress:
                                    ipaddress = list(tmpaddress)[0][4][0]
                        except:  # noqa: E722
                            pass

                    friendlyaddress = server
                    if ipaddress is not None and not ipaddress == server:
                        friendlyaddress = server + " (" + ipaddress + ")"
                    info['shares'].append({
                        "name": name,
                        "method": method,
                        "type": type,
                        "mode": mode,
                        "path": uri,
                        "host": server,
                        "ipaddress": ipaddress,
                        "friendlyaddress": friendlyaddress
                    })
    # TODO: fstab

    info['EX'] = ''

    if session:
        try:
            #  gets all current stream clients for images using eStreamServer
            #  TODO: merge eStreamServer and streamList
            #  TODO: get tuner info for streams
            #  TODO: get recoding/timer info if more than one
            info['streams'] = []
            try:
                from enigma import eStreamServer
                streamServer = eStreamServer.getInstance()
                if streamServer is not None:
                    for x in streamServer.getConnectedClients():
                        servicename = ServiceReference(
                            x[1]).getServiceName() or "(unknown service)"
                        if int(x[2]) == 0:
                            strtype = "S"
                        else:
                            strtype = "T"
                        info['streams'].append({
                            "ref": x[1],
                            "name": servicename,
                            "ip": x[0],
                            "type": strtype
                        })
            except Exception as error:
                print("[OpenWebif] -D- no eStreamServer %s" % error)
            recs = NavigationInstance.instance.getRecordings()
            if recs:
                #  only one stream and only TV
                from Plugins.Extensions.OpenWebif.controllers.stream import streamList
                s_name = ''
                # s_cip = ''

                print("[OpenWebif] -D- streamList count '%d'" %
                      len(streamList))
                if len(streamList) == 1:
                    from Screens.ChannelSelection import service_types_tv
                    # from enigma import eEPGCache
                    # epgcache = eEPGCache.getInstance()
                    serviceHandler = eServiceCenter.getInstance()
                    services = serviceHandler.list(
                        eServiceReference('%s ORDER BY name' %
                                          (service_types_tv)))
                    channels = services and services.getContent("SN", True)
                    s = streamList[0]
                    srefs = s.ref.toString()
                    for channel in channels:
                        if srefs == channel[0]:
                            s_name = channel[1] + ' (' + s.clientIP + ')'
                            break
                print("[OpenWebif] -D- s_name '%s'" % s_name)

                # only for debug
                for stream in streamList:
                    srefs = stream.ref.toString()
                    print("[OpenWebif] -D- srefs '%s'" % srefs)

                sname = ''
                timers = []
                for timer in NavigationInstance.instance.RecordTimer.timer_list:
                    if timer.isRunning() and not timer.justplay:
                        timers.append(
                            removeBad(timer.service_ref.getServiceName()))
                        print("[OpenWebif] -D- timer '%s'" %
                              timer.service_ref.getServiceName())


# TODO: more than one recording
                if len(timers) == 1:
                    sname = timers[0]

                if sname == '' and s_name != '':
                    sname = s_name

                print("[OpenWebif] -D- recs count '%d'" % len(recs))

                for rec in recs:
                    feinfo = rec.frontendInfo()
                    frontendData = feinfo and feinfo.getAll(True)
                    if frontendData is not None:
                        cur_info = feinfo.getTransponderData(True)
                        if cur_info:
                            nr = frontendData['tuner_number']
                            info['tuners'][nr]['rec'] = getOrbitalText(
                                cur_info) + ' / ' + sname

            service = session.nav.getCurrentService()
            if service is not None:
                sname = service.info().getName()
                feinfo = service.frontendInfo()
                frontendData = feinfo and feinfo.getAll(True)
                if frontendData is not None:
                    cur_info = feinfo.getTransponderData(True)
                    if cur_info:
                        nr = frontendData['tuner_number']
                        info['tuners'][nr]['live'] = getOrbitalText(
                            cur_info) + ' / ' + sname
        except Exception as error:
            info['EX'] = error

    info['timerpipzap'] = False
    info['timerautoadjust'] = False

    try:
        timer = RecordTimerEntry('', 0, 0, '', '', 0)
        if hasattr(timer, "pipzap"):
            info['timerpipzap'] = True
        if hasattr(timer, "autoadjust"):
            info['timerautoadjust'] = True
    except Exception as error:
        print("[OpenWebif] -D- RecordTimerEntry check %s" % error)

    STATICBOXINFO = info
    return info
Пример #16
0
import boxbranding
print "getMachineBuild=%s" % boxbranding.getMachineBuild()
print "getMachineProcModel=%s" % boxbranding.getMachineProcModel()
print "getMachineBrand=%s" % boxbranding.getMachineBrand()
print "getMachineName=%s" % boxbranding.getMachineName()
print "getMachineMtdKernel=%s" % boxbranding.getMachineMtdKernel()
print "getMachineKernelFile=%s" % boxbranding.getMachineKernelFile()
print "getMachineMtdRoot=%s" % boxbranding.getMachineMtdRoot()
print "getMachineRootFile=%s" % boxbranding.getMachineRootFile()
print "getMachineMKUBIFS=%s" % boxbranding.getMachineMKUBIFS()
print "getMachineUBINIZE=%s" % boxbranding.getMachineUBINIZE()
print "getBoxType=%s" % boxbranding.getBoxType()
print "getBrandOEM=%s" % boxbranding.getBrandOEM()
print "getOEVersion=%s" % boxbranding.getOEVersion()
print "getDriverDate=%s" % boxbranding.getDriverDate()
print "getImageVersion=%s" % boxbranding.getImageVersion()
print "getImageBuild=%s" % boxbranding.getImageBuild()
print "getImageDistro=%s" % boxbranding.getImageDistro()
print "getImageFolder=%s" % boxbranding.getImageFolder()
print "getImageFileSystem=%s" % boxbranding.getImageFileSystem()
Пример #17
0
    def __init__(self, session, args=0):
        Screen.__init__(self, session)
        self.session = session
        self.selection = 0
        self.MODEL = getBoxType()
        self.OEM = getBrandOEM()
        self.MACHINEBUILD = getMachineBuild()
        self.MACHINENAME = getMachineName()
        self.MACHINEBRAND = getMachineBrand()
        self.IMAGEFOLDER = getImageFolder()
        self.UBINIZE_ARGS = getMachineUBINIZE()
        self.MKUBIFS_ARGS = getMachineMKUBIFS()
        self.MTDKERNEL = getMachineMtdKernel()
        self.MTDROOTFS = getMachineMtdRoot()
        self.ROOTFSBIN = getMachineRootFile()
        self.KERNELBIN = getMachineKernelFile()
        self.ROOTFSTYPE = getImageFileSystem().strip()

        if self.MACHINEBUILD in ("hd51", "vs1500", "h7", "8100s"):
            self.MTDBOOT = "mmcblk0p1"
            self.EMMCIMG = "disk.img"
        elif self.MACHINEBUILD in ("xc7439", "osmio4k"):
            self.MTDBOOT = "mmcblk1p1"
            self.EMMCIMG = "emmc.img"
        elif self.MACHINEBUILD in ("cc1", "sf8008", "sf8008s", "ustym4kpr"):
            self.MTDBOOT = "none"
            self.EMMCIMG = "usb_update.bin"
        else:
            self.MTDBOOT = "none"
            self.EMMCIMG = "none"

        print "[FULL BACKUP] BOX MACHINEBUILD = >%s<" % self.MACHINEBUILD
        print "[FULL BACKUP] BOX MACHINENAME = >%s<" % self.MACHINENAME
        print "[FULL BACKUP] BOX MACHINEBRAND = >%s<" % self.MACHINEBRAND
        print "[FULL BACKUP] BOX MODEL = >%s<" % self.MODEL
        print "[FULL BACKUP] OEM MODEL = >%s<" % self.OEM
        print "[FULL BACKUP] IMAGEFOLDER = >%s<" % self.IMAGEFOLDER
        print "[FULL BACKUP] UBINIZE = >%s<" % self.UBINIZE_ARGS
        print "[FULL BACKUP] MKUBIFS = >%s<" % self.MKUBIFS_ARGS
        print "[FULL BACKUP] MTDBOOT = >%s<" % self.MTDBOOT
        print "[FULL BACKUP] MTDKERNEL = >%s<" % self.MTDKERNEL
        print "[FULL BACKUP] MTDROOTFS = >%s<" % self.MTDROOTFS
        print "[FULL BACKUP] ROOTFSBIN = >%s<" % self.ROOTFSBIN
        print "[FULL BACKUP] KERNELBIN = >%s<" % self.KERNELBIN
        print "[FULL BACKUP] ROOTFSTYPE = >%s<" % self.ROOTFSTYPE
        print "[FULL BACKUP] EMMCIMG = >%s<" % self.EMMCIMG

        self.error_files = ''
        self.list = self.list_files("/boot")
        self["key_green"] = StaticText("USB")
        self["key_red"] = StaticText("HDD")
        self["key_blue"] = StaticText(_("Exit"))
        if SystemInfo["HaveMultiBoot"]:
            self["key_yellow"] = StaticText(_("STARTUP"))
            self["info-multi"] = Label(
                _("You can select with yellow the OnlineFlash Image\n or select Recovery to create a USB Disk Image for clean Install."
                  ))
            self.read_current_multiboot()
        else:
            self["key_yellow"] = StaticText("")
            self["info-multi"] = Label(" ")
        self["info-usb"] = Label(
            _("USB = Do you want to make a back-up on USB?\nThis will take between 3 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert a USB flash drive before you select USB."
              ))
        self["info-hdd"] = Label(
            _("HDD = Do you want to make a USB-back-up image on HDD? \nThis only takes 1 or 10 minutes and is fully automatic."
              ))
        self["actions"] = ActionMap(
            ["OkCancelActions", "ColorActions"], {
                "blue": self.quit,
                "yellow": self.yellow,
                "green": self.green,
                "red": self.red,
                "cancel": self.quit,
            }, -2)
        self.onShown.append(self.show_Errors)
Пример #18
0
import boxbranding
print "getMachineBuild=%s" %boxbranding.getMachineBuild()
print "getMachineProcModel=%s" %boxbranding.getMachineProcModel()
print "getMachineBrand=%s" %boxbranding.getMachineBrand()
print "getMachineName=%s" %boxbranding.getMachineName()
print "getMachineMtdKernel=%s" %boxbranding.getMachineMtdKernel()
print "getMachineKernelFile=%s" %boxbranding.getMachineKernelFile()
print "getMachineMtdRoot=%s" %boxbranding.getMachineMtdRoot()
print "getMachineRootFile=%s" %boxbranding.getMachineRootFile()
print "getMachineMKUBIFS=%s" %boxbranding.getMachineMKUBIFS()
print "getMachineUBINIZE=%s" %boxbranding.getMachineUBINIZE()
print "getBoxType=%s" %boxbranding.getBoxType()
print "getBrandOEM=%s" %boxbranding.getBrandOEM()
print "getOEVersion=%s" %boxbranding.getOEVersion()
print "getDriverDate=%s" %boxbranding.getDriverDate()
print "getImageVersion=%s" %boxbranding.getImageVersion()
print "getImageBuild=%s" %boxbranding.getImageBuild()
print "getImageDistro=%s" %boxbranding.getImageDistro()
print "getImageFolder=%s" %boxbranding.getImageFolder()
print "getImageFileSystem=%s" %boxbranding.getImageFileSystem()
from enigma import eTimer, getBoxType

import os
from os import path
import glob
import struct
from Components.Console import Console
from boxbranding import getBoxBrand, getImageDistro, getImageVersion, getImageFileSystem, getImageFolder, getMachineMtdKernel, getMachineKernelFile, getMachineMtdBoot, getMachineMtdRoot, getMachineRootFile, getMachineMKUBIFS, getMachineUBINIZE

OMB_GETBOXTYPE = getBoxType()
OMB_GETBRANDOEM = getBoxBrand()
OMB_GETIMAGEDISTRO = getImageDistro()
OMB_GETIMAGEVERSION = getImageVersion()
OMB_GETIMAGEFILESYSTEM = getImageFileSystem()  # needed
OMB_GETIMAGEFOLDER = getImageFolder()  # needed
OMB_GETMACHINEMTDKERNEL = getMachineMtdKernel()
OMB_GETMACHINEKERNELFILE = getMachineKernelFile()  # needed
OMB_GETMACHINEMTDBOOT = getMachineMtdBoot()
OMB_GETMACHINEMTDROOT = getMachineMtdRoot()
OMB_GETMACHINEROOTFILE = getMachineRootFile()  # needed
OMB_GETMACHINEMKUBIFS = getMachineMKUBIFS()
OMB_GETMACHINEUBINIZE = getMachineUBINIZE()


class OMBManagerInstall(Screen):
    skin = """
			<screen position="360,150" size="560,400">
				<widget name="info"
						position="10,10"
						size="540,50"
Пример #20
0
	def __init__(self, session, args = 0):
		Screen.__init__(self, session)
		self.session = session
		self.selection = 0
		self.MODEL = getBoxType()
		self.OEM = getBrandOEM()
		self.MACHINEBUILD = getMachineBuild()
		self.MACHINENAME = getMachineName()
		self.MACHINEBRAND = getMachineBrand()
		self.IMAGEFOLDER = getImageFolder()
		self.HDFIMAGEVERSION = getImageVersion()
		self.HDFIMAGEBUILD = getImageBuild()
		self.HDFIMAGENAME = getImageDistro()
		self.UBINIZE_ARGS = getMachineUBINIZE()
		self.MKUBIFS_ARGS = getMachineMKUBIFS()
		self.MTDKERNEL = getMachineMtdKernel()
		self.MTDROOTFS = getMachineMtdRoot()
		self.ROOTFSBIN = getMachineRootFile()
		self.KERNELBIN = getMachineKernelFile()
		self.ROOTFSTYPE = getImageFileSystem().strip()

		if self.MACHINEBUILD in ("hd51","vs1500","h7","8100s"):
			self.MTDBOOT = "mmcblk0p1"
			self.EMMCIMG = "disk.img"
		elif self.MACHINEBUILD in ("xc7439","osmio4k"):
			self.MTDBOOT = "mmcblk1p1"
			self.EMMCIMG = "emmc.img"
		elif self.MACHINEBUILD in ("cc1","sf8008","ustym4kpr"):
			self.MTDBOOT = "none"
			self.EMMCIMG = "usb_update.bin"
		else:
			self.MTDBOOT = "none"
			self.EMMCIMG = "none"

		print "[FULL BACKUP] BOX MACHINEBUILD = >%s<" %self.MACHINEBUILD
		print "[FULL BACKUP] BOX MACHINENAME = >%s<" %self.MACHINENAME
		print "[FULL BACKUP] BOX MACHINEBRAND = >%s<" %self.MACHINEBRAND
		print "[FULL BACKUP] BOX MODEL = >%s<" %self.MODEL
		print "[FULL BACKUP] OEM MODEL = >%s<" %self.OEM
		print "[FULL BACKUP] IMAGEFOLDER = >%s<" %self.IMAGEFOLDER
		print "[FULL BACKUP] UBINIZE = >%s<" %self.UBINIZE_ARGS
		print "[FULL BACKUP] MKUBIFS = >%s<" %self.MKUBIFS_ARGS
		print "[FULL BACKUP] MTDBOOT = >%s<" %self.MTDBOOT
		print "[FULL BACKUP] MTDKERNEL = >%s<" %self.MTDKERNEL
		print "[FULL BACKUP] MTDROOTFS = >%s<" %self.MTDROOTFS
		print "[FULL BACKUP] ROOTFSBIN = >%s<" %self.ROOTFSBIN
		print "[FULL BACKUP] KERNELBIN = >%s<" %self.KERNELBIN
		print "[FULL BACKUP] ROOTFSTYPE = >%s<" %self.ROOTFSTYPE
		print "[FULL BACKUP] EMMCIMG = >%s<" %self.EMMCIMG
		if isDreamboxXZ:
			self.IMAGEFOLDER = self.MODEL
# fix me to xz
			self.ROOTFSTYPE = "tar.gz"
			self.ROOTFSBIN = "root.tar.gz"

		self.error_files = ''
		self.list = self.list_files("/boot")
		self["key_green"] = Button("USB")
		self["key_red"] = Button("HDD")
		self["key_blue"] = Button(_("Exit"))
		if SystemInfo["HaveMultiBoot"]:
			self["key_yellow"] = Button(_("Select Multiboot"))
			self["info-multi"] = Label(_("You can select with yellow the OnlineFlash Image\n or select Recovery to create a USB Disk Image for clean Install."))
			self.read_current_multiboot()
		else:
			self["key_yellow"] = Button("")
			self["info-multi"] = Label(" ")
		self["info-usb"] = Label(_("USB = Do you want to make a back-up on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB."))
		self["info-hdd"] = Label(_("HDD = Do you want to make an USB-back-up image on HDD? \nThis only takes 2 or 10 minutes and is fully automatic."))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"blue": self.quit,
			"yellow": self.yellow,
			"green": self.green,
			"red": self.red,
			"cancel": self.quit,
		}, -2)
		self.onShown.append(self.show_Errors)
Пример #21
0
	def __init__(self, session):
		Screen.__init__(self, session)
		self.setTitle(_("Open Vision information"))

		OpenVisionInformationText = _("Open Vision information") + "\n"

		OpenVisionInformationText += "\n"

		if config.misc.OVupdatecheck.value is True:
			try:
				if boxbranding.getVisionVersion().startswith("10"):
					ovurl = "https://raw.githubusercontent.com/OpenVisionE2/openvision-development-platform/python3/meta-openvision/conf/distro/revision.conf"
				else:
					ovurl = "https://raw.githubusercontent.com/OpenVisionE2/openvision-oe/develop/meta-openvision/conf/distro/revision.conf"
				ovresponse = urllib.request.urlopen(ovurl)
				ovrevision = ovresponse.read().decode()
				ovrevisionupdate = ovrevision.split('r')[1][:3]
			except Exception as e:
				ovrevisionupdate = _("Requires internet connection")
		else:
			ovrevisionupdate = _("Disabled in configuration")

		if fileExists("/etc/openvision/visionversion"):
			visionversion = open("/etc/openvision/visionversion", "r").read().strip()
			OpenVisionInformationText += _("Open Vision version: ") + visionversion + "\n"
		else:
			OpenVisionInformationText += _("Open Vision version: ") + boxbranding.getVisionVersion() + "\n"

		if fileExists("/etc/openvision/visionrevision"):
			visionrevision = open("/etc/openvision/visionrevision", "r").read().strip()
			OpenVisionInformationText += _("Open Vision revision: ") + visionrevision + " " + _("(Latest revision on github: ") + str(ovrevisionupdate) + ")" + "\n"
		else:
			OpenVisionInformationText += _("Open Vision revision: ") + boxbranding.getVisionRevision() + " " + _("(Latest revision on github: ") + str(ovrevisionupdate) + ")" + "\n"

		if fileExists("/etc/openvision/visionlanguage"):
			visionlanguage = open("/etc/openvision/visionlanguage", "r").read().strip()
			OpenVisionInformationText += _("Open Vision language: ") + visionlanguage + "\n"

		OpenVisionInformationText += _("Open Vision module: ") + about.getVisionModule() + "\n"
		OpenVisionInformationText += _("Flash type: ") + about.getFlashType() + "\n"

		OpenVisionInformationText += "\n"

		boxrctype = getBoxRCType()
		if boxrctype is not None and boxrctype != "unknown":
			OpenVisionInformationText += _("Factory RC type: ") + boxrctype + "\n"
		if boxrctype is not None and boxrctype == "unknown":
			if fileExists("/usr/bin/remotecfg"):
				OpenVisionInformationText += _("RC type: ") + _("Amlogic remote") + "\n"
			elif fileExists("/usr/sbin/lircd"):
				OpenVisionInformationText += _("RC type: ") + _("LIRC remote") + "\n"

		OpenVisionInformationText += _("Open Vision RC type: ") + boxbranding.getRCType() + "\n"
		OpenVisionInformationText += _("Open Vision RC name: ") + boxbranding.getRCName() + "\n"
		OpenVisionInformationText += _("Open Vision RC ID number: ") + boxbranding.getRCIDNum() + "\n"

		OpenVisionInformationText += "\n"

		if SystemInfo["HiSilicon"]:
			OpenVisionInformationText += _("HiSilicon dedicated information") + "\n"

			grab = os.popen("opkg list-installed | grep -- -grab | cut -f4 -d'-'").read().strip()
			if grab != "" and grab != "r0":
				OpenVisionInformationText += _("Grab: ") + grab + "\n"

			hihalt = os.popen("opkg list-installed | grep -- -hihalt | cut -f4 -d'-'").read().strip()
			if hihalt != "":
				OpenVisionInformationText += _("Halt: ") + hihalt + "\n"

			libs = os.popen("opkg list-installed | grep -- -libs | cut -f4 -d'-'").read().strip()
			if libs != "":
				OpenVisionInformationText += _("Libs: ") + libs + "\n"

			partitions = os.popen("opkg list-installed | grep -- -partitions | cut -f4 -d'-'").read().strip()
			if partitions != "":
				OpenVisionInformationText += _("Partitions: ") + partitions + "\n"

			reader = os.popen("opkg list-installed | grep -- -reader | cut -f4 -d'-'").read().strip()
			if reader != "":
				OpenVisionInformationText += _("Reader: ") + reader + "\n"

			showiframe = os.popen("opkg list-installed | grep -- -showiframe | cut -f4 -d'-'").read().strip()
			if showiframe != "":
				OpenVisionInformationText += _("Showiframe: ") + showiframe + "\n"

			OpenVisionInformationText += "\n"

		OpenVisionInformationText += _("Image architecture: ") + boxbranding.getImageArch() + "\n"
		if boxbranding.getImageFolder() != "":
			OpenVisionInformationText += _("Image folder: ") + boxbranding.getImageFolder() + "\n"
		if boxbranding.getImageFileSystem() != "":
			OpenVisionInformationText += _("Image file system: ") + boxbranding.getImageFileSystem() + "\n"
		OpenVisionInformationText += _("Image: ") + boxbranding.getImageDistro() + "\n"
		OpenVisionInformationText += _("Feed URL: ") + boxbranding.getFeedsUrl() + "\n"

		OpenVisionInformationText += _("Compiled by: ") + boxbranding.getDeveloperName() + "\n"
		OpenVisionInformationText += _("Build date: ") + about.getBuildDateString() + "\n"

		OpenVisionInformationText += _("OE: ") + boxbranding.getImageBuild() + "\n"

		OpenVisionInformationText += "\n"

		if boxbranding.getImageFPU() != "":
			OpenVisionInformationText += _("FPU: ") + boxbranding.getImageFPU() + "\n"

		if boxbranding.getImageArch() == "aarch64":
			if boxbranding.getHaveMultiLib() == "True":
				OpenVisionInformationText += _("MultiLib: ") + _("Yes") + "\n"
			else:
				OpenVisionInformationText += _("MultiLib: ") + _("No") + "\n"

		OpenVisionInformationText += "\n"

		if boxbranding.getMachineMtdBoot() != "":
			OpenVisionInformationText += _("MTD boot: ") + boxbranding.getMachineMtdBoot() + "\n"
		if boxbranding.getMachineMtdRoot() != "":
			OpenVisionInformationText += _("MTD root: ") + boxbranding.getMachineMtdRoot() + "\n"
		if boxbranding.getMachineMtdKernel() != "":
			OpenVisionInformationText += _("MTD kernel: ") + boxbranding.getMachineMtdKernel() + "\n"

		if boxbranding.getMachineRootFile() != "":
			OpenVisionInformationText += _("Root file: ") + boxbranding.getMachineRootFile() + "\n"
		if boxbranding.getMachineKernelFile() != "":
			OpenVisionInformationText += _("Kernel file: ") + boxbranding.getMachineKernelFile() + "\n"

		if boxbranding.getMachineMKUBIFS() != "":
			OpenVisionInformationText += _("MKUBIFS: ") + boxbranding.getMachineMKUBIFS() + "\n"
		if boxbranding.getMachineUBINIZE() != "":
			OpenVisionInformationText += _("UBINIZE: ") + boxbranding.getMachineUBINIZE() + "\n"

		OpenVisionInformationText += "\n"

		if fileExists("/proc/device-tree/amlogic-dt-id"):
			devicetid = open("/proc/device-tree/amlogic-dt-id", "r").read().strip()
			OpenVisionInformationText += _("Device id: ") + devicetid + "\n"

		if fileExists("/proc/device-tree/le-dt-id"):
			giventid = open("/proc/device-tree/le-dt-id", "r").read().strip()
			OpenVisionInformationText += _("Given device id: ") + giventid + "\n"

		self["AboutScrollLabel"] = ScrollLabel(OpenVisionInformationText)
		self["key_red"] = Button(_("Close"))

		self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
			{
				"cancel": self.close,
				"ok": self.close,
				"up": self["AboutScrollLabel"].pageUp,
				"down": self["AboutScrollLabel"].pageDown
			})
Пример #22
0
print("getMachineBrand=%s<" %boxbranding.getMachineBrand())
print("getMachineName=%s<" %boxbranding.getMachineName())
print("getMachineMtdKernel=%s<" %boxbranding.getMachineMtdKernel())
print("getMachineKernelFile=%s<" %boxbranding.getMachineKernelFile())
print("getMachineMtdRoot=%s<" %boxbranding.getMachineMtdRoot())
print("getMachineRootFile=%s<" %boxbranding.getMachineRootFile())
print("getMachineMKUBIFS=%s<" %boxbranding.getMachineMKUBIFS())
print("getMachineUBINIZE=%s<" %boxbranding.getMachineUBINIZE())
print("getBoxType=%s<" %boxbranding.getBoxType())
print("getBrandOEM=%s<" %boxbranding.getBrandOEM())
print("getOEVersion=%s<" %boxbranding.getOEVersion())
print("getDriverDate=%s<" %boxbranding.getDriverDate())
print("getImageVersion=%s<" %boxbranding.getImageVersion())
print("getImageBuild=%s<" %boxbranding.getImageBuild())
print("getImageDistro=%s<" %boxbranding.getImageDistro())
print("getImageFolder=%s<" %boxbranding.getImageFolder())
print("getImageFileSystem=%s<" %boxbranding.getImageFileSystem())
print("getImageDevBuild=%s<" %boxbranding.getImageDevBuild())
print("getImageType=%s<" %boxbranding.getImageType())
print("getMachineMake=%s<" %boxbranding.getMachineMake())
print("getImageArch=%s<" %boxbranding.getImageArch())
print("getFeedsUrl=%s<" %boxbranding.getFeedsUrl())
print("getDisplayType=%s<" %boxbranding.getDisplayType())
print("getHaveHDMI%s<" %boxbranding.getHaveHDMI())
print("getHaveYUV%s<" %boxbranding.getHaveYUV())
print("getHaveRCA%s<" %boxbranding.getHaveRCA())
print("getHaveAVJACK%s<" %boxbranding.getHaveAVJACK())
print("getHaveSCART%s<" %boxbranding.getHaveSCART())
print("getHaveSCARTYUV%s<" %boxbranding.getHaveSCARTYUV())
print("getHaveDVI%s<" %boxbranding.getHaveDVI())
print("getHaveMiniTV%s<" %boxbranding.getHaveMiniTV())
Пример #23
0
	def __init__(self, session, args = 0):
		Screen.__init__(self, session)
		self.session = session
		self.selection = 0
		self.MODEL = getBoxType()
		self.OEM = getBrandOEM()
		self.MACHINEBUILD = getMachineBuild()
		self.MACHINENAME = getMachineName()
		self.MACHINEBRAND = getMachineBrand()
		self.IMAGEFOLDER = getImageFolder()
		self.HDFIMAGEVERSION = getImageVersion()
		self.HDFIMAGEBUILD = getImageBuild()
		self.UBINIZE_ARGS = getMachineUBINIZE()
		self.MKUBIFS_ARGS = getMachineMKUBIFS()
		self.MTDKERNEL = getMachineMtdKernel()
		self.MTDROOTFS = getMachineMtdRoot()
		self.ROOTFSBIN = getMachineRootFile()
		self.KERNELBIN = getMachineKernelFile()
		self.ROOTFSTYPE = getImageFileSystem()

		if self.MACHINEBUILD in ("hd51","vs1500","h7","ceryon7252"):
			self.MTDBOOT = "mmcblk0p1"
			self.EMMCIMG = "disk.img"
		elif self.MACHINEBUILD in ("xc7439"):
			self.MTDBOOT = "mmcblk1p1"
			self.EMMCIMG = "emmc.img"
		else:
			self.MTDBOOT = "none"
			self.EMMCIMG = "none"

		print "[FULL BACKUP] BOX MACHINEBUILD = >%s<" %self.MACHINEBUILD
		print "[FULL BACKUP] BOX MACHINENAME = >%s<" %self.MACHINENAME
		print "[FULL BACKUP] BOX MACHINEBRAND = >%s<" %self.MACHINEBRAND
		print "[FULL BACKUP] BOX MODEL = >%s<" %self.MODEL
		print "[FULL BACKUP] OEM MODEL = >%s<" %self.OEM
		print "[FULL BACKUP] IMAGEFOLDER = >%s<" %self.IMAGEFOLDER
		print "[FULL BACKUP] UBINIZE = >%s<" %self.UBINIZE_ARGS
		print "[FULL BACKUP] MKUBIFS = >%s<" %self.MKUBIFS_ARGS
		print "[FULL BACKUP] MTDBOOT = >%s<" %self.MTDBOOT
		print "[FULL BACKUP] MTDKERNEL = >%s<" %self.MTDKERNEL
		print "[FULL BACKUP] MTDROOTFS = >%s<" %self.MTDROOTFS
		print "[FULL BACKUP] ROOTFSTYPE = >%s<" %self.ROOTFSTYPE
		print "[FULL BACKUP] ROOTFSTYPE = >%s<" %self.ROOTFSTYPE
		print "[FULL BACKUP] EMMCIMG = >%s<" %self.EMMCIMG
		if isDreamboxXZ:
			self.IMAGEFOLDER = self.MODEL
# fix me to xz
			self.ROOTFSTYPE = "tar.gz"
			self.ROOTFSBIN = "root.tar.gz"

		self.list = self.list_files("/boot")
		self["key_green"] = Button("USB")
		self["key_red"] = Button("HDD")
		self["key_blue"] = Button(_("Exit"))
		if SystemInfo["HaveMultiBoot"]:
			self["key_yellow"] = Button(_("STARTUP"))
			self["info-multi"] = Label(_("You can select with yellow the OnlineFlash Image\n or select Recovery to create a USB Disk Image for clean Install."))
		else:
			self["key_yellow"] = Button("")
			self["info-multi"] = Label(" ")
		self["info-usb"] = Label(_("USB = Do you want to make a back-up on USB?\nThis will take between 4 and 15 minutes depending on the used filesystem and is fully automatic.\nMake sure you first insert an USB flash drive before you select USB."))
		self["info-hdd"] = Label(_("HDD = Do you want to make an USB-back-up image on HDD? \nThis only takes 2 or 10 minutes and is fully automatic."))
		self["actions"] = ActionMap(["OkCancelActions", "ColorActions"],
		{
			"blue": self.quit,
			"yellow": self.yellow,
			"green": self.green,
			"red": self.red,
			"cancel": self.quit,
		}, -2)