# HG changeset patch # User Pascal Bellard # Date 1213271611 0 # Node ID cf7f6d5ad5ca725a8d33700055ad33c2a1e6a02e # Parent 13768ad7e79ed68ee1ba4e2f800fd58a8dbe10f4 module-init-tools: use lzlib to load modules compressed with gzip or lzma diff -r 13768ad7e79e -r cf7f6d5ad5ca module-init-tools/receipt --- a/module-init-tools/receipt Thu Jun 12 11:51:08 2008 +0000 +++ b/module-init-tools/receipt Thu Jun 12 11:53:31 2008 +0000 @@ -5,15 +5,17 @@ CATEGORY="base-system" SHORT_DESC="Kernel modules manipulation tools." MAINTAINER="pascal.bellard@slitaz.org" -DEPENDS="zlib" +DEPENDS="zlib lzlib" TARBALL="$PACKAGE-$VERSION.tar.gz" WEB_SITE="http://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/" WGET_URL="${WEB_SITE}$TARBALL" +BUILD_DEPENDS="zlib-dev lzlib-dev lzlib" # Rules to configure and make the package. compile_rules() { cd $src + patch -p1 < ../stuff/lzlib.u ./configure --enable-zlib --prefix=/usr \ --sbindir=/sbin --bindir=/bin --sysconfdir=/etc \ --infodir=/usr/share/info --mandir=/usr/share/man \ diff -r 13768ad7e79e -r cf7f6d5ad5ca module-init-tools/stuff/lzlib.u --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/module-init-tools/stuff/lzlib.u Thu Jun 12 11:53:31 2008 +0000 @@ -0,0 +1,83 @@ +--- module-init-tools-3.2/zlibsupport.c ++++ module-init-tools-3.2/zlibsupport.c +@@ -16,58 +16,33 @@ + #include "testing.h" + + #ifdef CONFIG_USE_ZLIB +-#include ++#include + +-void *grab_contents(gzFile *gzfd, unsigned long *size) +-{ +- unsigned int max = 16384; +- void *buffer = malloc(max); +- int ret; +- +- if (!buffer) +- return NULL; +- +- *size = 0; +- while ((ret = gzread(gzfd, buffer + *size, max - *size)) > 0) { +- *size += ret; +- if (*size == max) { +- buffer = realloc(buffer, max *= 2); +- if (!buffer) +- return NULL; +- } +- } +- if (ret < 0) { +- free(buffer); +- buffer = NULL; +- } +- return buffer; +-} +- + void *grab_fd(int fd, unsigned long *size) + { +- gzFile gzfd; ++ lzFile lzfd; + +- gzfd = gzdopen(fd, "rb"); +- if (!gzfd) ++ lzfd = lzdopen(fd, "rb"); ++ if (!lzfd) + return NULL; + +- /* gzclose(gzfd) would close fd, which would drop locks. ++ /* lzclose(lzfd) would close fd, which would drop locks. + Don't blame zlib: POSIX locking semantics are so horribly + broken that they should be ripped out. */ +- return grab_contents(gzfd, size); ++ return lzgrab(lzfd, size); + } + + /* gzopen handles uncompressed files transparently. */ + void *grab_file(const char *filename, unsigned long *size) + { +- gzFile gzfd; ++ lzFile lzfd; + void *buffer; + +- gzfd = gzopen(filename, "rb"); +- if (!gzfd) ++ lzfd = lzopen(filename, "rb"); ++ if (!lzfd) + return NULL; +- buffer = grab_contents(gzfd, size); +- gzclose(gzfd); ++ buffer = lzgrab(lzfd, size); ++ lzclose(lzfd); + return buffer; + } + +--- module-init-tools-3.2/configure ++++ module-init-tools-3.2/configure +@@ -1741,7 +1741,7 @@ + #define CONFIG_USE_ZLIB 1 + _ACEOF + +- zlib_flags="-Wl,-Bstatic -lz -Wl,-Bdynamic" ++ zlib_flags="-Wl,-Bdynamic -lz -llz" + fi + fi; +