Skip to main content
Rugix Bakery 0.9.6 is here: Build rules for custom image pipelines and verified boot for EFI and Raspberry Pi. Read the release post.
Documentation

core/image-squashfs

Create a SquashFS image from a directory tree.

Create a SquashFS image from a directory tree.

Inputs

tree

Kind: directory

Directory tree to package as a read-only filesystem.

Parameters

compression

Default: "zstd"

Compression algorithm accepted by mksquashfs, such as zstd or xz, or none.

block-size

Default: 131072

Filesystem block size in bytes.

mkfs-options

Default: ""

Additional mksquashfs arguments, separated with shell-style quoting.

Outputs

image

Kind: file

SquashFS filesystem image.

Execution

Environment

Rugix Bakery

Source epoch

Consumed

Output cache

Allowed

Behavior

SquashFS determines the image size from its contents. The rule uses mksquashfs without appending to an existing image. compression selects a compressor supported by mksquashfs, such as zstd or xz. none stores data, metadata, fragments, and extended attributes uncompressed.

The build source epoch fixes the filesystem creation time and clamps file timestamps. It defaults to zero. The rule uses one compression worker and reproducible SquashFS construction. Identical input contents and metadata, parameters, source epoch, and Rugix Bakery tooling produce identical image bytes.

Additional mkfs-options use shell-style quoting to separate arguments. Rugix Bakery does not perform shell expansion. Options that request random values or current timestamps override the rule’s reproducible defaults.

Example

For example, package application files with XZ compression:

uses = "core/image-squashfs"
inputs.tree = { path = "application-tree" }
parameters.compression = "xz"

Save the invocation as build-rule.toml in the project. Run ./run-bakery bake rule build-rule.toml build/result; exported artifacts appear under their output names in build/result.

For this rule, the source epoch must be between 0 and 4294967295 Unix seconds (inclusive), as required by the filesystem tooling.