wok-tiny diff busybox/stuff/busybox-1.18-zmodules.u @ rev 0
Add busybox
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Feb 01 09:36:49 2011 +0100 (2011-02-01) |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/busybox/stuff/busybox-1.18-zmodules.u Tue Feb 01 09:36:49 2011 +0100 1.3 @@ -0,0 +1,52 @@ 1.4 +Add LZMA_DEFAULT_MAGIC support 1.5 +--- busybox-1.18.0/include/archive.h 1.6 ++++ busybox-1.18.0/include/archive.h 1.7 +@@ -9,6 +9,8 @@ 1.8 + COMPRESS_MAGIC = 0x1f9d, 1.9 + GZIP_MAGIC = 0x1f8b, 1.10 + BZIP2_MAGIC = 'B' * 256 + 'Z', 1.11 ++ /* lzma default options: lc=3 lp=0 pb=2, historic % 256 == 0 */ 1.12 ++ LZMA_DEFAULT_MAGIC = 0x5d00, 1.13 + /* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */ 1.14 + /* More info at: http://tukaani.org/xz/xz-file-format.txt */ 1.15 + XZ_MAGIC1 = 0xfd * 256 + '7', 1.16 +@@ -20,6 +22,8 @@ 1.17 + COMPRESS_MAGIC = 0x9d1f, 1.18 + GZIP_MAGIC = 0x8b1f, 1.19 + BZIP2_MAGIC = 'Z' * 256 + 'B', 1.20 ++ /* lzma default options: lc=3 lp=0 pb=2, historic % 256 == 0 */ 1.21 ++ LZMA_DEFAULT_MAGIC = 0x5d, 1.22 + XZ_MAGIC1 = '7' * 256 + 0xfd, 1.23 + XZ_MAGIC2 = ((0 * 256 + 'Z') * 256 + 'X') * 256 + 'z', 1.24 + XZ_MAGIC1a = (('X' * 256 + 'z') * 256 + '7') * 256 + 0xfd, 1.25 + 1.26 +--- busybox-1.17.1/libbb/read_printf.c 1.27 ++++ busybox-1.17.1/libbb/read_printf.c 1.28 +@@ -286,6 +286,17 @@ 1.29 + # endif 1.30 + goto found_magic; 1.31 + } 1.32 ++ if (ENABLE_FEATURE_SEAMLESS_LZMA 1.33 ++ && magic.b16[0] == LZMA_DEFAULT_MAGIC 1.34 ++ ) { 1.35 ++# if BB_MMU 1.36 ++ xformer = unpack_lzma_stream; 1.37 ++ xlseek(fd, offset, SEEK_CUR); 1.38 ++# else 1.39 ++ xformer_prog = "unlzma"; 1.40 ++# endif 1.41 ++ goto found_magic; 1.42 ++ } 1.43 + if (ENABLE_FEATURE_SEAMLESS_XZ 1.44 + && magic.b16[0] == XZ_MAGIC1 1.45 + ) { 1.46 +@@ -342,7 +353,8 @@ 1.47 + /* .lzma has no header/signature, just trust it */ 1.48 + open_transformer(fd, unpack_lzma_stream, "unlzma"); 1.49 + else 1.50 +- if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0) 1.51 ++ if (((ENABLE_FEATURE_SEAMLESS_GZ|ENABLE_FEATURE_SEAMLESS_LZMA) 1.52 ++ && strcmp(sfx, "gz") == 0) 1.53 + || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0) 1.54 + || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0) 1.55 + ) {