aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-16 12:48:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-16 12:48:42 -0300
commitd82ffae7a6549d22d25f1784d22f33810626abdc (patch)
tree4cbea85478437fa5c749f3a99ef000df9dc2050b
parent78fd9c0f93856045ab26cf2364fa8d1f795a7624 (diff)
downloadkvmx-d82ffae7a6549d22d25f1784d22f33810626abdc.tar.gz
kvmx-d82ffae7a6549d22d25f1784d22f33810626abdc.tar.bz2
Shared folder - eval from project folder so . resolves correctly
-rw-r--r--TODO.md1
-rwxr-xr-xkvmx9
2 files changed, 4 insertions, 6 deletions
diff --git a/TODO.md b/TODO.md
index 307d567..d0605c0 100644
--- a/TODO.md
+++ b/TODO.md
@@ -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).
diff --git a/kvmx b/kvmx
index 889a9ba..4a347c2 100755
--- a/kvmx
+++ b/kvmx
@@ -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"