git://git.onelab.eu
/
build.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5916f9d
)
print out message during the initial rsync when migrating
author
parmentelat
<thierry.parmentelat@inria.fr>
Fri, 7 Dec 2018 11:41:05 +0000
(12:41 +0100)
committer
parmentelat
<thierry.parmentelat@inria.fr>
Fri, 7 Dec 2018 11:41:05 +0000
(12:41 +0100)
lbuild-initvm.sh
patch
|
blob
|
history
diff --git
a/lbuild-initvm.sh
b/lbuild-initvm.sh
index
ce22013
..
636fdc4
100755
(executable)
--- a/
lbuild-initvm.sh
+++ b/
lbuild-initvm.sh
@@
-868,6
+868,8
@@
function main () {
local lxc_root=$(lxcroot $lxc)
# rainchecks
local lxc_root=$(lxcroot $lxc)
# rainchecks
+ # when using with the -i option, checking that $lxc_root is void
+ # is a little too much stress..
almost_empty $lxc_root || \
{ echo "container $lxc already exists in $lxc_root - exiting" ; exit 1 ; }
virsh -c lxc:/// domuuid $lxc >& /dev/null && \
almost_empty $lxc_root || \
{ echo "container $lxc already exists in $lxc_root - exiting" ; exit 1 ; }
virsh -c lxc:/// domuuid $lxc >& /dev/null && \
@@
-876,9
+878,13
@@
function main () {
# if IMAGE, copy the provided rootfs to lxc_root
if [ -n "$IMAGE" ] ; then
# if IMAGE, copy the provided rootfs to lxc_root
if [ -n "$IMAGE" ] ; then
- [ ! -d "$IMAGE" ] && \
- { echo "$IMAGE rootfs folder does not exist - exiting" ; exit 1 ; }
- rsync -a $IMAGE/ $lxc_root/
+ if [ ! -d "$IMAGE" ]; then
+ echo "$IMAGE rootfs folder does not exist - exiting"
+ exit 1
+ else
+ echo "Copying $IMAGE into $lxc_root with rsync --archive --delete"
+ rsync --archive --delete $IMAGE/ $lxc_root/
+ fi
fi
# check we've exhausted the arguments
fi
# check we've exhausted the arguments