mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-06-12 05:07:45 +02:00
No kernel repack if it isn't patched at all
It turns out that decompressing and recompressing the kernel is enough to break booting on many devices that use MT6763. Fix #5124, fix #6204, fix #6566 Co-authored-by: LoveSy <shana@zju.edu.cn> Co-authored-by: 南宫雪珊 <vvb2060@gmail.com>
This commit is contained in:
@ -601,6 +601,9 @@ void repack(const char *src_img, const char *out_img, bool skip_comp) {
|
||||
// zImage size shall remain the same
|
||||
hdr->kernel_size() = boot.hdr->kernel_size();
|
||||
}
|
||||
} else if (boot.hdr->kernel_size() != 0) {
|
||||
xwrite(fd, boot.kernel, boot.hdr->kernel_size());
|
||||
hdr->kernel_size() = boot.hdr->kernel_size();
|
||||
}
|
||||
if (boot.flags[ZIMAGE_KERNEL]) {
|
||||
// Copy zImage tail and adjust size accordingly
|
||||
|
Reference in New Issue
Block a user