Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avb: Add support for AVB 2.0 format 1.3.0 #210

Merged
merged 1 commit into from
Nov 23, 2023
Merged

Conversation

chenxiaolong
Copy link
Owner

@chenxiaolong chenxiaolong commented Nov 22, 2023

Format version 1.3.0 adds a new 32-bit big endian flags field to chain descriptors, carved out from the reserved array. There is only one possible flag, which indicates that the target partition is not A/B and so the bootloader should not append the _a or _b suffix.

There are no known AVB images in the wild where the first four bytes of the reserved field are not zero. Thus, to keep the logic simple, the AVB parser will unconditionally parse those bytes as if they were the flags field, regardless of the file format version.

AOSP changes:

@chenxiaolong chenxiaolong self-assigned this Nov 22, 2023
@chenxiaolong
Copy link
Owner Author

With this new format version, I guess "AVB 2.0" no longer refers to just one thing. I wish they made the AVB version and the file format version the same. Otherwise, we'll end up with things like "USB 3.2 Gen 2x2" 🙂

Format version 1.3.0 adds a new 32-bit big endian `flags` field to
chain descriptors, carved out from the `reserved` array. There is only
one possible flag, which indicates that the target partition is not A/B
and so the bootloader should not append the `_a` or `_b` suffix.

There are no known AVB images in the wild where the first four bytes of
the `reserved` field are not zero. Thus, to keep the logic simple, the
AVB parser will unconditionally parse those bytes as if they were the
`flags` field, regardless of the file format version.

AOSP changes:

* https://android.googlesource.com/platform/external/avb/+/a1fe228b86543a21739c51352f5ce72f134fccfa%5E%21/
* https://android.googlesource.com/platform/external/avb/+/d00d02c390e267ef43d93562864dd6e45966c435%5E%21/

Signed-off-by: Andrew Gunnerson <[email protected]>
@chenxiaolong chenxiaolong merged commit d6705f4 into master Nov 23, 2023
22 checks passed
@chenxiaolong chenxiaolong deleted the avb_2.0_format_1.3 branch November 23, 2023 00:27
chenxiaolong added a commit that referenced this pull request Nov 23, 2023
Signed-off-by: Andrew Gunnerson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant