aboutsummaryrefslogtreecommitdiff
path: root/bin/gensquashfs/test
AgeCommit message (Collapse)Author
2023-10-24Cleanup: move memory/stdio streams to libcommonDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-10-24Cleanup: gensquashfs: remove tree walk for force-uid/gidDavid Oberhollenzer
If the --force-uid or --force-gid flags are used, don't do a recursive tree walk after the fact, instead simply apply the settings at the source (e.g. tree iterator). Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-09-03gensquashfs: fix file path for glob directory scanningDavid Oberhollenzer
If we glob a directory, the generated entries can be added to a virtual sub directory, that does not corespond to the original layout. If we try to use those virtual paths for packing files, it will fail, so we need to remove that prefix to reconstruct the original path. Second, the glob operation allows us to select a sub-directory of the pack-dir. This prefix-path is stripped away when scanning the entries. We need to add it back to get the original, pack-dir relative file paths. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-09-01gensquashfs: add a test for fstree_from_dir file source pathDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-06-15Mass rename istream_t/ostream_t with sqfs_ prefixDavid Oberhollenzer
istream_t becomes sqfs_istream_t and ostream_t becomes sqfs_ostream_t Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-06-05gensquashfs: replace XattrMapEntry with sqfs_xattr_tDavid Oberhollenzer
It has the same members, but with the added benefit that we already have helper functions for it in libsquashfs and we can just hose it directly into the xattr writer. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-06-03libio: consolidate add-hoc memory istream_t implementationsDavid Oberhollenzer
In several places, there are ad-hoc istream_t implementations that read from a memory buffer to test something else stacked on top. This commit consolidates those ad-hoc implmentations into a proper one in libio, and uses the chance to remove external files for some older tests that rely on file I/O instead. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-05-22libtar: add a dir_iterator_t implementation for tar filesDavid Oberhollenzer
The existing istream_t wrapper is mered into this one as well, we can open the files via the iterators open_file_ro function. Unit tests and tar2sqfs are modified accordingly. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-04-29gensquashfs: Dismantle the scan_dir wrapperDavid Oberhollenzer
Create the directory iterator externally and pass it to fstree_from_dir. The unit test is also removed, because the heavy lifting is now done outside the function. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-04-19libfstree: hoist file link pointer into parent structureDavid Oberhollenzer
Instead of having a file_info_t next pointer, requiring an up-cast to tree_node_t all the time, simply add a "next_by_type" pointer to the tree node itself, which can also be used for other purposes by other node types and removes the need for up-casting. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-04-19libfstree: get rid of dir_info_tDavid Oberhollenzer
The single boolean created_implicitly can be replaced with a general purpose flag field. The "children" pointer can then be hoisted directly into the data union of tree_node_t. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-04-02Move fstree CLI code to libcommonDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-04-01libsquashfs: remove the default block writer alignment featureDavid Oberhollenzer
The idea of the block align feature was to allow micro-managing that some files are forcefully aligned to 1k/4k ("device block") boundaries, hoping to improve access time at the cost of data density. The feature was not exposed in the tools for a long time and eventuall added to the sort file. Measurement and experimentation showed, that it in fact worsened the read performance on a test system with an old micro SD card as the bottle neck. The feature is removed, and if needed, can be brought back simply by wrapping/sub-classing the default block writer, if need be.. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-02-12libtar: Add a test for the tar writing codeDavid Oberhollenzer
Generate a simple tarball and compare it with a reference. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-02-08libtar: Add an istream_t implementationDavid Oberhollenzer
The tar_istream_t reads the data from a tar file, having been given the header, and synthesizes zero bytes for sparse regions. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
2023-01-31Reintegrate test code with library codeDavid Oberhollenzer
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>