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

Environment Variables

Every environment variable Strux sets for BSP scripts, plus the variables the strux CLI itself reads from your shell. For when scripts run, see Build Steps & Lifecycle Hooks.

Build script variables

Build-time lifecycle scripts (every step except flash_script_tool / flash_script) run inside the strux-builder Docker container with the project mounted at /project. They receive:

Identity and target

VariableValueDescription
BSP_NAMEe.g. qemuName of the BSP being built.
PRESELECTED_BSPsame as BSP_NAMEAlias for BSP_NAME.
HOST_ARCHarm64, x86_64, or armhfArchitecture of the build machine.
TARGET_ARCHarm64, x86_64, or armhfArchitecture of the target device (resolved from bsp.arch).
STEPe.g. make_imageThe lifecycle step the script is running at.
STRUX_VERSIONe.g. 0.3.0Version of the Strux CLI.
PROJECT_NAMEfrom strux.yamlThe project name.
PROJECT_VERSIONfrom strux.yamlThe project version.
STRUX_UPDATE_ENABLEDtrue / falseWhether the update system is enabled in strux.yaml (update.enabled).

Paths

Inside the container the project root is /project (when the CLI itself runs inside the builder container, e.g. in CI, these resolve to the real project path instead).

VariableValueDescription
PROJECT_DIR/projectProject root directory.
PROJECT_FOLDER/projectAlias for PROJECT_DIR.
PROJECT_DIST_DIR/project/distThe dist/ directory.
PROJECT_DIST_FOLDER/project/distAlias for PROJECT_DIST_DIR.
PROJECT_DIST_ARTIFACTS_FOLDER/project/dist/artifactsShared, user-editable build artifacts. See Artifacts.
SHARED_CACHE_DIR/project/dist/cacheShared cache root, for artifacts reused across BSPs.
BSP_CACHE_DIR/project/dist/cache/{bsp}BSP-specific cache directory.
PROJECT_DIST_CACHE_FOLDER/project/dist/cache/{bsp}Alias for BSP_CACHE_DIR.
PROJECT_DIST_OUTPUT_FOLDER/project/dist/output/{bsp}BSP-specific output directory — where final images go.
BSP_FOLDER/project/bsp/{bsp}The BSP's own directory.

Splash and display (conditional)

Set only when the corresponding configuration exists.

VariableValueDescription
SPLASH_ENABLEDtrue / falseFrom strux.yaml boot.splash.enabled. Only set when boot.splash is configured.
SPLASH_LOGOpathFrom strux.yaml boot.splash.logo. Only set when a logo is configured.
SPLASH_COLORhex colorFrom strux.yaml boot.splash.color. Only set when a color is configured.
DISPLAY_WIDTHe.g. 1920From bsp.yaml display.resolution. Only set when display is configured.
DISPLAY_HEIGHTe.g. 1080From bsp.yaml display.resolution. Only set when display is configured.

Flash script variables

flash_script_tool and flash_script scripts are run by strux flash directly on your host machine (not in Docker), with the flash workspace as the working directory. They inherit your shell environment plus BSP_NAME, PRESELECTED_BSP, HOST_ARCH, TARGET_ARCH, STRUX_VERSION, and the splash/display variables above (PROJECT_NAME, PROJECT_VERSION, and STRUX_UPDATE_ENABLED are not set for flash scripts). The path variables point at real host paths:

VariableValueDescription
PROJECT_DIR / PROJECT_FOLDERhost project pathProject root on your machine.
PROJECT_DIST_DIR / PROJECT_DIST_FOLDER{project}/distThe dist/ directory.
PROJECT_DIST_ARTIFACTS_FOLDER{project}/dist/artifactsShared artifacts directory.
SHARED_CACHE_DIR{project}/dist/cacheShared cache root.
BSP_CACHE_DIR / PROJECT_DIST_CACHE_FOLDER{project}/dist/cache/{bsp}BSP-specific cache.
PROJECT_DIST_OUTPUT_FOLDER{project}/dist/output/{bsp}BSP-specific output — where the image to flash lives.
BSP_FOLDER{project}/bsp/{bsp}The BSP directory.
FLASH_DIR{project}/dist/flash/{bsp}Flash workspace — the script's working directory; put downloaded tools here.
PROJECT_DIST_FLASH_FOLDERsame as FLASH_DIRAlias for FLASH_DIR.
STEPflash_script_tool or flash_scriptWhich flash stage is running.

See Flash Scripts for how to structure them.

Variables the CLI reads

These are read from your environment when you run strux:

VariableValueDescription
STRUX_IN_CONTAINER1Tells Strux it is already running inside the builder container (CI). Build scripts execute directly instead of spawning Docker, and verbose output is auto-enabled when there is no TTY.
STRUX_VERSIONversion stringOverrides the CLI's reported version (set at compile time in CI; local builds fall back to package.json).
STRUX_DEV_SERVER_URLURLDefault dev server URL for strux update when --server is not passed. Falls back to http://127.0.0.1:8000.
STRUX_DEV_NO_UI1Disables the interactive terminal UI in strux dev, logging plainly instead.
STRUX_GL1 or 0Forces GL acceleration on (1) or off (any other value) for strux run QEMU. Unset, Strux auto-detects from the GPU vendor (Intel/AMD on, NVIDIA and unknown off).

Values must be shell-safe

Strux validates script environment values before injecting them into the container; values that could break shell quoting are rejected. Keep paths and config values free of quotes and shell metacharacters.

Last Updated:: 6/13/26, 2:20 AM
Contributors: Miguel Medeiros
Prev
Build Steps & Lifecycle Hooks
Next
Path Resolution