+ # Build in temporary directory
+ mkdir -p "$__DEFAULT_VSERVERDIR/.vtmp"
+ TMP=$(mktemp -d "$__DEFAULT_VSERVERDIR/.vtmp/$NAME.XXXXXX")
+ mkdir -p "$__DEFAULT_VSERVERDIR/.vref"
+
+ # build the systemvserver from the one it was originally cloned from
+ TYPE=$(cat $systemvserver)
+ REF="$__DEFAULT_VSERVERDIR/.vref/$TYPE"
+ "$_VCLONE" "$REF"/ "$TMP"/
+ RETVAL=$?
+
+ # merge the stub with the reference to get the system vserver
+ if [ $RETVAL -eq 0 ] ; then
+ (cd "$__DEFAULT_VSERVERDIR/.vstub/$NAME"/ && find . | cpio -m -d -u -p "$TMP"/)
+ RETVAL=$?
+ fi
+
+ # Clean RPM state
+ rm -f "$TMP/var/lib/rpm/__db"*
+
+ # Move it to its permanent location when complete
+ if [ $RETVAL -eq 0 ] ; then
+ mv "$TMP" "$__DEFAULT_VSERVERDIR/.vref/$NAME"
+ success >&3 2>&4
+ else
+ failure >&3 2>&4
+ fi
+ echo >&3 2>&4
+ fi
+done
+
+echo -n $"Updating VServer reference images: " >&3 2>&4
+
+VROOTS="$__DEFAULT_VSERVERDIR/.vref/* $__DEFAULT_VSERVERDIR/.vcache/* $__DEFAULT_VSERVERDIR/${PLC_SLICE_PREFIX}_*"
+
+# Copy configuration files from host to slices
+for file in /etc/hosts /etc/resolv.conf /etc/planetlab/node_id \
+ /etc/planetlab/plc_config* /etc/planetlab/php/* \
+ /etc/pki/rpm-gpg/* ; do