git://git.onelab.eu
/
build.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
an attempt to make VM creation more robust, as more often than expected we fail that...
[build.git]
/
lbuild-initvm.sh
diff --git
a/lbuild-initvm.sh
b/lbuild-initvm.sh
index
c65026c
..
ee03232
100755
(executable)
--- a/
lbuild-initvm.sh
+++ b/
lbuild-initvm.sh
@@
-104,13
+104,12
@@
function fedora_install() {
cache=/var/cache/lxc/fedora/$arch/$release
cache=/var/cache/lxc/fedora/$arch/$release
- mkdir -p /var/lock/subsys/
(
(
- flock -
n -x
200 || { echo "Cache repository is busy." ; return 1 ; }
+ flock -
-exclusive --timeout 60
200 || { echo "Cache repository is busy." ; return 1 ; }
if [ ! -e "$cache/rootfs" ]; then
echo "Getting cache download in $cache/rootfs ... "
if [ ! -e "$cache/rootfs" ]; then
echo "Getting cache download in $cache/rootfs ... "
- fedora_download || { echo "Failed to download 'fedora base'"; return 1; }
+ fedora_download
$cache
|| { echo "Failed to download 'fedora base'"; return 1; }
else
echo "Updating cache $cache/rootfs ..."
if ! yum --installroot $cache/rootfs -y --nogpgcheck update ; then
else
echo "Updating cache $cache/rootfs ..."
if ! yum --installroot $cache/rootfs -y --nogpgcheck update ; then
@@
-120,18
+119,21
@@
function fedora_install() {
fi
fi
fi
fi
- echo "
Copy $cache/rootfs to $lxc_root
... "
+ echo "
Filling $lxc_root from $cache/rootfs
... "
rsync -a $cache/rootfs/ $lxc_root/
return 0
rsync -a $cache/rootfs/ $lxc_root/
return 0
- ) 200>
/var/lock/subsys/lxc
+ ) 200>
$cache/lock
return $?
}
function fedora_download() {
set -x
return $?
}
function fedora_download() {
set -x
+
+ cache=$1; shift
+
# check the mini fedora was not already downloaded
INSTALL_ROOT=$cache/partial
echo $INSTALL_ROOT
# check the mini fedora was not already downloaded
INSTALL_ROOT=$cache/partial
echo $INSTALL_ROOT