Skip to content

Commit

Permalink
external/avb: Add rollback only support for info_image
Browse files Browse the repository at this point in the history
For getting rollback_index or rollback_index_location of signed file directly at host

Test

  # test.bin
  #  rollback_index_location : 0
  #  rollback_index          : 1
  $ ./avbtool info_image --image test.bin --rollback_index
  1
  $ ./avbtool info_image --image test.bin --rollback_index_location
  0

Signed-off-by: wangjianyu3 <[email protected]>
  • Loading branch information
JianyuWang0623 committed Jan 2, 2025
1 parent 4832aa8 commit 05bac1c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions avbtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2424,6 +2424,12 @@ def info_image(self, args):
header.public_key_offset)
key_blob = vbmeta_blob[key_offset:key_offset + header.public_key_size]

if args.rollback_index_location:
o.write('{}\n'.format(header.rollback_index_location))
return
if args.rollback_index:
o.write('{}\n'.format(header.rollback_index))
return
if footer:
o.write('Footer version: {}.{}\n'.format(footer.version_major,
footer.version_minor))
Expand Down Expand Up @@ -4530,6 +4536,12 @@ def run(self, argv):
help=('Show information about Android Things '
'eXtension (ATX).'),
action='store_true')
sub_parser.add_argument('--rollback_index',
help=('Only rollback_index'),
action='store_true')
sub_parser.add_argument('--rollback_index_location',
help=('Only rollback_index_location'),
action='store_true')
sub_parser.set_defaults(func=self.info_image)

sub_parser = subparsers.add_parser(
Expand Down

0 comments on commit 05bac1c

Please sign in to comment.