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
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
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()
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)
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)
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)
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)
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)
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 })
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()
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 Components.Button import Button from Components.FileList import FileList from Components.Language import language from Components.Harddisk import harddiskmanager from Components.Label import Label from Components.ScrollLabel import ScrollLabel from Components.Sources.StaticText import StaticText from Plugins.Plugin import PluginDescriptor from Tools.Directories import resolveFilename, SCOPE_LANGUAGE, SCOPE_PLUGINS from os import environ from enigma import getDesktop, getBoxType, getBoxBrand from boxbranding import getMachineBuild, getMachineRootFile, getMachineKernelFile brand = getBoxBrand() rootfile = getMachineRootFile() kernelfile = getMachineKernelFile() lang = language.getLanguage() environ["LANGUAGE"] = lang[:2] gettext.bindtextdomain("enigma2", resolveFilename(SCOPE_LANGUAGE)) gettext.textdomain("enigma2") gettext.bindtextdomain("BackupSuite", "%s%s" % (resolveFilename(SCOPE_PLUGINS), "Extensions/BackupSuite/locale")) def _(txt): t = gettext.dgettext("BackupSuite", txt) if t == txt: t = gettext.gettext(txt) return t ###################################################################################################### #Set default configuration
# Embedded file name: /usr/lib/enigma2/python/BoxBrandingTest.py import boxbranding print 'getMachineBuild=%s<' % boxbranding.getMachineBuild() print 'getMachineMake=%s<' % boxbranding.getMachineMake() 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 '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()
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()
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" font="Regular;18" zPosition="1" />
from Screens.ChoiceBox import ChoiceBox from Screens.Screen import Screen from Screens.Console import Console from Screens.HelpMenu import HelpableScreen from Screens.TaskView import JobView from Tools.Downloader import downloadWithProgress from enigma import fbClass import urllib2 import os import shutil import math from boxbranding import getBoxType, getImageDistro, getMachineName, getMachineBrand, getImageVersion, getMachineKernelFile, getMachineRootFile distro = getImageDistro() ImageVersion = getImageVersion() ROOTFSBIN = getMachineRootFile() KERNELBIN = getMachineKernelFile() ############################################################################################################# image = 0 # 0=openATV / 1=openMips if distro.lower() == "openmips": image = 1 elif distro.lower() == "openatv": image = 0 feedurl_atv = 'http://images.mynonpublic.com/openatv/%s' % ImageVersion if ImageVersion == '5.3': ImageVersion2 = '6.0' else: ImageVersion2 = '5.3' feedurl_atv2 = 'http://images.mynonpublic.com/openatv/%s' % ImageVersion2 feedurl_om = 'http://image.openmips.com/5.3'
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)
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)
from Screens.ChoiceBox import ChoiceBox from Screens.Screen import Screen from Screens.Console import Console from Screens.HelpMenu import HelpableScreen from Screens.TaskView import JobView from Tools.Downloader import downloadWithProgress from enigma import fbClass import urllib2 import os import shutil import math from boxbranding import getBoxType, getImageDistro, getMachineName, getMachineBrand, getImageVersion, getMachineKernelFile, getMachineRootFile distro = getImageDistro() ImageVersion = getImageVersion() ROOTFSBIN = getMachineRootFile() KERNELBIN = getMachineKernelFile() ############################################################################################################# image = 0 # 0=openATV / 1=openMips if distro.lower() == "openmips": image = 1 elif distro.lower() == "openatv": image = 0 feedurl_atv = 'http://images.mynonpublic.com/openatv/%s' %ImageVersion if ImageVersion == '5.3': ImageVersion2= '5.4' else: ImageVersion2= '5.3' feedurl_atv2= 'http://images.mynonpublic.com/openatv/%s' %ImageVersion2 feedurl_om = 'http://image.openmips.com/5.3'
from __future__ import print_function 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()) 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())
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)