summaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-2.6.30/000-bzip_lzma_remove_nasty_hack.patch
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-04-21 15:18:55 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-04-21 15:18:55 +0000
commit2e5d3d2795663d7c3cc88356b307e05f833f4e16 (patch)
tree18d1d0ac7c60dfab6671b1e43e9dea94fe747c34 /target/linux/generic/patches-2.6.30/000-bzip_lzma_remove_nasty_hack.patch
parentc6379f629559533056a5ba0eaab84a02d6867171 (diff)
downloadmaster-31e0f0ae-2e5d3d2795663d7c3cc88356b307e05f833f4e16.tar.gz
master-31e0f0ae-2e5d3d2795663d7c3cc88356b307e05f833f4e16.tar.bz2
master-31e0f0ae-2e5d3d2795663d7c3cc88356b307e05f833f4e16.zip
linux/2.6.30: R.I.P.
SVN-Revision: 31411
Diffstat (limited to 'target/linux/generic/patches-2.6.30/000-bzip_lzma_remove_nasty_hack.patch')
-rw-r--r--target/linux/generic/patches-2.6.30/000-bzip_lzma_remove_nasty_hack.patch113
1 files changed, 0 insertions, 113 deletions
diff --git a/target/linux/generic/patches-2.6.30/000-bzip_lzma_remove_nasty_hack.patch b/target/linux/generic/patches-2.6.30/000-bzip_lzma_remove_nasty_hack.patch
deleted file mode 100644
index 33572b8905..0000000000
--- a/target/linux/generic/patches-2.6.30/000-bzip_lzma_remove_nasty_hack.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From b1af4315d823a2b6659c5b14bc17f7bc61878ef4 Mon Sep 17 00:00:00 2001
-From: Phillip Lougher <phillip@lougher.demon.co.uk>
-Date: Thu, 6 Aug 2009 15:09:31 -0700
-Subject: [PATCH] bzip2/lzma: remove nasty uncompressed size hack in pre-boot environment
-
-decompress_bunzip2 and decompress_unlzma have a nasty hack that subtracts
-4 from the input length if being called in the pre-boot environment.
-
-This is a nasty hack because it relies on the fact that flush = NULL only
-when called from the pre-boot environment (i.e.
-arch/x86/boot/compressed/misc.c). initramfs.c/do_mounts_rd.c pass in a
-flush buffer (flush != NULL).
-
-This hack prevents the decompressors from being used with flush = NULL by
-other callers unless knowledge of the hack is propagated to them.
-
-This patch removes the hack by making decompress (called only from the
-pre-boot environment) a wrapper function that subtracts 4 from the input
-length before calling the decompressor.
-
-Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
-Cc: "H. Peter Anvin" <hpa@zytor.com>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
----
- lib/decompress_bunzip2.c | 22 ++++++++++++++++------
- lib/decompress_unlzma.c | 21 ++++++++++++++++-----
- 2 files changed, 32 insertions(+), 11 deletions(-)
-
---- a/lib/decompress_bunzip2.c
-+++ b/lib/decompress_bunzip2.c
-@@ -45,9 +45,11 @@
- */
-
-
--#ifndef STATIC
-+#ifdef STATIC
-+#define PREBOOT
-+#else
- #include <linux/decompress/bunzip2.h>
--#endif /* !STATIC */
-+#endif /* STATIC */
-
- #include <linux/decompress/mm.h>
- #include <linux/slab.h>
-@@ -681,9 +683,7 @@ STATIC int INIT bunzip2(unsigned char *b
- set_error_fn(error_fn);
- if (flush)
- outbuf = malloc(BZIP2_IOBUF_SIZE);
-- else
-- len -= 4; /* Uncompressed size hack active in pre-boot
-- environment */
-+
- if (!outbuf) {
- error("Could not allocate output bufer");
- return -1;
-@@ -733,4 +733,14 @@ exit_0:
- return i;
- }
-
--#define decompress bunzip2
-+#ifdef PREBOOT
-+STATIC int INIT decompress(unsigned char *buf, int len,
-+ int(*fill)(void*, unsigned int),
-+ int(*flush)(void*, unsigned int),
-+ unsigned char *outbuf,
-+ int *pos,
-+ void(*error_fn)(char *x))
-+{
-+ return bunzip2(buf, len - 4, fill, flush, outbuf, pos, error_fn);
-+}
-+#endif
---- a/lib/decompress_unlzma.c
-+++ b/lib/decompress_unlzma.c
-@@ -29,7 +29,9 @@
- *Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
--#ifndef STATIC
-+#ifdef STATIC
-+#define PREBOOT
-+#else
- #include <linux/decompress/unlzma.h>
- #endif /* STATIC */
-
-@@ -543,9 +545,7 @@ STATIC inline int INIT unlzma(unsigned c
- int ret = -1;
-
- set_error_fn(error_fn);
-- if (!flush)
-- in_len -= 4; /* Uncompressed size hack active in pre-boot
-- environment */
-+
- if (buf)
- inbuf = buf;
- else
-@@ -645,4 +645,15 @@ exit_0:
- return ret;
- }
-
--#define decompress unlzma
-+#ifdef PREBOOT
-+STATIC int INIT decompress(unsigned char *buf, int in_len,
-+ int(*fill)(void*, unsigned int),
-+ int(*flush)(void*, unsigned int),
-+ unsigned char *output,
-+ int *posp,
-+ void(*error_fn)(char *x)
-+ )
-+{
-+ return unlzma(buf, in_len - 4, fill, flush, output, posp, error_fn);
-+}
-+#endif