3 @@ -120,6 +120,10 @@ config DECOMPRESS_LZMA
4 config DECOMPRESS_LZMA_NEEDED
8 + select LZO_DECOMPRESS
12 # Generic allocator support is selected if needed
16 @@ -69,6 +69,7 @@ obj-$(CONFIG_LZO_DECOMPRESS) += lzo/
17 lib-$(CONFIG_DECOMPRESS_GZIP) += decompress_inflate.o
18 lib-$(CONFIG_DECOMPRESS_BZIP2) += decompress_bunzip2.o
19 lib-$(CONFIG_DECOMPRESS_LZMA) += decompress_unlzma.o
20 +lib-$(CONFIG_DECOMPRESS_LZO) += decompress_unlzo.o
22 obj-$(CONFIG_TEXTSEARCH) += textsearch.o
23 obj-$(CONFIG_TEXTSEARCH_KMP) += ts_kmp.o
24 --- a/lib/decompress.c
25 +++ b/lib/decompress.c
27 #include <linux/decompress/bunzip2.h>
28 #include <linux/decompress/unlzma.h>
29 #include <linux/decompress/inflate.h>
30 +#include <linux/decompress/unlzo.h>
32 #include <linux/types.h>
33 #include <linux/string.h>
35 #ifndef CONFIG_DECOMPRESS_LZMA
38 +#ifndef CONFIG_DECOMPRESS_LZO
42 static const struct compress_format {
43 unsigned char magic[2];
44 @@ -32,6 +36,7 @@ static const struct compress_format {
45 { {037, 0236}, "gzip", gunzip },
46 { {0x42, 0x5a}, "bzip2", bunzip2 },
47 { {0x5d, 0x00}, "lzma", unlzma },
48 + { {0x89, 0x4c}, "lzo", unlzo },
49 { {0, 0}, NULL, NULL }
54 @@ -72,6 +72,15 @@ config RD_LZMA
55 Support loading of a LZMA encoded initial ramdisk or cpio buffer
59 + bool "Support initial ramdisks compressed using LZO" if EMBEDDED
61 + depends on BLK_DEV_INITRD && HAVE_KERNEL_LZO
62 + select DECOMPRESS_LZO
64 + Support loading of a LZO encoded initial ramdisk or cpio buffer
68 prompt "Built-in initramfs compression mode" if INITRAMFS_SOURCE!=""
70 @@ -108,16 +117,15 @@ config INITRAMFS_COMPRESSION_GZIP
74 - The old and tried gzip compression. Its compression ratio is
75 - the poorest among the 3 choices; however its speed (both
76 - compression and decompression) is the fastest.
77 + The old and tried gzip compression. It provides a good balance
78 + between compression ratio and decompression speed.
80 config INITRAMFS_COMPRESSION_BZIP2
84 Its compression ratio and speed is intermediate.
85 - Decompression speed is slowest among the three. The initramfs
86 + Decompression speed is slowest among the four. The initramfs
87 size is about 10% smaller with bzip2, in comparison to gzip.
88 Bzip2 uses a large amount of memory. For modern kernels you
89 will need at least 8MB RAM or more for booting.
90 @@ -128,7 +136,15 @@ config INITRAMFS_COMPRESSION_LZMA
92 The most recent compression algorithm.
93 Its ratio is best, decompression speed is between the other
94 - two. Compression is slowest. The initramfs size is about 33%
95 + three. Compression is slowest. The initramfs size is about 33%
96 smaller with LZMA in comparison to gzip.
98 +config INITRAMFS_COMPRESSION_LZO
102 + Its compression ratio is the poorest among the four. The kernel
103 + size is about about 10% bigger than gzip; however its speed
104 + (both compression and decompression) is the fastest.