chiark / gitweb /
Much work on packaging of xen stuff; not yet attempted a build
authorIan Jackson <ian@anarres>
Fri, 29 Sep 2006 17:38:19 +0000 (18:38 +0100)
committerIan Jackson <ian@anarres>
Fri, 29 Sep 2006 17:38:19 +0000 (18:38 +0100)
25 files changed:
.bzrignore
Makefile
debian/control
debian/rules
settings.make
xen/Makefile
xen/README
xen/cleanup
xen/config [deleted file]
xen/config-vars [deleted file]
xen/default-config [deleted file]
xen/etc--default--adt-xen [deleted file]
xen/example-config
xen/functions [deleted file]
xen/initscript [moved from xen/etc--init.d--adt-xen with 88% similarity]
xen/on-testbed
xen/readconfig [deleted file]
xen/readconfig.in [moved from xen/tail-config with 62% similarity]
xen/setup
xen/vif-route-adt
xen/vif-script [deleted file]
xen/with-testbed
xen/xen-divert-tls-libc [deleted file]
xen/xen-divert-tls-libc.before-expand [deleted file]
xen/xmdomain [deleted file]

index 267b5809fd68ae8750972123eed83896540da176..2b78d82513c32503988a2873813e308a9842b3a0 100644 (file)
@@ -1,3 +1,5 @@
 debian/autodebtest
 debian/tmp
 debian/files
+xen/sed-readconfig
+xen/readconfig
index d747249dbdcef3ff1897b8a624e6caa4a45a2d81..47098fe35c4236682c8576fba5492be32233369d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,11 +25,16 @@ include settings.make
 programs =     virt-chroot/adt-virt-chroot \
                runner/adt-run
 
-install:
+all:
+       cd xen && $(MAKE)
+
+install-here:
        $(INSTALL_DIRS) -d $(bindir) $(docdir) $(man1dir)
        set -e; for f in $(programs); do \
                $(INSTALL_PROGRAM) $$f $(bindir); \
                test ! -f $$f.1 || $(INSTALL_DOC) $$f.1 $(man1dir); \
                done
-       cd xen && $(MAKE) install
        $(INSTALL_DOC) CREDITS debian/changelog $(docdir)
+
+install: install-here
+       cd xen && $(MAKE) install
index a98d84488f29fd7dd9efb13bdd1e39774d64e1f0..3927f365e486f9068c7a86b160fb7594aad16ce1 100644 (file)
@@ -10,15 +10,24 @@ Architecture: all
 Depends: python2.4
 Conflicts: autodebtest (<< 0.5.3)
 Replaces: autodebtest (<< 0.5.3)
+Suggest: autopkgtest-xenlvm
 Description: automatic as-installed testing for Debian packages
  autopkgtest runs tests on binary packages.  The tests are run on the
  package as installed on a testbed system (which may be found via a
  virtualisation or containment system).  The tests are expected to be
  supplied in the corresponding Debian source package.  See adt-run(1)
  and /usr/share/doc/autopkgtest.
- .
- Status: this release is still pretty much a proof of concept.
 
-Package: autopkgtest-xen
+Package: autopkgtest-xenlvm
 Architecture: all
 Depends: pbuilder, libadns1-bin, chiark-utils-bin, iproute
+Suggest: autopkgtest
+Description: Xen/LVM2 based testbed snapshot system
+ Machinery for setting up a Xen domain which can be resumed over and
+ over again, discarding changes made each time.  This can be useful
+ for automated testing and other advanced techniques; autopkgtest is
+ able to make use of this machinery for its virtualisation needs.
+ .
+ You will need a working Xen setup to make use of this software.  Your
+ network administrator will need to provide support for the testbeds'
+ networking requirements.  See the README for details
index 7ce7d4e54a5844fe432039e709475d42ebafcfab..6b0ddd3edf71ea4d8b3163055e4601ba6cb75f42 100755 (executable)
 # installed as /usr/share/doc/autopkgtest/CREDITS).
 
 p=autopkgtest
+px=autopkgtext-xenlvm
 
-build build-arch build-indep:
+build build-indep:
+       $(MAKE)
+
+build-arch:
 binary-arch:
 
 binary binary-indep: checkdir
@@ -32,7 +36,10 @@ binary binary-indep: checkdir
        dh_clean
        dh_installdirs usr
 
-       $(MAKE) install prefix=debian/$p/usr
+       $(MAKE) install-here prefix=debian/$p/usr
+       $(MAKE) -C xen install \
+               prefix=debian/$(px)/usr \
+               etc=debian/$(px)/etc cfg_suffix=''
 
        cat CREDITS debian/copyright.suffix \
                >debian/$p/usr/share/doc/$p/copyright
index 1a817cbfe5937ed0eba2a47f7eb9d4981b40351a..1c439ad45cee8ea992ce33e1b6ed05231cb80c6c 100644 (file)
@@ -4,9 +4,13 @@ bindir =       $(prefix)/bin
 mandir =       $(share)/man
 man1dir =      $(mandir)/man1
 docdir =       $(share)/doc/autopkgtest
+sharedir =     $(share)/autopkgtest
+etcdir =       /etc
+etcinitddir =  $(etcdir)/init.d
+xenscripts =   $(etcdir)/xen/scripts
+cfg_suffix =   .dist
 
 INSTALL =              install
 INSTALL_DIRS =         $(INSTALL) -d
 INSTALL_PROGRAM =      $(INSTALL) -m 0755
 INSTALL_DOC =          $(INSTALL)
-
index 73d25800c4ae562daf751e4af31dbba083a366fb..00d12e62e1b6724d199d079010454b206b0e83c0 100644 (file)
 
 include ../settings.make
 
-install:
-       
+programs =     cleanup setup on-testbed with-testbed
+shareprograms =        fixups fixups-inside
+sharefiles =   readconfig
 
-       $(INSTALL_DIRS) -d $(bindir) $(docdir) $(man1dir)
+exec_prefix =  adt-xenlvm-
+
+install:       all
+       $(INSTALL_DIRS) -d $(bindir) $(docdir) $(man1dir) \
+               $(sharedir) $(etcinitdddir) $(xenscripts)
+       set -e; for f in $(programs) $(shareprograms); do \
+               $(INSTALL_PROGRAM) $$f $(sharedir); \
+               done
        set -e; for f in $(programs); do \
-               $(INSTALL_PROGRAM) $$f $(bindir); \
-               test ! -f $$f.1 || $(INSTALL_DOC) $$f.1 $(man1dir); \
+               ln -s $(sharedir)/$$f $(bindir)/$(exec_prefix)$$f; \
+               test ! -f $$f.1 || $(INSTALL_DOC) $$f.1 \
+                       $(man1dir)/$(exec_prefix)$$f; \
+               done
+       set -e; for f in $(sharefiles); do \
+               $(INSTALL_DATA) $$f $(sharedir); \
                done
-       cd xen && $(MAKE) install
-       $(INSTALL_DOC) CREDITS debian/changelog $(docdir)
+       $(INSTALL_DATA) initscript $(etcinitddir)/adtxenlvm$(cfg_suffix)
+       $(INSTALL_DATA) vif-route-adt $(xenscripts)/vif-route-adt$(cfg_suffix)
+
+all:           readconfig
+
+readconfig:    sed-readconfig readconfig.in
+       sed -f $^ >$@.new && mv -f $@.new $@
+
+sed-readconfig:        README Makefile
+       echo '/@@varlist@@/{h' >$@.new
+       sed -n 's,^adt_\([_0-9a-z]*\)[  ].*,s/\\*/\1/p;g,p' <$< >>$@.new
+       echo 'd}' >>$@.new && mv -f $@.new $@
index 2a80a2619cbaebe7a47c20723f1391966b528767..e85c023e484921b93eef761a0cd1e032f60fa16c 100644 (file)
@@ -27,6 +27,25 @@ adt_guest_ipaddr     from looking hostname up in the DNS
        not possible to use DHCP for IP address allocation for the
        testbed.
 
+---------- Firewall policy items ----------
+
+adt_fw_localmirrors    <none>
+       List of IP addresses of local mirrors, to which the
+       testbed should allowed to make HTTP requests.
+
+adt_fw_testbedclients  <host_ipaddr>
+       List of IP addresses of hosts which will be allowed to make
+       connections into the testbed system.
+
+adt_fw_prohibnets      192.168.0.0/24 172.16.0.0/12 10.0.0.0/8
+       List of network ranges with which the testbed will be
+       prohibited from communicating, notwithstanding
+       allowglobalports.
+
+adt_fw_allowglobalports        80
+       List of ports to which the testbed will be allowed to make
+       outgoing connections.
+
 ---------- Items that are likely to need attention ----------
 
 adt_kernel             the booted kernel file /boot/xen*`uname -r`
@@ -42,6 +61,11 @@ adt_modules          /lib/modules/`uname -r`
 adt_lvm_vg             the system's LVM volume group if there is only one
        LVM volume group to create base filesystem image in.
 
+adt_pbuilder_args      <none>
+       Extra arguments to pass to pbuilder.
+
+---------- Tuning parameters ----------
+
 adt_fs_type            ext3
 adt_fs_mkfs_args       <none>
        Filesystem type and any additional arguments to mkfs.  If
@@ -49,11 +73,6 @@ adt_fs_mkfs_args     <none>
        it is not possible to pass whitespace-containing arguments to
        mkfs.
 
-adt_pbuilder_args      <none>
-       Extra arguments to pass to pbuilder.
-
----------- Tuning parameters ----------
-
 adt_testbed_ram                256 [Mby]
        Physical RAM allocated for each testbed instance while
        creating and running.
@@ -110,6 +129,8 @@ adt_nominum         adt
        it will be separated by other parts by underscores `_', so
        they should be avoided.
 
+adt_guest_macaddr      00:16:3e:7c:aa:7f
+adt_net_vifscript      /etc/xen/scripts/vif-route-adt
 
 ---------- Items which should not usually need to be changed ----------
 
index e822dd7f7297dbdcaae2e12a416dd933d74c377a..145df5e3d3d26a70bd8ac0cffa04126414966eeb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 set -e
-. ./config
+. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/readconfig
 
 mkdir -p $adt_play $snap
 
diff --git a/xen/config b/xen/config
deleted file mode 100644 (file)
index ef6c52e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-#----------
-# must install
-#   autopkgtest pbuilder libadns1-bin chiark-utils-bin
-#
-# /etc/xen/scripts/vif-route-adt
-# /etc/default/adt-xen
-# /etc/init.d/adt-xen and links
-#----------
diff --git a/xen/config-vars b/xen/config-vars
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/xen/default-config b/xen/default-config
deleted file mode 100644 (file)
index c862257..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-adt_nominum=${adt_nominum}
-adt_testbed_ram=256
-adt_freeze_ram=32
-adt_fs_size=1G
-adt_fs_snapsize=100M
-adt_fs_cowchunk=8
-adt_playbase=/var/lib/autopkgtest/xenlvm
-adt_fs_type=ext3
-adt_fs_mkfs_args=''
-adt_vm_reduce_retries=10
-adt_ssh_keytype=dsa
diff --git a/xen/etc--default--adt-xen b/xen/etc--default--adt-xen
deleted file mode 100644 (file)
index 393185d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-LOCAL_MIRROR_IPS='172.18.45.6'
-LOCAL_CLIENT_IPS='172.18.45.97 172.18.45.6'
-LOCAL_NETWORKS='192.168.0.0/24 172.16.0.0/12 10.0.0.0/8'
-ALLOW_GLOBAL_HTTP=y
\ No newline at end of file
index d14fa574b261fcbcd35dcf6d1d897f1a69d22712..237dbbb41660974b2739f5fdfbd6e18a5c66cc4d 100644 (file)
@@ -1,3 +1,6 @@
 adt_pbuilder_args='--mirror http://mirror.relativity.greenend.org.uk/mirror/ubuntu.early'
 adt_guests_domain=.relativity.greenend.org.uk
 adt_host_hostname=samual.relativity.greenend.org.uk
+
+adt_fw_localmirrors=172.18.45.6
+adt_fw_testbedclients='172.18.45.97 172.18.45.6'
diff --git a/xen/functions b/xen/functions
deleted file mode 100644 (file)
index e69de29..0000000
similarity index 88%
rename from xen/etc--init.d--adt-xen
rename to xen/initscript
index eb040a5f0bbd5156794ca4e91d20283824fb5ae3..578b1dbffd6ef1e552a5b23277687b50dc68927b 100755 (executable)
@@ -1,7 +1,6 @@
 #!/bin/sh
-
 set -e
-
+. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/readconfig
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
 default=/etc/default/adt-xen
@@ -76,7 +75,7 @@ done
 
 main=AdtXenFwd
 
-for i in $LOCAL_MIRROR_IPS; do
+for i in $adt_fw_localmirrors; do
   iptables -A $main -d $i -j ACCEPT -p tcp --dport 80
   iptables -A $main -d $i -j AdtXenIcmp -p icmp
 done
@@ -90,21 +89,21 @@ while read command rest; do
   fi
 done
 
-for i in $LOCAL_CLIENT_IPS; do
+for i in $adt_fw_testbedclients; do
   iptables -A $main -d $i -j ACCEPT -p tcp ! --syn
   iptables -A $main -d $i -j AdtXenIcmp -p icmp
 done
 
-for i in $LOCAL_NETWORKS; do
+for i in $adt_fw_prohibnets; do
   iptables -A $main -d $i -j REJECT --reject-with icmp-net-prohibited
 done
 
-case "$ALLOW_GLOBAL_HTTP" in
-y*|1*|t*) 
-  iptables -A $main -p tcp --dport 80 -j ACCEPT
+if [ x"$adt_fw_allowglobalports" != x ]; then
   iptables -A $main -p icmp -j AdtXenIcmp
-  ;;
-esac
+fi
+for port in $adt_fw_allowglobalports; do
+  iptables -A $main -p tcp --dport $port -j ACCEPT
+done
 
 if test -f $default-rules; then
   . $default-rules
index d4bce670e0af6ee9b944c0fdc2c2a0fc5c44c870..aa5205137c303db4b7b7ed69d99ce6ac2e19f076 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 set -e
-. ./config
+. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/readconfig
 ssh -i $adt_sshkey $adt_guest_ipaddr "$@"
diff --git a/xen/readconfig b/xen/readconfig
deleted file mode 100644 (file)
index 5638cc9..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# This bash script is sourced by the various tools to set the
-# adt_... variables.
-
-fail () {
-       echo >&2 "xenlvm: ${0##*/}: error: $*"
-       exit 16
-}
-
-cmdline_args () {
-       while [ $# -gt 0 ]; do
-               arg="$1"
-               case "$arg" in
-               --*=*)
-                       value="${arg#*=}"
-
-                       var=${arg%%=*}
-                       var=${var#--}
-                       case "$var" in
-                       *-*)    var="$(printf "%s" "$var" | tr -- - _)" ;;
-                       esac
-                       var=${var#adt_}
-
-                       case $var in
-                       *) ;; # @@varlist@@
-                       *) fail "unknown configuration variable \`$var'" ;;
-                       esac
-
-                       eval "$var=\"\$value\""
-                       shift ;;
-
-               --)     break ;;
-               -*)     fail "unknown option \`$arg'" ;;
-               *)      shift; break ;;
-               esac
-       done
-       test $# = 0 || fail "non-option arguments not allowed"
-}
-
-. $ADT_XENLVM_SHARE/config-default
-cmdline_args
-. ${adt_config}
-
-. 
-
-
-lvm_baselv_namerhs=${adt_vg}/${adt_lvm_baselv}
-lvm_baselv_namepath=/dev/${adt_lvbaserhs}
-
-lvm_cowdata_namerhs:=${adt_vg}/${adt_lvm_cowdatalv}
-adt_cowdata_namepath:=/dev/${lvm_cowdata_namerhs}
-
-lvm_snapdev=/dev/mapper/${adt_devmapper_cowdev}
-
-lvm_fslink_ptrrhs=${adt_fslink_dir}/${adt_fslink_name}
-lvm_fslink_dirpath=/dev/${adt_fslink_dir}
-lvm_fslink_ptr=/dev/${lvm_fslink_dir}/${adt_fslink_name}
similarity index 62%
rename from xen/tail-config
rename to xen/readconfig.in
index 996c857e2c999f6ad5815be8f1da91c9b11b95ea..19598d3c2954993712805de45b17d385fc7b5cb3 100644 (file)
@@ -1,3 +1,72 @@
+# This bash script is sourced by the various tools to set the
+# adt_... variables and some other useful ones.
+
+#---------- useful general functions ----------
+
+fail () {
+       echo >&2 "xenlvm: ${0##*/}: error: $*"
+       exit 16
+}
+
+#---------- default values for simple settings ----------
+
+adt_nominum=adt
+adt_testbed_ram=256
+adt_freeze_ram=32
+adt_fs_size=1G
+adt_fs_snapsize=100M
+adt_fs_cowchunk=8
+adt_playbase=/var/lib/autopkgtest/xenlvm
+adt_fs_type=ext3
+adt_fs_mkfs_args=''
+adt_vm_reduce_retries=10
+adt_ssh_keytype=dsa
+
+adt_fw_localmirrors=''
+adt_fw_prohibnets='192.168.0.0/24 172.16.0.0/12 10.0.0.0/8'
+adt_fw_allowglobalports='80'
+
+adt_guest_macaddr=00:16:3e:7c:aa:7f
+adt_net_vifscript=/etc/xen/scripts/vif-route-adt
+
+#---------- arguments and config file ----------
+
+cmdline_args () {
+       while [ $# -gt 0 ]; do
+               arg="$1"
+               case "$arg" in
+               --*=*)
+                       value="${arg#*=}"
+
+                       var=${arg%%=*}
+                       var=${var#--}
+                       case "$var" in
+                       *-*)    var="$(printf "%s" "$var" | tr -- - _)" ;;
+                       esac
+                       var=${var#adt_}
+
+                       case $var in
+                       *) ;; # @@varlist@@
+                       *) fail "unknown configuration variable \`$var'" ;;
+                       esac
+
+                       eval "$var=\"\$value\""
+                       shift ;;
+
+               --)     break ;;
+               -*)     fail "unknown option \`$arg'" ;;
+               *)      shift; break ;;
+               esac
+       done
+       test $# = 0 || fail "non-option arguments not allowed"
+}
+
+cmdline_args
+. ${adt_config}
+cmdline_args
+
+#---------- calculated defaults for complex settings ----------
+
 case "$adt_lvm_vg" in
 '')
        echo "searching for default volume group ..."
@@ -112,3 +181,18 @@ ipaddr_from_hostname host
 
 : ${adt_fslink_dir:=adt-xenlvm}
 : ${adt_fslink_name:=${adt_nominum}_${adt_distro}_fs}
+
+# Firewall
+: ${adt_fw_testbedclients:=${adt_host_ipaddr}}
+
+lvm_baselv_namerhs=${adt_vg}/${adt_lvm_baselv}
+lvm_baselv_namepath=/dev/${adt_lvbaserhs}
+
+lvm_cowdata_namerhs:=${adt_vg}/${adt_lvm_cowdatalv}
+lvm_cowdata_namepath:=/dev/${lvm_cowdata_namerhs}
+
+lvm_snapdev=/dev/mapper/${adt_devmapper_cowdev}
+
+lvm_fslink_ptrrhs=${adt_fslink_dir}/${adt_fslink_name}
+lvm_fslink_dirpath=/dev/${adt_fslink_dir}
+lvm_fslink_ptr=/dev/${lvm_fslink_dir}/${adt_fslink_name}
index 83e5ab4f7e996d9d4364eb7f13b478f543ac8665..f1d52539641564de92bb4231cb66afab56d55a8f 100755 (executable)
--- a/xen/setup
+++ b/xen/setup
@@ -31,7 +31,7 @@ memory = $adt_testbed_ram
 root = "/dev/hda1"
 extra = "ro console=tty0"
 disk = [ "phy:$lvm_fslink_ptrrhs,hda1,w" ]
-vif = [ "bridge=none,mac=00:16:3e:7c:aa:7f,ip=$adt_guest_ipaddr,script=/etc/xen/scripts/vif-route-adt" ]
+vif = [ "bridge=none,mac=$adt_guest_macaddr,ip=${adt_guest_ipaddr},script=${adt_net_vifscript}" ]
 on_crash = "preserve"
 on_reboot = "preserve"
 on_shutdown = "preserve"
index 41ec6a023cbd5fadcdd8dadd5869cdec8be82802..ccf2a6a1b46d322570b59f1ff268b7fed3b6a157 100755 (executable)
 #         this script).
 #============================================================================
 
-exec 2>>/var/log/xen-hotplug.log
-set -x
 case $0 in */*) dir=${0%/*};; *) dir=.;; esac
 . "$dir/vif-common.sh"
 
 main_ip=$(dom0_ip)
+mac=$(xenstore_read "$XENBUS_PATH/mac")
 
 case "$command" in
     online)
         ifconfig ${vif} ${main_ip} netmask 255.255.255.255 \
                broadcast ${main_ip} up
        ip -f inet6 addr delete dev ${vif} local fe80::fcff:ffff:feff:ffff/64
-       ip -f inet neigh add \
-           to 172.18.45.66 \
-           dev ${vif} \
-           lladdr 00:16:3e:7c:aa:7f \
-           nud permanent
-       arp -i ${vif} -s 172.18.45.66 00:16:3e:7c:aa:7f pub
-        ipcmd='a'
+        ipcmd='add'
        iptcmd='-A'
+       cmdprefix=''
+       add_only=''
         ;;
     offline)
         ifdown ${vif}
-        ipcmd='d'
+        ipcmd='del'
        iptcmd='-D'
+       cmdprefix='do_without_error'
+       add_only=:
         ;;
 esac
 
-iptables "$iptcmd" INPUT -i "$vif" -j AdtXenIn
-iptables "$iptcmd" FORWARD -i "$vif" -j AdtXenFwd
-
 if [ "${ip}" ] ; then
     # If we've been given a list of IP addresses, then add routes from dom0 to
     # the guest using those addresses.
     for addr in ${ip} ; do
-      ip r ${ipcmd} ${addr} dev ${vif} src ${main_ip}
+      ${cmdprefix} ip route ${ipcmd} ${addr} dev ${vif} src ${main_ip}
+      ${add_only} ip -f inet neigh add to ${addr} dev ${vif} lladdr ${mac} nud permanent
+      ${add_only} arp -i ${vif} -s ${addr} ${mac} pub
     done 
 fi
 
-#S log debug "Successful vif-route $command for $vif."
+iptables "$iptcmd" INPUT -i "$vif" -j AdtXenIn
+iptables "$iptcmd" FORWARD -i "$vif" -j AdtXenFwd
+
+log debug "Successful vif-route $command for $vif."
 if [ "$command" == "online" ]
 then
   success
diff --git a/xen/vif-script b/xen/vif-script
deleted file mode 100755 (executable)
index b94f5fb..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-#============================================================================
-# /etc/xen/vif-route
-#
-# Script for configuring a vif in routed mode.
-# The hotplugging system will call this script if it is specified either in
-# the device configuration given to Xend, or the default Xend configuration
-# in /etc/xen/xend-config.sxp.  If the script is specified in neither of those
-# places, then vif-bridge is the default.
-#
-# Usage:
-# vif-route (add|remove|online|offline)
-#
-# Environment vars:
-# vif         vif interface name (required).
-# XENBUS_PATH path to this device's details in the XenStore (required).
-#
-# Read from the store:
-# ip      list of IP networks for the vif, space-separated (default given in
-#         this script).
-#============================================================================
-
-exec >/root/u 2>&1
-set -x
-date
-
-dir=$(dirname "$0")
-. "$dir/vif-common.sh"
-
-main_ip=$(dom0_ip)
-
-case "$command" in
-    online)
-        ifconfig ${vif} ${main_ip} netmask 255.255.255.255 \
-               broadcast ${main_ip} up
-        ipcmd='a'
-        ;;
-    offline)
-        ifdown ${vif}
-        ipcmd='d'
-        ;;
-esac
-
-if [ "${ip}" ] ; then
-    # If we've been given a list of IP addresses, then add routes from dom0 to
-    # the guest using those addresses.
-    for addr in ${ip} ; do
-      ip r ${ipcmd} ${addr} dev ${vif} src ${main_ip}
-    done 
-fi
-
-handle_iptable
-
-date >/root/t
-
-iptable
-
-log debug "Successful vif-route $command for $vif."
-if [ "$command" == "online" ]
-then
-  success
-fi
index d102f8b089bed48359fb065dc21fcf58a3bf8730..209183b2670ef36c51e87d95f9492bb257cdb176 100755 (executable)
@@ -3,13 +3,11 @@ set -e
 
 trap 'exit 127' 0
 
-. ./config
-./cleanup
+. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/readconfig
+${ADT_XENLVM_SHARE}/cleanup
 
 modprobe dm-snapshot ||:
 
-#dd if=/dev/zero of=/dev/$lvm_cowdata_namepath bs=512 count=$adt_fs_cowchunk status=noxfer
-
 bdsize=$(blockdev --getsize $adt_lvm_baselv)
 dmsetup create $adt_devmapper_cowdev <<END
 0 $bdsize snapshot $adt_lvm_baselv $lvm_cowdata_namepath n $adt_fs_cowchunk
diff --git a/xen/xen-divert-tls-libc b/xen/xen-divert-tls-libc
deleted file mode 100755 (executable)
index 296895d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd /lib
-
-eachfile () {
-        find -type f | sh -ec "while read f; do
-                $1
-        done"
-}
-
-case "$#.$1" in
-1.'do')
-        mkdir -p tls-aside
-        cd tls
-        find -type d -exec sh -c 'mkdir -p /lib/tls-aside/$1' x '{}' \;
-        eachfile 'dpkg-divert --add --divert "/lib/tls-aside/$f" "/lib/tls/$f"'
-        eachfile 'mv "/lib/tls/$f" "/lib/tls-aside/$f"'
-        chattr +i .
-        echo 'xen libc workaround enabled, diversions installed: 
- tls disabled, libc upgrade may be troubled'
-        ;;
-1.'undo')
-        chattr -i tls
-        if test -d tls-aside; then
-                cd tls-aside
-                eachfile 'mv "/lib/tls-aside/$f" "/lib/tls/$f"'
-                cd ..
-                rmdir tls-aside
-        fi
-        dpkg-divert --list | perl -ne '
-                next unless 
-            s,^local diversion of (/lib/tls/),dpkg-divert --remove $1,;
-                next unless s, to /lib/tls-aside/\S+$,,;
-                print or die $!;
-        ' | sh -e
-        echo 'xen libc workaround disabled, normal status restored: 
- tls enabled, libc upgrade definitely possible'
-        ;;
-*)
-        echo >&1 "usage: $0 do|undo"
-esac
-
-exit 0
diff --git a/xen/xen-divert-tls-libc.before-expand b/xen/xen-divert-tls-libc.before-expand
deleted file mode 100755 (executable)
index f05ffc9..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-set -e
-
-cd /lib
-
-eachfile () {
-       find -type f | sh -ec "while read f; do
-               $1
-       done"
-}
-
-case "$#.$1" in
-1.'do')
-       mkdir -p tls-aside
-       cd tls
-       find -type d -exec sh -c 'mkdir -p /lib/tls-aside/$1' x '{}' \;
-       eachfile 'dpkg-divert --add --divert "/lib/tls-aside/$f" "/lib/tls/$f"'
-       eachfile 'mv "/lib/tls/$f" "/lib/tls-aside/$f"'
-       chattr +i .
-       echo 'xen libc workaround enabled, diversions installed: 
- tls disabled, libc upgrade may be troubled'
-       ;;
-1.'undo')
-       chattr -i tls
-       if test -d tls-aside; then
-               cd tls-aside
-               eachfile 'mv "/lib/tls-aside/$f" "/lib/tls/$f"'
-               cd ..
-               rmdir tls-aside
-       fi
-       dpkg-divert --list | perl -ne '
-               next unless 
-           s,^local diversion of (/lib/tls/),dpkg-divert --remove $1,;
-               next unless s, to /lib/tls-aside/\S+$,,;
-               print or die $!;
-       ' | sh -e
-       echo 'xen libc workaround disabled, normal status restored: 
- tls enabled, libc upgrade definitely possible'
-       ;;
-*)
-       echo >&1 "usage: $0 do|undo"
-esac
-
-exit 0
diff --git a/xen/xmdomain b/xen/xmdomain
deleted file mode 100644 (file)
index 788aefe..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-kernel = "/boot/boot/vmlinuz-2.6-xen"
-memory = 128
-root = "/dev/hda1"
-extra = "ro console=tty0"
-disk = [ "phy:glalonde/adt_dapper_base,hda1,w" ]
-vif = [ "bridge=none,mac=00:16:3e:7c:aa:7f,ip=172.18.45.65,script=/etc/xen/scripts/vif-route-adt" ]
-on_crash = "preserve"
-on_reboot = "preserve"
-on_shutdown = "preserve"