From 47c107817532609ec5b9a142308408510c0a9e39 Mon Sep 17 00:00:00 2001 From: Sergii Dmytruk Date: Sat, 22 Jun 2024 20:43:13 +0300 Subject: 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 --- BaseTools/Source/Python/Capsule/GenerateCapsule.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'BaseTools') diff --git a/BaseTools/Source/Python/Capsule/GenerateCapsule.py b/BaseTools/Source/Python/Capsule/GenerateCapsule.py index 4d4e526432..87fa998274 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() -- cgit v1.2.3