From d5068781ec2528f88aaa92fbc9a5b9c256d53499 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 6 May 2019 12:09:56 +0200 Subject: Implement reading and writing of compressor options - gensquashfs simply asks the backend compressor to write its options to the file and does accounting - rdsquasfs simply asks the backend compressor to transparentyl snort the options from the file - not implemented in any compressor backend yet Signed-off-by: David Oberhollenzer --- mkfs/mkfs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'mkfs') diff --git a/mkfs/mkfs.c b/mkfs/mkfs.c index d708d37..ae6210b 100644 --- a/mkfs/mkfs.c +++ b/mkfs/mkfs.c @@ -39,7 +39,7 @@ static int padd_file(sqfs_info_t *info) int main(int argc, char **argv) { - int status = EXIT_FAILURE; + int status = EXIT_FAILURE, ret; sqfs_info_t info; memset(&info, 0, sizeof(info)); @@ -81,6 +81,15 @@ int main(int argc, char **argv) goto out_outfd; } + ret = info.cmp->write_options(info.cmp, info.outfd); + if (ret < 0) + goto out_cmp; + + if (ret > 0) { + info.super.flags |= SQFS_FLAG_COMPRESSOR_OPTIONS; + info.super.bytes_used += ret; + } + if (write_data_to_image(&info)) goto out_cmp; -- cgit v1.2.3