Support header_version up to version 2#7
Open
alexlarsson wants to merge 8 commits intoggrandou:masterfrom
Open
Support header_version up to version 2#7alexlarsson wants to merge 8 commits intoggrandou:masterfrom
alexlarsson wants to merge 8 commits intoggrandou:masterfrom
Conversation
This needs to be ssize, not ksize.
When creating a new image, if the stat fails with ENOENT we need to not check if it is a block device, we now do that randomly if the `S_ISBLK(st.st_mode)` check happens to pas with uninitialized `st`.
We need to skip the ramdisk as well to get to the second part.
It was using the ramdisk size
This means less duplicated code, especially when we later add support for more parts.
This imports bootimh.h from upstream commit e55998a0f2b61b685d5eb4a486ca3a0c680b1a2f, which has added v2 support. (File is: https://android.googlesource.com/platform/system/tools/mkbootimg/+/e55998a0f2b61b685d5eb4a486ca3a0c680b1a2f/include/bootimg/bootimg.h) The upstream version was C++, so the struct derivation like: struct boot_img_hdr_v1 : public boot_img_hdr_v0 { uint32_t recovery_dtbo_size; ... Was changed to: struct boot_img_hdr_v1 { struct boot_img_hdr_v0 v0; uint32_t recovery_dtbo_size; ... To make this work in C.
This adds support for the "recovery dtbo" and "dtb" parts in the header. Whenever we add a feature from the later versions we update the header version, but we never go backwards with versions. New headers start as version 1, so will only become 1 or 2 as needed. We also display some new information from v0 headers that were not shown before (os version, header version), as well as the new data in the v1 and v2 headers.
This builds and inspects some images in various ways and checks that we get the right results.
Author
|
Fixed some commit message typos |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds support for header_version 1 and 2, including dtb and dtbo support.
In addition it fixes various bugs and adds some tests. See the commits for details.