- update squashfs lzma patch
This commit is contained in:
Stephan Raue 2010-01-21 14:49:25 +01:00
parent cd2204e90c
commit 5d42263be0

View File

@ -1,7 +1,7 @@
diff -Naur linux-2.6.32/fs/squashfs/block.c linux-2.6.32.patch/fs/squashfs/block.c
--- linux-2.6.32/fs/squashfs/block.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/block.c 2009-12-05 18:41:38.437304056 +0100
@@ -29,16 +29,14 @@
diff -Naur linux-2.6.33-rc4/fs/squashfs/block.c linux-2.6.33-rc4.patch/fs/squashfs/block.c
--- linux-2.6.33-rc4/fs/squashfs/block.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/block.c 2010-01-21 10:38:28.000000000 +0100
@@ -29,15 +29,14 @@
#include <linux/fs.h>
#include <linux/vfs.h>
#include <linux/slab.h>
@ -14,12 +14,11 @@ diff -Naur linux-2.6.32/fs/squashfs/block.c linux-2.6.32.patch/fs/squashfs/block
#include "squashfs_fs_sb.h"
#include "squashfs_fs_i.h"
#include "squashfs.h"
-
+#include "decompressor.h"
/*
* Read the metadata block length, this is stored in the first two
* bytes of the metadata block.
@@ -153,72 +151,10 @@
@@ -153,72 +152,10 @@
}
if (compressed) {
@ -90,13 +89,13 @@ diff -Naur linux-2.6.32/fs/squashfs/block.c linux-2.6.32.patch/fs/squashfs/block
- length = msblk->stream.total_out;
- mutex_unlock(&msblk->read_data_mutex);
+ length = squashfs_decompress(msblk, buffer, bh, b, offset,
+ length, srclength, pages);
+ length, srclength, pages);
+ if (length < 0)
+ goto read_failure;
} else {
/*
* Block is uncompressed.
@@ -255,9 +191,6 @@
@@ -255,9 +192,6 @@
kfree(bh);
return length;
@ -106,9 +105,9 @@ diff -Naur linux-2.6.32/fs/squashfs/block.c linux-2.6.32.patch/fs/squashfs/block
block_release:
for (; k < b; k++)
put_bh(bh[k]);
diff -Naur linux-2.6.32/fs/squashfs/cache.c linux-2.6.32.patch/fs/squashfs/cache.c
--- linux-2.6.32/fs/squashfs/cache.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/cache.c 2009-12-05 18:41:38.438305640 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/cache.c linux-2.6.33-rc4.patch/fs/squashfs/cache.c
--- linux-2.6.33-rc4/fs/squashfs/cache.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/cache.c 2010-01-21 10:38:28.000000000 +0100
@@ -51,7 +51,6 @@
#include <linux/sched.h>
#include <linux/spinlock.h>
@ -117,9 +116,9 @@ diff -Naur linux-2.6.32/fs/squashfs/cache.c linux-2.6.32.patch/fs/squashfs/cache
#include <linux/pagemap.h>
#include "squashfs_fs.h"
diff -Naur linux-2.6.32/fs/squashfs/decompressor.c linux-2.6.32.patch/fs/squashfs/decompressor.c
--- linux-2.6.32/fs/squashfs/decompressor.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/decompressor.c 2009-12-05 18:41:38.439304990 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/decompressor.c linux-2.6.33-rc4.patch/fs/squashfs/decompressor.c
--- linux-2.6.33-rc4/fs/squashfs/decompressor.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/decompressor.c 2010-01-21 10:38:28.000000000 +0100
@@ -0,0 +1,72 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
@ -193,9 +192,9 @@ diff -Naur linux-2.6.32/fs/squashfs/decompressor.c linux-2.6.32.patch/fs/squashf
+
+ return decompressor[i];
+}
diff -Naur linux-2.6.32/fs/squashfs/decompressor.h linux-2.6.32.patch/fs/squashfs/decompressor.h
--- linux-2.6.32/fs/squashfs/decompressor.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/decompressor.h 2009-12-05 18:41:38.439304990 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/decompressor.h linux-2.6.33-rc4.patch/fs/squashfs/decompressor.h
--- linux-2.6.33-rc4/fs/squashfs/decompressor.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/decompressor.h 2010-01-21 10:38:28.000000000 +0100
@@ -0,0 +1,55 @@
+#ifndef DECOMPRESSOR_H
+#define DECOMPRESSOR_H
@ -252,9 +251,9 @@ diff -Naur linux-2.6.32/fs/squashfs/decompressor.h linux-2.6.32.patch/fs/squashf
+ length, srclength, pages);
+}
+#endif
diff -Naur linux-2.6.32/fs/squashfs/dir.c linux-2.6.32.patch/fs/squashfs/dir.c
--- linux-2.6.32/fs/squashfs/dir.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/dir.c 2009-12-05 18:41:38.439304990 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/dir.c linux-2.6.33-rc4.patch/fs/squashfs/dir.c
--- linux-2.6.33-rc4/fs/squashfs/dir.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/dir.c 2010-01-21 10:38:28.000000000 +0100
@@ -30,7 +30,6 @@
#include <linux/fs.h>
#include <linux/vfs.h>
@ -263,9 +262,9 @@ diff -Naur linux-2.6.32/fs/squashfs/dir.c linux-2.6.32.patch/fs/squashfs/dir.c
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
diff -Naur linux-2.6.32/fs/squashfs/export.c linux-2.6.32.patch/fs/squashfs/export.c
--- linux-2.6.32/fs/squashfs/export.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/export.c 2009-12-05 18:41:38.440302872 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/export.c linux-2.6.33-rc4.patch/fs/squashfs/export.c
--- linux-2.6.33-rc4/fs/squashfs/export.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/export.c 2010-01-21 10:38:28.000000000 +0100
@@ -39,7 +39,6 @@
#include <linux/vfs.h>
#include <linux/dcache.h>
@ -274,9 +273,9 @@ diff -Naur linux-2.6.32/fs/squashfs/export.c linux-2.6.32.patch/fs/squashfs/expo
#include <linux/slab.h>
#include "squashfs_fs.h"
diff -Naur linux-2.6.32/fs/squashfs/file.c linux-2.6.32.patch/fs/squashfs/file.c
--- linux-2.6.32/fs/squashfs/file.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/file.c 2009-12-05 18:41:38.493304431 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/file.c linux-2.6.33-rc4.patch/fs/squashfs/file.c
--- linux-2.6.33-rc4/fs/squashfs/file.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/file.c 2010-01-21 10:38:28.000000000 +0100
@@ -47,7 +47,6 @@
#include <linux/string.h>
#include <linux/pagemap.h>
@ -285,9 +284,9 @@ diff -Naur linux-2.6.32/fs/squashfs/file.c linux-2.6.32.patch/fs/squashfs/file.c
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
diff -Naur linux-2.6.32/fs/squashfs/fragment.c linux-2.6.32.patch/fs/squashfs/fragment.c
--- linux-2.6.32/fs/squashfs/fragment.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/fragment.c 2009-12-05 18:41:38.494304967 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/fragment.c linux-2.6.33-rc4.patch/fs/squashfs/fragment.c
--- linux-2.6.33-rc4/fs/squashfs/fragment.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/fragment.c 2010-01-21 10:38:28.000000000 +0100
@@ -36,7 +36,6 @@
#include <linux/fs.h>
#include <linux/vfs.h>
@ -296,9 +295,9 @@ diff -Naur linux-2.6.32/fs/squashfs/fragment.c linux-2.6.32.patch/fs/squashfs/fr
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
diff -Naur linux-2.6.32/fs/squashfs/id.c linux-2.6.32.patch/fs/squashfs/id.c
--- linux-2.6.32/fs/squashfs/id.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/id.c 2009-12-05 18:41:38.495305225 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/id.c linux-2.6.33-rc4.patch/fs/squashfs/id.c
--- linux-2.6.33-rc4/fs/squashfs/id.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/id.c 2010-01-21 10:38:28.000000000 +0100
@@ -34,7 +34,6 @@
#include <linux/fs.h>
#include <linux/vfs.h>
@ -307,9 +306,9 @@ diff -Naur linux-2.6.32/fs/squashfs/id.c linux-2.6.32.patch/fs/squashfs/id.c
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
diff -Naur linux-2.6.32/fs/squashfs/inode.c linux-2.6.32.patch/fs/squashfs/inode.c
--- linux-2.6.32/fs/squashfs/inode.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/inode.c 2009-12-05 18:41:38.496306250 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/inode.c linux-2.6.33-rc4.patch/fs/squashfs/inode.c
--- linux-2.6.33-rc4/fs/squashfs/inode.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/inode.c 2010-01-21 10:38:28.000000000 +0100
@@ -40,7 +40,6 @@
#include <linux/fs.h>
@ -318,9 +317,9 @@ diff -Naur linux-2.6.32/fs/squashfs/inode.c linux-2.6.32.patch/fs/squashfs/inode
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
diff -Naur linux-2.6.32/fs/squashfs/Kconfig linux-2.6.32.patch/fs/squashfs/Kconfig
--- linux-2.6.32/fs/squashfs/Kconfig 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/Kconfig 2009-12-05 18:41:38.497305111 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/Kconfig linux-2.6.33-rc4.patch/fs/squashfs/Kconfig
--- linux-2.6.33-rc4/fs/squashfs/Kconfig 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/Kconfig 2010-01-21 10:38:28.000000000 +0100
@@ -26,6 +26,12 @@
If unsure, say N.
@ -334,9 +333,9 @@ diff -Naur linux-2.6.32/fs/squashfs/Kconfig linux-2.6.32.patch/fs/squashfs/Kconf
config SQUASHFS_EMBEDDED
bool "Additional option for memory-constrained systems"
diff -Naur linux-2.6.32/fs/squashfs/lzma_wrapper.c linux-2.6.32.patch/fs/squashfs/lzma_wrapper.c
--- linux-2.6.32/fs/squashfs/lzma_wrapper.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/lzma_wrapper.c 2009-12-05 18:41:38.498304460 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/lzma_wrapper.c linux-2.6.33-rc4.patch/fs/squashfs/lzma_wrapper.c
--- linux-2.6.33-rc4/fs/squashfs/lzma_wrapper.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/lzma_wrapper.c 2010-01-21 10:38:28.000000000 +0100
@@ -0,0 +1,151 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
@ -390,7 +389,7 @@ diff -Naur linux-2.6.32/fs/squashfs/lzma_wrapper.c linux-2.6.32.patch/fs/squashf
+ lzma_error = 1;
+}
+
+
+
+static void *lzma_init(struct squashfs_sb_info *msblk)
+{
+ struct squashfs_lzma *stream = kzalloc(sizeof(*stream), GFP_KERNEL);
@ -489,9 +488,9 @@ diff -Naur linux-2.6.32/fs/squashfs/lzma_wrapper.c linux-2.6.32.patch/fs/squashf
+ .supported = 1
+};
+
diff -Naur linux-2.6.32/fs/squashfs/Makefile linux-2.6.32.patch/fs/squashfs/Makefile
--- linux-2.6.32/fs/squashfs/Makefile 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/Makefile 2009-12-05 18:41:38.498304460 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/Makefile linux-2.6.33-rc4.patch/fs/squashfs/Makefile
--- linux-2.6.33-rc4/fs/squashfs/Makefile 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/Makefile 2010-01-21 10:38:28.000000000 +0100
@@ -4,4 +4,5 @@
obj-$(CONFIG_SQUASHFS) += squashfs.o
@ -499,9 +498,9 @@ diff -Naur linux-2.6.32/fs/squashfs/Makefile linux-2.6.32.patch/fs/squashfs/Make
-squashfs-y += namei.o super.o symlink.o
+squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o
+squashfs-$(CONFIG_SQUASHFS_LZMA) += lzma_wrapper.o
diff -Naur linux-2.6.32/fs/squashfs/namei.c linux-2.6.32.patch/fs/squashfs/namei.c
--- linux-2.6.32/fs/squashfs/namei.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/namei.c 2009-12-05 18:41:38.499304857 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/namei.c linux-2.6.33-rc4.patch/fs/squashfs/namei.c
--- linux-2.6.33-rc4/fs/squashfs/namei.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/namei.c 2010-01-21 10:38:28.000000000 +0100
@@ -57,7 +57,6 @@
#include <linux/slab.h>
#include <linux/string.h>
@ -510,9 +509,9 @@ diff -Naur linux-2.6.32/fs/squashfs/namei.c linux-2.6.32.patch/fs/squashfs/namei
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
diff -Naur linux-2.6.32/fs/squashfs/squashfs_fs.h linux-2.6.32.patch/fs/squashfs/squashfs_fs.h
--- linux-2.6.32/fs/squashfs/squashfs_fs.h 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/squashfs_fs.h 2009-12-05 18:41:38.500303299 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/squashfs_fs.h linux-2.6.33-rc4.patch/fs/squashfs/squashfs_fs.h
--- linux-2.6.33-rc4/fs/squashfs/squashfs_fs.h 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/squashfs_fs.h 2010-01-21 10:38:28.000000000 +0100
@@ -211,7 +211,9 @@
/*
* definitions for structures on disk
@ -524,9 +523,9 @@ diff -Naur linux-2.6.32/fs/squashfs/squashfs_fs.h linux-2.6.32.patch/fs/squashfs
struct squashfs_super_block {
__le32 s_magic;
diff -Naur linux-2.6.32/fs/squashfs/squashfs_fs_sb.h linux-2.6.32.patch/fs/squashfs/squashfs_fs_sb.h
--- linux-2.6.32/fs/squashfs/squashfs_fs_sb.h 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/squashfs_fs_sb.h 2009-12-05 18:41:38.500303299 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/squashfs_fs_sb.h linux-2.6.33-rc4.patch/fs/squashfs/squashfs_fs_sb.h
--- linux-2.6.33-rc4/fs/squashfs/squashfs_fs_sb.h 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/squashfs_fs_sb.h 2010-01-21 10:38:28.000000000 +0100
@@ -52,25 +52,26 @@
};
@ -574,9 +573,9 @@ diff -Naur linux-2.6.32/fs/squashfs/squashfs_fs_sb.h linux-2.6.32.patch/fs/squas
+ unsigned int inodes;
};
#endif
diff -Naur linux-2.6.32/fs/squashfs/squashfs.h linux-2.6.32.patch/fs/squashfs/squashfs.h
--- linux-2.6.32/fs/squashfs/squashfs.h 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/squashfs.h 2009-12-05 18:41:38.500303299 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/squashfs.h linux-2.6.33-rc4.patch/fs/squashfs/squashfs.h
--- linux-2.6.33-rc4/fs/squashfs/squashfs.h 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/squashfs.h 2010-01-21 10:38:28.000000000 +0100
@@ -51,6 +51,9 @@
u64, int);
extern int squashfs_read_table(struct super_block *, void *, u64, int);
@ -606,9 +605,9 @@ diff -Naur linux-2.6.32/fs/squashfs/squashfs.h linux-2.6.32.patch/fs/squashfs/sq
+
+/* lzma wrapper.c */
+extern const struct squashfs_decompressor squashfs_lzma_comp_ops;
diff -Naur linux-2.6.32/fs/squashfs/super.c linux-2.6.32.patch/fs/squashfs/super.c
--- linux-2.6.32/fs/squashfs/super.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/super.c 2009-12-05 18:57:00.781303859 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/super.c linux-2.6.33-rc4.patch/fs/squashfs/super.c
--- linux-2.6.33-rc4/fs/squashfs/super.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/super.c 2010-01-21 10:38:28.000000000 +0100
@@ -35,34 +35,41 @@
#include <linux/pagemap.h>
#include <linux/init.h>
@ -746,9 +745,9 @@ diff -Naur linux-2.6.32/fs/squashfs/super.c linux-2.6.32.patch/fs/squashfs/super
kfree(sb->s_fs_info);
sb->s_fs_info = NULL;
}
diff -Naur linux-2.6.32/fs/squashfs/symlink.c linux-2.6.32.patch/fs/squashfs/symlink.c
--- linux-2.6.32/fs/squashfs/symlink.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/symlink.c 2009-12-05 18:41:38.502302976 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/symlink.c linux-2.6.33-rc4.patch/fs/squashfs/symlink.c
--- linux-2.6.33-rc4/fs/squashfs/symlink.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/symlink.c 2010-01-21 10:38:28.000000000 +0100
@@ -36,7 +36,6 @@
#include <linux/slab.h>
#include <linux/string.h>
@ -757,9 +756,9 @@ diff -Naur linux-2.6.32/fs/squashfs/symlink.c linux-2.6.32.patch/fs/squashfs/sym
#include "squashfs_fs.h"
#include "squashfs_fs_sb.h"
diff -Naur linux-2.6.32/fs/squashfs/zlib_wrapper.c linux-2.6.32.patch/fs/squashfs/zlib_wrapper.c
--- linux-2.6.32/fs/squashfs/zlib_wrapper.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.32.patch/fs/squashfs/zlib_wrapper.c 2009-12-05 18:41:38.502302976 +0100
diff -Naur linux-2.6.33-rc4/fs/squashfs/zlib_wrapper.c linux-2.6.33-rc4.patch/fs/squashfs/zlib_wrapper.c
--- linux-2.6.33-rc4/fs/squashfs/zlib_wrapper.c 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/fs/squashfs/zlib_wrapper.c 2010-01-21 10:38:28.000000000 +0100
@@ -0,0 +1,150 @@
+/*
+ * Squashfs - a compressed read only filesystem for Linux
@ -911,10 +910,10 @@ diff -Naur linux-2.6.32/fs/squashfs/zlib_wrapper.c linux-2.6.32.patch/fs/squashf
+ .supported = 1
+};
+
diff -Naur linux-2.6.32/include/linux/decompress/bunzip2_mm.h linux-2.6.32.patch/include/linux/decompress/bunzip2_mm.h
--- linux-2.6.32/include/linux/decompress/bunzip2_mm.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.32.patch/include/linux/decompress/bunzip2_mm.h 2009-12-05 18:41:38.502302976 +0100
@@ -0,0 +1,12 @@
diff -Naur linux-2.6.33-rc4/include/linux/decompress/bunzip2_mm.h linux-2.6.33-rc4.patch/include/linux/decompress/bunzip2_mm.h
--- linux-2.6.33-rc4/include/linux/decompress/bunzip2_mm.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/include/linux/decompress/bunzip2_mm.h 2010-01-21 10:38:28.000000000 +0100
@@ -0,0 +1,13 @@
+#ifndef BUNZIP2_MM_H
+#define BUNZIP2_MM_H
+
@ -924,13 +923,14 @@ diff -Naur linux-2.6.32/include/linux/decompress/bunzip2_mm.h linux-2.6.32.patch
+#else
+/* Compile for initramfs/initrd code only */
+#define INIT __init
+static void(*error)(char *m);
+#endif
+
+#endif
diff -Naur linux-2.6.32/include/linux/decompress/inflate_mm.h linux-2.6.32.patch/include/linux/decompress/inflate_mm.h
--- linux-2.6.32/include/linux/decompress/inflate_mm.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.32.patch/include/linux/decompress/inflate_mm.h 2009-12-05 18:41:38.503302604 +0100
@@ -0,0 +1,12 @@
diff -Naur linux-2.6.33-rc4/include/linux/decompress/inflate_mm.h linux-2.6.33-rc4.patch/include/linux/decompress/inflate_mm.h
--- linux-2.6.33-rc4/include/linux/decompress/inflate_mm.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/include/linux/decompress/inflate_mm.h 2010-01-21 10:38:28.000000000 +0100
@@ -0,0 +1,13 @@
+#ifndef INFLATE_MM_H
+#define INFLATE_MM_H
+
@ -940,12 +940,13 @@ diff -Naur linux-2.6.32/include/linux/decompress/inflate_mm.h linux-2.6.32.patch
+#else
+/* Compile for initramfs/initrd code only */
+#define INIT __init
+static void(*error)(char *m);
+#endif
+
+#endif
diff -Naur linux-2.6.32/include/linux/decompress/mm.h linux-2.6.32.patch/include/linux/decompress/mm.h
--- linux-2.6.32/include/linux/decompress/mm.h 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/include/linux/decompress/mm.h 2009-12-05 18:41:38.503302604 +0100
diff -Naur linux-2.6.33-rc4/include/linux/decompress/mm.h linux-2.6.33-rc4.patch/include/linux/decompress/mm.h
--- linux-2.6.33-rc4/include/linux/decompress/mm.h 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/include/linux/decompress/mm.h 2010-01-21 10:38:28.000000000 +0100
@@ -53,8 +53,6 @@
#define set_error_fn(x)
@ -955,17 +956,20 @@ diff -Naur linux-2.6.32/include/linux/decompress/mm.h linux-2.6.32.patch/include
#else /* STATIC */
/* Code active when compiled standalone for use when loading ramdisk: */
@@ -77,7 +75,6 @@
static void(*error)(char *m);
@@ -74,10 +72,8 @@
#define large_malloc(a) vmalloc(a)
#define large_free(a) vfree(a)
-static void(*error)(char *m);
#define set_error_fn(x) error = x;
-#define INIT __init
#define STATIC
#include <linux/init.h>
diff -Naur linux-2.6.32/include/linux/decompress/unlzma_mm.h linux-2.6.32.patch/include/linux/decompress/unlzma_mm.h
--- linux-2.6.32/include/linux/decompress/unlzma_mm.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.32.patch/include/linux/decompress/unlzma_mm.h 2009-12-05 18:41:38.503302604 +0100
diff -Naur linux-2.6.33-rc4/include/linux/decompress/unlzma_mm.h linux-2.6.33-rc4.patch/include/linux/decompress/unlzma_mm.h
--- linux-2.6.33-rc4/include/linux/decompress/unlzma_mm.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/include/linux/decompress/unlzma_mm.h 2010-01-21 10:38:28.000000000 +0100
@@ -0,0 +1,20 @@
+#ifndef UNLZMA_MM_H
+#define UNLZMA_MM_H
@ -987,9 +991,26 @@ diff -Naur linux-2.6.32/include/linux/decompress/unlzma_mm.h linux-2.6.32.patch/
+#endif
+
+#endif
diff -Naur linux-2.6.32/lib/decompress_bunzip2.c linux-2.6.32.patch/lib/decompress_bunzip2.c
--- linux-2.6.32/lib/decompress_bunzip2.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/lib/decompress_bunzip2.c 2009-12-05 18:41:38.504178266 +0100
diff -Naur linux-2.6.33-rc4/include/linux/decompress/unlzo_mm.h linux-2.6.33-rc4.patch/include/linux/decompress/unlzo_mm.h
--- linux-2.6.33-rc4/include/linux/decompress/unlzo_mm.h 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/include/linux/decompress/unlzo_mm.h 2010-01-21 10:38:28.000000000 +0100
@@ -0,0 +1,13 @@
+#ifndef UNLZO_MM_H
+#define UNLZO_MM_H
+
+#ifdef STATIC
+/* Code active when included from pre-boot environment: */
+#define INIT
+#else
+/* Compile for initramfs/initrd code only */
+#define INIT __init
+static void(*error)(char *m);
+#endif
+
+#endif
diff -Naur linux-2.6.33-rc4/lib/decompress_bunzip2.c linux-2.6.33-rc4.patch/lib/decompress_bunzip2.c
--- linux-2.6.33-rc4/lib/decompress_bunzip2.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/lib/decompress_bunzip2.c 2010-01-21 10:38:32.000000000 +0100
@@ -52,6 +52,7 @@
#include <linux/slab.h>
#endif /* STATIC */
@ -998,9 +1019,9 @@ diff -Naur linux-2.6.32/lib/decompress_bunzip2.c linux-2.6.32.patch/lib/decompre
#include <linux/decompress/mm.h>
#ifndef INT_MAX
diff -Naur linux-2.6.32/lib/decompress_inflate.c linux-2.6.32.patch/lib/decompress_inflate.c
--- linux-2.6.32/lib/decompress_inflate.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/lib/decompress_inflate.c 2009-12-05 18:41:38.504178266 +0100
diff -Naur linux-2.6.33-rc4/lib/decompress_inflate.c linux-2.6.33-rc4.patch/lib/decompress_inflate.c
--- linux-2.6.33-rc4/lib/decompress_inflate.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/lib/decompress_inflate.c 2010-01-21 10:38:32.000000000 +0100
@@ -23,6 +23,7 @@
#endif /* STATIC */
@ -1009,9 +1030,9 @@ diff -Naur linux-2.6.32/lib/decompress_inflate.c linux-2.6.32.patch/lib/decompre
#include <linux/decompress/mm.h>
#define GZIP_IOBUF_SIZE (16*1024)
diff -Naur linux-2.6.32/lib/decompress_unlzma.c linux-2.6.32.patch/lib/decompress_unlzma.c
--- linux-2.6.32/lib/decompress_unlzma.c 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/lib/decompress_unlzma.c 2009-12-05 18:41:38.514296914 +0100
diff -Naur linux-2.6.33-rc4/lib/decompress_unlzma.c linux-2.6.33-rc4.patch/lib/decompress_unlzma.c
--- linux-2.6.33-rc4/lib/decompress_unlzma.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/lib/decompress_unlzma.c 2010-01-21 10:38:32.000000000 +0100
@@ -36,6 +36,7 @@
#include <linux/slab.h>
#endif /* STATIC */
@ -1020,7 +1041,248 @@ diff -Naur linux-2.6.32/lib/decompress_unlzma.c linux-2.6.32.patch/lib/decompres
#include <linux/decompress/mm.h>
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
@@ -531,7 +532,7 @@
@@ -88,7 +89,7 @@
}
/* Called twice: once at startup and once in rc_normalize() */
-static void INIT rc_read(struct rc *rc)
+static void INIT rc_read(struct rc *rc, void(*error)(char *x))
{
rc->buffer_size = rc->fill((char *)rc->buffer, LZMA_IOBUF_SIZE);
if (rc->buffer_size <= 0)
@@ -115,13 +116,13 @@
rc->range = 0xFFFFFFFF;
}
-static inline void INIT rc_init_code(struct rc *rc)
+static inline void INIT rc_init_code(struct rc *rc, void(*error)(char *x))
{
int i;
for (i = 0; i < 5; i++) {
if (rc->ptr >= rc->buffer_end)
- rc_read(rc);
+ rc_read(rc, error);
rc->code = (rc->code << 8) | *rc->ptr++;
}
}
@@ -134,32 +135,33 @@
}
/* Called twice, but one callsite is in inline'd rc_is_bit_0_helper() */
-static void INIT rc_do_normalize(struct rc *rc)
+static void INIT rc_do_normalize(struct rc *rc, void(*error)(char *x))
{
if (rc->ptr >= rc->buffer_end)
- rc_read(rc);
+ rc_read(rc, error);
rc->range <<= 8;
rc->code = (rc->code << 8) | *rc->ptr++;
}
-static inline void INIT rc_normalize(struct rc *rc)
+static inline void INIT rc_normalize(struct rc *rc, void(*error)(char *x))
{
if (rc->range < (1 << RC_TOP_BITS))
- rc_do_normalize(rc);
+ rc_do_normalize(rc, error);
}
/* Called 9 times */
/* Why rc_is_bit_0_helper exists?
*Because we want to always expose (rc->code < rc->bound) to optimizer
*/
-static inline uint32_t INIT rc_is_bit_0_helper(struct rc *rc, uint16_t *p)
+static inline uint32_t INIT rc_is_bit_0_helper(struct rc *rc, uint16_t *p,
+ void (*error)(char *x))
{
- rc_normalize(rc);
+ rc_normalize(rc, error);
rc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS);
return rc->bound;
}
-static inline int INIT rc_is_bit_0(struct rc *rc, uint16_t *p)
+static inline int INIT rc_is_bit_0(struct rc *rc, uint16_t *p, void(*error)(char *x))
{
- uint32_t t = rc_is_bit_0_helper(rc, p);
+ uint32_t t = rc_is_bit_0_helper(rc, p, error);
return rc->code < t;
}
@@ -177,9 +179,9 @@
}
/* Called 4 times in unlzma loop */
-static int INIT rc_get_bit(struct rc *rc, uint16_t *p, int *symbol)
+static int INIT rc_get_bit(struct rc *rc, uint16_t *p, int *symbol, void(*error)(char *x))
{
- if (rc_is_bit_0(rc, p)) {
+ if (rc_is_bit_0(rc, p, error)) {
rc_update_bit_0(rc, p);
*symbol *= 2;
return 0;
@@ -191,9 +193,9 @@
}
/* Called once */
-static inline int INIT rc_direct_bit(struct rc *rc)
+static inline int INIT rc_direct_bit(struct rc *rc , void(*error)(char *x))
{
- rc_normalize(rc);
+ rc_normalize(rc, error);
rc->range >>= 1;
if (rc->code >= rc->range) {
rc->code -= rc->range;
@@ -204,13 +206,14 @@
/* Called twice */
static inline void INIT
-rc_bit_tree_decode(struct rc *rc, uint16_t *p, int num_levels, int *symbol)
+rc_bit_tree_decode(struct rc *rc, uint16_t *p, int num_levels, int *symbol,
+ void(*error)(char *x))
{
int i = num_levels;
*symbol = 1;
while (i--)
- rc_get_bit(rc, p + *symbol, symbol);
+ rc_get_bit(rc, p + *symbol, symbol, error);
*symbol -= 1 << num_levels;
}
@@ -347,7 +350,8 @@
static inline void INIT process_bit0(struct writer *wr, struct rc *rc,
struct cstate *cst, uint16_t *p,
int pos_state, uint16_t *prob,
- int lc, uint32_t literal_pos_mask) {
+ int lc, uint32_t literal_pos_mask,
+ void(*error)(char *x)) {
int mi = 1;
rc_update_bit_0(rc, prob);
prob = (p + LZMA_LITERAL +
@@ -365,7 +369,7 @@
match_byte <<= 1;
bit = match_byte & 0x100;
prob_lit = prob + 0x100 + bit + mi;
- if (rc_get_bit(rc, prob_lit, &mi)) {
+ if (rc_get_bit(rc, prob_lit, &mi, error)) {
if (!bit)
break;
} else {
@@ -376,7 +380,7 @@
}
while (mi < 0x100) {
uint16_t *prob_lit = prob + mi;
- rc_get_bit(rc, prob_lit, &mi);
+ rc_get_bit(rc, prob_lit, &mi, error);
}
write_byte(wr, mi);
if (cst->state < 4)
@@ -389,7 +393,8 @@
static inline void INIT process_bit1(struct writer *wr, struct rc *rc,
struct cstate *cst, uint16_t *p,
- int pos_state, uint16_t *prob) {
+ int pos_state, uint16_t *prob,
+ void(*error)(char *x)) {
int offset;
uint16_t *prob_len;
int num_bits;
@@ -397,7 +402,7 @@
rc_update_bit_1(rc, prob);
prob = p + LZMA_IS_REP + cst->state;
- if (rc_is_bit_0(rc, prob)) {
+ if (rc_is_bit_0(rc, prob, error)) {
rc_update_bit_0(rc, prob);
cst->rep3 = cst->rep2;
cst->rep2 = cst->rep1;
@@ -407,13 +412,13 @@
} else {
rc_update_bit_1(rc, prob);
prob = p + LZMA_IS_REP_G0 + cst->state;
- if (rc_is_bit_0(rc, prob)) {
+ if (rc_is_bit_0(rc, prob, error)) {
rc_update_bit_0(rc, prob);
prob = (p + LZMA_IS_REP_0_LONG
+ (cst->state <<
LZMA_NUM_POS_BITS_MAX) +
pos_state);
- if (rc_is_bit_0(rc, prob)) {
+ if (rc_is_bit_0(rc, prob, error)) {
rc_update_bit_0(rc, prob);
cst->state = cst->state < LZMA_NUM_LIT_STATES ?
@@ -428,13 +433,13 @@
rc_update_bit_1(rc, prob);
prob = p + LZMA_IS_REP_G1 + cst->state;
- if (rc_is_bit_0(rc, prob)) {
+ if (rc_is_bit_0(rc, prob, error)) {
rc_update_bit_0(rc, prob);
distance = cst->rep1;
} else {
rc_update_bit_1(rc, prob);
prob = p + LZMA_IS_REP_G2 + cst->state;
- if (rc_is_bit_0(rc, prob)) {
+ if (rc_is_bit_0(rc, prob, error)) {
rc_update_bit_0(rc, prob);
distance = cst->rep2;
} else {
@@ -452,7 +457,7 @@
}
prob_len = prob + LZMA_LEN_CHOICE;
- if (rc_is_bit_0(rc, prob_len)) {
+ if (rc_is_bit_0(rc, prob_len, error)) {
rc_update_bit_0(rc, prob_len);
prob_len = (prob + LZMA_LEN_LOW
+ (pos_state <<
@@ -462,7 +467,7 @@
} else {
rc_update_bit_1(rc, prob_len);
prob_len = prob + LZMA_LEN_CHOICE_2;
- if (rc_is_bit_0(rc, prob_len)) {
+ if (rc_is_bit_0(rc, prob_len, error)) {
rc_update_bit_0(rc, prob_len);
prob_len = (prob + LZMA_LEN_MID
+ (pos_state <<
@@ -478,7 +483,7 @@
}
}
- rc_bit_tree_decode(rc, prob_len, num_bits, &len);
+ rc_bit_tree_decode(rc, prob_len, num_bits, &len, error);
len += offset;
if (cst->state < 4) {
@@ -493,7 +498,7 @@
<< LZMA_NUM_POS_SLOT_BITS);
rc_bit_tree_decode(rc, prob,
LZMA_NUM_POS_SLOT_BITS,
- &pos_slot);
+ &pos_slot, error);
if (pos_slot >= LZMA_START_POS_MODEL_INDEX) {
int i, mi;
num_bits = (pos_slot >> 1) - 1;
@@ -506,7 +511,7 @@
num_bits -= LZMA_NUM_ALIGN_BITS;
while (num_bits--)
cst->rep0 = (cst->rep0 << 1) |
- rc_direct_bit(rc);
+ rc_direct_bit(rc, error);
prob = p + LZMA_ALIGN;
cst->rep0 <<= LZMA_NUM_ALIGN_BITS;
num_bits = LZMA_NUM_ALIGN_BITS;
@@ -514,7 +519,7 @@
i = 1;
mi = 1;
while (num_bits--) {
- if (rc_get_bit(rc, prob + mi, &mi))
+ if (rc_get_bit(rc, prob + mi, &mi, error))
cst->rep0 |= i;
i <<= 1;
}
@@ -531,12 +536,12 @@
@ -1029,19 +1291,78 @@ diff -Naur linux-2.6.32/lib/decompress_unlzma.c linux-2.6.32.patch/lib/decompres
int(*fill)(void*, unsigned int),
int(*flush)(void*, unsigned int),
unsigned char *output,
@@ -664,4 +665,6 @@
int *posp,
- void(*error_fn)(char *x)
+ void(*error)(char *x)
)
{
return unlzma(buf, in_len - 4, fill, flush, output, posp, error_fn);
struct lzma_header header;
@@ -552,8 +557,6 @@
unsigned char *inbuf;
int ret = -1;
- set_error_fn(error_fn);
-
if (buf)
inbuf = buf;
else
@@ -576,7 +579,7 @@
for (i = 0; i < sizeof(header); i++) {
if (rc.ptr >= rc.buffer_end)
- rc_read(&rc);
+ rc_read(&rc, error);
((unsigned char *)&header)[i] = *rc.ptr++;
}
@@ -621,17 +624,17 @@
for (i = 0; i < num_probs; i++)
p[i] = (1 << RC_MODEL_TOTAL_BITS) >> 1;
- rc_init_code(&rc);
+ rc_init_code(&rc, error);
while (get_pos(&wr) < header.dst_size) {
int pos_state = get_pos(&wr) & pos_state_mask;
uint16_t *prob = p + LZMA_IS_MATCH +
(cst.state << LZMA_NUM_POS_BITS_MAX) + pos_state;
- if (rc_is_bit_0(&rc, prob))
+ if (rc_is_bit_0(&rc, prob, error))
process_bit0(&wr, &rc, &cst, p, pos_state, prob,
- lc, literal_pos_mask);
+ lc, literal_pos_mask, error);
else {
- process_bit1(&wr, &rc, &cst, p, pos_state, prob);
+ process_bit1(&wr, &rc, &cst, p, pos_state, prob, error);
if (cst.rep0 == 0)
break;
}
@@ -652,6 +655,9 @@
exit_0:
return ret;
}
+#elif defined(CONFIG_DECOMPRESS_LZMA_NEEDED)
+#if defined(CONFIG_DECOMPRESS_LZMA_NEEDED) && !defined(PREBOOT)
+EXPORT_SYMBOL(unlzma);
+#endif
#ifdef PREBOOT
STATIC int INIT decompress(unsigned char *buf, int in_len,
diff -Naur linux-2.6.33-rc4/lib/decompress_unlzo.c linux-2.6.33-rc4.patch/lib/decompress_unlzo.c
--- linux-2.6.33-rc4/lib/decompress_unlzo.c 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/lib/decompress_unlzo.c 2010-01-21 10:38:32.000000000 +0100
@@ -34,6 +34,7 @@
#include "lzo/lzo1x_decompress.c"
#else
#include <linux/slab.h>
+#include <linux/decompress/unlzo_mm.h>
#include <linux/decompress/unlzo.h>
#endif
diff -Naur linux-2.6.32/lib/decompress_unlzma.c.orig linux-2.6.32.patch/lib/decompress_unlzma.c.orig
diff -Naur linux-2.6.32/lib/Kconfig linux-2.6.32.patch/lib/Kconfig
--- linux-2.6.32/lib/Kconfig 2009-12-03 04:51:21.000000000 +0100
+++ linux-2.6.32.patch/lib/Kconfig 2009-12-05 18:41:38.514296914 +0100
@@ -117,6 +117,9 @@
config DECOMPRESS_LZMA
diff -Naur linux-2.6.33-rc4/lib/Kconfig linux-2.6.33-rc4.patch/lib/Kconfig
--- linux-2.6.33-rc4/lib/Kconfig 2010-01-13 06:15:00.000000000 +0100
+++ linux-2.6.33-rc4.patch/lib/Kconfig 2010-01-21 11:32:21.424348815 +0100
@@ -121,6 +121,9 @@
select LZO_DECOMPRESS
tristate
+config DECOMPRESS_LZMA_NEEDED