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
Preview
You're viewing the Next docs — a rolling preview of in-development changes. The current release docs may differ.

Projects

A Rugix Bakery project is a directory containing the following files and directories:

  • run-bakery: Shell script for running Rugix Bakery pinned to a major version.
  • rugix-bakery.toml: Project configuration file.
  • layers: Directory containing project-specific layer configurations (optional).
  • recipes: Directory containing project-specific recipes (optional).
  • rules: Directory containing reusable build rules (optional).
  • envs: Directory containing tooling environments defined by Dockerfiles (optional).
  • tests: Directory containing system tests (optional).

We also refer to the directory containing all these files and directories as the project directory.

Note that you must always run ./run-bakery directly in the project directory.

Project Templates

Templates provide a starting configuration and recipes for a project. You can browse the templates on GitHub or list those included in your Rugix Bakery version:

./run-bakery init

To initialize a new project, pass a template name. For example, in a directory containing the run-bakery launcher and no rugix-bakery.toml:

./run-bakery init debian-grub-efi

Rugix Bakery includes these general-purpose templates:

TemplateDescription
quickstart-guideDebian for AMD64 and ARM64 EFI systems and Raspberry Pi 4 and 5, used in the quickstart guide.
alpine-grub-efiAlpine for AMD64 and ARM64 EFI systems, using GRUB.
debian-grub-efiDebian for AMD64 and ARM64 EFI systems, using GRUB.
yocto-grub-efiYocto for AMD64 and ARM64 QEMU systems, using GRUB.
rpi-alpineAlpine for Raspberry Pi 4, Compute Module 4, and Pi 5.
rpi-debianDebian for Raspberry Pi 4, Compute Module 4, and Pi 5.
rpi-raspiosRaspberry Pi OS for all Raspberry Pi models.

Secure Boot

These Debian templates support signed boot and verified root filesystems. Follow the linked READMEs for build and firmware setup instructions.

TemplateHardware
debian-secure-efiAMD64 EFI; adaptable to ARM64 EFI
rpi-debian-secureRaspberry Pi 4, Compute Module 4, and Pi 5

Project Configuration

Each project is configured in a rugix-bakery.toml configuration file. Such a file typically has two sections, repositories and systems. We explain those sections in further detail in dedicated sections of this documentation.

To give you an idea how a configuration file may look like, here is an example:

rugix-bakery.toml
#:schema https://raw.githubusercontent.com/rugix/rugix/refs/tags/v0.8.0/schemas/rugix-bakery-project.schema.json

[repositories]
rugix-extra = { git = "https://github.com/rugix/rugix-extra.git", branch = "v0.9" }

[systems.customized-arm64]
layer = "customized"
architecture = "arm64"

The #:schema directive is used to specify a JSON Schema for the TOML file. Rugix Bakery comes with JSON Schemas for all its configuration files, enabling straightforward validation and autocompletion in modern IDEs.

For reference, here is the complete schema for project configuration files:

ProjectConfigobject

Project configuration.

repositoriesobject
valueSourceConfig

Repository source.

option 1object
gitstringrequired
tagstring
branchstring
revstring
dirstring
option 2object
pathstringrequired
systemsobject
valueSystemConfig
layerstringrequired
mixinsarray<string>
valuestring
architectureArchitecturerequired

Architecture.

  • amd64
  • arm64
  • armv7
  • armhf
  • arm
targetTarget

Target.

  • generic-grub-efi
  • rpi-tryboot
  • rpi-uboot
  • bsp
  • unknown
imageSystemImageConfig
sizeNumBytes

Number of bytes.

layoutImageLayout

Layout of an image.

typePartitionTableType

Partition table type.

  • mbr
  • gpt
raw-blobsarray<RawBlob>
valueRawBlob

Raw firmware blob written at a fixed offset on the disk.

filestringrequired
offsetNumBytesrequired

Number of bytes.

sizeNumBytes

Number of bytes.

partitionsarray<ImagePartition>
valueImagePartition

Partition of an image.

namestring
sizeNumBytes

Number of bytes.

filesystemFilesystem

Filesystem.

option 1object
typeconst "ext4"required
ext4
additional-optionsarray<string>
valuestring
clamp-mtimeTimestamp

Timestamp.

option 2object
typeconst "fat32"required
fat32
option 3object
typeconst "squashfs"required
squashfs
additional-optionsarray<string>
valuestring
no-compressionboolean
rootstring
typePartitionType

Partition type.

bootableboolean
rulesobject
valueRuleInvocation

An invocation of a repository-defined rule.

usesRuleReferencerequired

A rule name or the implementation of an enclosing rule parameter.

option 1string
option 2object
rule-parameterstringrequired
inputsobject
valueArtifactSource

An artifact reference within a composition.

option 1object
inputstringrequired
option 2object
pathstringrequired
option 3object
ruleRuleOutputSourcerequired

Reference to a node output.

nodestringrequired
outputstringrequired
option 4object
selectArtifactSelectionrequired

A path within a directory artifact. Symlinks must resolve inside that directory.

sourceArtifactSource (cycle)required
pathstringrequired
kindArtifactKindrequired

Filesystem object accepted by an input or produced by an output.

  • file
  • directory
option 5object
treeobjectrequired
valueArtifactSource (cycle)
parametersobject
valueParameterBinding

A literal parameter value or a reference to an enclosing parameter.

option 1object
parameterstringrequired
option 2any of
option 1string
option 2boolean
option 3integer | string (int64)int64
  • pattern: ^-?[0-9]+$
option 4number | string
  • pattern: ^(NaN|[+-]?Infinity)$
secretsobject
valueArtifactSource

An artifact reference within a composition.

option 1object
inputstringrequired
option 2object
pathstringrequired
option 3object
ruleRuleOutputSourcerequired

Reference to a node output.

nodestringrequired
outputstringrequired
option 4object
selectArtifactSelectionrequired

A path within a directory artifact. Symlinks must resolve inside that directory.

sourceArtifactSource (cycle)required
pathstringrequired
kindArtifactKindrequired

Filesystem object accepted by an input or produced by an output.

  • file
  • directory
option 5object
treeobjectrequired
valueArtifactSource (cycle)
rulesobject
valueRuleBinding

An implementation bound to a rule parameter. Bindings resolve in the scope that contains them. The graph supplies the interface inputs and parameters, which a binding must not bind.

usesRuleReference

A rule name or the implementation of an enclosing rule parameter.

option 1string
option 2object
rule-parameterstringrequired
inputsobject
valueArtifactSource

An artifact reference within a composition.

option 1object
inputstringrequired
option 2object
pathstringrequired
option 3object
ruleRuleOutputSourcerequired

Reference to a node output.

nodestringrequired
outputstringrequired
option 4object
selectArtifactSelectionrequired

A path within a directory artifact. Symlinks must resolve inside that directory.

sourceArtifactSource (cycle)required
pathstringrequired
kindArtifactKindrequired

Filesystem object accepted by an input or produced by an output.

  • file
  • directory
option 5object
treeobjectrequired
valueArtifactSource (cycle)
parametersobject
valueParameterBinding

A literal parameter value or a reference to an enclosing parameter.

option 1object
parameterstringrequired
option 2any of
option 1string
option 2boolean
option 3integer | string (int64)int64
  • pattern: ^-?[0-9]+$
option 4number | string
  • pattern: ^(NaN|[+-]?Infinity)$
secretsobject
valueArtifactSource

An artifact reference within a composition.

option 1object
inputstringrequired
option 2object
pathstringrequired
option 3object
ruleRuleOutputSourcerequired

Reference to a node output.

nodestringrequired
outputstringrequired
option 4object
selectArtifactSelectionrequired

A path within a directory artifact. Symlinks must resolve inside that directory.

sourceArtifactSource (cycle)required
pathstringrequired
kindArtifactKindrequired

Filesystem object accepted by an input or produced by an output.

  • file
  • directory
option 5object
treeobjectrequired
valueArtifactSource (cycle)
rulesobject
valueRuleBinding (cycle)
outputsobject
valueArtifactSource

An artifact reference within a composition.

option 1object
inputstringrequired
option 2object
pathstringrequired
option 3object
ruleRuleOutputSourcerequired

Reference to a node output.

nodestringrequired
outputstringrequired
option 4object
selectArtifactSelectionrequired

A path within a directory artifact. Symlinks must resolve inside that directory.

sourceArtifactSource (cycle)required
pathstringrequired
kindArtifactKindrequired

Filesystem object accepted by an input or produced by an output.

  • file
  • directory
option 5object
treeobjectrequired
valueArtifactSource (cycle)
bundleSystemBundleConfig

Bundle encoding for the predefined pipeline.

enabledboolean
compressionboolean
chunkerChunkerAlgorithm

Bundle payload chunking algorithm, as defined by rugix-bundle.

optionsSystemOptions
use-squashfsSquashfsOptions
additional-optionsarray<string>
valuestring
no-compressionboolean

You will find the most recent version of this schema on GitHub.

System Artifacts

A system’s rules table instantiates reusable build rules. Its outputs table maps published file names to graph artifacts. A target or image also enables the predefined pipeline, whose outputs rules can use through the reserved node target. See Systems for examples and bundle configuration.

./run-bakery bake system customized
./run-bakery bake system customized --artifact system.img --output build/image-only