diff options
author | Dan Williams <dcbw@redhat.com> | 2015-01-27 18:05:07 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2015-01-28 15:17:23 -0600 |
commit | b8a5749d56463c7daa9db4919c1e0d14b28e519a (patch) | |
tree | bcc7a50a3a9641ad19890a7d24b4e8b47dc3c6bb | |
parent | a8ed039318ffcfcbb04c00f36ccee5e2600028c2 (diff) | |
download | NetworkManager-dcbw/live-vm.tar.gz |
live-vm: allow specifying the shared directorydcbw/live-vm
-rwxr-xr-x | contrib/fedora/nm-live-vm/run.sh | 11 | ||||
-rw-r--r-- | contrib/fedora/nm-live-vm/self-extract.sh | 10 |
2 files changed, 16 insertions, 5 deletions
diff --git a/contrib/fedora/nm-live-vm/run.sh b/contrib/fedora/nm-live-vm/run.sh index 97371bdd8a..b887b98f16 100755 --- a/contrib/fedora/nm-live-vm/run.sh +++ b/contrib/fedora/nm-live-vm/run.sh @@ -1,4 +1,6 @@ #!/bin/sh +# vim: ft=sh ts=4 sts=4 sw=4 et ai +# -*- Mode: bash; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- # Three network interfaces NET_OPTIONS="-net nic -net user,hostfwd=tcp:127.0.0.1:10022-:22 -net nic -net user -net nic -net user" @@ -8,11 +10,14 @@ if [ -f /etc/redhat-release ]; then OS=`cat /etc/redhat-release | cut -d" " -f1,2,3,4` fi -DIR="$(dirname "$(readlink -f "$0")")" -SDIR="$DIR/share" MEMORY=$((3*1024)) -mkdir "$SDIR" +DIR="$(dirname "$(readlink -f "$0")")" +SDIR="$DIR/share" +if [ -n "$1" ]; then + SDIR="$1" +fi +mkdir -p "$SDIR" cd "$DIR" diff --git a/contrib/fedora/nm-live-vm/self-extract.sh b/contrib/fedora/nm-live-vm/self-extract.sh index 28f97beab5..7966de71e9 100644 --- a/contrib/fedora/nm-live-vm/self-extract.sh +++ b/contrib/fedora/nm-live-vm/self-extract.sh @@ -3,14 +3,16 @@ # -*- Mode: bash; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- help() { - echo "Usage: self-extract.sh [--suffix SUFFIX] [--delete]" + echo "Usage: self-extract.sh [--suffix SUFFIX] [--delete] [--sharedir DIR]" echo " --suffix: use the given suffix when extracting the live VM directory" echo " --delete: delete the live VM directory when the VM exits" + echo " --sharedir: directory to use for sharing files between guest and host" exit 0 } SUFFIX= DELETE= +SHAREDIR= while [[ $# > 0 ]]; do key="$1" case $key in @@ -21,6 +23,10 @@ while [[ $# > 0 ]]; do -d|--delete) DELETE=yes ;; + -a|--sharedir) + SHAREDIR="$2" + shift + ;; -h|--help) help ;; @@ -46,7 +52,7 @@ sed '1,/^__MARK__$/d' "$BUNDLE" > $NAME.tar.gz || exit 1 tar -xvf $NAME.tar.gz || exit 1 cd $NAME || exit 1 -./run.sh || exit 1 +./run.sh "$SHAREDIR" || exit 1 if [ "$DELETE" = "yes" ]; then rm -rf "$TEMP" |