Skip to content

feat: Add EB Linux support to QEMU ITF plugin#123

Draft
lurtz wants to merge 8 commits into
eclipse-score:mainfrom
elektrobit-contrib:add-eb-linux-support-to-qemu-plugin
Draft

feat: Add EB Linux support to QEMU ITF plugin#123
lurtz wants to merge 8 commits into
eclipse-score:mainfrom
elektrobit-contrib:add-eb-linux-support-to-qemu-plugin

Conversation

@lurtz

@lurtz lurtz commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

So far the QEMU plugin code has only been able to run QNX images, which are booted via the -kernel QEMU parameter. This is not enough for Linux images, where the file system is typically not part of the kernel image. In addition to that the EB Linux image is only compiled for AARCH64 for which some architecture abstraction is also needed.

The changes aim to be backwards compatible so that existing code using the current interface of the QEMU ITF plugin stay working without changes.

As drive-by fixes Docker tests have been excluded from QNX test runs. Now bazel test //test/... --config=qemu-integration works as well.

Next steps

This is only sufficient to run the image, but uploading binaries and test data is still missing. I can either do this in this PR or to keep it small in a future PR. I also plan to add Ubuntu support, which typically seems to come in conjunction with cloud-init.

Copilot AI left a comment

Copy link
Copy Markdown

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 extends the QEMU ITF plugin beyond the existing QNX -kernel flow to support EB Linux images by adding (a) separate disk image handling and (b) architecture selection (x86_64 vs aarch64). It also updates CI/test configuration to make QEMU-based integration tests easier to run on Linux.

Changes:

  • Add architecture abstraction and Linux disk-image support (with ephemeral qcow2 overlay) to the QEMU plugin.
  • Add EBclfsa aarch64 QEMU integration-test resources + a new ping integration test target.
  • Adjust Bazel/CI config to run the relevant tests/builds on Linux hosts and install QEMU in GitHub Actions.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/unit/BUILD Restrict selected unit tests to Linux platforms.
test/resources/ebclfsa_aarch64/config-overlay/etc/config/network/network Add static network configuration overlay for EBclfsa image customization.
test/resources/ebclfsa_aarch64/build_image.sh New script to boot EBclfsa image in QEMU and deploy tar payloads into the image.
test/resources/ebclfsa_aarch64/BUILD Add rules to extract fastdev archive and build an ITF-ready EBclfsa image.
test/resources/ebclfsa_aarch64_qemu/qemu_config.json Provide QEMU network/SSH/core/RAM settings for EBclfsa integration tests.
test/resources/ebclfsa_aarch64_qemu/kernel_cmdline.txt Provide Linux kernel cmdline for EBclfsa QEMU boot.
test/resources/ebclfsa_aarch64_qemu/BUILD Export EBclfsa QEMU config artifacts and alias image/kernel targets.
test/resources/BUILD Mark OCI image/load targets as Linux-compatible only.
test/integration/test_ebclfsa_ping.py New integration test validating host↔target connectivity.
test/integration/BUILD Add EBclfsa ping test and include it in the manual QEMU test suite; restrict selected tests to Linux.
score/itf/plugins/qemu/qemu.py Add architecture-aware QEMU command construction; support optional kernel cmdline and disk image.
score/itf/plugins/qemu/qemu_target.py Extend target setup to pass architecture/disk/cmdline into QEMU process creation.
score/itf/plugins/qemu/qemu_process.py Wire new QEMU parameters through the process wrapper.
score/itf/plugins/qemu/init.py Add CLI options for disk image/arch/kernel cmdline and create qcow2 overlays for disk images.
MODULE.bazel Add http_file repo for EBclfsa fastdev archive used by integration resources.
.github/workflows/itf.yml Install QEMU + enable KVM perms in CI for general build/test job.
.bazelrc Add --build_tests_only to the qemu-integration test config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

set -uoex pipefail
Comment on lines +48 to +51
if [[ ! -d "${IMAGE_TARGET}" ]]; then
echo "Error: Image target location is not a directory: ${IMAGE_TARGET}" >&2
exit 1
fi
Comment on lines +74 to +77
qemu-system-aarch64 -m 2048 -cpu cortex-a53 -machine virt \
-kernel "${KERNEL}" \
-machine "virt,virtualization=true,gic-version=3" \
-smp 8 \
Comment on lines +27 to +34
pkg_tar(
name = "network_config_tar",
srcs = [
"config-overlay/etc/config/network/network",
],
mode = "0755",
package_dir = "/etc/config/network",
)
Comment on lines +43 to +61
overlay_fd, overlay_path = tempfile.mkstemp(suffix=".qcow2", prefix="qemu_overlay_")
os.close(overlay_fd)
subprocess.run(
[
"qemu-img",
"create",
"-f",
"qcow2",
"-b",
base_image,
"-F",
_get_image_format(base_image),
overlay_path,
],
check=True,
capture_output=True,
)
logger.info(f"Created qcow2 overlay: {overlay_path} (backing: {base_image})")
return overlay_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants