History

Merge tag 'x86-boot-2020-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 boot updates from Ingo Molnar: "The main change in this cycle was to add support for ZSTD-compressed kernel and initrd images. ZSTD has a very fast decompressor, yet it compresses better than gzip" * tag 'x86-boot-2020-08-03' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: Documentation: dontdiff: Add zstd compressed files .gitignore: Add ZSTD-compressed files x86: Add support for ZSTD compressed kernel x86: Bump ZO_z_extra_bytes margin for zstd usr: Add support for zstd compressed initramfs init: Add support for zstd compressed kernel lib: Add zstd support to decompress lib: Prepare zstd for preboot environment, improve performance

Linus Torvalds committed 6 years ago

Commit c0dfadf2 parents ba77c56 1ac1efa21 files · +469 −26Browse files

Showing the changes to scripts (1 of 21 files). Show all

Unified · Split

scripts/Makefile.lib+22−0
@@ -413,6 +413,28 @@ quiet_cmd_xzkern = XZKERN $@ · 412 unmodified lines
413413 quiet_cmd_xzmisc = XZMISC $@
414414 cmd_xzmisc = cat $(real-prereqs) | $(XZ) --check=crc32 --lzma2=dict=1MiB > $@
415415
416+# ZSTD
417+# ---------------------------------------------------------------------------
418+# Appends the uncompressed size of the data using size_append. The .zst
419+# format has the size information available at the beginning of the file too,
420+# but it's in a more complex format and it's good to avoid changing the part
421+# of the boot code that reads the uncompressed size.
422+#
423+# Note that the bytes added by size_append will make the zstd tool think that
424+# the file is corrupt. This is expected.
425+#
426+# zstd uses a maximum window size of 8 MB. zstd22 uses a maximum window size of
427+# 128 MB. zstd22 is used for kernel compression because it is decompressed in a
428+# single pass, so zstd doesn't need to allocate a window buffer. When streaming
429+# decompression is used, like initramfs decompression, zstd22 should likely not
430+# be used because it would require zstd to allocate a 128 MB buffer.
431+
432+quiet_cmd_zstd = ZSTD $@
433+ cmd_zstd = { cat $(real-prereqs) | $(ZSTD) -19; $(size_append); } > $@
434+
435+quiet_cmd_zstd22 = ZSTD22 $@
436+ cmd_zstd22 = { cat $(real-prereqs) | $(ZSTD) -22 --ultra; $(size_append); } > $@
437+
416438 # ASM offsets
417439 # ---------------------------------------------------------------------------
418440