diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2017-03-16 16:39:58 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2017-03-16 16:39:58 -0300 |
commit | cdea4d9d46db12a2d11dd36f6ba44f42f12b3ca4 (patch) | |
tree | 54b31550e11507ea472257f4977cce2afbfd3fd6 | |
parent | dc567951ec5ffef0e691be57dc9fe588e3b60872 (diff) | |
download | kvmx-cdea4d9d46db12a2d11dd36f6ba44f42f12b3ca4.tar.gz kvmx-cdea4d9d46db12a2d11dd36f6ba44f42f12b3ca4.tar.bz2 |
Default image image location
-rw-r--r-- | TODO.md | 1 | ||||
-rwxr-xr-x | kvmx | 12 | ||||
-rw-r--r-- | kvmxfile | 2 |
3 files changed, 12 insertions, 3 deletions
@@ -2,7 +2,6 @@ TODO ==== * Shared folder and mountpoint pairs. -* Default image image location so putting that info on kvmxfile is optional. * More kvmx-create params (ssh, serial console, etc). * Production mode (systemd service, serial console, no passwordless ssh, etc). * Support for more distros at kvmx-create (archlinux, gentoo, slackware, etc). @@ -25,6 +25,7 @@ DIRNAME="`dirname $0`" ACTION="$1" VM="$2" GLOBAL_USER_CONFIG_FOLDER="$HOME/.config/kvmx" +GLOBAL_USER_CONFIG_FILE="$HOME/.config/kvmxconfig" # Set application base function __kvmx_set_app_base { @@ -79,6 +80,11 @@ function __kvmx_initialize { # Initalize mkdir -p $GLOBAL_USER_CONFIG_FOLDER + # Load user config + if [ -e "$GLOBAL_USER_CONFIG_FILE" ]; then + source $GLOBAL_USER_CONFIG_FILE + fi + # Load and check guest config if [ "$ACTION" != "init" ] && [ "$ACTION" != "list" ] && [ "$ACTION" != "edit" ] && [ "$ACTION" != "usage" ]; then if [ ! -e "$GLOBAL_USER_CONFIG_FOLDER/$VM" ]; then @@ -89,7 +95,11 @@ function __kvmx_initialize { fi if [ -z "$image" ]; then - image="/var/cache/qemu/$VM/box.img" + if [ -z "$image_base" ]; then + image_base="$HOME/.local/share/kvmx" + fi + + image="$image_base/$VM/box.img" fi # Box and folder config @@ -23,7 +23,7 @@ run_spice_client="1" #port_mapping="hostfwd=tcp:127.0.0.1:8080-:80,hostfwd=tcp:127.0.0.1:8443-:443" # Where the guest image is stored -image="$HOME/.local/share/kvmx/$VM/box.img" +#image="$HOME/.local/share/kvmx/$VM/box.img" # Image size size="10G" |