diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-03-16 12:48:42 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-03-16 12:48:42 -0300 |
commit | d82ffae7a6549d22d25f1784d22f33810626abdc (patch) | |
tree | 4cbea85478437fa5c749f3a99ef000df9dc2050b | |
parent | 78fd9c0f93856045ab26cf2364fa8d1f795a7624 (diff) | |
download | kvmx-d82ffae7a6549d22d25f1784d22f33810626abdc.tar.gz kvmx-d82ffae7a6549d22d25f1784d22f33810626abdc.tar.bz2 |
Shared folder - eval from project folder so . resolves correctly
-rw-r--r-- | TODO.md | 1 | ||||
-rwxr-xr-x | kvmx | 9 |
2 files changed, 4 insertions, 6 deletions
@@ -2,7 +2,6 @@ TODO ==== * Default image image location so putting that info on kvmxfile is optional. -* Shared folder - eval from project folder so . resolves correctly. * Use APP_BASE variable like the Hydra Suite (symlink handling, etc). * More kvmx-create params (ssh, serial console, etc). * Support for more distros at kvmx-create (archlinux, gentoo, slackware, etc). @@ -67,7 +67,8 @@ function kvmx_up { fi if [ ! -z "$shared_folder" ]; then - shared_folder="`cd $shared_folder &> /dev/null && pwd`" + # Get absolute path of shared folder relative to project path + shared_folder="`cd $KVMX_PROJECT_FOLDER && cd $shared_folder &> /dev/null && pwd`" local shared="-fsdev local,id=shared,path=$shared_folder,security_model=none -device virtio-9p-pci,fsdev=shared,mount_tag=shared" fi @@ -356,11 +357,9 @@ function kvmx_initialize { image="/var/cache/qemu/$VM/box.img" fi - if [ -z "$KVMXFILE" ]; then - KVMXFILE="/var/cache/qemu/$VM/kvmxfile" - fi - # Box and folder config + KVMXFILE="`readlink $GLOBAL_USER_CONFIG_FOLDER/$VM`" + KVMX_PROJECT_FOLDER="`dirname $KVMXFILE`" STORAGE="`dirname $image`" STATE_DIR="$STORAGE/state/$VM" PIDFILE="$STATE_DIR/pid" |