aboutsummaryrefslogtreecommitdiff
path: root/mkfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-06 12:09:56 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-06 12:15:44 +0200
commitd5068781ec2528f88aaa92fbc9a5b9c256d53499 (patch)
tree8eac6ec1a02f12e71ec97b1cf66113f37df6d508 /mkfs
parentcbcf86dde27767682483985e42f7ca49e1d3a208 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs')
-rw-r--r--mkfs/mkfs.c11
1 files changed, 10 insertions, 1 deletions
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;