~postmarketos/pmbootstrap

6d035108e8802468361a0ff56fe598fb13d5eb1d — Caleb Connolly 1 year, 4 months ago 41c24a4 b4/flash_all_extra
flasher: add flash_all option

Add an option to flash all partitions which are used on the device. This
slightly simplifies the process of installing as it can now be done in a
single command instead of needing one for each partition.
2 files changed, 11 insertions(+), 1 deletions(-)

M pmb/flasher/frontend.py
M pmb/parse/arguments.py
M pmb/flasher/frontend.py => pmb/flasher/frontend.py +7 -0
@@ 122,6 122,11 @@ def flash_lk2nd(args):
    pmb.flasher.run(args, "flash_lk2nd")


def flash_all(args):
    for action in ["flash_rootfs", "flash_kernel", "flash_vbmeta", "flash_dtbo"]:
        pmb.flasher.run(args, action, ignore_errors=True)


def frontend(args):
    action = args.action_flasher
    method = args.flash_method or args.deviceinfo["flash_method"]


@@ 151,6 156,8 @@ def frontend(args):
        sideload(args)
    if action in ["flash_lk2nd"]:
        flash_lk2nd(args)
    if action == "flash_all":
        flash_all(args)

    extra = args.action_extra
    if extra and "fastboot" in method and action != "boot":

M pmb/parse/arguments.py => pmb/parse/arguments.py +4 -1
@@ 277,8 277,11 @@ def arguments_flasher(subparser):
                            help="partition to flash the dtbo to (defaults"
                            " to deviceinfo_flash_*_partition_dtbo)")

    flash_all = sub.add_parser("flash_all",
                               help="Flash all partitions needed for the device")

    for action in [flash_kernel, flash_lk2nd, flash_rootfs,
                   flash_vbmeta, flash_dtbo]:
                   flash_vbmeta, flash_dtbo, flash_all]:
        extra = action.add_argument(dest="action_extra",
                                    metavar="EXTRA",
                                    help="Additional commands to flasher"