summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergii Dmytruk <sergii.dmytruk@3mdeb.com>2024-06-22 20:43:13 +0300
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-05 19:33:50 +0000
commit47c107817532609ec5b9a142308408510c0a9e39 (patch)
tree8baf2a7107bbc9619308cfe19b317d3fb84b2044
parent822ff966c6dcc8bf5dc9b87d0b4e4ac2f7102e8b (diff)
downloadedk2-47c107817532609ec5b9a142308408510c0a9e39.zip
edk2-47c107817532609ec5b9a142308408510c0a9e39.tar.gz
edk2-47c107817532609ec5b9a142308408510c0a9e39.tar.bz2
BaseTools/GenerateCapsule.py: Require --output for --decode
--decode unconditionally uses args.OutputFile.name as a prefix for output files that it creates and fails in a non-pretty way without --output option. This doesn't address creation/truncation of the file specified via --output, but at least you're able to decode a capsule. Signed-off-by: Sergii Dmytruk <sergii.dmytruk@3mdeb.com>
-rw-r--r--BaseTools/Source/Python/Capsule/GenerateCapsule.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
index 4d4e526..87fa998 100644
--- a/BaseTools/Source/Python/Capsule/GenerateCapsule.py
+++ b/BaseTools/Source/Python/Capsule/GenerateCapsule.py
@@ -519,6 +519,10 @@ if __name__ == '__main__':
else:
raise argparse.ArgumentTypeError ('--update-image-index must be an integer in range 0x1..0xff')
+ if args.Decode:
+ if args.OutputFile is None:
+ raise argparse.ArgumentTypeError ('--decode requires --output')
+
if self.UseSignTool:
if self.SignToolPfxFile is not None:
self.SignToolPfxFile.close()