Expand description
Facilities for writing SquashFS archives.
The most straightforward way to write a SquashFS file from a directory tree on-disk is to use a
TreeProcessor
. This provides the ability to make “last-minute” modifications to the files
that are added, such as skipping certain files or modifying metadata.
To create a totally “synthetic” SquashFS file that is not built from files in a filesystem,
open a Writer
and feed Source
s to it.
§Limitations
This library does not yet handle hard links; files with multiple hard links will be archived as separate files with identical contents (which should be deduplicated and end up taking up little additional space).
The SquashFS specification includes a field in directory inodes for the parent inode number,
presumably to make ..
directory entries work. This is one factor that makes it impossible to
build a SquashFS file without building out the entire directory tree to be archived in memory.
I have tried as hard as poassible to reduce the amount of data that must be stored for each
node added, and this architecture makes it infeasible to store parent inodes in directory
entries. I hope to fix this some day, and in the meantime it has not caused problems in the
ways I have used the resultant files.
Structs§
- Source
- A single node to be added to the SquashFS archive.
- Source
File - A
Source
bundled with the path where it should be located. - Tree
Iterator - An iterator yielding the nodes in a directory tree in a way suitable for archiving.
- Tree
Processor - Tool to help create an archive from a directory in the filesystem.
- Writer
- A basic SquashFS writer.
Enums§
- Block
Flags - Flags to fine-tune how an entry is added to the archive.
- Source
Data - Represents the data of a filesystem object that can be added to an archive.