Update help message and make behavior consistent

This commit is contained in:
topjohnwu
2022-06-14 21:19:07 -07:00
parent 754e690274
commit 1699da1754
2 changed files with 37 additions and 24 deletions
+1 -1
View File
@@ -577,7 +577,7 @@ void repack(const char *src_img, const char *out_img, bool skip_comp) {
}
if (access(KERNEL_FILE, R_OK) == 0) {
auto m = mmap_data(KERNEL_FILE);
if (!COMPRESSED_ANY(check_fmt(m.buf, m.sz)) && COMPRESSED(boot.k_fmt)) {
if (!skip_comp && !COMPRESSED_ANY(check_fmt(m.buf, m.sz)) && COMPRESSED(boot.k_fmt)) {
// Always use zopfli for zImage compression
auto fmt = (boot.flags[ZIMAGE_KERNEL] && boot.k_fmt == GZIP) ? ZOPFLI : boot.k_fmt;
hdr->kernel_size() = compress(fmt, fd, m.buf, m.sz);