Strux OS Documentation
Home
Guide
Concepts
BSP Development
Reference
GitHub
Home
Guide
Concepts
BSP Development
Reference
GitHub
  • BSP Guide

    • BSP Development
    • Writing a BSP
    • Custom Kernels
    • Bootloaders
    • Writing Lifecycle Scripts
    • Runtime Extensions
    • Flash Scripts
    • BSP Examples
  • BSP Concepts

    • Lifecycle Scripts
    • The Runtime Extension System
    • Dual Rootfs & A/B Updates
  • BSP Reference

    • bsp.yaml Reference
    • Build Steps & Lifecycle Hooks
    • Environment Variables
    • Path Resolution

Build Steps & Lifecycle Hooks

The exact order of the build pipeline, what each step does, when conditional steps run, and the full list of before_* / after_* hook values your BSP scripts can attach to. For the mental model behind the pipeline, see Build Pipeline; for how to write hook scripts, see the Scripts guide.

Pipeline order

Steps run in this order on every strux build (and the build phase of strux dev). Each cacheable step is skipped when the build cache detects no changes to its inputs; its surrounding hooks still run (subject to their own script caching).

#StepWhat it doesRuns whenHooks around it
1frontendRegenerates TypeScript API types, then compiles the web frontend (Vue/React/vanilla) with Vite.Alwaysbefore_frontend / after_frontend
2applicationCompiles your main.go backend for the target architecture.Alwaysbefore_application / after_application
3cageCompiles the Cage Wayland compositor.Alwaysbefore_cage / after_cage
4wpeCompiles the WPE WebKit extension and the patched Cog browser launcher.Alwaysbefore_wpe / after_wpe
5screenCompiles the screen capture daemon (strux-screen).Alwaysnone
6clientCompiles the on-device Strux client binary; writes (dev) or removes (production) the dev environment config.Alwaysbefore_client / after_client
7kernelTwo phases: fetch + patch the kernel source (extract), then configure, compile, and install it.Only when boot.kernel.custom_kernel: truebefore_kernel, after_kernel_extract (between the phases), after_kernel
8bootloaderBuilds the bootloader (U-Boot, GRUB, ...).Only when boot.bootloader.enabled: true; the built-in build additionally requires type to be set and not custom or nonebefore_bootloader / after_bootloader
9rootfs-baseCreates the minimal Debian base root filesystem with debootstrap.Alwaysbefore_rootfs / after_rootfs
10rootfs-postPost-processes the rootfs: installs your binaries, kernel, packages, overlays, splash, and display config into it. The display config is written just before this step.Alwaysnone (followed by before_bundle)
11before_bundleHook-only stage between rootfs post-processing and image creation.Always—
12make_imageRuns the BSP's make_image script(s) to produce the final disk image. There is no built-in image step — the BSP must provide this.Always (if the BSP defines a make_image script)—
13update bundleGenerates the signed Strux rootfs update bundle from the built image.Only when strux.yaml has update.enabled: true and update.auto_bundle: true — see Updates—
14after_buildHook-only stage after everything completes.Always—

before_build hooks run before step 1, right after configuration validation and artifact preparation.

Conditional steps and caching

When custom_kernel is false or bootloader.enabled is false, the corresponding step is treated as intentionally skipped — it does not poison the cache for later steps. Setting bootloader.type: custom keeps the bootloader stage enabled (hooks and custom_bootloader scripts run) but skips Strux's built-in build.

Replacing built-in steps

Two hook values don't wrap a built-in step — they replace it:

HookReplacesBehavior
custom_kernelThe built-in kernel build (both the extract and build phases)Your script runs instead. before_kernel and after_kernel still run around it; after_kernel_extract does not run, since the built-in extract phase is skipped. Requires boot.kernel.custom_kernel: true.
custom_bootloaderThe built-in bootloader buildYour script runs instead. before_bootloader and after_bootloader still run around it. Requires boot.bootloader.enabled: true.

All valid hook values

The complete set of values accepted by scripts[].step in bsp.yaml:

Step valueFires
before_buildVery first, before any compilation.
before_frontendBefore frontend compilation.
after_frontendAfter frontend compilation.
before_applicationBefore main.go compilation.
after_applicationAfter main.go compilation.
before_cageBefore Cage compositor compilation.
after_cageAfter Cage compilation.
before_wpeBefore WPE WebKit extension compilation.
after_wpeAfter WPE extension compilation.
before_clientBefore Strux client compilation.
after_clientAfter Strux client compilation.
before_kernelBefore kernel source fetch. Conditional: custom_kernel: true.
after_kernel_extractAfter kernel source fetch + patching, before configuration and compilation — e.g. to install a boot logo into the source tree. Conditional: custom_kernel: true and no custom_kernel script.
custom_kernelReplaces the built-in kernel build. Conditional: custom_kernel: true.
after_kernelAfter the kernel build (built-in or custom). Conditional: custom_kernel: true.
before_bootloaderBefore the bootloader build. Conditional: bootloader.enabled: true.
custom_bootloaderReplaces the built-in bootloader build. Conditional: bootloader.enabled: true.
after_bootloaderAfter the bootloader build (built-in or custom). Conditional: bootloader.enabled: true.
before_rootfsBefore base root filesystem creation.
after_rootfsAfter base root filesystem creation.
before_bundleAfter rootfs post-processing, before make_image.
make_imageCreates the final disk image for the target device.
after_buildVery last, after everything completes.
flash_script_toolNot part of the build. Run on the host by strux flash, before flash_script — e.g. to download a vendor flashing tool. See Flash Scripts.
flash_scriptNot part of the build. Run on the host by strux flash to write the image to a device. See Flash Scripts.

Multiple scripts may share the same step; they run in the order they appear in bsp.yaml.

Where scripts run

All build-time scripts run inside the strux-builder Docker container with your project mounted at /project. The two flash_* steps run directly on your host machine. Either way, scripts get a standard set of environment variables — see Environment Variables.

Last Updated:: 6/13/26, 2:20 AM
Contributors: Miguel Medeiros
Prev
bsp.yaml Reference
Next
Environment Variables