wok-6.x rev 310

Linux: export unlzma
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 02 20:47:57 2008 +0000 (2008-03-02)
parents 3a5e92c048e0
children b15eab4dc854
files linux/receipt linux/stuff/linux-lzma-export.u
line diff
     1.1 --- a/linux/receipt	Sat Mar 01 12:55:33 2008 +0000
     1.2 +++ b/linux/receipt	Sun Mar 02 20:47:57 2008 +0000
     1.3 @@ -22,6 +22,7 @@
     1.4  	patch -p1 < ../stuff/config-acpi-$VERSION.u
     1.5  	patch -p1 < ../stuff/linux-utf8-$VERSION.u
     1.6  	patch -p1 < ../stuff/config-ieee1394-$VERSION.u
     1.7 +	patch -p1 < ../stuff/linux-lzma-export.u
     1.8  	make oldconfig
     1.9  	make bzImage
    1.10  	make modules
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/linux/stuff/linux-lzma-export.u	Sun Mar 02 20:47:57 2008 +0000
     2.3 @@ -0,0 +1,67 @@
     2.4 +--- linux-2.6.24.2/lib/decompress_unlzma.c
     2.5 ++++ linux-2.6.24.2/lib/decompress_unlzma.c
     2.6 +@@ -321,7 +321,7 @@ typedef struct {
     2.7 + #define LZMA_LITERAL (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS)
     2.8 + 
     2.9 + 
    2.10 +-STATIC int unlzma(char *inbuf, int in_len, 
    2.11 ++int unlzma(char *inbuf, int in_len, 
    2.12 + 		   int(*fill)(void*,unsigned int),
    2.13 + 		   int(*writebb)(char*,unsigned int),
    2.14 + 		   int *posp)
    2.15 +@@ -348,10 +348,21 @@ STATIC int unlzma(char *inbuf, int in_le
    2.16 + 
    2.17 + 	rc_init(&rc, fill, inbuf, in_len);
    2.18 + 
    2.19 +-	for (i = 0; i < sizeof(header); i++) {
    2.20 +-		if (rc.ptr >= rc.buffer_end)
    2.21 +-			rc_read(&rc);
    2.22 +-		((unsigned char *)&header)[i] = *rc.ptr++;
    2.23 ++	header.dict_size = header.dst_size = in_len;
    2.24 ++	if (inbuf && inbuf[0] == 0) {
    2.25 ++		const LZMA_LC = 3, LZMA_LP = 0, LZMA_PB = 2;
    2.26 ++		header.pos = (LZMA_PB * 45) + (LZMA_LP * 5) + LZMA_LC;
    2.27 ++		rc.ptr++;
    2.28 ++	}
    2.29 ++	else {
    2.30 ++		int hdrsize = sizeof(header);
    2.31 ++		if (inbuf && (1 + * (unsigned long *) &inbuf[9]) > 1U)
    2.32 ++			hdrsize = 5;
    2.33 ++		for (i = 0; i < hdrsize; i++) {
    2.34 ++			if (rc.ptr >= rc.buffer_end)
    2.35 ++				rc_read(&rc);
    2.36 ++			((unsigned char *)&header)[i] = *rc.ptr++;
    2.37 ++		}
    2.38 + 	}
    2.39 + 
    2.40 + 	if (header.pos >= (9 * 5 * 5))
    2.41 +
    2.42 +--- linux-2.6.24.2/lib/Makefile	
    2.43 ++++ linux-2.6.24.2/lib/Makefile	
    2.44 +@@ -51,7 +51,7 @@ obj-$(CONFIG_LIBCRC32C)	+= libcrc32c.o
    2.45 + obj-$(CONFIG_GENERIC_ALLOCATOR) += genalloc.o
    2.46 + 
    2.47 + obj-$(CONFIG_RD_BZIP2)	+= decompress_bunzip2.o
    2.48 +-obj-$(CONFIG_RD_LZMA)	+= decompress_unlzma.o
    2.49 ++obj-$(CONFIG_RD_LZMA)	+= decompress_unlzma.o unlzma_syms.o
    2.50 + 
    2.51 + 
    2.52 + obj-$(CONFIG_ZLIB_INFLATE) += zlib_inflate/
    2.53 +
    2.54 +--- linux-2.6.24.2/lib/unlzma_syms.c	
    2.55 ++++ linux-2.6.24.2/lib/unlzma_syms.c	
    2.56 +@@ -0,0 +1,14 @@
    2.57 ++/*
    2.58 ++ * linux/lib/unlzma_syms.c
    2.59 ++ *
    2.60 ++ * Exported symbols for the unlzma functionality.
    2.61 ++ *
    2.62 ++ */
    2.63 ++
    2.64 ++#include <linux/module.h>
    2.65 ++#include <linux/init.h>
    2.66 ++
    2.67 ++#include <linux/decompress_unlzma.h>
    2.68 ++
    2.69 ++EXPORT_SYMBOL(unlzma);
    2.70 ++MODULE_LICENSE("GPL");