wok-6.x annotate busybox/stuff/busybox-1.17.0-zmodules.u @ rev 5861

busybox: fix insmod
author Pascal Bellard <pascal.bellard@slitaz.org>
date Mon Jul 19 16:23:07 2010 +0200 (2010-07-19)
parents 1ed09465c0ae
children
rev   line source
pascal@5776 1 Add LZMA_DEFAULT_MAGIC support
pascal@5776 2 --- busybox-1.17.0/include/unarchive.h
pascal@5776 3 +++ busybox-1.17.0/include/unarchive.h
pascal@5776 4 @@ -9,6 +9,8 @@
pascal@5776 5 COMPRESS_MAGIC = 0x1f9d,
pascal@5776 6 GZIP_MAGIC = 0x1f8b,
pascal@5776 7 BZIP2_MAGIC = 'B' * 256 + 'Z',
pascal@5776 8 + /* lzma default options: lc=3 lp=0 pb=2, historic % 256 == 0 */
pascal@5776 9 + LZMA_DEFAULT_MAGIC = 0x5d00,
pascal@5776 10 /* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */
pascal@5776 11 /* More info at: http://tukaani.org/xz/xz-file-format.txt */
pascal@5776 12 XZ_MAGIC1 = 0xfd * 256 + '7',
pascal@5776 13 @@ -20,6 +22,8 @@
pascal@5776 14 COMPRESS_MAGIC = 0x9d1f,
pascal@5776 15 GZIP_MAGIC = 0x8b1f,
pascal@5776 16 BZIP2_MAGIC = 'Z' * 256 + 'B',
pascal@5776 17 + /* lzma default options: lc=3 lp=0 pb=2, historic % 256 == 0 */
pascal@5776 18 + LZMA_DEFAULT_MAGIC = 0x5d,
pascal@5776 19 XZ_MAGIC1 = '7' * 256 + 0xfd,
pascal@5776 20 XZ_MAGIC2 = ((0 * 256 + 'Z') * 256 + 'X') * 256 + 'z',
pascal@5776 21 XZ_MAGIC1a = (('X' * 256 + 'z') * 256 + '7') * 256 + 0xfd,
pascal@5773 22
pascal@5773 23 --- busybox-1.17.0/libbb/read_printf.c
pascal@5773 24 +++ busybox-1.17.0/libbb/read_printf.c
pascal@5861 25 @@ -286,6 +286,17 @@
pascal@5776 26 # endif
pascal@5776 27 goto found_magic;
pascal@5776 28 }
pascal@5776 29 + if (ENABLE_FEATURE_SEAMLESS_LZMA
pascal@5776 30 + && magic.b16[0] == LZMA_DEFAULT_MAGIC
pascal@5776 31 + ) {
pascal@5776 32 +# if BB_MMU
pascal@5776 33 + xformer = unpack_lzma_stream;
pascal@5861 34 + xlseek(fd, offset, SEEK_CUR);
pascal@5776 35 +# else
pascal@5776 36 + xformer_prog = "unlzma";
pascal@5776 37 +# endif
pascal@5776 38 + goto found_magic;
pascal@5776 39 + }
pascal@5776 40 if (ENABLE_FEATURE_SEAMLESS_XZ
pascal@5776 41 && magic.b16[0] == XZ_MAGIC1
pascal@5776 42 ) {
pascal@5861 43 @@ -342,7 +353,8 @@
pascal@5861 44 /* .lzma has no header/signature, just trust it */
pascal@5861 45 open_transformer(fd, unpack_lzma_stream, "unlzma");
pascal@5861 46 else
pascal@5861 47 - if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0)
pascal@5861 48 + if (((ENABLE_FEATURE_SEAMLESS_GZ|ENABLE_FEATURE_SEAMLESS_LZMA)
pascal@5861 49 + && strcmp(sfx, "gz") == 0)
pascal@5861 50 || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0)
pascal@5861 51 || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0)
pascal@5861 52 ) {