From f439b20706ade4b5630c3d6c57e6a36ce0dc287a Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Sun, 30 Jun 2019 16:41:21 +0200 Subject: Add support for repacking condensed sparse files This commit broadly does the following things: - Rename and move the sparse mapping structure to libutil - Add a function to the data writer for writing condensed versions of sparse files, given the mapping. - This shares code with the already existing function for regular files. The shared code is moved to a common helper function. - Add support to tar2sqfs for repacking sparse files. Signed-off-by: David Oberhollenzer --- include/util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/util.h') diff --git a/include/util.h b/include/util.h index d5b20dd..997cbf5 100644 --- a/include/util.h +++ b/include/util.h @@ -5,6 +5,13 @@ #include #include +/* layout structure for sparse files, indicating where the actual data is */ +typedef struct sparse_map_t { + struct sparse_map_t *next; + uint64_t offset; + uint64_t count; +} sparse_map_t; + /* Convert back to forward slashed, remove all preceeding and trailing slashes, collapse all sequences of slashes, remove all path components that are '.' -- cgit v1.2.3