Repository navigation
Conversation
|
The created documentation from the pull request is available at: docu-html |
PR 2: Add debugfs-based overlay injection tooling for CI images. - inject_overlay.py: Python script that extracts partition, injects tar contents via debugfs -w, writes modified partition back - Handles directories, files, symlinks with proper permissions - Free space verification before injection - No loop mounts, no root privileges, no CAP_SYS_ADMIN required This enables offline image modification in CI containers without privileged modes or boot-to-deploy patterns.
e64470d to
799f419
Compare
There was a problem hiding this comment.
Would this be a candidate for https://github.com/eclipse-score/rules_imagefs ?
There was a problem hiding this comment.
|
|
||
| build:linux-aarch64 --config=_common | ||
| build:linux-aarch64 --extra_toolchains=@score_gcc_aarch64_toolchain//:aarch64-linux-gcc_12.2.0 | ||
| build:linux-aarch64 --extra_toolchains=@ferrocene_aarch64_ebclfsa//:rust_ferrocene_toolchain |
There was a problem hiding this comment.
Why not using the ebclfsa toolchain for the entire build? The produced binaries should also work on Raspberry PI: https://github.com/orgs/eclipse-score/discussions/3237
There was a problem hiding this comment.
To maintain consistency between the linux-x86 and linux-arm builds, having both use gcc12 seems like the more appropriate approach.
Additionally, if the ebclfsa toolchain is already compatible and intended for use with Raspberry Pi, what would be the rationale for introducing an entirely new variant?
There was a problem hiding this comment.
🟡 Changes recommended
Overlay injection has unresolved correctness and performance defects, and the new test targets need fixes before they can provide reliable validation.
7 open issues
Execute symlink requests with correct debugfs argument order · New Handle debugfs write collisions explicitly · New Create overlay directories with parent-first mkdir requests · New Detect debugfs request failures before write-back · New Add missing injector test implementation · New Use larger transfer blocks for partition I/O · New Restrict test to compatible Linux AArch64 platforms · New
What changed in this PR
Adds generic Linux AArch64 build support as groundwork for the Raspberry Pi image work in #403, alongside offline image-overlay tooling.
Changes:
- Registers GCC 12.2.0 for AArch64, reuses Ferrocene Rust, configures bindgen, and refreshes the lockfile.
- Adds a showcase payload test for architecture, glibc compatibility, and ELF segment alignment.
- Introduces ext4 overlay injection tooling and a test target with fixture data.
| File | Description |
|---|---|
tests/toolchain/linux_aarch64_elf_compatibility_test.sh |
Checks payload ELF compatibility. |
tests/toolchain/BUILD |
Declares the compatibility test. |
MODULE.bazel.lock |
Records the AArch64 toolchain resolution. |
images/common/overlay/test/test_file.txt |
Supplies overlay fixture content. |
images/common/overlay/test/BUILD |
Declares the fixture archive and injector test. |
images/common/overlay/inject_overlay.py |
Implements offline ext4 overlay injection. |
images/common/overlay/BUILD |
Exposes the injector as a Bazel executable. |
bazel_common/score_gcc_toolchains.MODULE.bazel |
Registers the generic AArch64 GCC toolchain. |
.bazelrc |
Adds Linux AArch64 build and bindgen settings. |
Review effort: Balanced
- Fix symlink handling in inject_overlay.py with correct debugfs argument order - Handle file write collisions by removing existing destinations first - Replace invalid 'mkdir -p' with parent-first directory creation - Add debugfs error detection to prevent silent failures - Improve I/O performance with larger block size (1M instead of 1 byte) - Add proper test implementation for inject_overlay_test.py - Add platform constraints to linux_aarch64 test for compatibility - Format BUILD files with buildifier
Review Comments AddressedI've addressed all 7 technical issues from the Copilot review in commit fba8a3d: High Severity Fixes
Medium Severity Fixes
All 7 review threads have been resolved. The remaining open threads are design questions about toolchain choice and alternative implementations. |
Regarding rules_imagefs questionAfter reviewing The
The injection tool is specifically designed for scenarios where you have an existing disk image (e.g., from a OS build) and need to inject additional files/overlays without requiring loop mounts or CAP_SYS_ADMIN privileges. This is essential for CI/CD pipelines running in containers without elevated permissions. Use case:
This could potentially be moved to |
Update: Overlay tooling moved to rules_imagefsI've created PR eclipse-score/rules_imagefs#33 with the overlay injection tooling now available in the New location: Once that PR is merged, this repository can:
The
To use it: load("@score_rules_imagefs//rules/linux:ext4_overlay.bzl", "ext4_overlay_inject")
ext4_overlay_inject(
name = "custom_pi_image",
image = ":base_image",
partition = 2,
srcs = ["//config:overlay_files"],
package_dir = "/opt/custom",
)Should we update this PR to depend on rules_imagefs, or keep the local implementation? |
Replaces local inject_overlay implementation with the reusable implementation from eclipse-score/rules_imagefs#33. Changes: - Add git_override for score_rules_imagefs pointing to PR #33 - Remove local images/common/overlay implementation - Update MODULE.bazel.lock The overlay injection tooling is now available as: @score_rules_imagefs//rules/linux:ext4_overlay.bzl This enables reuse across all eclipse-score projects and consolidates filesystem image tooling in the rules_imagefs repository. TODO: Remove git_override after rules_imagefs#33 is merged
✅ Migrated to rules_imagefsI've updated this PR to use the ext4 overlay injection tooling from Changes in commit 6a55ee9:
Usage: load("@score_rules_imagefs//rules/linux:ext4_overlay.bzl", "ext4_overlay_inject")
ext4_overlay_inject(
name = "custom_pi_image",
image = ":base_image",
partition = 2,
srcs = ["//config:overlay_files"],
package_dir = "/opt/custom",
)Next steps:
This consolidates all filesystem image tooling in the |
Your way of replying to review findings will result in a total mess, because context is lost. I did not mean to go straight ahead with an implementation, but wanted to first question if it is necessary to modify images, which can be huge. For integration testing I first thought about modifying the images, but except for basic setup avoided doing that. The reason is that this way the same image can be reused in many tests. This should lead to less disk space being used and faster build times. In the context of flashing it onto a SD card, this means flashing a separate partition and mounting that at startup. Then the rootfs partition can always stay untouched on the SD card and only the separate partition needs to be rewritten. This should save build time and SD card wear and tear. |
Sure but testing was initially not in scope. I could not understand what is wrong with the reply. |
Usually you reply in the thread of the review comment to keep the context. This is now harder to establish. |


Refs: #403
Frank Scholter Peres frank.scholter_peres@mercedes-benz.com, Mercedes-Benz Tech Innovation GmbH
Provider Information