wok view busybox/stuff/busybox-1.22-zmodules.u @ rev 16452
Add: SkypeFreak
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Sat Apr 19 12:42:09 2014 +0300 (2014-04-19) |
parents | 9b20a58d7246 |
children | e10394d67dd1 |
line source
1 Add LZMA_DEFAULT_MAGIC support
2 --- busybox-1.20/archival/libarchive/open_transformer.c
3 +++ busybox-1.20/archival/libarchive/open_transformer.c
4 @@ -132,6 +132,21 @@
5 /* .gz and .bz2 both have 2-byte signature, and their
6 * unpack_XXX_stream wants this header skipped. */
7 xread(fd, magic.b16, sizeof(magic.b16[0]));
8 +#if 1
9 +// SliTaz uses .gz suffix for lzma'd kernel modules
10 +#if BB_BIG_ENDIAN
11 +#define LZMA_DEFAULT_MAGIC 0x5d00
12 +#else
13 +#define LZMA_DEFAULT_MAGIC 0x5d
14 +#endif
15 + if (ENABLE_FEATURE_SEAMLESS_LZMA
16 + && magic.b16[0] == LZMA_DEFAULT_MAGIC
17 + ) {
18 + xlseek(fd, offset, SEEK_CUR);
19 + open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
20 + return 0;
21 + }
22 +#endif
23 if (ENABLE_FEATURE_SEAMLESS_GZ
24 && magic.b16[0] == GZIP_MAGIC
25 ) {
27 --- busybox-1.22.0/archival/libarchive/open_transformer.c
28 +++ busybox-1.22.0/archival/libarchive/open_transformer.c
29 @@ -205,15 +205,15 @@
30 return fd;
32 sfx = strrchr(fname, '.');
33 - if (sfx) {
34 - sfx++;
35 - if (ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0)
36 - /* .lzma has no header/signature, just trust it */
37 - open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
38 - else
39 - if ((ENABLE_FEATURE_SEAMLESS_GZ && strcmp(sfx, "gz") == 0)
40 - || (ENABLE_FEATURE_SEAMLESS_BZ2 && strcmp(sfx, "bz2") == 0)
41 - || (ENABLE_FEATURE_SEAMLESS_XZ && strcmp(sfx, "xz") == 0)
42 + if (sfx++ && ENABLE_FEATURE_SEAMLESS_LZMA && strcmp(sfx, "lzma") == 0) {
43 + /* .lzma has no header/signature, just trust it */
44 + open_transformer_with_sig(fd, unpack_lzma_stream, "unlzma");
45 + }
46 + else {
47 + if ((ENABLE_FEATURE_SEAMLESS_GZ)
48 + || (ENABLE_FEATURE_SEAMLESS_BZ2)
49 + || (ENABLE_FEATURE_SEAMLESS_LZMA)
50 + || (ENABLE_FEATURE_SEAMLESS_XZ)
51 ) {
52 - setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 1);
53 + setup_unzip_on_fd(fd, /*fail_if_not_detected:*/ 0);
54 }