Skip to content

Commit

Permalink
external/avb: Passing all sub arguments to info_image
Browse files Browse the repository at this point in the history
For extending new options.

Signed-off-by: wangjianyu3 <[email protected]>
  • Loading branch information
JianyuWang0623 committed Jan 2, 2025
1 parent 783f81d commit 4832aa8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions avbtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2405,16 +2405,16 @@ def set_ab_metadata(self, misc_image, slot_data):
misc_image.seek(self.AB_MISC_METADATA_OFFSET)
misc_image.write(ab_data)

def info_image(self, image_filename, output, atx):
def info_image(self, args):
"""Implements the 'info_image' command.
Arguments:
image_filename: Image file to get information from (file object).
output: Output file to write human-readable information to (file object).
atx: If True, show information about Android Things eXtension (ATX).
args.image.name: Image file to get information from (file object).
args.output: Output file to write human-readable information to (file object).
args.atx: If True, show information about Android Things eXtension (ATX).
"""
image = ImageHandler(image_filename, read_only=True)
o = output
image = ImageHandler(args.image.name, read_only=True)
o = args.output
(footer, header, descriptors, image_size) = self._parse_image(image)

# To show the SHA1 of the public key.
Expand Down Expand Up @@ -2464,7 +2464,7 @@ def info_image(self, image_filename, output, atx):
if num_printed == 0:
o.write(' (none)\n')

if atx and header.public_key_metadata_size:
if args.atx and header.public_key_metadata_size:
o.write('Android Things eXtension (ATX):\n')
key_metadata_offset = (header.SIZE +
header.authentication_data_block_size +
Expand Down Expand Up @@ -4868,7 +4868,7 @@ def set_ab_metadata(self, args):

def info_image(self, args):
"""Implements the 'info_image' sub-command."""
self.avb.info_image(args.image.name, args.output, args.atx)
self.avb.info_image(args)

def verify_image(self, args):
"""Implements the 'verify_image' sub-command."""
Expand Down

0 comments on commit 4832aa8

Please sign in to comment.