mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-23 18:15:30 +00:00
Search for dtb only if not existed
This commit is contained in:
parent
7a376c9efc
commit
b614b06736
@ -92,14 +92,16 @@ int parse_img(void *orig, size_t size, boot_img *boot) {
|
|||||||
boot->extra = base + pos;
|
boot->extra = base + pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Linear search in kernel for DTB
|
// Search for dtb in kernel if not found
|
||||||
for (int i = 0; i < boot->hdr.kernel_size; ++i) {
|
if (boot->hdr.dt_size == 0) {
|
||||||
if (memcmp(boot->kernel + i, DTB_MAGIC, 4) == 0) {
|
for (int i = 0; i < boot->hdr.kernel_size; ++i) {
|
||||||
boot->flags |= APPEND_DTB;
|
if (memcmp(boot->kernel + i, DTB_MAGIC, 4) == 0) {
|
||||||
boot->dtb = boot->kernel + i;
|
boot->flags |= APPEND_DTB;
|
||||||
boot->hdr.dt_size = boot->hdr.kernel_size - i;
|
boot->dtb = boot->kernel + i;
|
||||||
boot->hdr.kernel_size = i;
|
boot->hdr.dt_size = boot->hdr.kernel_size - i;
|
||||||
fprintf(stderr, "APPEND_DTB [%d]\n", boot->hdr.dt_size);
|
boot->hdr.kernel_size = i;
|
||||||
|
fprintf(stderr, "APPEND_DTB [%d]\n", boot->hdr.dt_size);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user