Skip to content

Conversation

@learmj
Copy link
Collaborator

@learmj learmj commented Nov 13, 2025

Introduce a mini build system framework to bootstrap a private sysroot for mission critical packages, and use it to build bdebstrap and genimage.

  • Avoids using old distro versions (eg genimage v16 in Bookworm - Sept 2022 - which cannot create usable sparse files of vfat images).
  • Decouples from distro versions (eg bdebstrap not being avilable in Trixie).
  • Enables using new features in these tools when they become available.
  • Using a newer version of bdebstrap means we can add support for caching downloaded deb pkgs which will speed up rebuilds dramatically - this is not available < 0.6.0.
  • Can patch tools as/if needed.
  • Doesn't interfere with the build machine system/distro installed packages (sysroot has priority in path variables inside rpi-image-gen execution).
  • Enables seamless usage of rpi-image-gen on x86 machines (genimage not available to install via apt on x86 and needs manual install).

The trade-off is a short on-off delay on first rpi-image-gen invocation plus additional build machine dependencies (very likely already installed by default on a normal build workstation).

All tools that are built are installed to a standalone sysroot dir which is completely isolated from distro installed packages, and can be reused across all rpi-image-gen device builds.

Fixes #113 #106

vfetch added to perform metadata-backed file get+verify operations,
storing the asset in a cache directory where it can be retrieved
transparently on subsequent invocations.
Add new global IG top level cache dir keyed off workroot.
To decouple from reliance on distro-provided packages for the build
machine, introduce a new lightweight build framework for building
packages from source. rpi-image-gen can use this scheme at bootstrap
to ensure it always has required versions of mission critical
programs. Build bdebstrap and genimage using this scheme, installing
them to a private sysroot where they can be used for all builds.

The trade off is a short on-off delay on the initial rpi-image-gen
invocation plus additional distro deps. Longer term, distro dependencies
will be reduced signifficantly by introducing the ability to run builds
in a container.

Fixes: raspberrypi#113
Extend the config parser to support env keys. Variables defined under
the env key will be present in the build environment.
Re-work the dependency installation mech to support different
categories of host dependencies and validate if a program installed as a
dependency can be located post-install.
Applying categories to dependencies should be beneficial when introducing
containerised execution support.
Write bootstrap information to a new output dir declared by the sys base
layer.

Fixes raspberrypi#106
@learmj learmj merged commit b7716d5 into raspberrypi:master Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Building images in Trixie is not possible

1 participant