From ea1cb44cc85e70fdeb8514fc909c54af72b1bfe9 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 30 Apr 2019 13:29:40 +0200 Subject: Pack file data and fragments Signed-off-by: David Oberhollenzer --- mkfs/mksquashfs.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'mkfs/mksquashfs.c') diff --git a/mkfs/mksquashfs.c b/mkfs/mksquashfs.c index 65cd552..418d669 100644 --- a/mkfs/mksquashfs.c +++ b/mkfs/mksquashfs.c @@ -68,13 +68,25 @@ int main(int argc, char **argv) print_tree(0, info.fs.root); - if (sqfs_super_write(&info)) + info.cmp = compressor_create(info.super.compression_id, true, + info.super.block_size); + if (info.cmp == NULL) { + fputs("Error creating compressor\n", stderr); goto out_outfd; + } + + if (write_data_to_image(&info)) + goto out_cmp; + + if (sqfs_super_write(&info)) + goto out_cmp; if (sqfs_padd_file(&info)) - goto out_fstree; + goto out_cmp; status = EXIT_SUCCESS; +out_cmp: + info.cmp->destroy(info.cmp); out_fstree: fstree_cleanup(&info.fs); out_outfd: -- cgit v1.2.3