done
}
+function stop_initscripts() {
+ while test $# -ge 1
+ do
+ if test ! -f $1
+ then
+ shift 1
+ continue
+ fi
+ case $DISTRO in
+ "Debian" )
+ $SUDO update-rc.d $1 remove || echo "Couldn't remove $1 from init"
+ ;;
+ "Fedora" )
+ $SUDO chkconfig --del $1 || echo "Couldn't remove $1 from init"
+ ;;
+ * )
+ echo "I don't know how to start initscripts on $DISTRO"
+ return 1
+ ;;
+ esac
+ shift 1
+ done
+}
function grub_configure() {
echo "Grub: nothing to configure"
}
+
+function grub_unconfigure() {
+ echo "Grub: nothing to unconfigure"
+}
function libvirt_configure() {
start_initscripts libvirtd libvirt-guests virtlockd
}
+
+function libvirt_unconfigure() {
+ stop_initscripts libvirtd libvirt-guests virtlockd
+}
set -e
source config
+source common-functions.sh
export PWD=`pwd`
export GIT=${GIT-git}
grub_clean
libvirt_clean
-for i in `cat /var/log/raisin.log`
+xen_unconfigure
+grub_unconfigure
+libvirt_unconfigure
+
+for i in `cat /var/log/raisin.log 2>/dev/null`
do
rm -rf /"$i"
done
rm -rf /var/log/raisin.log
rm -rf "$INST_DIR"
+
start_initscripts xencommons xendomains xen-watchdog
xen_update_bootloader_$DISTRO
}
+
+function xen_unconfigure() {
+ # leave the bridge in place
+ stop_initscripts xencommons xendomains xen-watchdog
+ if test "`grep -rIi xen /boot/grub* | head -1`"
+ then
+ xen_update_bootloader_$DISTRO
+ fi
+}