#!/bin/bash
+# chkconfig: 345 20 80
+# description: Create BTRFS subvolumes for LXC reference images.
+#
+
case "$1" in
start|restart|reload)
;;
esac
+# Check if we are in the build environment
+mount | grep 'planetlab-vservers' > /dev/null
+RETVAL=$?
+[ $RETVAL -ne 0 ] && exit 0
+
# Source function library
. /etc/init.d/functions
if [ -f /vservers/lxc-reference-${VERSION}.tgz ]; then
mkdir -p /vservers/.lvref
- btrfs subvolume /vservers/.lvref/lxc-f14-x86_86
- btrfs subvolume /vservers/.lvref/lxc-squeeze-x86_86
- tar zxvf /vservers/lxc-reference-${VERSION}.tgz -C /vservers/tmp
+ btrfs subvolume create /vservers/.lvref/lxc-f14-x86_64
+ btrfs subvolume create /vservers/.lvref/lxc-squeeze-x86_64
+ tar zxf /vservers/lxc-reference-${VERSION}.tgz -C /vservers/
rm -rf /vservers/lxc-reference-${VERSION}.tgz
fi