From 5e5a878045f398513855b63ed85562c7dbe8cd3a Mon Sep 17 00:00:00 2001 From: Ivan-Velickovic Date: Thu, 14 Nov 2024 13:15:02 +1100 Subject: [PATCH] Move mkvirtdisk script to tools/ It's useful in other projects, right now it's duplicated in libvmm as well but what we'll do is just make libvmm use sddf/tools/mkvirtdisk. Signed-off-by: Ivan-Velickovic --- examples/blk/blk.mk | 2 +- examples/blk/build.zig | 5 +++-- {examples/blk => tools}/mkvirtdisk | 0 3 files changed, 4 insertions(+), 3 deletions(-) rename {examples/blk => tools}/mkvirtdisk (100%) diff --git a/examples/blk/blk.mk b/examples/blk/blk.mk index d6f6da363..87eb36dd4 100644 --- a/examples/blk/blk.mk +++ b/examples/blk/blk.mk @@ -90,7 +90,7 @@ $(IMAGE_FILE) $(REPORT_FILE): $(IMAGES) $(SYSTEM_FILE) $(MICROKIT_TOOL) $(SYSTEM_FILE) --search-path $(BUILD_DIR) --board $(MICROKIT_BOARD) --config $(MICROKIT_CONFIG) -o $(IMAGE_FILE) -r $(REPORT_FILE) qemu_disk: - ../mkvirtdisk mydisk 1 512 16777216 + $(SDDF)/tools/mkvirtdisk mydisk 1 512 16777216 qemu: ${IMAGE_FILE} qemu_disk $(QEMU) -machine virt,virtualization=on \ diff --git a/examples/blk/build.zig b/examples/blk/build.zig index b1a89069c..f107988dd 100644 --- a/examples/blk/build.zig +++ b/examples/blk/build.zig @@ -138,8 +138,9 @@ pub fn build(b: *std.Build) void { const create_disk_cmd = b.addSystemCommand(&[_][]const u8{ "bash", }); - create_disk_cmd.addFileArg(b.path("mkvirtdisk")); - create_disk_cmd.addFileInput(b.path("mkvirtdisk")); + const mkvirtdisk = sddf_dep.path("tools/mkvirtdisk"); + create_disk_cmd.addFileArg(mkvirtdisk); + create_disk_cmd.addFileInput(mkvirtdisk); const disk = create_disk_cmd.addOutputFileArg("disk"); create_disk_cmd.addArgs(&[_][]const u8{ "1", "512", b.fmt("{}", .{ 1024 * 1024 * 16 }), diff --git a/examples/blk/mkvirtdisk b/tools/mkvirtdisk similarity index 100% rename from examples/blk/mkvirtdisk rename to tools/mkvirtdisk