From 2ec7321484a2c19b3887996419366860541ed266 Mon Sep 17 00:00:00 2001 From: Yuriy Taraday Date: Thu, 25 Jun 2015 10:25:23 +0200 Subject: [PATCH] Add libvirt ZFS pkg compile to setup_node.sh --- deploy/libvirt.patch | 38 ++++++++++++++++++++++++++++++++++++++ deploy/setup_node.sh | 26 ++++++++++++++++---------- 2 files changed, 54 insertions(+), 10 deletions(-) create mode 100644 deploy/libvirt.patch diff --git a/deploy/libvirt.patch b/deploy/libvirt.patch new file mode 100644 index 00000000..392fdd7e --- /dev/null +++ b/deploy/libvirt.patch @@ -0,0 +1,38 @@ +--- tests/storagepoolxml2xmltest.c ++++ tests/storagepoolxml2xmltest.c.new +@@ -106,8 +106,8 @@ + DO_TEST("pool-gluster-sub"); + DO_TEST("pool-scsi-type-scsi-host-stable"); + #ifdef WITH_STORAGE_ZFS +- DO_TEST("pool-zfs"); +- DO_TEST("pool-zfs-sourcedev"); ++// DO_TEST("pool-zfs"); ++// DO_TEST("pool-zfs-sourcedev"); + #endif + + return ret == 0 ? EXIT_SUCCESS : EXIT_FAILURE; +--- debian/rules ++++ debian/rules.new +@@ -76,6 +76,7 @@ + $(WITH_POLKIT) \ + $(WITH_UDEV) \ + --with-storage-fs \ ++ --with-storage-zfs \ + $(WITH_STORAGE_LVM) \ + $(WITH_STORAGE_ISCSI) \ + $(WITH_STORAGE_DISK) \ +--- configure.ac ++++ configure.ac.new +@@ -1977,9 +1977,9 @@ + with_storage_zfs=$with_freebsd + fi + +-if test "$with_storage_zfs" = "yes" && test "$with_freebsd" = "no"; then +- AC_MSG_ERROR([The ZFS storage driver can be enabled on FreeBSD only.]) +-fi ++#if test "$with_storage_zfs" = "yes" && test "$with_freebsd" = "no"; then ++ #AC_MSG_ERROR([The ZFS storage driver can be enabled on FreeBSD only.]) ++#fi + + if test "$with_storage_zfs" = "yes" || + test "$with_storage_zfs" = "check"; then diff --git a/deploy/setup_node.sh b/deploy/setup_node.sh index b2d67370..d25cee34 100755 --- a/deploy/setup_node.sh +++ b/deploy/setup_node.sh @@ -1,16 +1,22 @@ #!/bin/bash -ex -# In debian-installer's shell run: -# anna-install network-console -# it'll bring up password settings and SSH setup after network setup -# BTW, 172.18.184.58:3142 is a good choice for mirror in cz ;) - -# After system is booted -sudo apt-get install libvirt-bin qemu-kvm lvm2 -# Logout/login to get into libvirtd group +MYDIR="$(readlink -e "$(dirname "$BASH_SOURCE")")" +# Use provided preseed.cfg to install everything # Fucking https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1343245 printf ' /dev/vms/* rw,\n /dev/dm-* rw,\n' | sudo tee -a /etc/apparmor.d/abstractions/libvirt-qemu > /dev/null -# Setup LVM -virsh pool-define-as vms logical --source-dev /dev/sdc +# Build and install Libvirt package with ZFS support +mkdir ~/libvirt-build +pushd ~/libvirt-build +apt-get source libvirt-bin +sudo apt-get build-dep libvirt-bin +sudo apt-get install devscripts +cd libvirt-1.2.12 +patch -p0 < "$MYDIR/libvirt.patch" +debuild -uc -us -b +cd .. +sudo dpkg -i --force-confnew libvirt0_1.2.12-0ubuntu13_amd64.deb libvirt-bin_1.2.12-0ubuntu13_amd64.deb +popd +# Setup ZFS +virsh pool-define-as vms zfs --source-dev /dev/sdc virsh pool-build vms virsh pool-autostart vms virsh pool-start vms