tools/testramfs: upgrade to use VMs#3478
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades the testramfs tool from a limited host-architecture-only testing utility to a comprehensive VM-based testing tool that supports multiple architectures (amd64, arm64, riscv64). The tool now leverages pre-built kernels and initramfs from the "github.com/u-root/cpu/vm" package to enable cross-architecture testing.
Key Changes:
- Replaced namespace-based isolation with full VM-based testing using QEMU
- Added support for cross-architecture testing via GOOS/GOARCH environment variables
- Simplified command-line interface to act as a wrapper around the u-root command
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3478 +/- ##
==========================================
+ Coverage 61.91% 62.00% +0.08%
==========================================
Files 639 639
Lines 43148 43148
==========================================
+ Hits 26717 26752 +35
+ Misses 16431 16396 -35
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
0ebbc57 to
0704fef
Compare
f5b1d7c to
5b35431
Compare
brho
previously approved these changes
Jan 7, 2026
binjip978
reviewed
Jan 7, 2026
binjip978
previously approved these changes
Jan 7, 2026
The testramfs tool was of limited usefulness, as it only worked on the host architecture The command now uses the "github.com/u-root/cpu/vm", which provides pre-built kernels and initramfs with cpud built in. Testramfs has one required argument, which is the directory in which to run u-root; and optional arguments, passed directly to u-root. It currently requires that the output file be in the current working directory; this can change. testramfs will build the initramfs, using the u-root command; then drop you into an interactive shell in the VM, using one of 3 embedded kernels. testramfs assumes a reasonable qemu command exists in $PATH. It does not require grqphics. Tested on OSX so far. You can now test 3 different architectures, via environment variables. GOARCH=amd64 GOOS=linux ./testramfs ../.. GOARCH=arm64 GOOS=linux ./testramfs ../.. GOARCH=riscv64 GOOS=linux ./testramfs ../.. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
3c6c5d4 to
2a6dcd3
Compare
binjip978
approved these changes
Jan 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The testramfs tool was of limited usefulness, as it only worked on the host architecture
The command now uses the "github.com/u-root/cpu/vm", which provides pre-built kernels and initramfs with cpud built in.
Testramfs has one required argument, which is the directory in which to run u-root; and optional arguments, passed directly to u-root. It currently requires that the output file be in the current working directory; this can change.
testramfs will build the initramfs, using the u-root command; then drop you into an interactive shell in the VM, using one of 3 embedded kernels.
testramfs assumes a reasonable qemu command exists in $PATH. It does not require grqphics.
Tested on OSX so far.
You can now test 3 different architectures, via environment variables. GOARCH=amd64 GOOS=linux ./testramfs ../..
GOARCH=arm64 GOOS=linux ./testramfs ../..
GOARCH=riscv64 GOOS=linux ./testramfs ../..