Skip to content

# Raspberry Pi 5 (aarch64) Image — Implementation Plan #403

Open
eclipse-score/rules_imagefs
#33

Description

@FScholPer

Raspberry Pi 5 (aarch64) Image — Implementation Plan

Status: Two-Phase Bazel-to-Yocto Architecture · Updated: 2026-11-03

Goal

Add a Raspberry Pi 5 (aarch64) image to the S-CORE reference_integration repo
using a two-phase Bazel-to-Yocto architecture following the Eclipse Leda pattern.
The image deploys the S-CORE showcase binaries and is testable in CI.

Architecture Decision

Two-phase decoupled build:

  • Phase 1 (Bazel): Compiles all software into a standardized, architecture-specific deployment tarball. Yocto is blind to this phase.
  • Phase 2 (Yocto/Kas): Set up in yocto/. Custom recipe fetches the compiled asset from Phase 1, handles OS assembly and license compliance.

Why this approach:

  • Decouples build systems to avoid conflicts
  • Enables Yocto's license compliance engine
  • Follows Eclipse Leda pattern for automotive distributions
  • Allows base OS customization while keeping S-CORE builds hermetic

EBBR Compliance

Decision: Not applicable for Pi 5

EBBR requires U-Boot, which does not support Raspberry Pi 5 (BCM2712). Pi 5 uses proprietary EEPROM bootloader.

Alternative: Pi 4B supports U-Boot (rpi_arm64_defconfig) and could follow the EBBR pattern. Not pursued for initial implementation.

Image Strategy

  • Location: yocto/ directory in repository root
  • Base OS: Yocto-built custom distribution layer (meta-score)
  • S-CORE payloads: Pre-built Bazel tarball (showcases_aarch64.tar.gz)
  • License compliance: Built-in engine with automatic auditing
  • QEMU CI: Use virt machine + external kernel

Toolchain

  • Register aarch64-linux-gcc_12.2.0 in bazel_common/score_gcc_toolchains.MODULE.bazel
  • Add build:linux-aarch64 config to .bazelrc
  • Reuse @ferrocene_aarch64_ebclfsa//:rust_ferrocene_toolchain for Rust (static)
  • Refresh MODULE.bazel.lock after toolchain registration
  • Verify: readelf for glibc ≤ 2.41 and PT_LOAD alignment ≥ 16K

Implementation Steps

Step 1: Bazel Build Target (Phase 1)

Location: //showcases:BUILD.bazel

Tasks:

  1. Define pkg_tar rule targeting linux-aarch64 toolchain
  2. Output: showcases_aarch64.tar.gz with binaries in /usr/bin/, configs at runtime paths
  3. Ensure proper permissions and directory structure

Acceptance:

  • bazel build //showcases:showcases_pkg_tar --config=linux-aarch64 succeeds
  • Tarball contains all showcase binaries with correct paths
  • ELF compatibility verified (glibc ≤ 2.41, PT_LOAD ≥ 16K)

Dependencies: PR 1 (aarch64 toolchain) must be merged


Step 2: Kas Configuration Template (Phase 2 Setup)

Location: yocto/kas-score.yaml

Tasks:

  1. Create yocto/ directory structure
  2. Provide kas-score.yaml for workspace orchestration
  3. Pin dependencies by Git commit hashes:
    • poky (Trixie-compatible)
    • meta-openembedded
    • meta-raspberrypi (Pi 5 BCM2712 support)
  4. Include local path mapping to meta-score layer

Acceptance:

  • kas checkout yocto/kas-score.yaml clones all layers
  • All layers pinned to explicit commits
  • Raspberry Pi 5 support included

Dependencies: None (parallel with Step 1)


Step 3: Custom Yocto Layer Configuration

Location: yocto/meta-score/conf/distro/score.conf

Tasks:

  1. Create layer structure:
    yocto/meta-score/
    ├── conf/
    │   ├── layer.conf
    │   └── distro/
    │       └── score.conf
    ├── recipes-score/
    │   └── apps/
    │       └── score-showcases.bb
    └── README.md
    
  2. Port Eclipse Leda compliance flags into S-CORE distribution profile:
    INCOMPATIBLE_LICENSE = "GPL-3.0* LGPL-3.0* AGPL-3.0*"
    COPY_LIC_MANIFEST = "1"
    COPY_LIC_DIRS = "1"
    LICENSE_CREATE_PACKAGE = "1"
    COPYLEFT_LICENSE_EXCLUDE = 'CLOSED Proprietary LicenseRef-Broadcom-RPi LicenseRef-Synaptics-Killswitch'

Acceptance:

  • Layer passes bitbake-layers show-layers validation
  • Distribution applies license compliance rules
  • License manifests generated during build

Dependencies: Step 2


Step 4: The Handoff Recipe

Location: yocto/meta-score/recipes-score/apps/score-showcases.bb

Tasks:

  1. Create Yocto recipe consuming showcases_aarch64.tar.gz
  2. Configure SRC_URI:
    • Option A: file://showcases_aarch64.tar.gz in files/
    • Option B: Environment variable to Bazel output directory
  3. Implement do_install to extract and install into ${D}

Recipe Template:

SUMMARY = "S-CORE Showcases - Pre-built Bazel Artifacts"
LICENSE = "CLOSED"

SRC_URI = "file://showcases_aarch64.tar.gz"

do_install() {
    install -d ${D}${bindir}
    tar -xzf ${WORKDIR}/showcases_aarch64.tar.gz -C ${D}
}

FILES:${PN} += "/usr/bin/*"

Acceptance:

  • bitbake score-showcases packages the Bazel tarball
  • Package contains all showcase binaries at correct paths
  • Recipe integrates without errors

Dependencies: Steps 1 and 3


Step 5: CI Workflow Integration

Location: .github/workflows/pi5-image.yml

Tasks:

  1. Create two-phase GitHub Actions workflow:
    • Phase 1: Bazel build
      - name: Build Bazel Artifacts
        run: bazel build //showcases:showcases_pkg_tar --config=linux-aarch64
    • Phase 2: Yocto/Kas build
      - name: Build Yocto Image
        run: kas build yocto/kas-score.yaml
        env:
          BAZEL_OUTPUT_DIR: ${{ github.workspace }}/bazel-bin/showcases
  2. Pass Bazel output to BitBake environment
  3. Configure .img artifact upload
  4. Cache base Yocto layers within GitHub storage
  5. Use separate ext4 partition for test data (image reuse)

Acceptance:

  • Workflow runs on PR and main
  • Phase 1 completes before Phase 2
  • .img uploaded on main/release
  • CI validates QEMU boot
  • Base layers cached

Dependencies: Steps 1-4


PR Delivery Plan

PR Deliverable Depends On Phase
1 Generic aarch64 toolchain None 1
2 Bazel tarball target PR 1 1
3 Yocto directory + Kas configuration None 2
4 Custom distribution layer (meta-score) PR 3 2
5 Handoff recipe (score-showcases.bb) PR 2, PR 4 2
6 CI workflow (two-phase build) PR 5 Both
7 Hardware validation and documentation PR 6 2

Parallelization: PRs 1 and 3 are independent. PRs 2 and 4 can proceed in parallel once prerequisites met.


Verification Criteria

  1. bazel test --config=linux-aarch64 //images/pi5_aarch64:test — boots in QEMU, SSH works, showcases run
  2. bazel build --config=linux-aarch64 //images/pi5_aarch64:image — produces flashable .img
  3. CI workflow green on PR
  4. MODULE.bazel.lock refreshed + committed
  5. readelf confirms glibc ≤ 2.41, PT_LOAD ≥ 16K

Open Items

  1. Pi 4B vs Pi 5: Consider Pi 4B first (QEMU support, same image for QEMU+hardware)?
  2. Image storage: Mirror Yocto base layers to eclipse-score GitHub releases?
  3. Handoff approach: Use ext4_overlay_inject from rules_imagefs or direct tar extraction?
  4. Network reliability: Cache Yocto layers within GitHub infrastructure

Related Resources

Intial plan

Base Images (pinned by sha256; mirror only as fallback)

Artifact Base Upstream URL Size
Pi 5 Raspberry Pi OS trixie lite arm64 2026-10-06 https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2026-10-06/2026-10-06-raspios-trixie-arm64-lite.img.xz 525 MB (xz)
Generic CI Debian 13 genericcloud arm64 https://cloud.debian.org/images/cloud/trixie/20261015-2632/debian-13-genericcloud-arm64-20261015-2632.tar.xz (pin a dated dir, never latest/) 214 MB (tar.xz, contains disk.raw)

Activity

  1. self-assigned this
    on Oct 16, 2026
  2. added theissue type on Oct 16, 2026
  3. lurtz commented on Oct 23, 2026

    @lurtz
    Contributor

    Some stuff I learned along the way and want to share.

    In this issue you plan to download images from raspberrypi.com and debian.org. Githubs connection to the internet is not reliable. It works better, if you can use storage inside the Github network.

    When building infrastructure for integration tests, I kept an eye on not creating huge copies of images. Thus data needed for testing is compiled into a separate ext4 and the image itself is untouched. This should also allow faster compile + debug cycles.

    I wonder a bit about using a Raspberry PI 5, when QEMU has support for 4B. Then the same image could be used via QEMU and on hardware.

  4. changed the title [-]Add Raspberry pi image in ref int[/-] [+]Decouple S-CORE Reference Integration for Raspberry Pi 5 using a Two-Phase Bazel-to-Yocto Architecture[/+] on Nov 3, 2026
  5. changed the title [-]Decouple S-CORE Reference Integration for Raspberry Pi 5 using a Two-Phase Bazel-to-Yocto Architecture[/-] [+]# Raspberry Pi 5 (aarch64) Image — Implementation Plan[/+] on Nov 3, 2026
  6. jgetas commented on Nov 4, 2026

    @jgetas
    I wonder a bit about using a Raspberry PI 5, when QEMU has support for 4B. Then the same image could be used via QEMU and on hardware.
    

    The RPI4B support exists since QEMU 9.0, but had issues, especially in QNX. The ethernet device is supported only in new QEMU 11.2 which is planned to be released in December 2026. Once it is there it is surely interesting to see if a binary OS can be run in both QEMU and the hardware!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions