From 27b831b32a591b5bec00ba4aa394cded1a0d4f48 Mon Sep 17 00:00:00 2001 From: Jeffrey Rongen Date: Wed, 1 May 2024 11:27:59 +0200 Subject: [PATCH] Add fuse option to argument parsing --- mtk | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mtk b/mtk index 2bbfa0f..2567fee 100755 --- a/mtk +++ b/mtk @@ -14,6 +14,7 @@ cmds = { "rf": "Read whole flash to file", "rs": "Read sectors starting at start_sector to filename", "ro": "Read flash starting at offset to filename", + "fs": "Mount the device as a FUSE filesystem", "w": "Write partition from filename", "wf": "Write flash from filename", "wl": "Write partitions from directory path to flash", @@ -55,7 +56,7 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description=info) subparsers = parser.add_subparsers(dest="cmd", help='Valid commands are: \n' + - 'printgpt, gpt, r, rl, rf, rs, w, wf, wl, e, es, footer, reset, \n' + + 'printgpt, gpt, r, rl, rf, fs, rs, w, wf, wl, e, es, footer, reset, \n' + 'dumpbrom, dumpsram, dumppreloader, payload, crash, brute, gettargetconfig, \n' + 'peek, stage, plstage, da, script\n') @@ -67,6 +68,7 @@ if __name__ == '__main__': parser_rf = subparsers.add_parser("rf", help="Read whole flash to file") parser_rs = subparsers.add_parser("rs", help="Read sectors starting at start_sector to filename") parser_ro = subparsers.add_parser("ro", help="Read flash starting at offset to filename") + parser_fs = subparsers.add_parser("fs", help="Mount the device as a FUSE filesystem") parser_w = subparsers.add_parser("w", help="Write partition from filename") parser_wf = subparsers.add_parser("wf", help="Write flash from filename") parser_wl = subparsers.add_parser("wl", help="Write partitions from directory path to flash") @@ -405,6 +407,9 @@ if __name__ == '__main__': parser_ro.add_argument('--auth', type=str, help="Use auth file (auth_sv5.auth)") parser_ro.add_argument('--cert', type=str, help="Use cert file") + parser_fs.add_argument('mountpoint', help='Directory to mount the FUSE filesystem in') + parser_fs.add_argument('--rw', help='Mount the filesystem as writeable', default=False, action='store_true') + parser_w.add_argument('partitionname', help='Partition to write (separate by comma for multiple partitions)') parser_w.add_argument('filename', help='Filename for writing (separate by comma for multiple filenames)') parser_w.add_argument('--loader', type=str, help='Use specific DA loader, disable autodetection')