Add no decompression flag to magiskboot split

This commit is contained in:
osm0sis
2024-02-04 23:54:44 -04:00
committed by John Wu
parent 7f6b5305ba
commit 991802ab82
3 changed files with 14 additions and 6 deletions

View File

@@ -520,12 +520,12 @@ bool boot_img::verify(const char *cert) const {
return rust::verify_boot_image(*this, cert);
}
int split_image_dtb(const char *filename) {
int split_image_dtb(const char *filename, bool skip_decomp) {
mmap_data img(filename);
if (int off = find_dtb_offset(img.buf(), img.sz()); off > 0) {
format_t fmt = check_fmt_lg(img.buf(), img.sz());
if (COMPRESSED(fmt)) {
if (!skip_decomp && COMPRESSED(fmt)) {
int fd = creat(KERNEL_FILE, 0644);
decompress(fmt, fd, img.buf(), off);
close(fd);