Module export

Module export 

Source
Expand description

APIs for creating container images from OSTree commits

StructsΒ§

ExportOptions
Configuration for tar export.
OstreeTarWriter πŸ”’

ConstantsΒ§

BARE_SPLIT_XATTRS_MODE
The repository mode generated by a tar export stream.
BUF_CAPACITY πŸ”’
A decently large buffer, as used by e.g. coreutils cat. System calls are expensive.
OSTREEDIR πŸ”’
OSTREEREF πŸ”’
REPO_CONFIG πŸ”’
The base repository configuration that identifies this is a tar export.
SECURITY_SELINUX_XATTR πŸ”’
Then derive a string version (without the NUL) from the above.
SECURITY_SELINUX_XATTR_C πŸ”’
The SELinux xattr. Because the ostree xattrs require an embedded NUL, we store that version as a constant.
SYSROOT πŸ”’
TAR_PATH_PREFIX_V0 πŸ”’
In v0 format, we use this relative path prefix. I think I chose this by looking at the current Fedora base image tar stream. However, several others don’t do this and have paths be relative by simply omitting ./, i.e. the tar stream contains usr/bin/bash and not ./usr/bin/bash. The former looks cleaner to me, so in v1 we drop it.

FunctionsΒ§

append_pax_xattrs πŸ”’
Append xattrs to the tar stream as PAX extensions, excluding security.selinux which doesn’t become visible in container runtimes anyway. https://github.com/containers/storage/blob/0d4a8d2aaf293c9f0464b888d932ab5147a284b9/pkg/archive/archive.go#L85
export_chunk πŸ”’
Output a chunk to a tar stream.
export_commit
Export an ostree commit to an (uncompressed) tar archive stream.
export_final_chunk πŸ”’
Output the last chunk in a chunking.
impl_export πŸ”’
Recursively walk an OSTree commit and generate data into a [tar::Builder] which contains all of the metadata objects, as well as a hardlinked stream that looks like a checkout. Extended attributes are stored specially out of band of tar so that they can be reliably retrieved.
impl_raw_export πŸ”’
Export an ostree commit as a β€œraw” tar stream - just the filesystem content with /usr/etc -> /etc remapping, without ostree repository structure.
map_path πŸ”’
Convert /usr/etc back to /etc
map_path_inner πŸ”’
Convert from to to
map_path_v1 πŸ”’
Convert usr/etc back to etc for the tar stream.
object_path πŸ”’
path_equivalent_for_tar πŸ”’
Given two paths, which may be absolute (starting with /) or start with ./, return true if they are equal after removing those prefixes. This is effectively β€œwould these paths be equal” when processed as a tar entry.
path_for_tar_v1 πŸ”’
Chunked (or version 1) tar streams don’t have a leading ./.
raw_export_dir πŸ”’
Recursively export a directory for raw export mode.
reinject_detached_metadata πŸ”’
Process an exported tar stream, and update the detached metadata.
symlink_is_denormal πŸ”’
Check for β€œdenormal” symlinks which contain β€œ//”
tar_append_default_data πŸ”’
unmap_path πŸ”’
Convert etc to usr/etc Note: no leading β€˜/’ or β€˜./’
update_detached_metadata
Replace the detached metadata in an tar stream which is an export of an OSTree commit.
v1_xattrs_object_path πŸ”’
write_chunk πŸ”’
Implementation of chunk writing, assumes that the preliminary structure has been written to the tar stream.