diff --git a/srcpkgs/xen/files/proc-xen.mount b/srcpkgs/xen/files/proc-xen.mount new file mode 100644 index 00000000000..0eaa59c5fab --- /dev/null +++ b/srcpkgs/xen/files/proc-xen.mount @@ -0,0 +1,9 @@ +[Unit] +Description=Mount /proc/xen files +ConditionPathExists=/proc/xen +RefuseManualStop=true + +[Mount] +What=xenfs +Where=/proc/xen +Type=xenfs diff --git a/srcpkgs/xen/files/tmpfiles.d-xen.conf b/srcpkgs/xen/files/tmpfiles.d-xen.conf new file mode 100644 index 00000000000..50410177216 --- /dev/null +++ b/srcpkgs/xen/files/tmpfiles.d-xen.conf @@ -0,0 +1 @@ +d /run/xen 0755 root root - diff --git a/srcpkgs/xen/files/var-lib-xenstored.mount b/srcpkgs/xen/files/var-lib-xenstored.mount new file mode 100644 index 00000000000..1c2015ca225 --- /dev/null +++ b/srcpkgs/xen/files/var-lib-xenstored.mount @@ -0,0 +1,10 @@ +[Unit] +Description=mount xenstore file system +ConditionPathExists=/proc/xen +RefuseManualStop=true + +[Mount] +What=xenstore +Where=/var/lib/xenstored +Type=tmpfs +Options=mode=755 diff --git a/srcpkgs/xen/files/xen.conf b/srcpkgs/xen/files/xen.conf new file mode 100644 index 00000000000..4fbf6c96bc8 --- /dev/null +++ b/srcpkgs/xen/files/xen.conf @@ -0,0 +1,7 @@ +xen-evtchn +xen-gntdev +xen-gntalloc +xen-blkback +xen-netback +xen-pciback +xen-acpi-processor diff --git a/srcpkgs/xen/files/xenconsoled.service b/srcpkgs/xen/files/xenconsoled.service new file mode 100644 index 00000000000..edcc8e69fb5 --- /dev/null +++ b/srcpkgs/xen/files/xenconsoled.service @@ -0,0 +1,18 @@ +[Unit] +Description=Xenconsoled - handles logging from guest consoles and hypervisor +Requires=proc-xen.mount +After=proc-xen.mount xenstored.service +ConditionPathExists=/proc/xen + +[Service] +Type=simple +Environment=XENCONSOLED_ARGS= +Environment=XENCONSOLED_LOG=none +Environment=XENCONSOLED_LOG_DIR=/var/log/xen/console +EnvironmentFile=-/etc/conf.d/xenconsoled +PIDFile=/var/run/xenconsoled.pid +ExecStartPre=/usr/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/usr/sbin/xenconsoled --log=${XENCONSOLED_LOG} --log-dir=${XENCONSOLED_LOG_DIR} $XENCONSOLED_ARGS + +[Install] +WantedBy=multi-user.target diff --git a/srcpkgs/xen/files/xendomU@.service b/srcpkgs/xen/files/xendomU@.service new file mode 100644 index 00000000000..57d6e520df7 --- /dev/null +++ b/srcpkgs/xen/files/xendomU@.service @@ -0,0 +1,12 @@ +[Unit] +Description=xen domU service for domain %i +Requires=xenstored.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/sbin/xl create /etc/xen/conf/%i.cfg +ExecStop=/usr/sbin/xl shutdown %i + +[Install] +WantedBy=multi-user.target diff --git a/srcpkgs/xen/files/xendomains.service b/srcpkgs/xen/files/xendomains.service new file mode 100644 index 00000000000..d49bd5593e7 --- /dev/null +++ b/srcpkgs/xen/files/xendomains.service @@ -0,0 +1,15 @@ +[Unit] +Description=Xendomains - start and stop guests on boot and shutdown +Requires=proc-xen.mount xenstored.service +After=proc-xen.mount xenstored.service xenconsoled.service +ConditionPathExists=/proc/xen + +[Service] +Type=oneshot +RemainAfterExit=true +ExecStartPre=/usr/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/etc/xen/scripts/xendomains start +ExecStop=/etc/xen/scripts/xendomains stop + +[Install] +WantedBy=multi-user.target diff --git a/srcpkgs/xen/files/xenstored.service b/srcpkgs/xen/files/xenstored.service new file mode 100644 index 00000000000..c898fd24bfa --- /dev/null +++ b/srcpkgs/xen/files/xenstored.service @@ -0,0 +1,19 @@ +[Unit] +Description=Xenstored - daemon managing xenstore file system +Requires=proc-xen.mount var-lib-xenstored.mount systemd-tmpfiles-setup.service +After=proc-xen.mount var-lib-xenstored.mount systemd-tmpfiles-setup.service +Before=libvirtd.service libvirt-guests.service +RefuseManualStop=true +ConditionPathExists=/proc/xen + +[Service] +Type=forking +Environment=XENSTORED_ARGS= +EnvironmentFile=-/etc/conf.d/xenstored +PIDFile=/var/run/xenstored.pid +ExecStartPre=/usr/bin/grep -q control_d /proc/xen/capabilities +ExecStart=/usr/sbin/xenstored --pid-file /var/run/xenstored.pid $XENSTORED_ARGS +ExecStartPost=/usr/bin/xenstore-write "/local/domain/0/name" "Domain-0" + +[Install] +WantedBy=multi-user.target diff --git a/srcpkgs/xen/patches/gdbsx-glibc-2.17.patch b/srcpkgs/xen/patches/gdbsx-glibc-2.17.patch new file mode 100644 index 00000000000..5d9b33ba00f --- /dev/null +++ b/srcpkgs/xen/patches/gdbsx-glibc-2.17.patch @@ -0,0 +1,10 @@ +--- tools/debugger/gdbsx/xg/xg_main.c ++++ tools/debugger/gdbsx/xg/xg_main.c +@@ -34,6 +34,7 @@ + * XGTRC(): generic trace utility + */ + ++#include + #include + #include + #include diff --git a/srcpkgs/xen/patches/qemu-timer_settime-librt.patch b/srcpkgs/xen/patches/qemu-timer_settime-librt.patch new file mode 100644 index 00000000000..f16d79412eb --- /dev/null +++ b/srcpkgs/xen/patches/qemu-timer_settime-librt.patch @@ -0,0 +1,22 @@ +--- tools/qemu-xen/Makefile.target.orig 2013-06-04 15:51:15.320999319 +0200 ++++ tools/qemu-xen/Makefile.target 2013-06-04 15:51:37.360864318 +0200 +@@ -205,7 +205,7 @@ obj-$(CONFIG_REALLY_VIRTFS) += 9pfs/virt + obj-$(CONFIG_KVM) += kvm.o kvm-all.o + obj-$(CONFIG_NO_KVM) += kvm-stub.o + obj-y += memory.o +-LIBS+=-lz ++LIBS+=-lz -lrt + + QEMU_CFLAGS += $(VNC_TLS_CFLAGS) + QEMU_CFLAGS += $(VNC_SASL_CFLAGS) +--- tools/qemu-xen-traditional/Makefile.target ++++ tools/qemu-xen-traditional/Makefile.target +@@ -520,7 +520,7 @@ + OBJS+=block-raw-posix.o + endif + +-LIBS+=-lz ++LIBS+=-lz -lm -lrt + ifdef CONFIG_ALSA + LIBS += -lasound + endif diff --git a/srcpkgs/xen/template b/srcpkgs/xen/template index 1f4b30c598c..76fc758bb36 100644 --- a/srcpkgs/xen/template +++ b/srcpkgs/xen/template @@ -1,11 +1,13 @@ # Template file for 'xen' pkgname=xen -version=4.1.2 +version=4.2.2 wrksrc=xen-${version} -revision=2 -makedepends="which lzo-devel openssl-devel e2fsprogs-devel zlib-devel gnutls-devel>=3.1.5 +revision=1 +hostmakedepends="which wget bison pkg-config" +makedepends="lzo-devel openssl-devel e2fsprogs-devel zlib-devel gnutls-devel>=3.1.5 libbluetooth-devel pciutils-devel libX11-devel libXext-devel SDL-devel MesaLib-devel - ncurses-devel liblzma-devel python-devel dev86 acpica-utils wget git" + ncurses-devel liblzma-devel python-devel yajl-devel libglib-devel iproute2 + bridge-utils dev86 acpica-utils" if [ "${XBPS_MACHINE}" = "x86_64" ]; then makedepends+=" gcc-multilib" fi @@ -14,59 +16,84 @@ maintainer="Juan RP " homepage="http://xen.org" license="GPL-2" distfiles="http://bits.xensource.com/oss-xen/release/$version/xen-$version.tar.gz" -checksum=7d9c93057cf480d3f1efa792b19285a84fa3c06060ea5c5c453be00887389b0d +checksum=c9bfe91a5e72f8545acebad9889d64368020359bfe18044c0e683133e55ae005 long_desc=" This package provides the official Xen Hypervisor and related utilities for starting/stopping/accessing unprivileged domains (domUs)." -broken_as_needed=yes +do_configure() { + unset CC LD AR AS RANLIB CPP CFLAGS CPPFLAGS LDFLAGS + ./configure --prefix=/usr +} do_build() { install -d ${DESTDIR} - cd ${DESTDIR} && ln -sf . install + cd ${DESTDIR} + ln -sf . install if [ "${XBPS_MACHINE}" = "x86_64" ]; then install -d ${DESTDIR}/usr/lib - cd ${DESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc} + cd ${DESTDIR}/usr + ln -sf lib lib64 + cd ${wrksrc} fi - cd ${wrksrc} && make ${makejobs} DISTDIR=${DESTDIR} xen tools + unset CC LD AR AS RANLIB CPP CFLAGS CPPFLAGS LDFLAGS + make ${makejobs} DISTDIR=${DESTDIR} } do_install() { if [ "${XBPS_MACHINE}" = "x86_64" ]; then install -d ${DESTDIR}/usr/lib - cd ${DESTDIR}/usr && ln -s lib lib64 && cd ${wrksrc} + cd ${DESTDIR}/usr + ln -sf lib lib64 + cd ${wrksrc} fi - + unset CC LD AR AS RANLIB CPP CFLAGS CPPFLAGS LDFLAGS make DESTDIR=${DESTDIR} install-xen install-tools - rm -f ${DESTDIR}/usr/lib/lib - - # Remove unneeded stuff. - rm -f ${DESTDIR}/install ${DESTDIR}/usr/lib64 # Move example config files into correct directory. vmkdir usr/share/examples/xen - mv ${DESTDIR}/etc/xen/xmexample* ${DESTDIR}/usr/share/examples/xen + mv ${DESTDIR}/etc/xen/x*example* ${DESTDIR}/usr/share/examples/xen mv ${DESTDIR}/etc/xen/cpupool ${DESTDIR}/usr/share/examples/xen + + # Remove useless stuff. + rm -rf ${DESTDIR}/etc/init.d ${DESTDIR}/usr/local + rm -f ${DESTDIR}/install.sh ${DESTDIR}/usr/lib64 + rm -rf ${DESTDIR}/usr/bin/qemu-*-xen + rm -rf ${DESTDIR}/usr/share/qemu-xen + rm -f ${DESTDIR}/boot/xen{,-4,-4.2}.gz + rm -f ${DESTDIR}/usr/sbin/xen-python-path + + # Move bash-completion to the correct dir. + vmkdir usr/share/bash-completion/completions + mv ${DESTDIR}/etc/bash_completion.d/* \ + ${DESTDIR}/usr/share/bash-completion/completions + + # Install systemd services. + vmkdir usr/lib/systemd/system + install -m644 ${FILESDIR}/*.{mount,service} ${DESTDIR}/usr/lib/systemd/system + vmkdir usr/lib/modules-load.d + install -m644 ${FILESDIR}/xen.conf ${DESTDIR}/usr/lib/modules-load.d + install -Dm644 ${FILESDIR}/tmpfiles.d-xen.conf \ + ${DESTDIR}/usr/lib/tmpfiles.d/xen.conf + + # Move bins to /usr/bin. + mv ${DESTDIR}/usr/sbin/* ${DESTDIR}/usr/bin/ } xen-devel_package() { - depends="xen" - short_desc="${sourcepkg} development files" + short_desc="Xen development files" pkg_install() { vmove usr/include - vmove "usr/lib/lib*.*a" + vmove "usr/lib/*.a" } } xen_package() { make_dirs=" /var/run/xenstored 755 root root - /var/run/xend/boot 755 root root /var/lib/xenstored 755 root root /var/lib/xen/xenpaging 755 root root /var/xen/dump 755 root root - /var/log/xen 755 root root - /var/lock/subsys 755 root root /etc/xen/auto 755 root root" conf_files=" /etc/default/xendomains @@ -76,11 +103,15 @@ xen_package() { /etc/xen/xend-config.sxp /etc/xen/xend-pci-quirks.sxp /etc/xen/xend-pci-permissive.sxp" + nostrip_files=" + openbios-ppc + openbios-sparc32 + openbios-sparc64 + palcode-clipper + xen-syms-${version}" pycompile_module="xen grub" depends="iproute2 bridge-utils" - nostrip=yes pkg_install() { - vmove etc - vmove usr + vmove all } }