git://git.onelab.eu
/
infrastructure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6025e35
)
create-vm.sh: add option -I image - to specify the location of the rootfs
author
Mohamed Larabi
<mohamed.larabi@inria.fr>
Tue, 18 Feb 2014 16:41:31 +0000
(17:41 +0100)
committer
Mohamed Larabi
<mohamed.larabi@inria.fr>
Tue, 18 Feb 2014 16:41:31 +0000
(17:41 +0100)
scripts/create-vm.sh
patch
|
blob
|
history
diff --git
a/scripts/create-vm.sh
b/scripts/create-vm.sh
index
f4c88f0
..
b879490
100755
(executable)
--- a/
scripts/create-vm.sh
+++ b/
scripts/create-vm.sh
@@
-24,16
+24,17
@@
INTERACTIVE=
DISTRO=$DEFAULT_DISTRO
function usage () {
message="$@"
DISTRO=$DEFAULT_DISTRO
function usage () {
message="$@"
- echo "usage : $COMMAND [-i] [-f distro] hostname"
+ echo "usage : $COMMAND [-i] [-f distro]
[-I Image]
hostname"
echo " default distro is $DEFAULT_DISTRO"
[ -n "$message" ] && echo $message
exit 1
}
echo " default distro is $DEFAULT_DISTRO"
[ -n "$message" ] && echo $message
exit 1
}
-while getopts "f:ih" flag; do
+while getopts "f:
I:
ih" flag; do
case $flag in
f) DISTRO=$OPTARG;;
i) INTERACTIVE=true ;;
case $flag in
f) DISTRO=$OPTARG;;
i) INTERACTIVE=true ;;
+ I) IMAGE=$OPTARG;;
?|h) usage "" ;;
esac
done
?|h) usage "" ;;
esac
done
@@
-49,7
+50,11
@@
container="$1" ; shift
fqdn=$container.$DOMAIN
fqdn=$container.$DOMAIN
-command="$BUILD/lbuild-initvm.sh -f $DISTRO -n $fqdn $container"
+if [ -n "$IMAGE" ]; then
+ command="$BUILD/lbuild-initvm.sh -f $DISTRO -n $fqdn -i $IMAGE $container"
+else
+ command="$BUILD/lbuild-initvm.sh -f $DISTRO -n $fqdn $container"
+fi
if [ -n "$INTERACTIVE" ] ; then
echo -n "Run $command OK ? "
if [ -n "$INTERACTIVE" ] ; then
echo -n "Run $command OK ? "