binman: Add command-line support for replacing entries
Add a 'replace' command to binman to permit entries to be replaced, either
individually or all at once (using a filter).
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/binman/cmdline.py b/tools/binman/cmdline.py
index a43aec6..1e38593 100644
--- a/tools/binman/cmdline.py
+++ b/tools/binman/cmdline.py
@@ -84,6 +84,23 @@
extract_parser.add_argument('-U', '--uncompressed', action='store_true',
help='Output raw uncompressed data for compressed entries')
+ replace_parser = subparsers.add_parser('replace',
+ help='Replace entries in an image')
+ replace_parser.add_argument('-C', '--compressed', action='store_true',
+ help='Input data is already compressed if needed for the entry')
+ replace_parser.add_argument('-i', '--image', type=str, required=True,
+ help='Image filename to extract')
+ replace_parser.add_argument('-f', '--filename', type=str,
+ help='Input filename to read from')
+ replace_parser.add_argument('-F', '--fix-size', action='store_true',
+ help="Don't allow entries to be resized")
+ replace_parser.add_argument('-I', '--indir', type=str, default='',
+ help='Path to directory to use for input files')
+ replace_parser.add_argument('-m', '--map', action='store_true',
+ default=False, help='Output a map file for the updated image')
+ replace_parser.add_argument('paths', type=str, nargs='*',
+ help='Paths within file to extract (wildcard)')
+
test_parser = subparsers.add_parser('test', help='Run tests')
test_parser.add_argument('-P', '--processes', type=int,
help='set number of processes to use for running tests')