1
0
Fork 0
mirror of https://github.com/pygos/pkg-utils.git synced 2024-11-24 21:40:43 +01:00

pkg2sqfs: set lzma dictionary size to block size

It's the default the kernel implementation expects if no options
are set.

Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
David Oberhollenzer 2019-04-17 23:57:43 +02:00
parent 214a5e917e
commit ac8e457c96

View file

@ -102,13 +102,18 @@ compressor_stream_t *sqfs_get_compressor(sqfs_super_t *s)
{
PKG_COMPRESSION id;
compressor_t *cmp;
size_t xz_dictsz;
void *options;
switch (s->compression_id) {
case SQFS_COMP_GZIP:
id = PKG_COMPRESSION_ZLIB;
options = NULL;
break;
case SQFS_COMP_XZ:
id = PKG_COMPRESSION_LZMA;
xz_dictsz = s->block_size;
options = &xz_dictsz;
break;
default:
fputs("unsupported compressor\n", stderr);
@ -119,5 +124,5 @@ compressor_stream_t *sqfs_get_compressor(sqfs_super_t *s)
if (cmp == NULL)
return NULL;
return cmp->compression_stream(cmp);
return cmp->compression_stream(cmp, options);
}