wok-stable view linux/stuff/005-squashfs-add-xz-compression-configuration-option.patch @ rev 10824

Up yad (0.12.0) - Up since it's our main gui tools and have nice new features as well as bug fixes
author Christophe Lincoln <pankso@slitaz.org>
date Mon Jun 06 20:10:50 2011 +0200 (2011-06-06)
parents
children
line source
1 From: Phillip Lougher <phillip@lougher.demon.co.uk>
2 Date: Thu, 9 Dec 2010 02:08:31 +0000 (+0000)
3 Subject: Squashfs: Add XZ compression configuration option
4 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fpkl%2Fsquashfs-xz.git;a=commitdiff_plain;h=e23d468968e608de27328888240de27d7582ad52
6 Squashfs: Add XZ compression configuration option
8 Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
9 ---
11 diff --git a/fs/squashfs/Kconfig b/fs/squashfs/Kconfig
12 index e5f63da..e96d99a 100644
13 --- a/fs/squashfs/Kconfig
14 +++ b/fs/squashfs/Kconfig
15 @@ -53,6 +53,22 @@ config SQUASHFS_LZO
17 If unsure, say N.
19 +config SQUASHFS_XZ
20 + bool "Include support for XZ compressed file systems"
21 + depends on SQUASHFS
22 + default n
23 + select XZ_DEC
24 + help
25 + Saying Y here includes support for reading Squashfs file systems
26 + compressed with XZ compresssion. XZ gives better compression than
27 + the default zlib compression, at the expense of greater CPU and
28 + memory overhead.
29 +
30 + XZ is not the standard compression used in Squashfs and so most
31 + file systems will be readable without selecting this option.
32 +
33 + If unsure, say N.
34 +
35 config SQUASHFS_EMBEDDED
36 bool "Additional option for memory-constrained systems"
37 depends on SQUASHFS
38 diff --git a/fs/squashfs/Makefile b/fs/squashfs/Makefile
39 index 7672bac..cecf2be 100644
40 --- a/fs/squashfs/Makefile
41 +++ b/fs/squashfs/Makefile
42 @@ -7,3 +7,4 @@ squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
43 squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o
44 squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o
45 squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o
46 +squashfs-$(CONFIG_SQUASHFS_XZ) += xz_wrapper.o
47 diff --git a/fs/squashfs/decompressor.c b/fs/squashfs/decompressor.c
48 index 24af9ce..ac333b8 100644
49 --- a/fs/squashfs/decompressor.c
50 +++ b/fs/squashfs/decompressor.c
51 @@ -46,6 +46,12 @@ static const struct squashfs_decompressor squashfs_lzo_unsupported_comp_ops = {
52 };
53 #endif
55 +#ifndef CONFIG_SQUASHFS_XZ
56 +static const struct squashfs_decompressor squashfs_xz_unsupported_comp_ops = {
57 + NULL, NULL, NULL, XZ_COMPRESSION, "xz", 0
58 +};
59 +#endif
60 +
61 static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
62 NULL, NULL, NULL, 0, "unknown", 0
63 };
64 @@ -58,6 +64,11 @@ static const struct squashfs_decompressor *decompressor[] = {
65 #else
66 &squashfs_lzo_unsupported_comp_ops,
67 #endif
68 +#ifdef CONFIG_SQUASHFS_XZ
69 + &squashfs_xz_comp_ops,
70 +#else
71 + &squashfs_xz_unsupported_comp_ops,
72 +#endif
73 &squashfs_unknown_comp_ops
74 };
76 diff --git a/fs/squashfs/squashfs.h b/fs/squashfs/squashfs.h
77 index 5d45569..1096e2e 100644
78 --- a/fs/squashfs/squashfs.h
79 +++ b/fs/squashfs/squashfs.h
80 @@ -107,3 +107,6 @@ extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
82 /* lzo_wrapper.c */
83 extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
84 +
85 +/* xz_wrapper.c */
86 +extern const struct squashfs_decompressor squashfs_xz_comp_ops;