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-debian-efi-verified

Build a signed systemd-boot A/B release with a verified root from a prepared Debian root filesystem.

Build a signed systemd-boot A/B release with a verified root from a prepared Debian root filesystem.

Inputs

rootfs

Kind: directory

Required

Prepared root filesystem implementing the core verified-root boot contract.

boot-certificate

Kind: file

Required

PEM-encoded RSA X.509 certificate for signing EFI boot artifacts.

bundle-certificate

Kind: file

Required

Single PEM-encoded X.509 end-entity signer certificate issued directly by the trusted root. No intermediates. The default signer requires RSA.

secure-boot-keys

Kind: directory

Default: {"tree":{}}

Authenticated variables PK.auth, KEK.auth, and db.auth that systemd-boot enrolls in Setup Mode. Empty by default, disabling enrollment.

Parameters

architecture

Required

Target architecture: amd64 or arm64. Must match the system architecture.

kernel-version

Default: ""

Exact installed kernel version. Empty selects the unique installed version.

cmdline-extra

Default: ""

Additional authenticated kernel arguments.

panic-timeout

Default: 10

Kernel panic reboot delay in seconds. Zero leaves the system stopped.

boot-timeout

Default: 0

systemd-boot menu timeout in seconds.

signing-time

Default: ""

Signing time as Unix seconds in a string. Empty uses the build source epoch.

config-size

Default: 0

ESP capacity in bytes. Zero reserves three copies of its current files, uses at least 256 MiB, and rounds up to 64 MiB.

root-compression

Default: "none"

SquashFS compression of the root filesystem, such as zstd or xz, or none.

disk-size

Default: 0

Factory disk capacity in bytes. Zero sizes the disk from its partitions.

secondary-config

Default: false

Reserve an empty secondary configuration partition with the same capacity as the ESP.

Outputs

image

Artifact Source: {"rule":{"node":"release","output":"image"}}

bundle

Artifact Source: {"rule":{"node":"release","output":"bundle"}}

bundle-hash

Artifact Source: {"rule":{"node":"release","output":"bundle-hash"}}

uki

Artifact Source: {"rule":{"node":"release","output":"uki"}}

bootloader

Artifact Source: {"rule":{"node":"release","output":"bootloader"}}

root-hash

Artifact Source: {"rule":{"node":"release","output":"root-hash"}}

hash-offset

Artifact Source: {"rule":{"node":"release","output":"hash-offset"}}

data-size

Artifact Source: {"rule":{"node":"release","output":"data-size"}}

Rule Parameters

Callers can replace these operations through rules bindings. An implementation receives the listed inputs and parameters and must produce the listed outputs. See Rule Parameters.

efi-signer

Sign an EFI executable. Bakery verifies each signature against boot-certificate.

Default implementation: core/sign-efi.

Input image

Kind: file

Unsigned PE executable: the UKI or systemd-boot.

Input certificate

Kind: file

The boot-certificate input.

Parameter signing-time

Signing time as Unix seconds in a string. Empty means the build source epoch.

Output image

Kind: file

PE executable with a UEFI Secure Boot signature.

bundle-signer

Create a CMS signature over the bundle’s signed metadata. Bakery verifies it against bundle-certificate.

Default implementation: core/sign-cms.

Input content

Kind: file

Signed bundle metadata.

Input certificate

Kind: file

The bundle-certificate input.

Parameter signing-time

Signing time as Unix seconds in a string. Empty means the build source epoch.

Output signature

Kind: file

DER-encoded CMS SignedData with the encapsulated content and signer certificate.

Execution

Composes other rules into a build graph.

Behavior

Build an EFI A/B release with a verified root from a prepared Debian root filesystem. This wrapper selects one installed kernel with core/kernel-debian, generates its initrd with core/initrd-debian, and passes both to core/image-efi-verified.

Prepare the root filesystem with core/debian-efi-verified-setup and configure trusted update signers in /etc/rugix/ctrl.toml through a project recipe. On first boot, Rugix Ctrl completes the factory layout through native bootstrap. The wrapper consumes the prepared root without modifying it.

The required architecture must match the system’s architecture setting. Set kernel-version when several installed kernels exist; its empty default requires a unique installed kernel. Automatic capacity defaults, optional size overrides, remaining release inputs, signing policy, outputs, and Secure Boot key enrollment match the generic EFI composition. The wrapper forwards its efi-signer and bundle-signer rule parameters to it, so you can sign with an HSM or a KMS as described in its signer documentation.

Customize Boot Settings

Set cmdline-extra to supply kernel arguments, such as consoles and log levels. It defaults to an empty string. The panic-timeout parameter defaults to 10 seconds; zero disables automatic reboot after a panic. Verified-root arguments remain supplied by the composition.

Set boot-timeout to control the systemd-boot menu timeout in seconds. For example:

parameters.cmdline-extra = "console=ttyS0,115200n8 loglevel=4"
parameters.panic-timeout = 30
parameters.boot-timeout = 5

Example

For example, select the wrapper in a system definition:

[systems.efi]
layer = "efi"
architecture = "amd64"

[systems.efi.rules.release]
uses = "core/image-debian-efi-verified"
parameters.architecture = "amd64"
inputs.boot-certificate = { path = "keys/boot.crt" }
inputs.bundle-certificate = { path = "keys/bundle.crt" }
rules.efi-signer.secrets.key = { path = "keys/boot.key" }
rules.bundle-signer.secrets.key = { path = "keys/bundle.key" }

[systems.efi.outputs]
"system.img" = { rule = { node = "release", output = "image" } }
"system.rugixb" = { rule = { node = "release", output = "bundle" } }
"system.rugixb-hash" = { rule = { node = "release", output = "bundle-hash" } }

Bakery supplies the built layer as rootfs. Run ./run-bakery bake system efi --release-version v1.

Secondary Configuration Partition

To reserve space for a replacement ESP, including systemd-boot, set parameters.secondary-config = true. This adds an empty config-secondary partition with the same capacity as config. Both config partitions precede the system partitions, so system-a, system-b, and data use partition numbers 3, 4, and 5 after bootstrap.

Enable the matching recipe option in the root filesystem’s layer:

[parameters."core/debian-efi-verified-setup"]
secondary_config = true

Use this option when provisioning a matching factory layout. Existing installations need a separate partition-layout migration before receiving the changed root configuration.

Custom roots must provide equivalent system and bootstrap configurations. The EFI layout rule describes the reserved partition. The update bundle continues to update the root and UKI slots; updating and activating a replacement ESP requires a separate operation.