diff --git a/extract-partitions.py b/extract-partitions.py index 853878c..f7e4d14 100755 --- a/extract-partitions.py +++ b/extract-partitions.py @@ -19,6 +19,8 @@ parser.add_argument("-d", "--outdir", default=".", parser.add_argument("--max-size", metavar="kbytes", type=int, default=65535, help="Maximum partition size to dump (in KiB) or 0 to dump all (default %(default)d)") parser.add_argument("--debug", action='store_true', help="Enable debug messages") +parser.add_argument("--skip-hello", action="store_true", + help="Immediately send commands, skip HELO message") def dump_partitions(comm, disk_fd, outdir, max_size): parts = partitions.get_partitions(comm) @@ -54,7 +56,9 @@ def main(): comm = lglaf.autodetect_device() with closing(comm): - lglaf.try_hello(comm) + if not args.skip_hello: + lglaf.try_hello(comm) + with partitions.laf_open_disk(comm) as disk_fd: _logger.debug("Opened fd %d for disk", disk_fd) dump_partitions(comm, disk_fd, args.outdir, args.max_size * 1024) diff --git a/partitions.py b/partitions.py index aa96c8b..c38fa6b 100755 --- a/partitions.py +++ b/partitions.py @@ -232,6 +232,8 @@ parser.add_argument("--wipe", action='store_true', parser.add_argument("partition", nargs='?', help="Partition number (e.g. 1 for block device mmcblk0p1)" " or partition name (e.g. 'recovery')") +parser.add_argument("--skip-hello", action="store_true", + help="Immediately send commands, skip HELO message") def main(): args = parser.parse_args() @@ -247,7 +249,9 @@ def main(): comm = lglaf.autodetect_device() with closing(comm): - lglaf.try_hello(comm) + + if not args.skip_hello: + lglaf.try_hello(comm) if args.list: list_partitions(comm, args.partition)