summaryrefslogtreecommitdiff
path: root/mkfs/mkfs.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-13 01:19:27 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-13 01:19:27 +0100
commit74f25ae0f3ebc1cd435f29c21ab164a9028af980 (patch)
tree2e3e9eec59efdd55be698f4fd726ac1066c1597b /mkfs/mkfs.c
parentf274c6a208bb329298f83f05d0f9fe8e1a8b5423 (diff)
Add --no-tail-packing option to gensquashfs, tar2sqfs
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/mkfs.c')
-rw-r--r--mkfs/mkfs.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/mkfs/mkfs.c b/mkfs/mkfs.c
index 6ddcdb0..ea01452 100644
--- a/mkfs/mkfs.c
+++ b/mkfs/mkfs.c
@@ -51,6 +51,7 @@ static int pack_files(sqfs_data_writer_t *data, fstree_t *fs,
char *node_path;
file_info_t *fi;
size_t size;
+ int flags;
int ret;
if (set_working_dir(opt))
@@ -115,7 +116,12 @@ static int pack_files(sqfs_data_writer_t *data, fstree_t *fs,
fi->user_ptr = inode;
- ret = write_data_from_file(path, data, inode, file, 0);
+ flags = 0;
+
+ if (opt->no_tail_packing && filesize > opt->cfg.block_size)
+ flags |= SQFS_BLK_DONT_FRAGMENT;
+
+ ret = write_data_from_file(path, data, inode, file, flags);
file->destroy(file);
free(node_path);