def create(size, redundant, bigendian, infile, outfile):
""" Create new image from attached file """
try:
env = uboot.EnvBlob(size=size, redundant=redundant, bigendian=bigendian)
with open(infile, 'r') as f:
env.load(f.read())
with open(outfile, 'wb') as f:
f.write(env.export())
except Exception as e:
click.echo(str(e) if str(e) else "Unknown Error !")
sys.exit(ERROR_CODE)
click.secho(" Successfully created: %s" % outfile)
# U-Boot mkenv: Extract image content
评论列表
文章目录