问题描述
partition table 配置 system img 大小6GB以上
出现编译报错
Could not build verity tree! Error: build_verity_tree: system/extras/verity/build_verity_tree.cpp:96: int hash_chunk(void *, const void *, int): Assertion `len % ctx->block_size == 0' failed.
Out of space? the tree size of out/target/product/HLTE316T/system is (MB): |
解决方案
1. 合入Google的patch(共5笔change)
https://android-review.googlesource.com/q/%2522Bug:+78432315%25222. 打上上面那些patch之後還是會有問題, 需要再做下面的更改
/xref/system/core/libsparse/output_file.c#287
- int to_write;
+ int64_t to_write;-to_write = min(off, (int64_t)INT_MAX);
+to_write = min(off, (int64_t)LLONG_MAX);3.还有
diff --git a/mrdump_host_cmd/protocol.cpp b/mrdump_host_cmd/protocol.cpp
- to_write = std::min(TRANSPORT_BUF_SIZE - transport_buf_len, len);
+ to_write = std::min(TRANSPORT_BUF_SIZE - transport_buf_len, (int)len);
https://android-review.googlesource.com/q/%2522Bug:+78432315%25222. 打上上面那些patch之後還是會有問題, 需要再做下面的更改
/xref/system/core/libsparse/output_file.c#287
- int to_write;
+ int64_t to_write;-to_write = min(off, (int64_t)INT_MAX);
+to_write = min(off, (int64_t)LLONG_MAX);3.还有
diff --git a/mrdump_host_cmd/protocol.cpp b/mrdump_host_cmd/protocol.cpp
- to_write = std::min(TRANSPORT_BUF_SIZE - transport_buf_len, len);
+ to_write = std::min(TRANSPORT_BUF_SIZE - transport_buf_len, (int)len);