diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - + TOOLCHAIN := x86_64-unknown-linux-musl VPATH = target/system target/$(TOOLCHAIN)/debug target/$(TOOLCHAIN)/release @@ -23,10 +23,16 @@ ID := $(shell date +%s) all: vsock echo_server -check: vsock echo_server +check: vsock echo_server test + +test: + cargo test --all + +fmt: cargo fmt --all -- --check + +clippy: cargo clippy --all-targets --all-features -- -D warnings - cargo test --all clean: cargo clean @@ -49,6 +55,11 @@ vm: initrd.cpio sudo qemu-system-x86_64 -kernel test_fixture/bzImage -initrd target/$(TOOLCHAIN)/debug/initrd.cpio \ -enable-kvm -m 256 -device vhost-vsock-pci,id=vhost-vsock-pci0,guest-cid=3 -nographic -append "console=ttyS0" +# Start a virtio socket enabled vm in background +vm-for-action: initrd.cpio + sudo qemu-system-x86_64 -kernel test_fixture/bzImage -initrd target/$(TOOLCHAIN)/debug/initrd.cpio \ + -m 256 -device vhost-vsock-pci,id=vhost-vsock-pci0,guest-cid=3 -display none -daemonize -append "console=ttyS0" + # Create a simple operating system image for the vm initrd.cpio: echo_server -rm -f target/$(TOOLCHAIN)/debug/initrd.cpio @@ -58,4 +69,4 @@ initrd.cpio: echo_server cp echo_server/target/$(TOOLCHAIN)/debug/echo_server /tmp/$(ID)/ (cd '/tmp/$(ID)' && find . | grep -v 'initrd.cpio' | cpio -H newc -o --append -F initrd.cpio) mv /tmp/$(ID)/initrd.cpio target/$(TOOLCHAIN)/debug/ - rm -Rf /tmp/$(ID)
\ No newline at end of file + rm -Rf /tmp/$(ID) |