summaryrefslogtreecommitdiff
path: root/lib/sqfs/comp/compressor.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-04 04:57:08 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-06-04 04:57:08 +0200
commit0f23f0396aede08a5d0c95d75b272f1b1787a365 (patch)
tree2e0eda82a0a4151cd01b129bb404db2cd3e95581 /lib/sqfs/comp/compressor.c
parentad73b9440422c06805764da6058ebeb6d41a4f04 (diff)
lzma compressor: support micro management options
The LZMA compressor (through the xz-utils library) supports basically the same options for micro management as the XZ compressor. This commit enables support for those options in the compressor, the option parser and adds an option field to the configuration structure. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/comp/compressor.c')
-rw-r--r--lib/sqfs/comp/compressor.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/sqfs/comp/compressor.c b/lib/sqfs/comp/compressor.c
index 2a0cebb..521471d 100644
--- a/lib/sqfs/comp/compressor.c
+++ b/lib/sqfs/comp/compressor.c
@@ -98,6 +98,10 @@ int sqfs_compressor_create(const sqfs_compressor_config_t *cfg,
ret = memcmp(cfg->opt.xz.padd0, padd0,
sizeof(cfg->opt.xz.padd0));
break;
+ case SQFS_COMP_LZMA:
+ ret = memcmp(cfg->opt.lzma.padd0, padd0,
+ sizeof(cfg->opt.lzma.padd0));
+ break;
case SQFS_COMP_LZO:
ret = memcmp(cfg->opt.lzo.padd0, padd0,
sizeof(cfg->opt.lzo.padd0));
@@ -172,6 +176,11 @@ int sqfs_compressor_config_init(sqfs_compressor_config_t *cfg,
break;
case SQFS_COMP_LZMA:
flag_mask |= SQFS_COMP_FLAG_LZMA_ALL;
+ cfg->opt.lzma.dict_size = block_size;
+ cfg->opt.lzma.level = SQFS_LZMA_DEFAULT_LEVEL;
+ cfg->opt.lzma.lc = SQFS_LZMA_DEFAULT_LC;
+ cfg->opt.lzma.lp = SQFS_LZMA_DEFAULT_LP;
+ cfg->opt.lzma.pb = SQFS_LZMA_DEFAULT_PB;
break;
case SQFS_COMP_LZ4:
flag_mask |= SQFS_COMP_FLAG_LZ4_ALL;