core/prepare-rpi-boot
Package a kernel, initrd, firmware and authenticated command line for Raspberry Pi.
Package a kernel, initrd, firmware and authenticated command line for Raspberry Pi.
Inputs
-
config -
Kind: file
Firmware config.txt selecting kernel8.img and initrd, including any board-specific settings.
-
boot -
Kind: directory
Raspberry Pi firmware tree containing start4.elf, fixup4.dat, DTBs, and overlays.
-
kernel -
Kind: file
ARM64 Linux kernel image.
-
initrd -
Kind: file
Initrd implementing the verified-root boot contract.
-
cmdline -
Kind: file
Authenticated kernel command line.
Outputs
-
tree -
Kind: directory
Contents of the signed boot ramdisk.
Execution
-
Environment
-
Rugix Bakery
-
Source epoch
-
Consumed
-
Output cache
-
Allowed
Behavior
Prepare the contents of a signed Raspberry Pi 4/CM4 or Pi 5 boot image. The
boot input supplies start4.elf, fixup4.dat, device trees (*.dtb), and an
overlays directory. The rule copies these with the supplied kernel, initrd,
and authenticated command line.
The config input supplies the complete inner config.txt. It is copied
verbatim, so board settings and selected overlays remain under the caller’s
control. Select kernel8.img and load initrd; those are the filenames used
for the kernel and initrd inputs. For example:
[all]
arm_64bit=1
kernel=kernel8.img
initramfs initrd followkernel
dtoverlay=my-boardUART is enabled only when the supplied configuration requests it.
The exported tree is unsigned. Package it with core/image-fat and sign that
image with core/sign-rpi. Firmware trust provisioning remains separate.
Example
For example, prepare a Pi boot tree:
uses = "core/prepare-rpi-boot"
inputs.boot = { path = "firmware" }
inputs.kernel = { path = "kernel" }
inputs.initrd = { path = "initrd" }
inputs.cmdline = { path = "cmdline" }
inputs.config = { path = "config.txt" }
Save the invocation as build-rule.toml and run
./run-bakery bake rule build-rule.toml build/result.