def init_externals(): if not os.path.isdir(generated()): os.makedirs(generated()) if os.path.isfile(bct_dump()) and \ os.path.isfile(cbootimage()) and \ os.path.isfile(externals() + "nvflash/nvflash") and \ os.path.isfile(externals() + "gpt_surgeon.py") and \ os.path.isfile(externals() + "uboot-sos.img"): return None print "Initialize externals..." res = execute("./init-externals.sh \"%s\"" % log_file()) if res != 0: print "Failed with code %d.\nLog file is ./generated/init.log" % res quit() print
def uboot_sos(): res = init(externals() + "uboot-sos.img") print "Sos image downloaded with code %d" % res return res