Example #1
0
 def run(self):
     # Edit the casper.conf
     # Strangely enough, casper uses the "quiet" flag if the build system is either Debian or Ubuntu
     if config.VStatus is False:
         logger.logI(self.tn, _("Editing casper and LSB configuration files"))
     logger.logV(self.tn, _("Editing casper.conf"))
     buildsys = "Ubuntu"
     if configutils.parseBoolean(configutils.getValue(configs[configutils.casperquiet])) is False:
         buildsys = ""
     unionfs = configutils.getValue(configs[configutils.unionfs])
     if unionfs == "overlayfs" and aptutil.compVersions(aptutil.getPkgVersion(aptutil.getPkg("casper", aptcache)), "1.272", aptutil.lt):
         logger.logW(self.tn, _("Using DEFAULT instead of overlayfs"))
         unionfs = "DEFAULT"
     self.varEditor(tmpsys + "etc/casper.conf", {
                                         "USERNAME": configutils.getValue(configs[configutils.username]),
                                         "USERFULLNAME":
                                             configutils.getValue(configs[configutils.userfullname]),
                                         "HOST": configutils.getValue(configs[configutils.host]),
                                         "BUILD_SYSTEM": buildsys,
                                         "FLAVOUR": configutils.getValue(configs[configutils.flavour]),
                                         "UNIONFS": unionfs})
     logger.logV(self.tn, _("Editing lsb-release"))
     self.varEditor(tmpsys + "etc/lsb-release", {
                                 "DISTRIB_ID": configutils.getValue(configs[configutils.sysname]),
                                 "DISTRIB_RELEASE": configutils.getValue(configs[configutils.version]),
                                 "DISTRIB_CODENAME": configutils.getValue(configs[configutils.codename]),
                                 "DISTRIB_DESCRIPTION":
     configutils.getValue(configs[configutils.description])})
Example #2
0
def getModules():
    returnme = []
    modules = os.listdir(config.ModFolder)
    for i in modules:
        dirs = os.path.join(config.ModFolder, i)
        if not os.path.isdir(dirs) or not "__init__.py" in os.listdir(dirs):
            continue
        file, pathname, desc = imp.find_module("__init__", [dirs])
        module = imp.load_module("__init__", file, pathname, desc)
        if not isModule(module):
            continue
        loadme = True
        if not isCompatible(module):
            loadme = False
        if loadme:
            returnme.append({"name": i, "file": file, "path": pathname, "desc": desc})
        else:
            logger.logW(tn, _("Module") + " " + module.modulename + " " + _("will not be loaded"))
    return returnme
Example #3
0
def isCompatible(module):
    if module.relinuxmoduleapi != config.version:
        logger.logW(
            tn,
            _("Module")
            + " "
            + module.modulename
            + " "
            + _("is incompatible with this relinux version")
            + " ("
            + _("relinux version:")
            + " "
            + config.version
            + ", "
            + _("required version:")
            + " "
            + module.relinuxmoduleapi
            + ")",
        )
        return False
    return True