This patch adds lzip decompression support to the linux kernel. This includes support for lzip-compressed kernel image, initramfs, initrd, modules, and squashfs filesystems. To apply the patch, first choose a version of the patch with the same VERSION and PATCHLEVEL numbers as your kernel version. For example, if you plan to patch linux-4.4.16, choose the patch file linux-4.4.x_lzip-*.diff.lz. If a patch for the desired VERSION-PATCHLEVEL combination does not exist, you may request it in the lzip-bug list (see below). Here is an example of how to apply the patch to version 4.7: $ cd ~/linux-4.7 $ patch -p1 < ../linux-4.7_lzip-0.diff Or if you prefer to apply the patch without decompressing it first: $ cd ~/linux-4.7 $ lzip -cd ../linux-4.7_lzip-0.diff.lz | patch -p1 See Documentation/process/applying-patches.rst in the kernel tree for a nice tutorial on the patch program. Please, send bug reports, suggestions, requests, etc, about this patch to . Documentation/lzip.txt follows: ----------------------------------------------------------------------- ============================== Lzip data compression in Linux ============================== Introduction ============ Lzip is a lossless data compressor with a user interface similar to the one of gzip or bzip2. Lzip can compress about as fast as gzip (lzip -0), or compress most files more than bzip2 (lzip -9). Decompression speed is intermediate between gzip and bzip2. Lzip implements the LZMA algorithm. Lzip has been designed, written and tested with great care to be the standard general-purpose compressor for unix-like systems. The lzip format is as simple as possible (but not simpler). It provides accurate and robust 3 factor integrity checking. Learn more about lzip at http://www.nongnu.org/lzip/lzip.html Lzip related components in the kernel ===================================== The lzip_decompress module in lib/lzip.c provides a versatile lzip decompression function able to do buffer to buffer decompression or stream decompression with fill and flush callback functions. The usage of the function is documented in include/linux/lzip.h. For decompressing the kernel image, initramfs, and initrd, there is a wrapper function in lib/decompress_lunzip.c providing the same common interface as the other decompress_*.c files, which is defined in include/linux/decompress/generic.h. For kernel makefiles, two commands are provided in scripts/Makefile.lib for use with $(call if_changed). The kernel image must be compressed with $(call if_changed,klzip) which will append a four-byte trailer containing the size of the uncompressed data, which is needed by the boot code. Other things should be compressed with $(call if_changed,lzip). Testing ======= Lzip-compressed kernel images of multiple linux versions since 2.6.30.10 have been built and tested, even on machines as modest as an AMD 486-DX2 at 66 MHz with 64 MiB of RAM. In the worst case (on the slow machine above), lzip just increased the boot time a 15% compared with gzip. On more modern machines, lzip may boot slightly faster than gzip. It just takes 0.2 seconds for lzip to decompress vmlinuz-4.4.16 on my machine. Decompression time is usually a small fraction of the total boot time. For example, using lz4 on a desktop machine in order to save 0.05 seconds of a total boot time of 20 seconds is probably not worth the increased image size. Xlunzip is a test tool for the lzip_decompress module. It is similar to lunzip, but it uses the lzip_decompress module as a backend. The xlunzip home page is at http://www.nongnu.org/lzip/xlunzip.html Author: Antonio Diaz Diaz Updated: 2018-07-08