Skip to content

Commit

Permalink
feat: make --volume create guest directory before mounting
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Mar 20, 2024
1 parent d2924ac commit 77fb173
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cartesi-machine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ where options are:
-v or --volume=<host_directory>:<guest_directory>
like --virtio-9p, but also appends init commands to auto mount the
host directory in the guest.
host directory in the guest directory.
mount tags are incrementally set to "vfs0", "vfs1", ...
this option implies --sync-init-date.
Expand Down Expand Up @@ -660,6 +660,7 @@ local function handle_volume_option(host_directory, guest_directory)
local tag = "vfs" .. virtio_volume_count
virtio_volume_count = virtio_volume_count + 1
table.insert(virtio, { type = "p9fs", tag = tag, host_directory = host_directory })
append_init = append_init .. "busybox mkdir -p " .. guest_directory .. " && "
append_init = append_init .. "busybox mount -t 9p " .. tag .. " " .. guest_directory .. "\n"
-- sync guest date with host date, otherwise file system updates will have wrong dates
handle_sync_init_date(true)
Expand Down

0 comments on commit 77fb173

Please sign in to comment.