Commit 08cd5b81 authored by topjohnwu's avatar topjohnwu

Try to repair boot_hdr v1 entries

parent 5d3a8a5b
...@@ -440,6 +440,10 @@ void repack(const char* orig_image, const char* out_image) { ...@@ -440,6 +440,10 @@ void repack(const char* orig_image, const char* out_image) {
// Print new image info // Print new image info
boot.print_hdr(); boot.print_hdr();
// Try to fix the header
if (boot.header_version() && boot.header_size() == 0)
boot.header_size(sizeof(boot_img_hdr));
// Main header // Main header
memcpy(boot.map_addr + header_off, boot.hdr, boot.hdr_size()); memcpy(boot.map_addr + header_off, boot.hdr, boot.hdr_size());
......
...@@ -207,6 +207,8 @@ static_cast<boot_img_hdr_v1 *>(hdr)->x) ...@@ -207,6 +207,8 @@ static_cast<boot_img_hdr_v1 *>(hdr)->x)
hdr_set(recovery_dtbo_size, uint32_t); hdr_set(recovery_dtbo_size, uint32_t);
hdr_get(recovery_dtbo_offset, uint32_t); hdr_get(recovery_dtbo_offset, uint32_t);
hdr_set(recovery_dtbo_offset, uint32_t); hdr_set(recovery_dtbo_offset, uint32_t);
hdr_get(header_size, uint32_t);
hdr_set(header_size, uint32_t);
uint32_t header_version() { uint32_t header_version() {
if (IS_PXA) if (IS_PXA)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment