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/prepare-efi-esp

Prepare an ESP tree with a signed bootloader and initial A/B UKI.

Preview
You're viewing the Next docs — a rolling preview of in-development changes. The current release docs may differ.

Prepare an ESP tree with a signed bootloader and initial A/B UKI.

Inputs

uki

Kind: file

Required

Signed UKI for the initial A slot.

bootloader

Kind: file

Required

Signed systemd-boot executable.

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.

timeout

Default: 0

systemd-boot menu timeout in seconds.

Outputs

tree

Kind: directory

EFI System Partition contents.

Execution

Environment

Rugix Bakery

Source epoch

Consumed

Output cache

Allowed

Behavior

Prepare an EFI System Partition directory tree for the core A/B boot policy. Install a signed systemd-boot executable at EFI/BOOT/BOOTX64.EFI for amd64, or EFI/BOOT/BOOTAA64.EFI for arm64. Install the initial signed UKI at EFI/Linux/rugix-a.efi.

The generated loader configuration selects A by default, uses the timeout parameter as the menu timeout in seconds (zero by default), and disables the command-line editor. Rugix Ctrl later installs B as EFI/Linux/rugix-b.efi. The filesystem holding this tree needs capacity for both UKIs.

If the optional secure-boot-keys directory is not empty, it must contain exactly PK.auth, KEK.auth, and db.auth. The rule installs them at loader/keys/auto/ and sets secure-boot-enroll force, so systemd-boot enrolls them when the firmware is in Setup Mode. core/image-efi-verified explains the enrollment.

The tree includes .rugix/bootstrap, which starts Rugix Ctrl’s native first-boot expansion using the root filesystem’s bootstrap plan. The ESP is Rugix Ctrl’s configuration partition, mounted at /run/rugix/mounts/config.

The rule packages its inputs and does not sign them. Supply matching signed artifacts and pass the exported tree to core/image-fat.

Example

For example, prepare an AMD64 ESP:

uses = "core/prepare-efi-esp"
inputs.uki = { path = "signed-uki.efi" }
inputs.bootloader = { path = "signed-systemd-boot.efi" }
parameters.architecture = "amd64"

Save the invocation as build-rule.toml and run ./run-bakery bake rule build-rule.toml build/result.