1 --- a/squashfs-tools/lzma_wrapper.c
2 +++ b/squashfs-tools/lzma_wrapper.c
8 +#include "compressor.h"
10 #define LZMA_HEADER_SIZE (LZMA_PROPS_SIZE + 8)
13 size_t props_size = LZMA_PROPS_SIZE,
14 outlen = block_size - LZMA_HEADER_SIZE;
20 + if (!comp_args || sscanf(comp_args, "%d:%d:%d", &lc, &lp, &pb) != 3) {
26 res = LzmaCompress(d + LZMA_HEADER_SIZE, &outlen, s, size, d,
27 - &props_size, 5, block_size, 3, 0, 2, 32, 1);
28 + &props_size, 5, block_size, lc, lp, pb, 32, 1);
30 if(res == SZ_ERROR_OUTPUT_EOF) {
32 --- a/squashfs-tools/compressor.c
33 +++ b/squashfs-tools/compressor.c
35 #include "compressor.h"
36 #include "squashfs_fs.h"
38 +char *comp_args = NULL;
39 extern int gzip_compress(void **, char *, char *, int, int, int *);
40 extern int gzip_uncompress(char *, char *, int, int, int *);
41 extern int lzma_compress(void **, char *, char *, int, int, int *);
42 --- a/squashfs-tools/compressor.h
43 +++ b/squashfs-tools/compressor.h
45 extern struct compressor *lookup_compressor(char *);
46 extern struct compressor *lookup_compressor_id(int);
47 extern void display_compressors(char *, char *);
48 +extern char *comp_args;
49 --- a/squashfs-tools/mksquashfs.c
50 +++ b/squashfs-tools/mksquashfs.c
51 @@ -4355,6 +4355,12 @@
55 + } else if(strcmp(argv[i], "-comp_args") == 0) {
57 + ERROR("%s: -comp_args missing compression arguments\n", argv[0]);
60 + comp_args = argv[i];
61 } else if(strcmp(argv[i], "-pf") == 0) {
63 ERROR("%s: -pf missing filename\n", argv[0]);
65 "[-e list of exclude\ndirs/files]\n", argv[0]);
66 ERROR("\nFilesystem build options:\n");
67 ERROR("-comp <comp>\t\tselect <comp> compression\n");
68 + ERROR("-comp_args <comp>\t\tselect compression arguments\n");
69 ERROR("\t\t\tCompressors available:\n");
70 display_compressors("\t\t\t", COMP_DEFAULT);
71 ERROR("-b <block_size>\t\tset data block to "
73 else if(strcmp(argv[i], "-root-becomes") == 0 ||
74 strcmp(argv[i], "-sort") == 0 ||
75 strcmp(argv[i], "-pf") == 0 ||
76 - strcmp(argv[i], "-comp") == 0)
77 + strcmp(argv[i], "-comp") == 0 ||
78 + strcmp(argv[i], "-comp_args") == 0)
83 else if(strcmp(argv[i], "-root-becomes") == 0 ||
84 strcmp(argv[i], "-ef") == 0 ||
85 strcmp(argv[i], "-pf") == 0 ||
86 - strcmp(argv[i], "-comp") == 0)
87 + strcmp(argv[i], "-comp") == 0 ||
88 + strcmp(argv[i], "-comp_args") == 0)