Merge branch 'stable-2.8' into stable-2.9
[ganeti-local] / devel / build_chroot
index c65b5ff..6f8df03 100755 (executable)
@@ -5,7 +5,10 @@
 : ${CONF_DIR:=/etc/schroot/chroot.d}
 : ${CHROOT_DIR:=/srv/chroot}
 : ${ALTERNATIVE_EDITOR:=/usr/bin/vim.basic}
-# The value of DATA_DIR is read as well from the environment.
+: ${CHROOT_FINAL_HOOK:=/bin/true}
+# Additional Variables taken from the environmen
+# DATA_DIR
+# CHROOT_EXTRA_DEBIAN_PACKAGES    
 
 #Automatically generated variables
 CHROOTNAME=$DIST_RELEASE-$ARCH
@@ -118,7 +121,7 @@ in_chroot -- \
 
 #Install selected packages from backports
 in_chroot -- \
-  apt-get -y --no-install-recommends -t squeeze-backports install \
+  $APT_INSTALL -t squeeze-backports \
     git \
     git-email \
     vim
@@ -136,7 +139,8 @@ in_chroot -- \
   $APT_INSTALL lvm2 ssh bridge-utils iproute iputils-arping \
                ndisc6 python python-pyopenssl openssl \
                python-pyparsing python-simplejson \
-               python-pyinotify python-pycurl python-yaml socat fping
+               python-pyinotify python-pycurl python-yaml python-mock \
+               socat fping
 
 in_chroot -- \
   $APT_INSTALL python-paramiko qemu-utils
@@ -177,7 +181,8 @@ in_chroot -- \
     snap-server==0.8.1 \
     text==0.11.3.0 \
     vector==0.9.1 \
-    json==0.4.4
+    json==0.4.4 \
+    process==1.0.1.2
 
 #Python development tools
 in_chroot -- \
@@ -210,10 +215,21 @@ in_chroot -- \
 in_chroot -- \
   $APT_INSTALL python-docutils debhelper quilt
 
+# extra debian packages
+
+for package in $CHROOT_EXTRA_DEBIAN_PACKAGES
+do in_chroot -- \
+  $APT_INSTALL $package
+done
+
 #Set default editor
 in_chroot -- \
   update-alternatives --set editor $ALTERNATIVE_EDITOR
 
+# Final user hook
+
+in_chroot -- $CHROOT_FINAL_HOOK
+
 rm -f $COMP_FILEPATH
 echo "Creating compressed schroot image..."
 cd $CHDIR