COMMAND=$(basename $0)
DIRNAME=$(dirname $0)
+BUILD_DIR=$(pwd)
# pkgs parsing utilities
PATH=$(dirname $0):$PATH export PATH
check_yum_installed libvirt
#retrieve and install lxc from sources
- raw_version=$(lxc-version ||: )
- lxc_installed_version=$(echo $raw_version | sed -e 's,.*: ,,')
- if [ "$lxc_installed_version" != "$lxc_version" ] ; then
- echo "Expecting version" '['$lxc_version']'
- echo "Found version" '['$lxc_installed_version']'
+ #raw_version=$(lxc-version ||: )
+ #lxc_installed_version=$(echo $raw_version | sed -e 's,.*: ,,')
+ #if [ "$lxc_installed_version" != "$lxc_version" ] ; then
+ if [ ! -f /usr/bin/lxc-ls ] ; then
+ #echo "Expecting version" '['$lxc_version']'
+ #echo "Found version" '['$lxc_installed_version']'
echo "Installing lxc ..."
cd /root
[ -d lxc ] || git clone git://lxc.git.sourceforge.net/gitroot/lxc/lxc
./configure --prefix=/usr --exec-prefix=/usr
make
make install
+ mkdir -p /usr/var/lib/
+ [ -d /usr/var/lib/lxc ] || ln -s /var/lib/lxc /usr/var/lib/lxc
+ cd $BUILD_DIR
fi
# #create a placeholder (just a hack to make lxc works)
isInstalled=$(netstat -rn | grep '^0.0.0.0' | awk '{print $8;}')
if [ "$isInstalled" != "br0" ] ; then
bridge_init
- sleep5
+ sleep 5
fi
return 0
echo "Unknown personality: $personality"
fi
-
+ # need lxc installed before we can run lxc-ls
+ # need bridge installed
+ prepare_host
+
if [ -n "$VBUILD_MODE" ] ; then
# Bridge IP affectation
exit 1
fi
- # need lxc installed before we can run lxc-ls
- prepare_host
-
+
if [ ! -z "$(lxc-ls | grep $lxc)" ];then
echo "container $lxc exists"
exit 1