feat: Add EB Linux support to QEMU ITF plugin - #123
Conversation
There was a problem hiding this comment.
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.
e3ae98a to
bfd4ccf
Compare
| qemu_config=load_configuration(request.config.getoption("qemu_config")), | ||
| qemu_image=request.config.getoption("qemu_image"), | ||
| qemu_kernel=qemu_kernel, | ||
| qemu_rootfs=request.config.getoption("qemu_rootfs"), |
There was a problem hiding this comment.
getoption is called a second time in this function. Would it make sense to move this to the top and create a local variable for it?
Personally I would do something like this at the beginning of the function
get_opt = request.config.getoption
qemu_config_path = get_opt("qemu_config")
qemu_image = get_opt("qemu_image")
qemu_kernel = get_opt("qemu_kernel")
qemu_rootfs = get_opt("qemu_rootfs")There was a problem hiding this comment.
I did not create the alias, because I see no benefit in it. It creates more lines and one additional indirection
So far the QEMU plugin code has only been able to run QNX images, which are booted via the
-kernelQEMU 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-integrationworks 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.