# # spec file for package xen # # Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # Name: xen ExclusiveArch: %ix86 x86_64 %arm aarch64 %define xvers 4.3 %define xvermaj 4 %define changeset 27204 %define xen_build_dir xen-4.3.0-testing %ifarch %arm aarch64 %define with_kmp 0 %define with_stubdom 0 %else %define with_kmp 1 %define with_stubdom 1 %endif # EFI requires gcc46 or newer # its available in 12.1 or >= sles11sp2 %if %suse_version == 1210 || %suse_version == 1110 %define with_gcc46 1 %else %define with_gcc46 0 %endif %ifarch x86_64 %arm aarch64 %define with_dom0_support 1 %else %define with_dom0_support 0 %endif %define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services %if %suse_version >= 1230 %define with_systemd 1 %define with_xend 0 %else %define with_xend 1 %define with_systemd 0 %endif BuildRequires: LibVNCServer-devel BuildRequires: SDL-devel BuildRequires: automake %ifnarch %arm aarch64 BuildRequires: bin86 %endif BuildRequires: curl-devel %ifnarch %arm aarch64 BuildRequires: dev86 %endif BuildRequires: fdupes BuildRequires: glib2-devel BuildRequires: graphviz BuildRequires: latex2html BuildRequires: libaio-devel BuildRequires: libbz2-devel BuildRequires: libjpeg-devel BuildRequires: libpixman-1-0-devel BuildRequires: libuuid-devel BuildRequires: libxml2-devel BuildRequires: libyajl-devel BuildRequires: ncurses-devel BuildRequires: openssl BuildRequires: openssl-devel BuildRequires: pciutils-devel BuildRequires: python-devel BuildRequires: texinfo BuildRequires: transfig %if %suse_version >= 1230 BuildRequires: systemd %endif %if %suse_version >= 1120 BuildRequires: xz-devel %endif %if %suse_version <= 1110 BuildRequires: pmtools %else %ifnarch %arm aarch64 BuildRequires: acpica %endif %endif %if %suse_version >= 1030 BuildRequires: texlive BuildRequires: texlive-latex %if %suse_version > 1220 BuildRequires: texlive-courier BuildRequires: texlive-dvips BuildRequires: texlive-helvetic BuildRequires: texlive-psnfss BuildRequires: texlive-times BuildRequires: tex(a4.sty) BuildRequires: tex(a4wide.sty) BuildRequires: tex(fancyhdr.sty) BuildRequires: tex(parskip.sty) BuildRequires: tex(setspace.sty) %endif %else BuildRequires: te_ams BuildRequires: te_latex BuildRequires: tetex %endif %ifarch x86_64 %if %{?with_gcc46}0 BuildRequires: gcc46 BuildRequires: libgcc46 BuildRequires: libgcc46-32bit %endif BuildRequires: gcc-32bit BuildRequires: gcc43-32bit BuildRequires: glibc-32bit BuildRequires: glibc-devel-32bit %define max_cpus 256 %define pae_enabled n %else %define max_cpus 32 %ifnarch %arm %define pae_enabled y %endif %endif BuildRequires: glibc-devel %if %{?with_kmp}0 BuildRequires: kernel-source BuildRequires: kernel-syms BuildRequires: module-init-tools %if %suse_version < 1220 BuildRequires: xorg-x11 %else BuildRequires: lndir %endif %endif Version: 4.3.0_09 Release: 0 PreReq: %insserv_prereq %fillup_prereq Summary: Xen Virtualization: Hypervisor (aka VMM aka Microkernel) License: GPL-2.0+ Group: System/Kernel Source0: xen-4.3.0-testing-src.tar.bz2 Source1: stubdom.tar.bz2 Source2: qemu-xen-traditional-dir-remote.tar.bz2 Source3: qemu-xen-dir-remote.tar.bz2 Source4: seabios-dir-remote.tar.bz2 Source5: ipxe.tar.bz2 Source6: xen-utils-0.1.tar.bz2 Source10: README.SuSE Source11: boot.xen Source12: boot.local.xenU Source13: init.xend Source14: init.xendomains Source15: logrotate.conf Source16: domUloader.py Source17: xmexample.domUloader Source18: xmexample.disks Source19: block-nbd Source20: block-iscsi Source21: block-npiv-common.sh Source22: block-npiv Source23: block-npiv-vport Source24: xmclone.sh Source25: xend-relocation.sh Source26: init.xen_loop %if %{?with_kmp}0 Source27: xen_pvdrivers.conf Source28: kmp_filelist %endif Source29: block-dmmd # Xen API remote authentication sources Source30: etc_pam.d_xen-api Source31: xenapiusers # Sysconfig hook script for Xen Source32: xen-updown.sh # Firewall service file for xend relocation server Source33: xend-relocation-server.fw # Init script and sysconf file for pciback Source34: init.pciback Source35: sysconfig.pciback Source36: xnloader.py # Systemd service files Source40: xend.service Source41: xencommons.service Source42: xendomains.service Source43: xen-watchdog.service Source99: baselibs.conf # http://xenbits.xensource.com/ext/xenalyze Source20000: xenalyze.hg.tar.bz2 # Upstream patches Patch1: 51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch Patch2: 51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch Patch3: 51d27841-iommu-amd-Workaround-for-erratum-787.patch Patch4: 51daa074-Revert-hvmloader-always-include-HPET-table.patch Patch5: 51d5334e-x86-mm-Ensure-useful-progress-in-alloc_l2_table.patch Patch6: 51dd155c-adjust-x86-EFI-build.patch Patch7: 51e517e6-AMD-IOMMU-allocate-IRTEs.patch Patch8: 51e5183f-AMD-IOMMU-untie-remap-and-vector-maps.patch Patch9: 51e63d80-x86-cpuidle-Change-logging-for-unknown-APIC-IDs.patch Patch10: 51e63df6-VMX-fix-interaction-of-APIC-V-and-Viridian-emulation.patch Patch11: 51e6540d-x86-don-t-use-destroy_xen_mappings-for-vunmap.patch Patch12: 51e7963f-x86-time-Update-wallclock-in-shared-info-when-altering-domain-time-offset.patch Patch13: 51ffd577-fix-off-by-one-mistakes-in-vm_alloc.patch Patch14: 51ffd5fd-x86-refine-FPU-selector-handling-code-for-XSAVEOPT.patch Patch15: 520114bb-Nested-VMX-Flush-TLBs-and-Caches-if-paging-mode-changed.patch Patch16: 520a5504-VMX-add-boot-parameter-to-enable-disable-APIC-v-dynamically.patch Patch17: 520a24f6-x86-AMD-Fix-nested-svm-crash-due-to-assertion-in-__virt_to_maddr.patch Patch18: 520a2570-x86-AMD-Inject-GP-instead-of-UD-when-unable-to-map-vmcb.patch Patch19: 520b4b60-VT-d-protect-against-bogus-information-coming-from-BIOS.patch Patch20: 520b4bda-x86-MTRR-fix-range-check-in-mtrr_add_page.patch Patch21: 520cb8b6-x86-time-fix-check-for-negative-time-in-__update_vcpu_system_time.patch Patch22: 52146070-ACPI-fix-acpi_os_map_memory.patch Patch23: 5214d26a-VT-d-warn-about-CFI-being-enabled-by-firmware.patch Patch24: 5215d094-Nested-VMX-Check-whether-interrupt-is-blocked-by-TPR.patch Patch25: 5215d0c5-Nested-VMX-Force-check-ISR-when-L2-is-running.patch Patch26: 5215d135-Nested-VMX-Clear-APIC-v-control-bit-in-vmcs02.patch Patch27: 5215d2d5-Nested-VMX-Update-APIC-v-RVI-SVI-when-vmexit-to-L1.patch Patch28: 5215d8b0-Correct-X2-APIC-HVM-emulation.patch # Upstream qemu patches # Our patches Patch301: xen-destdir.patch Patch302: xen-changeset.patch Patch303: xen-xmexample.patch Patch304: xen-xmexample-vti.patch Patch310: bridge-opensuse.patch Patch311: bridge-vlan.patch Patch312: bridge-bonding.patch Patch313: bridge-record-creation.patch Patch314: vif-bridge-no-iptables.patch Patch315: vif-bridge-tap-fix.patch Patch316: xl-conf-default-bridge.patch Patch320: network-nat-open-SuSEfirewall2-FORWARD.patch Patch321: udev-rules.patch Patch322: libxen_permissive.patch Patch323: xenconsole-no-multiple-connections.patch # Needs to go upstream Patch330: xencommons-sysconfig.patch Patch331: suspend_evtchn_lock.patch Patch332: xenpaging.doc.patch # Other bug fixes or features Patch350: hibernate.patch Patch351: stdvga-cache.patch Patch352: ipxe-enable-nics.patch Patch353: pygrub-netware-xnloader.patch Patch360: blktapctrl-close-fifos.patch Patch361: blktapctrl-default-to-ioemu.patch Patch362: blktapctrl-disable-debug-printf.patch Patch363: blktap-pv-cdrom.patch # Hypervisor and PV driver Patches Patch501: x86-ioapic-ack-default.patch Patch502: x86-cpufreq-report.patch Patch503: x86-dom-print.patch Patch504: x86-extra-trap-info.patch Patch520: supported_module.patch Patch521: magic_ioport_compat.patch Patch522: xen.sles11sp1.fate311487.xen_platform_pci.dmistring.patch Patch523: disable_emulated_device.patch # Legacy Xend and Qemu patches Patch800: xend-traditional-qemu.patch # Build patches Patch99997: disable-wget-check.patch Patch99998: tmp-initscript-modprobe.patch Patch99999: tmp_build.patch Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/ BuildRoot: %{_tmppath}/%{name}-%{version}-build %define pyver %(python -c "import sys; print sys.version[:3]") %if %{?with_kmp}0 %suse_kernel_module_package -n xen um xen -f kmp_filelist %endif %description Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. This package contains the Xen Hypervisor. (tm) Modern computers are sufficiently powerful to use virtualization to present the illusion of many smaller virtual machines (VMs), each running a separate operating system instance. Successful partitioning of a machine to support the concurrent execution of multiple operating systems poses several challenges. Firstly, virtual machines must be isolated from one another: It is not acceptable for the execution of one to adversely affect the performance of another. This is particularly true when virtual machines are owned by mutually untrusting users. Secondly, it is necessary to support a variety of different operating systems to accommodate the heterogeneity of popular applications. Thirdly, the performance overhead introduced by virtualization should be small. Xen uses a technique called paravirtualization: The guest OS is modified, mainly to enhance performance. The Xen hypervisor (microkernel) does not provide device drivers for your hardware (except for CPU and memory). This job is left to the kernel that's running in domain 0. Thus the domain 0 kernel is privileged; it has full hardware access. It's started immediately after Xen starts up. Other domains have no access to the hardware; instead they use virtual interfaces that are provided by Xen (with the help of the domain 0 kernel). In addition to this package you need to install the kernel-xen, xen-libs and xen-tools packages to use Xen. Xen version 3 and newer also supports running unmodified guests using full virtualization, if appropriate hardware is present. [Hypervisor is a trademark of IBM] Authors: -------- Ian Pratt Keir Fraser Christian Limpach Mark Williamson Ewan Mellor ... %package libs Summary: Xen Virtualization: Libraries Group: System/Kernel %description libs Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. This package contains the libraries used to interact with the Xen virtual machine monitor. In addition to this package you need to install kernel-xen, xen and xen-tools to use Xen. Authors: -------- Ian Pratt %if %{?with_dom0_support}0 %package tools Summary: Xen Virtualization: Control tools for domain 0 Group: System/Kernel Requires: bridge-utils Requires: multipath-tools Requires: python Requires: python-curses Requires: python-lxml Requires: python-openssl Requires: python-pam Requires: python-xml Requires: xen-libs = %{version} # subpackage existed in 10.3 Provides: xen-tools-ioemu = %{version} Obsoletes: xen-tools-ioemu < %{version} Conflicts: libvirt < 1.0.5 %description tools Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. This package contains the control tools that allow you to start, stop, migrate, and manage virtual machines. In addition to this package you need to install kernel-xen, xen and xen-libs to use Xen. Authors: -------- Ian Pratt %package xend-tools Summary: Xen Virtualization: Control tools for domain 0 Group: System/Kernel Requires: python Requires: python-curses Requires: python-lxml Requires: python-openssl Requires: python-pam Requires: python-xml Requires: xen-tools Conflicts: libvirt < 1.0.5 %description xend-tools Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. This package contains the control tools that allow you to start, stop migrate, and manage virtual machines using the legacy xend/xm toolstack. In addition to this package you need to install kernel-xen, xen and xen-libs to use Xen. Authors: -------- Ian Pratt %endif %package tools-domU Summary: Xen Virtualization: Control tools for domain U Group: System/Kernel Conflicts: xen-tools %description tools-domU Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. This package contains tools that allow unprivileged domains to query the virtualized environment. Authors: -------- Ian Pratt %package devel Summary: Xen Virtualization: Headers and libraries for development Group: System/Kernel Requires: xen-libs = %{version} %description devel Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. This package contains the libraries and header files needed to create tools to control virtual machines. Authors: -------- Ian Pratt %if %{?with_kmp}0 %package KMP Summary: Xen para-virtual device drivers for fully virtualized guests Group: System/Kernel Conflicts: xen %description KMP Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. This package contains the Xen para-virtual device drivers for fully virtualized guests. %endif %if %{?with_dom0_support}0 %package doc-html Summary: Xen Virtualization: HTML documentation Group: Documentation/HTML %description doc-html Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. xen-doc-html contains the online documentation in HTML format. Point your browser at file:/usr/share/doc/packages/xen/html/ Authors: -------- Ian Pratt %package doc-pdf Summary: Xen Virtualization: PDF documentation Group: Documentation/Other %description doc-pdf Xen is a virtual machine monitor for x86 that supports execution of multiple guest operating systems with unprecedented levels of performance and resource isolation. xen-doc-pdf contains the online documentation in PDF format. Use xpdf/kpdf/gpdf/gv/... to read the files in /usr/share/doc/packages/xen/pdf/ Authors -------- Ian Pratt %endif %prep %setup -q -n %xen_build_dir -a 1 -a 2 -a 3 -a 4 -a 5 -a 6 -a 20000 # Upstream patches # Qemu # Our patches %patch1 -p1 %patch2 -p1 %patch3 -p1 %patch4 -p1 %patch5 -p1 %patch6 -p1 %patch7 -p1 %patch8 -p1 %patch9 -p1 %patch10 -p1 %patch11 -p1 %patch12 -p1 %patch13 -p1 %patch14 -p1 %patch15 -p1 %patch16 -p1 %patch17 -p1 %patch18 -p1 %patch19 -p1 %patch20 -p1 %patch21 -p1 %patch22 -p1 %patch23 -p1 %patch24 -p1 %patch25 -p1 %patch26 -p1 %patch27 -p1 %patch28 -p1 %patch301 -p1 %patch302 -p1 %patch303 -p1 %patch304 -p1 %patch310 -p1 %patch311 -p1 %patch312 -p1 %patch313 -p1 %patch314 -p1 %patch315 -p1 %patch316 -p1 %patch320 -p1 %patch321 -p1 %patch322 -p1 %patch323 -p1 %patch330 -p1 %patch331 -p1 %patch332 -p1 %patch350 -p1 %patch351 -p1 %patch352 -p1 %patch353 -p1 %patch360 -p1 %patch361 -p1 %patch362 -p1 %patch363 -p1 %patch501 -p1 %patch502 -p1 %patch503 -p1 %patch504 -p1 %patch520 -p1 %patch521 -p1 %patch522 -p1 %patch523 -p1 %patch800 -p1 %patch99997 -p1 %patch99998 -p1 %patch99999 -p1 # tools/qemu-xen-traditional-dir-remote/configure ./tools/qemu-xen-dir-remote/configure use # clock_gettime to check whether -lrt is needed - and don't check other functions # with glibc 2.17 clock_gettime is part of libc, so use timer_settime sed -i -e 's/int main(void) { clockid_t id; return clock_gettime(id, NULL); }/int main(void) { struct itimerspec v;timer_t t; return timer_gettime (t, \&v);}/' \ tools/qemu-xen-traditional-dir-remote/configure ./tools/qemu-xen-dir-remote/configure %build XEN_EXTRAVERSION=%version-%release XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}} sed -i "s/XEN_EXTRAVERSION[\t ]*.=.*\$/XEN_EXTRAVERSION = $XEN_EXTRAVERSION/" xen/Makefile sed -i "s/XEN_CHANGESET[\t ]*=.*\$/XEN_CHANGESET = %{changeset}/" xen/Makefile export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS" ./configure \ --enable-xenapi \ --prefix=/usr \ --exec_prefix=/usr \ --bindir=%{_bindir} \ --sbindir=%{_sbindir} \ --libdir=%{_libdir} \ --datadir=%{_datadir} %if %{?with_dom0_support}0 CFLAGS_SAVE=$CFLAGS %ifnarch %arm aarch64 make -C xenalyze.hg CC="gcc -I../xen/include -DMAX_CPUS=%{max_cpus} ${RPM_OPT_FLAGS}" %{?_smp_mflags} -k %endif make -C tools/include/xen-foreign %{?_smp_mflags} make tools docs %{?_smp_mflags} make -C tools/debugger/gdbsx make -C tools/xen-utils-0.1 XEN_INTREE_BUILD=yes XEN_ROOT=$PWD %else make -C tools/include/xen-foreign %{?_smp_mflags} make tools docs %{?_smp_mflags} %endif %if %{?with_kmp}0 # PV driver modules export XL=/usr/src/linux export XEN=/usr/src/linux/include/xen mkdir -p obj for flavor in %flavors_to_build; do rm -rf obj/$flavor cp -r unmodified_drivers/linux-2.6 obj/$flavor cd obj/$flavor ./mkbuildtree make -C /usr/src/linux-obj/%_target_cpu/$flavor modules \ %{?_smp_mflags} \ M=$PWD cd ../.. done %endif %install export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS" %if %{?with_dom0_support}0 # EFI %ifarch x86_64 %arm aarch64 make -C xen install \ %if %{?with_gcc46}0 CC=gcc-4.6 \ %endif max_phys_cpus=%{max_cpus} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags} make -C xen clean %endif install_xen() { local ext="" if [ -n "$1" ]; then ext="-$1" mv $RPM_BUILD_ROOT/boot/xen-%{version}-%{release}.gz \ $RPM_BUILD_ROOT/boot/xen${ext}-%{version}-%{release}.gz mv $RPM_BUILD_ROOT/boot/xen-syms-%{version}-%{release} \ $RPM_BUILD_ROOT/boot/xen-syms${ext}-%{version}-%{release} fi rm $RPM_BUILD_ROOT/boot/xen-%{xvers}.gz rm $RPM_BUILD_ROOT/boot/xen-%{xvermaj}.gz rm $RPM_BUILD_ROOT/boot/xen.gz # Do not link to links; grub cannot follow. ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvers}.gz ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}-%{xvermaj}.gz ln -s xen${ext}-%{version}-%{release}.gz $RPM_BUILD_ROOT/boot/xen${ext}.gz ln -sf xen-syms${ext}-%{version}-%{release} $RPM_BUILD_ROOT/boot/xen-syms${ext} } %ifnarch %arm aarch64 make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=y crash_debug=y DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags} install_xen dbg make -C xen clean %endif make -C xen install max_phys_cpus=%{max_cpus} pae=%{pae_enabled} debug=n crash_debug=n DESTDIR=$RPM_BUILD_ROOT %{?_smp_mflags} install_xen make -C xen clean make -C tools/include/xen-foreign %{?_smp_mflags} # tools export XEN_PYTHON_NATIVE_INSTALL=1 make -C tools install \ DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags} rm -f $RPM_BUILD_ROOT/usr/sbin/{qcow-create,img2qcow,qcow2raw} echo > xen.files.txt %ifarch x86_64 mkdir -p $RPM_BUILD_ROOT/${_libdir}/xen/bin/ ln -s /usr/lib/xen/bin/qemu-dm $RPM_BUILD_ROOT/%{_libdir}/xen/bin/qemu-dm # EFI depends on gcc46 if test -d $RPM_BUILD_ROOT%{_libdir}/efi then echo %{_libdir}/efi >> xen.files.txt fi cp -avL xenalyze.hg/dump-raw $RPM_BUILD_ROOT/%{_bindir}/xenalyze.dump-raw cp -avL xenalyze.hg/xenalyze $RPM_BUILD_ROOT/%{_bindir} %endif %else make -C tools install DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} %{?_smp_mflags} %endif # PV driver modules %if %{?with_kmp}0 export INSTALL_MOD_PATH=$RPM_BUILD_ROOT export INSTALL_MOD_DIR=updates mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d for flavor in %flavors_to_build; do make -C /usr/src/linux-obj/%_target_cpu/$flavor modules_install \ M=$PWD/obj/$flavor install -m644 %SOURCE27 $RPM_BUILD_ROOT/etc/modprobe.d/xen_pvdrivers-$flavor.conf done %endif %if %{?with_dom0_support}0 # Stubdom %if %{?with_stubdom}0 # remove -fstack-protector flag for stubdom build section export EXTRA_CFLAGS_XEN_TOOLS=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g') export EXTRA_CFLAGS_QEMU_TRADITIONAL=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g') export EXTRA_CFLAGS_QEMU_XEN=$(echo $RPM_OPT_FLAGS |sed -e 's/-fstack-protector//g') make stubdom %{?_smp_mflags} make -C stubdom install \ DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} \ DOCDIR=%{_defaultdocdir}/xen INCDIR=%{_includedir} mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen %ifarch x86_64 ln -s /usr/lib/xen/bin/stubdom-dm $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdom-dm ln -s /usr/lib/xen/bin/stubdompath.sh $RPM_BUILD_ROOT/usr/lib64/xen/bin/stubdompath.sh %endif # restore -fstack-protector flag export EXTRA_CFLAGS_XEN_TOOLS="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_TRADITIONAL="$RPM_OPT_FLAGS" export EXTRA_CFLAGS_QEMU_XEN="$RPM_OPT_FLAGS" %endif # Docs make -C docs install \ DESTDIR=$RPM_BUILD_ROOT MANDIR=%{_mandir} \ DOCDIR=%{_defaultdocdir}/xen for name in COPYING %SOURCE10 %SOURCE11 %SOURCE12; do install -m 644 $name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/ done mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc for name in vtpm.txt crashdb.txt sedf_scheduler_mini-HOWTO.txt xenpaging.txt; do install -m 644 docs/misc/$name $RPM_BUILD_ROOT/%{_defaultdocdir}/xen/misc/ done %endif # Init scripts %if %{?with_dom0_support}0 mkdir -p $RPM_BUILD_ROOT/etc/init.d %ifnarch %arm aarch64 install %SOURCE13 $RPM_BUILD_ROOT/etc/init.d/xend ln -s /etc/init.d/xend $RPM_BUILD_ROOT/usr/sbin/rcxend %endif install tools/hotplug/Linux/init.d/xendomains $RPM_BUILD_ROOT/etc/init.d/xendomains ln -s /etc/init.d/xendomains $RPM_BUILD_ROOT/usr/sbin/rcxendomains %ifnarch %arm aarch64 install %SOURCE34 $RPM_BUILD_ROOT/etc/init.d/pciback ln -s /etc/init.d/pciback $RPM_BUILD_ROOT/usr/sbin/rcpciback install %SOURCE35 $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.pciback %endif mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d install -m644 %SOURCE26 $RPM_BUILD_ROOT/etc/modprobe.d/xen_loop.conf # Example config mkdir -p $RPM_BUILD_ROOT/etc/xen/{vm,examples,scripts} mv $RPM_BUILD_ROOT/etc/xen/xmexample* $RPM_BUILD_ROOT/etc/xen/examples mv $RPM_BUILD_ROOT/etc/xen/xlexample* $RPM_BUILD_ROOT/etc/xen/examples rm -f $RPM_BUILD_ROOT/etc/xen/examples/*nbd install -m644 %SOURCE17 %SOURCE18 $RPM_BUILD_ROOT/etc/xen/examples/ install -m644 tools/xentrace/formats $RPM_BUILD_ROOT/etc/xen/examples/xentrace_formats.txt # Scripts rm -f $RPM_BUILD_ROOT/etc/xen/scripts/block-*nbd install -m755 %SOURCE19 %SOURCE20 %SOURCE21 %SOURCE22 %SOURCE23 %SOURCE24 %SOURCE25 %SOURCE29 $RPM_BUILD_ROOT/etc/xen/scripts/ ln -s /etc/xen/scripts/vm-monitor $RPM_BUILD_ROOT/etc/xen/scripts/set-lock # Xen API remote authentication files install -d $RPM_BUILD_ROOT/etc/pam.d install -m644 %SOURCE30 $RPM_BUILD_ROOT/etc/pam.d/xen-api install -m644 %SOURCE31 $RPM_BUILD_ROOT/etc/xen/ # Sysconfig hook for Xen mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/scripts mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d install -m755 %SOURCE32 $RPM_BUILD_ROOT/etc/sysconfig/network/scripts ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/xen ln -s /etc/sysconfig/network/scripts/xen-updown.sh $RPM_BUILD_ROOT/etc/sysconfig/network/if-down.d/xen # Logrotate install -m644 -D %SOURCE15 $RPM_BUILD_ROOT/etc/logrotate.d/xen # Directories mkdir -p $RPM_BUILD_ROOT/var/lib/xenstored mkdir -p $RPM_BUILD_ROOT/var/lib/xen/images mkdir -p $RPM_BUILD_ROOT/var/lib/xen/jobs mkdir -p $RPM_BUILD_ROOT/var/lib/xen/save mkdir -p $RPM_BUILD_ROOT/var/lib/xen/dump mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/domain mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/migrate mkdir -p $RPM_BUILD_ROOT/var/lib/xen/xend-db/vnet mkdir -p $RPM_BUILD_ROOT/var/log/xen mkdir -p $RPM_BUILD_ROOT/var/log/xen/console ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images # Bootloader mkdir -p $RPM_BUILD_ROOT/usr/lib/xen/boot/ install -m755 %SOURCE16 $RPM_BUILD_ROOT/usr/lib/xen/boot/ install -m755 %SOURCE36 $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages # Udev support mkdir -p $RPM_BUILD_ROOT/etc/udev/rules.d mv $RPM_BUILD_ROOT/etc/udev/rules.d/xen-backend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xen.rules mv $RPM_BUILD_ROOT/etc/udev/rules.d/xend.rules $RPM_BUILD_ROOT/etc/udev/rules.d/40-xend.rules # Systemd %if %{?with_systemd}0 mkdir -p %{buildroot}%{_unitdir} install -m 644 %{SOURCE40} %{buildroot}%{_unitdir}/xend.service install -m 644 %{SOURCE41} %{buildroot}%{_unitdir}/xencommons.service install -m 644 %{SOURCE42} %{buildroot}%{_unitdir}/xendomains.service install -m 644 %{SOURCE43} %{buildroot}%{_unitdir}/xen-watchdog.service %endif # Xen utils make -C tools/xen-utils-0.1 install DESTDIR=$RPM_BUILD_ROOT XEN_INTREE_BUILD=yes XEN_ROOT=$PWD # Clean up unpackaged files rm -f $RPM_BUILD_ROOT/%{_datadir}/doc/packages/xen/html/hypercall/.deps rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-* rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/openbios-* rm -f $RPM_BUILD_ROOT/usr/share/qemu-xen/qemu/palcode-clipper rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/*.egg-info rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen/README.* rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu-img-xen rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu-nbd-xen rm -rf $RPM_BUILD_ROOT/usr/lib/debug rm -f $RPM_BUILD_ROOT/usr/local/etc/qemu/target-x86_64.conf rm -f $RPM_BUILD_ROOT/usr/etc/qemu/target-x86_64.conf rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper # Install firewall definitions format is described here: # /usr/share/SuSEfirewall2/services/TEMPLATE mkdir -p $RPM_BUILD_ROOT/%{_fwdefdir} install -m 644 %{S:26} $RPM_BUILD_ROOT/%{_fwdefdir}/xend-relocation-server # create symlinks for keymaps %fdupes -s $RPM_BUILD_ROOT/%{_datadir} %else # 32 bit hypervisor no longer supported. Remove dom0 tools. rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc rm -rf $RPM_BUILD_ROOT/usr/local/share/doc rm -rf $RPM_BUILD_ROOT/%{_datadir}/man rm -rf $RPM_BUILD_ROOT/usr/local/share/man rm -rf $RPM_BUILD_ROOT/%{_datadir}/qemu-xen rm -rf $RPM_BUILD_ROOT/%{_datadir}/xen rm -rf $RPM_BUILD_ROOT/%{_datadir}/locale rm -rf $RPM_BUILD_ROOT/%{_libdir}/xen rm -rf $RPM_BUILD_ROOT/%{_libdir}/python* rm -rf $RPM_BUILD_ROOT/usr/sbin rm -f $RPM_BUILD_ROOT/usr/bin/xencov_split rm -rf $RPM_BUILD_ROOT/etc/bash_completion.d rm -rf $RPM_BUILD_ROOT/etc/init.d rm -rf $RPM_BUILD_ROOT/etc/logrotate.d rm -rf $RPM_BUILD_ROOT/etc/pam.d rm -rf $RPM_BUILD_ROOT/etc/sysconfig rm -rf $RPM_BUILD_ROOT/etc/udev rm -rf $RPM_BUILD_ROOT/etc/qemu rm -rf $RPM_BUILD_ROOT/etc/xen rm -rf $RPM_BUILD_ROOT/usr/local/etc rm -rf $RPM_BUILD_ROOT/var rm -f $RPM_BUILD_ROOT/%{_bindir}/*store* rm -f $RPM_BUILD_ROOT/%{_bindir}/*trace* rm -f $RPM_BUILD_ROOT/%{_bindir}/xenalyze* rm -f $RPM_BUILD_ROOT/%{_bindir}/qemu* rm -f $RPM_BUILD_ROOT/%{_bindir}/pygrub rm -f $RPM_BUILD_ROOT/%{_bindir}/remus rm -f $RPM_BUILD_ROOT/%{_bindir}/tapdisk-ioemu rm -f $RPM_BUILD_ROOT/%{_bindir}/xencons rm -f $RPM_BUILD_ROOT/usr/etc/qemu/target-x86_64.conf rm -f $RPM_BUILD_ROOT/usr/local/etc/qemu/target-x86_64.conf rm -f $RPM_BUILD_ROOT/usr/libexec/qemu-bridge-helper %endif %if %{?with_dom0_support}0 %files -f xen.files.txt %defattr(-,root,root) /boot/xen-%{version}-%{release}.gz /boot/xen-%{xvermaj}.gz /boot/xen-%{xvers}.gz %ifnarch %arm aarch64 /boot/xen-dbg-%{version}-%{release}.gz /boot/xen-dbg-%{xvermaj}.gz /boot/xen-dbg-%{xvers}.gz /boot/xen-dbg.gz %endif /boot/xen-syms /boot/xen-syms-%{version}-%{release} %ifnarch %arm aarch64 /boot/xen-syms-dbg /boot/xen-syms-dbg-%{version}-%{release} %endif /boot/xen.gz %endif %files libs %defattr(-,root,root) %{_libdir}/fs/ %{_libdir}/*.so.* %if %{?with_dom0_support}0 %files tools %defattr(-,root,root) %ifnarch %arm aarch64 /usr/bin/xenalyze /usr/bin/xenalyze.dump-raw %endif /usr/bin/xencons /usr/bin/xenstore* /usr/bin/xentrace* /usr/bin/pygrub %ifnarch %arm aarch64 /usr/bin/tapdisk-ioemu /usr/bin/remus /usr/bin/xencov_split /usr/sbin/blktapctrl %endif /usr/sbin/flask-* /usr/sbin/tap* /usr/sbin/rcxendomains %ifnarch %arm aarch64 /usr/sbin/rcpciback /usr/sbin/xenbaked %endif /usr/sbin/xenconsoled /usr/sbin/xencov %ifnarch %arm aarch64 /usr/sbin/xen-hptool /usr/sbin/xen-hvmcrash /usr/sbin/xen-hvmctx /usr/sbin/xenlockprof /usr/sbin/xen-lowmemd /usr/sbin/xenmon.py /usr/sbin/xenperf /usr/sbin/xenpm /usr/sbin/xenpmd %endif /usr/sbin/xen-ringwatch /usr/sbin/xenstored %ifnarch %arm aarch64 /usr/sbin/xen-tmem-list-parse %endif /usr/sbin/xentop %ifnarch %arm aarch64 /usr/sbin/xentrace_setmask %endif /usr/sbin/xenwatchdogd /usr/sbin/xsview /usr/sbin/gtracestat /usr/sbin/gtraceview /usr/sbin/lock-util /usr/sbin/td-util %ifnarch %arm aarch64 /usr/sbin/vhd-update /usr/sbin/vhd-util /usr/sbin/gdbsx %endif /usr/sbin/xl %ifnarch %arm aarch64 /usr/sbin/kdd %endif %dir %attr(700,root,root) /etc/xen %dir /etc/xen/scripts /etc/xen/scripts/blktap /etc/xen/scripts/block* /etc/xen/scripts/external-device-migrate /etc/xen/scripts/hotplugpath.sh /etc/xen/scripts/locking.sh /etc/xen/scripts/logging.sh /etc/xen/scripts/network-* %ifnarch %arm aarch64 /etc/xen/scripts/qemu-ifup %endif /etc/xen/scripts/vif2 /etc/xen/scripts/vif-* /etc/xen/scripts/vscsi /etc/xen/scripts/xen-hotplug-* /etc/xen/scripts/xen-network-common.sh /etc/xen/scripts/xen-script-common.sh /etc/xen/scripts/xmclone.sh %{_libdir}/xen %ifarch x86_64 aarch64 /usr/lib/xen %endif %ifnarch %arm aarch64 /var/adm/fillup-templates/sysconfig.pciback %endif /var/adm/fillup-templates/sysconfig.xencommons /var/adm/fillup-templates/sysconfig.xendomains %dir /var/lib/xen %dir %attr(700,root,root) /var/lib/xen/images %dir %attr(700,root,root) /var/lib/xen/save %dir %attr(700,root,root) /var/lib/xen/dump %ifnarch %arm aarch64 %dir %attr(700,root,root) /var/lib/xen/xenpaging %endif %dir /var/lib/xenstored %dir /var/log/xen %dir /var/log/xen/console %config /etc/logrotate.d/xen /etc/xen/auto %config /etc/xen/examples /etc/xen/images %config /etc/xen/cpupool /etc/xen/README* %config /etc/xen/vm %config(noreplace) /etc/xen/xenapiusers %config(noreplace) /etc/xen/xl.conf %config /etc/pam.d/xen-api %config /etc/modprobe.d/xen_loop.conf %config /etc/init.d/xencommons %config /etc/init.d/xendomains %config /etc/init.d/xen-watchdog %ifnarch %arm aarch64 %config /etc/init.d/pciback %endif %if %{?with_systemd}0 %{_unitdir}/xencommons.service %{_unitdir}/xendomains.service %{_unitdir}/xen-watchdog.service %endif %dir /etc/modprobe.d %dir /etc/udev %dir /etc/udev/rules.d /etc/udev/rules.d/40-xen.rules /etc/sysconfig/network/scripts/xen-updown.sh /etc/sysconfig/network/if-up.d/xen /etc/sysconfig/network/if-down.d/xen /etc/bash_completion.d/xl.sh %ifnarch %arm aarch64 %dir %{_datadir}/qemu-xen %{_datadir}/qemu-xen/* %endif %dir %{_datadir}/xen %{_datadir}/xen/*.dtd %ifnarch %arm aarch64 %dir %{_datadir}/xen/qemu %{_datadir}/xen/qemu/* %endif %dir %{_libdir}/python%{pyver}/site-packages/grub %dir %{_libdir}/python%{pyver}/site-packages/xen %dir %{_libdir}/python%{pyver}/site-packages/xen/lowlevel %dir %{_libdir}/python%{pyver}/site-packages/xen/xsview %{_libdir}/python%{pyver}/site-packages/grub/* %{_libdir}/python%{pyver}/site-packages/xen/__init__* %{_libdir}/python%{pyver}/site-packages/xen/lowlevel/* %{_libdir}/python%{pyver}/site-packages/xen/xsview/* %{_libdir}/python%{pyver}/site-packages/fsimage.so %{_libdir}/python%{pyver}/site-packages/xnloader.py %dir %{_defaultdocdir}/xen %{_defaultdocdir}/xen/COPYING %{_defaultdocdir}/xen/README.SuSE %{_defaultdocdir}/xen/boot.local.xenU %{_defaultdocdir}/xen/boot.xen %{_defaultdocdir}/xen/misc %{_mandir}/man1/xentop.1.gz %{_mandir}/man1/xentrace_format.1.gz %{_mandir}/man1/xl.1.gz %{_mandir}/man5/xl.cfg.5.gz %{_mandir}/man5/xl.conf.5.gz %{_mandir}/man5/xlcpupool.cfg.5.gz %{_mandir}/man8/*.8.gz %files xend-tools %defattr(-,root,root) %ifnarch %arm aarch64 /etc/udev/rules.d/40-xend.rules %endif %ifnarch %arm aarch64 /usr/sbin/rcxend /usr/sbin/xm /usr/sbin/xend /usr/sbin/xen-bugtool /usr/sbin/xen-python-path /usr/sbin/xen-list /usr/sbin/xen-destroy /usr/sbin/xen-vmresync %dir /var/lib/xen/xend-db %dir /var/lib/xen/xend-db/domain %dir /var/lib/xen/xend-db/migrate %dir /var/lib/xen/xend-db/vnet %dir %{_libdir}/python%{pyver}/site-packages/xen/remus %dir %{_libdir}/python%{pyver}/site-packages/xen/sv %dir %{_libdir}/python%{pyver}/site-packages/xen/util %dir %{_libdir}/python%{pyver}/site-packages/xen/xend %dir %{_libdir}/python%{pyver}/site-packages/xen/xm %dir %{_libdir}/python%{pyver}/site-packages/xen/web %config /etc/init.d/xend %if %{?with_systemd}0 %{_unitdir}/xend.service %endif %endif %dir %attr(700,root,root) /etc/xen %config(noreplace) /etc/xen/*.sxp %config(noreplace) /etc/xen/*.xml %ifnarch %arm aarch64 /etc/xen/scripts/xend-relocation.sh /etc/xen/scripts/domain-lock* /etc/xen/scripts/vm-monitor /etc/xen/scripts/set-lock %{_libdir}/python%{pyver}/site-packages/xen/remus/* %{_libdir}/python%{pyver}/site-packages/xen/sv/* %{_libdir}/python%{pyver}/site-packages/xen/util/* %{_libdir}/python%{pyver}/site-packages/xen/xend/* %{_libdir}/python%{pyver}/site-packages/xen/xm/* %{_libdir}/python%{pyver}/site-packages/xen/web/* %config %{_fwdefdir}/xend-relocation-server %{_mandir}/man1/xm.1.gz %{_mandir}/man5/xmdomain.cfg.5.gz %{_mandir}/man5/xend-config.sxp.5.gz %{_mandir}/man1/xen-list.1.gz %endif %endif %files tools-domU %defattr(-,root,root) %ifnarch %arm aarch64 /usr/bin/xen-detect %endif /bin/domu-xenstore /bin/xenstore-* %files devel %defattr(-,root,root) %{_libdir}/*.a %{_libdir}/*.so /usr/include/* %if %{?with_dom0_support}0 %files doc-html %defattr(-,root,root) %{_defaultdocdir}/xen/html %endif %if %{?with_dom0_support}0 %post # EFI if [ -d /boot/efi/efi/SuSE -a -e /usr/lib64/efi/xen-%{version}-%{release}.efi ]; then cp /usr/lib64/efi/xen-%{version}-%{release}.efi /boot/efi/efi/SuSE/ fi %postun # EFI if [ -e /boot/efi/efi/SuSE/xen-%{version}-%{release}.efi ]; then rm /boot/efi/efi/SuSE/xen-%{version}-%{release}.efi fi %post tools %if %{?with_xend}0 %if %{?with_systemd}0 %{fillup_and_insserv -i -y -n xencommons xencommons} %{fillup_and_insserv -i -y -n xend xend} /bin/systemctl enable xend.service /bin/systemctl enable xencommons.service %else # Enable both xm (xend based) and xl (libxl based) if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then echo "postin %{name}-tools: Forcing insserv xencommons during package upgrade because xend was enabled." echo "postin %{name}-tools: with xend" fi %{fillup_and_insserv -Y -n xencommons xencommons} else %{fillup_and_insserv -y -n xencommons xencommons} fi %{fillup_and_insserv -y -n xend xend} %endif %else # without_xend %if %{?with_systemd}0 %{fillup_and_insserv -i -y -n xencommons xencommons} /bin/systemctl enable xencommons.service %else # Disable xm (xend based) and enable only xl (libxl based) if /bin/ls /etc/init.d/rc3.d/S??xend > /dev/null 2>&1 ; then if ! /bin/ls /etc/init.d/rc3.d/S??xencommons > /dev/null 2>&1 ; then echo "postin %{name}-tools: Forcing insserv xencommons during package upgrade because xend was enabled." fi echo "postin %{name}-tools: disabling xend in favor of xencommons. xm command replaced by xl." %{stop_on_removal xend} rm -fv /etc/init.d/rc?.d/???xend || : %{fillup_and_insserv -Y -n xencommons xencommons} else %{fillup_and_insserv -y -n xencommons xencommons} fi %endif %endif # %ifnarch %arm aarch64 %if %{?with_systemd}0 %{fillup_and_insserv -i -y -n xendomains xendomains} /bin/systemctl enable xendomains.service %else %{fillup_and_insserv -y -n xendomains xendomains} %{fillup_only -n pciback} if [ -f /usr/bin/qemu-img ]; then if [ -f /usr/bin/qemu-img-xen ]; then rm /usr/bin/qemu-img-xen fi ln -s /usr/bin/qemu-img /usr/bin/qemu-img-xen fi if [ -f /usr/bin/qemu-nbd ]; then if [ -f /usr/bin/qemu-nbd-xen ]; then rm /usr/bin/qemu-nbd-xen fi ln -s /usr/bin/qemu-nbd /usr/bin/qemu-nbd-xen fi %endif %endif %preun tools %if %{?with_systemd}0 /bin/systemctl disable xend.service /bin/systemctl disable xencommons.service /bin/systemctl disable xendomains.service %else %{stop_on_removal xendomains xend xencommons} %endif %postun tools %if %{?with_xend}0 # with_xend %{restart_on_update xend} %endif %{insserv_cleanup} %ifnarch %arm aarch64 if [ -f /usr/bin/qemu-img-xen ]; then rm /usr/bin/qemu-img-xen fi if [ -f /usr/bin/qemu-nbd-xen ]; then rm /usr/bin/qemu-nbd-xen fi %endif %endif %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %changelog