pmb.install._install.print_flash_info: new func (MR 1946)

Move code that prints flashing information from install_system_image()
to its own function. For the on-device installer, we'll need to call
install_system_image() twice, without printing the flashing information
each time. While at it, add "step" and "steps" parameters.
This commit is contained in:
Oliver Smith 2020-06-07 08:08:06 +02:00 committed by Bart Ribbers
parent a97ec615ad
commit a3fd169c76
No known key found for this signature in database
GPG Key ID: 699D16185DAFAE61
1 changed files with 14 additions and 6 deletions

View File

@ -417,8 +417,13 @@ def install_system_image(args, size_reserve=0):
pmb.chroot.user(args, ["mv", "-f", sys_image_sparse, sys_image],
working_dir="/home/pmos/rootfs/")
# Kernel flash information
logging.info("*** (5/5) FLASHING TO DEVICE ***")
def print_flash_info(args, step=5, steps=5):
""" Print flashing information, based on the deviceinfo data and the
pmbootstrap arguments.
:param step: installation step number """
logging.info(f"*** ({step}/{steps}) FLASHING TO DEVICE ***")
logging.info("Run the following to flash your installation to the"
" target device:")
@ -552,7 +557,10 @@ def install(args):
# Set the hostname as the device name
setup_hostname(args)
if args.android_recovery_zip:
install_recovery_zip(args)
elif not args.no_image:
install_system_image(args)
if args.no_image:
return
elif args.android_recovery_zip:
return install_recovery_zip(args)
install_system_image(args)
print_flash_info(args)