Repository navigation
Build and check images in a throwaway QEMU/KVM VM - #5
Merged
Merged
Conversation
…n verdict, QEMU sandbox, review fixes
… a time, pidfiles checked
…p escalates, review fixes
… only while the pid is still it
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.
Summary
scripts/vm/vm.sh: builds and checks the sargo images in a throwaway QEMU/KVM VM, so the privileged steps (build-image.sh, verify-image.sh, negative-test.sh) never need the host's root or Docker socket. It runs as the user, with no libvirt and no sudo.manifest.toml[build-vm]by version and sha256, and checked against the arch-boxes signing key inscripts/vm/arch-boxes.asc.-sandbox onwith spawn denied, and the guest's host key is generated and pinned before first boot (StrictHostKeyChecking yes). Before every build, listeners on the host's loopback (IPv4 and IPv6) check that the guest cannot reach them; the verdict comes from the host, not from the guest.VM_REUSE=1. Only a git bundle of the requested ref goes in, and only the named image files come out, copied as bytes, with size caps. Guest output is treated as data: both streams are filtered of terminal control sequences, bounded in size, and never evaluated, and no terminal input reaches the guest. The guest's serial console log is capped at 64M. One build runs at a time per state directory.scripts/vm/in-vm-build.shruns CI's image steps: the packages, the release image and its verify, the QML tests, the PIN door, the negative test, and the dev image.scripts/vm/flash-sargo.shflashes the result from the repo's own script, never from a flash.sh that came out of the VM.docs/build-vm.mdcovers usage, isolation and its residual risk (the guest can reach the LAN and the host's non-loopback addresses), and the measured times.Test plan
vm.sh fetch-base: the sha256 and signature were verified against the pinned key.vm.sh build HEAD <dev key>passed end to end on the final commit: the isolation check passed (IPv4 and IPv6 loopback unreachable, outbound HTTPS working), all packages built including the kernel, and so did both images. verify-image passed (apart from the online-resize check, which qemu-user cannot emulate and CI runs natively), as did the QML tests, the PIN door and the negative tests. The images and SHA256SUMS were copied out and their checksums matched.flash-sargo.shpassed its file and SHA256SUMS checks on the copied-out images.stopescalates to SIGKILL on a QEMU that ignores TERM, and keeps its pidfile until it is gone.$.