diff --git a/platform/qemu-virt-arm/rules.mk b/platform/qemu-virt-arm/rules.mk index 79721db2c..eb00bda1d 100644 --- a/platform/qemu-virt-arm/rules.mk +++ b/platform/qemu-virt-arm/rules.mk @@ -33,6 +33,7 @@ MODULE_DEPS += \ dev/virtio/block \ dev/virtio/gpu \ dev/virtio/net \ + dev/virtio/9p \ lib/cbuf \ lib/fdtwalk \ diff --git a/scripts/do-qemuarm b/scripts/do-qemuarm index d5ea9a1db..70b753435 100755 --- a/scripts/do-qemuarm +++ b/scripts/do-qemuarm @@ -17,6 +17,7 @@ function HELP { echo "-n : a virtio network device" echo "-t : a virtio tap network device" echo "-g : a virtio display" + echo "-f : a virtio 9p device with a host shared directory" echo echo "-h for help" echo "all arguments after -- are passed to qemu directly" @@ -33,16 +34,19 @@ DO_CORTEX_M3=0 DO_DISPLAY=0 DO_CMPCTMALLOC=0 DO_MINIHEAP=0 +DO_V9P=0 +DO_V9P_DIR="" SMP=1 MEMSIZE=512 SUDO="" PROJECT="" -while getopts cd:ghm:Mnt36vp:s: FLAG; do +while getopts cd:ghm:Mnt36vp:s:f: FLAG; do case $FLAG in c) DO_CMPCTMALLOC=1;; d) DO_DISK=1; DISK_IMAGE=$OPTARG;; g) DO_DISPLAY=1;; + f) DO_V9P=1; DO_V9P_DIR=$OPTARG;; M) DO_MINIHEAP=1;; n) DO_NET=1;; t) DO_NET_TAP=1;; @@ -121,6 +125,11 @@ else ARGS+=" -nographic" fi +if (( $DO_V9P )); then + ARGS+=" -fsdev local,path=$DO_V9P_DIR,security_model=mapped,id=v9p0" + ARGS+=" -device virtio-9p-device,fsdev=v9p0,mount_tag=V9P0" +fi + MAKE_VARS="" if (( $DO_CMPCTMALLOC )); then