Commit b43ac399 authored by Angus Ainslie's avatar Angus Ainslie
Browse files

scripts/flash-image: add some args



Add a daemon arg and usb path to allow multiple instances of flash-image to
run on a host.
Signed-off-by: default avatarAngus Ainslie <angus@akkea.ca>
parent 70c4e06f
......@@ -48,11 +48,21 @@ def write_uuu_script(target, image, uboot, mods):
mods=mods))
def flash_image(uuu_target, debug):
if debug:
subprocess.check_call(['uuu', '-v', uuu_target])
else:
subprocess.check_call(['uuu', uuu_target])
def flash_image(uuu_target, args):
uuu_cmd = ['uuu']
if args.debug:
uuu_cmd.append('-v')
if args.daemon:
uuu_cmd.append('-d')
if args.usbpath:
uuu_cmd.append('-m')
uuu_cmd.append(args.path)
uuu_cmd.append(uuu_target)
subprocess.check_call(uuu_cmd)
def main():
......@@ -66,8 +76,12 @@ def main():
group = parser.add_argument_group(title='Testing and debugging options')
group.add_argument('--debug', action="store_true", default=False,
help='Enable debug output')
group.add_argument('--daemon', action="store_true", default=False,
help='Enable enable daemon mode for parallel flashing')
group.add_argument('--uboot', type=str,
help='u-boot version to flash')
group.add_argument('--usbpath', type=str, default=None,
help='Only flash device on this usb path')
args = parser.parse_args()
level = logging.DEBUG if args.debug else logging.INFO
......@@ -107,7 +121,7 @@ def main():
os.symlink(uboot_target, os.path.join(outdir, UBOOT.format(uboot_board)))
write_uuu_script(uuu_target, image_target, uboot_target, uuu_mods)
flash_image(uuu_target, args.debug)
flash_image(uuu_target, args)
except KeyboardInterrupt:
logging.error("CTRL-C pressed.")
return 1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment