Skip to content

feat: Add ext4 image creation - #16

Merged
nradakovic merged 5 commits into
mainfrom
add-ext4-image-creation
Sep 3, 2026
Merged

nradakovic merged 5 commits into
mainfrom
add-ext4-image-creation

Conversation

@lurtz

@lurtz lurtz commented Aug 24, 2026 •

Copy link
Copy Markdown
Contributor

These images are handy when running integration tests targeting Linux. They can be created with user rights and given to QEMU as a second disk. This way we avoid having to modify the base image.

This also bumps bazel to version 8.6.0 to align with other S-CORE repos.

lurtz added 2 commits August 24, 2026 13:52
These images are handy when running integration tests targeting Linux.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Starlark rule to build Linux ext4 filesystem images (without journaling) for use in integration tests (e.g., attaching as a secondary QEMU disk), and updates repo documentation and Bazel versioning to align with other S-CORE repos.

Changes:

  • Add ext4 Bazel rule (rules/linux/ext4.bzl) to construct an ext4 image from rules_pkg inputs.
  • Add a Bazel sh_test validating the image contents and symlink behavior via debugfs/tune2fs.
  • Update documentation and Bazel version/lockfile to reflect the new rule and Bazel 8.6.0.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
rules/linux/ext4.bzl Adds the new ext4 rule implementation that stages files/symlinks and runs mke2fs to produce an ext4 image.
rules/linux/BUILD Exports ext4.bzl for external loading.
rules/linux/test/BUILD Adds a small test package that builds an ext4 image and verifies it via sh_test.
rules/linux/test/ext4_test.sh Implements runtime validation of the generated ext4 image using debugfs and tune2fs.
rules/linux/test/hello.txt Adds a sample rootfs file used by the ext4 image test.
README.md Documents the new ext4 rule and shows a usage example.
.bazelversion Bumps Bazel to 8.6.0.
MODULE.bazel.lock Updates the lockfile to match the Bazel/module version bump.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/ext4/ext4_test.sh
Comment thread rules/linux/ext4.bzl Outdated
Comment thread rules/linux/ext4.bzl
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: lurtz <727209+lurtz@users.noreply.github.com>
- Introduce `//toolchains/linux:ext4_toolchain_type` and `ext4_toolchain_config`
  so `mke2fs`/`coreutils` are resolved via toolchain resolution instead of a
  hardcoded call; wire it up in the `imagefs` module extension for
  `type = "ext4"`, auto-provisioning hermetic `coreutils` via bazel_lib.
- Split the ext4 rule's image-building logic into static
  `//rules/linux/tools:compute_size`/`:create_image` scripts driven by argv,
  replacing generated-script logic.
- Move `imagefs_toolchain.bzl` from `rules/qnx/` to `rules/` since it's now
  shared across qnx and linux toolchain types.
- Add `templates/linux/BUILD.template` for generating the linux/ext4 toolchain
  repo, mirroring the existing qnx template.
- Extract the ext4 test into a separate nested Bazel module under `tests/`
  (score_rules_imagefs_tests) that depends on the root module via
  `local_path_override`, exercising the `imagefs` extension like a real
  external consumer.
- Update README.md to document the ext4 toolchain setup, module extension
  usage, and current repository layout.
Comment thread rules/linux/tools/compute_size.sh Outdated
To avoid copying files 2 times (for each action), implementation
now uses only one script for generating the ext4 image type.
@nradakovic
nradakovic merged commit 419c2f9 into main Sep 3, 2026
6 checks passed
@nradakovic
nradakovic deleted the add-ext4-image-creation branch September 3, 2026 10:18
lurtz added a commit to eclipse-score/os_images that referenced this pull request Sep 10, 2026
When running integration tests, the test data needs to be available in the virtual machine. Mounting the images automatically mimics the behavior of QNX and Docker images, where the test data is also available without extra actions.

Depends on
- eclipse-score/rules_imagefs#16
lurtz added a commit to lurtz/inc_someip_gateway that referenced this pull request Sep 16, 2026
So far this repo has its own ITF QEMU plugin, which is not sustainable
in the long run, because it creates more maintenance effort. The changes
needed to use the ITF QEMU plugin from the itf repo are now merged to
main, which enables us to remove our QEMU plugin.

This requires the following pull requests to be merged:

- eclipse-score/itf#123
- eclipse-score/itf#135
- eclipse-score/itf#139
- eclipse-score/rules_imagefs#16
- eclipse-score/os_images#29
- eclipse-score/os_images#19


The goal of this pull request to make the patch in the linked pull
request obsolete and use the ITF code without changes.
@nradakovic nradakovic linked an issue Oct 4, 2026 that may be closed by this pull request
7 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

Create a raw ext4 filesystem image from input files

3 participants