示例#1
0
def ubootSetup(Device):
  try:
    bName = builtins.Config['Board']['model'].lower()
    fName = bName + ".fex"
    Utils.copyFiles(Utils.getPath("mnt/usr/share/armStrap-U-Boot/" + bName + "/"+ fName), Utils.getPath("mnt/boot/" + fName))
    Utils.runChrootCommand(command = "/usr/bin/fex2bin /boot/" + fName + " /boot/script.bin")
    Utils.runCommand(command = "/bin/dd if=" + Utils.getPath("mnt/usr/share/armStrap-U-Boot/" + bName + "/u-boot-sunxi-with-spl.bin") + " of=" + Device + " bs=1024 seek=8")
  except SystemExit:
    pass
  except:
    logging.exception("Caught Exception")
    sys.exit(os.EX_SOFTWARE)
示例#2
0
文件: extractor.py 项目: gofed/lib
	def _getGoSymbols(self, path, imports_only=False):
		script_dir = getScriptDir(__file__) + "/."
		options = ""
		if imports_only:
			options = "-imports"

		so, se, rc = runCommand("%s/parseGo %s '%s'" % (script_dir, options, path))
		if rc != 0:
			return (1, se)

		return (0, so)
示例#3
0
    def _getGoSymbols(self, path, imports_only=False):
        script_dir = getScriptDir(__file__) + "/."
        options = ""
        if imports_only:
            options = "-imports"

        so, se, rc = runCommand("%s/parseGo %s '%s'" %
                                (script_dir, options, path))
        if rc != 0:
            return (1, se)

        return (0, so)
示例#4
0
    def extract(self):
        options = [
            "--package-path {}".format(self._package_path),
            "--package-prefix {}:{}".format(self._package_path, self._hexsha),
            "--symbol-table-dir {}".format(self._generated),
            "--goversion {}".format(self._goversion),
            "--library",
        ]

        if self._cgo != "":
            options.append("--cgo-symbols-path {}".format(self._cgo))

        if self._depsfile.endswith("glide.lock"):
            options.append("--glidefile {}".format(self._depsfile))
        elif self._depsfile.endswith("Godeps.json"):
            options.append("--godepsfile {}".format(self._depsfile))
        else:
            raise ValueError("Dependency file {} not recognized".format(self._depsfile))

        self._so, se, rc = runCommand("GOPATH={} goextract {}".format(self._gopath, " ".join(options)))
        if rc != 0:
            raise ExtractionException("goextract({}): {}".format(rc, se))

        return self
	def _getLicense(self, doc):
		# TODO(jchaloup): find licence check written in python
		so, se, rc = runCommand("licensecheck %s" % doc)
		if rc == 0:
			return ":".join(so.split("\n")[0].split(":")[1:]).strip()
		return "Unknown"
 def _getLicense(self, doc):
     # TODO(jchaloup): find licence check written in python
     so, se, rc = runCommand("licensecheck %s" % doc)
     if rc == 0:
         return ":".join(so.split("\n")[0].split(":")[1:]).strip()
     return "Unknown"