* Rearrange the source package
* Divert /etc/xen/qemu-ifup, since it existed and we've been scribbling
over it
+ * Generate /etc/xen/xend-config.sxp
- -- Evan Broder <broder@mit.edu> Sat, 25 Oct 2008 16:15:33 -0400
+ -- Evan Broder <broder@mit.edu> Sat, 25 Oct 2008 17:41:40 -0400
sipb-xen-dom0 (2.10) unstable; urgency=low
Section: base
Priority: extra
Maintainer: Invirt project <invirt@mit.edu>
-Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0)
-Standards-Version: 3.7.2
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), xen-utils-3.2
+Standards-Version: 3.8.0
Package: invirt-xen-config
Architecture: all
# Description:
### END INIT INFO
-set -e
+PACKAGE=invirt-xen-config
+PARENTPACKAGE=xend
+GEN_FILES=/etc/xen/xend-config.sxp
-case $1 in
- start)
+dpkg -s "$PACKAGE" >/dev/null 2>/dev/null || exit 0
+
+. /lib/init/gen-files.sh
+. /lib/init/std-init.sh
+
+do_start() {
+ gen_files
+
echo 1 >/proc/sys/net/ipv4/ip_forward
- for foo in all default; do
- echo 1 >/proc/sys/net/ipv4/conf/$foo/rp_filter
- echo 1 >/proc/sys/net/ipv4/conf/$foo/proxy_arp
+ for i in all default; do
+ echo 1 >/proc/sys/net/ipv4/conf/$i/rp_filter
+ echo 1 >/proc/sys/net/ipv4/conf/$i/proxy_arp
done
- ;;
- esac
+
+ invoke-rc.d "$PARENTPACKAGE" "$1"
+}
+
+do_reload() {
+ do_start
+}
+
+do_stop() {
+ invoke-rc.d "$PARENTPACKAGE" "$1"
+}
+
+std_init "$1"
qemu-dm-invirt usr/sbin
qemu-ifup.invirt etc/xen
vif-invirtroute etc/xen/scripts
+
+debian/xend-config.sxp.invirt.mako etc/xen
DEB_DIVERT_EXTENSION = .invirt
DEB_DIVERT_FILES_invirt-xen-config += \
- /etc/xen/qemu-ifup.invirt
+ /etc/xen/qemu-ifup.invirt \
+ /etc/xen/xend-config.sxp.invirt
include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/config-package.mk
+
+common-build-indep:: debian/xend-config.sxp.invirt.mako
+
+debian/xend-config.sxp.invirt.mako: $(call debian_check_files,/etc/xen/xend-config.sxp)
+ debian/transform_xend-config.sxp.invirt.mako < $< > $@
+
+clean::
+ rm -f debian/xend-config.sxp.invirt.mako
--- /dev/null
+#!/usr/bin/perl -0n
+print <<'EOF';
+<%
+from invirt.config import structs as cfg
+import os
+hostname = os.uname()[1]
+%>
+EOF
+
+s/^\#?\(xend-relocation-address ''\)/(xend-relocation-address '\${hostname}-internal')/m or die;
+s/^\(xend-relocation-hosts-allow '[^']*'\)/(xend-relocation-hosts-allow '')/m or die;
+s/^\(dom0-min-mem [0-9]*\)/(dom0-min-mem 1536)/m or die;
+print;