3 # description: Create BTRFS subvolumes for LXC reference images.
6 # not needed -- Source function library
7 #. /etc/init.d/functions
9 # This is where sliceimage(s) store their reference images
10 sliceimage_dir=/vservers/.vref
11 lxc_dir=/vservers/.lvref
13 # Check if we are in the build environment
14 function check_node () {
15 mount | grep -q 'planetlab-vservers' || exit 0
16 [ -d $sliceimage_dir ] || { echo "No sliceimage installed" ; exit 1; }
25 slicefamilies=$(cd $sliceimage_dir ; ls )
27 for slicefamily in $slicefamilies; do
28 # initialize if needed
29 [ -d $lxc_dir/$slicefamily ] || btrfs subvolume create $lxc_dir/$slicefamily
31 #btrfs subvolume create $lxc_dir/lxc-squeeze-x86_64
32 # copy the slice image into the btrfs ?
33 rsync -av --delete $sliceimage_dir/$slicefamily/ $lxc_dir/$slicefamily/
38 echo -n "Checking node .. "
41 echo "From installed sliceimage variants"
43 echo "Exported to lxc"
48 start|restart|reload) start ; exit 0 ;;
49 status) status ; exit 0 ;;
51 *) echo $"Usage: $0 {start|stop|status}"