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