示例#1
0
    def __init__(self):
        self.makefile = None

        super(makefile, self).__init__("{}/{}".format(self.dir_top(),
                                                      "make.ci"))
        if (self.exist()):
            self.die("previous make not yet finished")

        self.setup = base.yml(self.file_setup())
        self.makefile = open(self.path(), mode='w')
        self.done = 0
示例#2
0
    def install(self):
        ccache = base.yml(self.file_setup()).val("ccache")
        g = gcc.gcc(self._arch)

        file = "mymake"
        ccache = "ccache " if (ccache) else ""

        with open(file, mode="w") as f:
            f.write("ARCH={} make CROSS_COMPILE=\"{}{}\" $@".format(
                self._arch, ccache, g.gcc()))
        os.chmod(file, 0o755)
示例#3
0
    def create_via_yaml(self, file):
        yaml = base.yml(file)

        self.write("all:")
        for config in yaml.each_target():
            self.write(" {}".format(config.name()))
        self.write("\n\n")

        for config in yaml.each_target():
            self.create_make(config)

        self.done = 1
示例#4
0
    def create_git_push(self, args):
        self.print("ref: {}".format(args[0]))
        self.print("old: {}".format(args[1]))
        self.print("new: {}".format(args[2]))  # pushed commit

        commit = args[2]
        setup = base.yml(self.file_setup())
        yaml = base.yml("{}/{}".format(self.dir_top(), setup.val("ci_yaml")))
        kernel = setup.val("kernel")
        ci_branch = setup.val("ci_branch")

        self.write("all: kernel_update linuxci_update")
        for config in yaml.each_target():
            self.write(" {}".format(config.name()))
        self.write("\n\n")

        self.write("kernel_update:\n")
        self.write("	cd {};\\\n".format(kernel))
        self.write("	git --git-dir=.git prune;\\\n")
        self.write("	git --git-dir=.git gc;\\\n")
        self.write("	git --git-dir=.git repack;\\\n")
        self.write("	git --git-dir=.git remote update --prune;\\\n")
        self.write("	git --git-dir=.git checkout {};\n".format(commit))
        self.write("\n")

        self.write("linuxci_update:\n")
        self.write("	cd {};\\\n".format(self.dir_top()))
        self.write("	git --git-dir=.git prune;\\\n")
        self.write("	git --git-dir=.git gc;\\\n")
        self.write("	git --git-dir=.git repack;\\\n")
        self.write("	git --git-dir=.git remote update --prune;\\\n")
        self.write("	git --git-dir=.git checkout {};\n".format(ci_branch))
        self.write("\n")

        for config in yaml.each_target():
            self.create_make(config)

        self.done = 1
示例#5
0
    def __init__(self, config):
        setup = base.yml(self.file_setup())
        logerr = setup.val("logerr")
        mail = base.yml(self.file_setup()).val("mail")
        cfg = base.config(config)
        bin = base.binary(cfg)
        log = "{}/log".format(bin.path())

        if (not mail):
            return

        if (not bin.exist()):
            return

        if (not os.path.exists(log)):
            return

        if (logerr):
            self.run("{}/script/logerr.sh {} | mail -s \"Linux-CI error: {}: {}\" {}".
                     format(self.dir_top(), log, os.uname()[1], config, mail))
        else:
            self.run("mail -s \"Linux-CI: {}: {}\" {} < {}".
                     format(os.uname()[1], config, mail, log))