SHA256
1
0
forked from pool/xen

- bnc#685338: Fix porting of xend-domain-lock.patch

- update scripts to use xl instead of xm:
  xen-updown.sh, init.xendomains, xmclone.sh

- disable xend in openSuSE > 11.4
  the xl command is the replacement for the xm command

- mark runlevel scripts as config to preserve local changes by
  admin or dev during package update

- enable xencommons runlevel script during upgrade if xend was
  already enabled

- call /sbin/ldconfig directly in xen-libs post install scripts

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=110
This commit is contained in:
2011-04-11 22:31:41 +00:00
committed by Git OBS Bridge
parent af590c6636
commit 58f0aa1c59
6 changed files with 251 additions and 128 deletions

219
xen.spec
View File

@@ -1,5 +1,5 @@
#
# spec file for package xen
# spec file for package xen (Version 4.1.0_01)
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -26,39 +26,44 @@ ExclusiveArch: %ix86 x86_64
%define xen_build_dir xen-4.1.0-testing
%define with_kmp 1
%define with_stubdom 0
BuildRequires: LibVNCServer-devel
BuildRequires: SDL-devel
BuildRequires: automake
BuildRequires: bin86
BuildRequires: curl-devel
BuildRequires: dev86
BuildRequires: graphviz
BuildRequires: latex2html
BuildRequires: libjpeg-devel
BuildRequires: libxml2-devel
BuildRequires: ncurses-devel
BuildRequires: openssl
BuildRequires: openssl-devel
BuildRequires: pciutils-devel
BuildRequires: python-devel
BuildRequires: texinfo
BuildRequires: transfig
BuildRequires: libbz2-devel
%if %suse_version > 1140
%define with_xend 0
%else
%define with_xend 1
%endif
BuildRequires: LibVNCServer-devel
BuildRequires: SDL-devel
BuildRequires: automake
BuildRequires: bin86
BuildRequires: curl-devel
BuildRequires: dev86
BuildRequires: graphviz
BuildRequires: latex2html
BuildRequires: libjpeg-devel
BuildRequires: libxml2-devel
BuildRequires: ncurses-devel
BuildRequires: openssl
BuildRequires: openssl-devel
BuildRequires: pciutils-devel
BuildRequires: python-devel
BuildRequires: texinfo
BuildRequires: transfig
BuildRequires: libbz2-devel
%if %suse_version >= 1120
BuildRequires: xz-devel
BuildRequires: xz-devel
%endif
%if %suse_version <= 1110
BuildRequires: pmtools
BuildRequires: pmtools
%else
BuildRequires: acpica
BuildRequires: acpica
%endif
%if %suse_version >= 1030
BuildRequires: texlive
BuildRequires: texlive-latex
BuildRequires: texlive
BuildRequires: texlive-latex
%else
BuildRequires: te_ams
BuildRequires: te_latex
BuildRequires: tetex
BuildRequires: te_ams
BuildRequires: te_latex
BuildRequires: tetex
%endif
%ifarch x86_64
BuildRequires: glibc-32bit glibc-devel-32bit
@@ -75,7 +80,7 @@ BuildRequires: glibc-devel
BuildRequires: kernel-source kernel-syms module-init-tools xorg-x11
%endif
Version: 4.1.0_01
Release: 5
Release: 1
License: GPLv2+
Group: System/Kernel
AutoReqProv: on
@@ -167,7 +172,7 @@ Patch370: xend-sysconfig.patch
Patch371: domu-usb-controller.patch
Patch372: usb-list.patch
Patch373: xend-devid-or-name.patch
Patch374: suspend_evtchn_lock.patch
Patch374: suspend_evtchn_lock.patch
# Patches for snapshot support
Patch400: snapshot-ioemu-save.patch
Patch401: snapshot-ioemu-restore.patch
@@ -223,39 +228,38 @@ Patch651: ioemu-disable-scsi.patch
Patch652: ioemu-disable-emulated-ide-if-pv.patch
Patch700: hv_extid_compatibility.patch
# FATE 310510
Patch10001: xenpaging.tools_xenpaging_cleanup.patch
Patch10002: xenpaging.pageout_policy.patch
Patch10003: xenpaging.get_paged_frame.patch
Patch10004: xenpaging.makefile.patch
Patch10010: xenpaging.policy_linear.patch
Patch10011: xenpaging.pagefile.patch
Patch10012: xenpaging.xenpaging_init.patch
Patch10013: xenpaging.mem_paging_tool_qemu_flush_cache.patch
Patch10014: xenpaging.machine_to_phys_mapping.patch
Patch10015: xenpaging.populate_only_if_paged.patch
Patch10017: xenpaging.autostart.patch
Patch10018: xenpaging.signal_handling.patch
Patch10019: xenpaging.MRU_SIZE.patch
Patch10020: xenpaging.guest_remove_page.patch
Patch10021: xenpaging.mem_event_check_ring-free_requests.patch
Patch10022: xenpaging.blacklist.patch
Patch10023: xenpaging.autostart_delay.patch
Patch10024: xenpaging.page_already_populated.patch
Patch10025: xenpaging.notify_policy_only_once.patch
Patch10026: xenpaging.num_pages_equal_max_pages.patch
Patch10027: xenpaging.p2m_mem_paging_populate_if_p2m_ram_paged.patch
Patch10028: xenpaging.HVMCOPY_gfn_paged_out.patch
Patch10029: xenpaging.optimize_p2m_mem_paging_populate.patch
Patch10030: xenpaging.paging_prep_enomem.patch
Patch10031: xenpaging.print-arguments.patch
Patch10032: xenpaging.no_domain_id.patch
Patch10033: xenpaging.runtime_mru_size.patch
Patch10040: xenpaging.doc.patch
Patch10001: xenpaging.tools_xenpaging_cleanup.patch
Patch10002: xenpaging.pageout_policy.patch
Patch10003: xenpaging.get_paged_frame.patch
Patch10004: xenpaging.makefile.patch
Patch10010: xenpaging.policy_linear.patch
Patch10011: xenpaging.pagefile.patch
Patch10012: xenpaging.xenpaging_init.patch
Patch10013: xenpaging.mem_paging_tool_qemu_flush_cache.patch
Patch10014: xenpaging.machine_to_phys_mapping.patch
Patch10015: xenpaging.populate_only_if_paged.patch
Patch10017: xenpaging.autostart.patch
Patch10018: xenpaging.signal_handling.patch
Patch10019: xenpaging.MRU_SIZE.patch
Patch10020: xenpaging.guest_remove_page.patch
Patch10021: xenpaging.mem_event_check_ring-free_requests.patch
Patch10022: xenpaging.blacklist.patch
Patch10023: xenpaging.autostart_delay.patch
Patch10024: xenpaging.page_already_populated.patch
Patch10025: xenpaging.notify_policy_only_once.patch
Patch10026: xenpaging.num_pages_equal_max_pages.patch
Patch10027: xenpaging.p2m_mem_paging_populate_if_p2m_ram_paged.patch
Patch10028: xenpaging.HVMCOPY_gfn_paged_out.patch
Patch10029: xenpaging.optimize_p2m_mem_paging_populate.patch
Patch10030: xenpaging.paging_prep_enomem.patch
Patch10031: xenpaging.print-arguments.patch
Patch10032: xenpaging.no_domain_id.patch
Patch10033: xenpaging.runtime_mru_size.patch
Patch10040: xenpaging.doc.patch
# Build patch
Patch99999: tmp_build.patch
Url: http://www.cl.cam.ac.uk/Research/SRG/netos/xen/
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#%define pysite %(python -c "import distutils.sysconfig; print distutils.sysconfig.get_python_lib()")
%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
@@ -714,6 +718,7 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools
#%patch10040 -p1
%patch99999 -p1
%build
XEN_EXTRAVERSION=%version-%release
XEN_EXTRAVERSION=${XEN_EXTRAVERSION#%{xvers}}
@@ -726,9 +731,6 @@ make -C xenalyze.hg CC="gcc -I../xen/include" %{?_smp_mflags}
make -C tools/include/xen-foreign %{?_smp_mflags}
make tools docs %{?_smp_mflags}
make -C tools/debugger/gdbsx
#### there are code problems that don't pass the 02-check-gcc-output, hence bitbucket
###env MAKE="make %{?_smp_mflags}" ./gdbbuild 1>/dev/null 2>/dev/null
###cd ../../..
%if %{?with_kmp}0
# pv driver modules
export XL=/usr/src/linux
@@ -748,9 +750,7 @@ done
make -C tools/xen-utils-0.1 XEN_INTREE_BUILD=yes
%install
test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
export CFLAGS="$RPM_OPT_FLAGS"
export RPM_OPT_FLAGS
install_xen()
{
local ext=""
@@ -776,8 +776,6 @@ make -C xen clean
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
export CFLAGS="$RPM_OPT_FLAGS"
export RPM_OPT_FLAGS
make -C tools/include/xen-foreign %{?_smp_mflags}
# tools
export XEN_PYTHON_NATIVE_INSTALL=1
@@ -812,7 +810,6 @@ make -C stubdom install \
DOCDIR=%{_defaultdocdir}/xen INCDIR=%{_includedir}
mkdir -p $RPM_BUILD_ROOT/%{_defaultdocdir}/xen
%ifarch x86_64
ln -s /usr/lib/xen/boot/pv-grub-x86_32.gz $RPM_BUILD_ROOT/usr/lib/xen/boot/pv-grub-x86_32.gz
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
@@ -868,7 +865,6 @@ 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/lib/xen/xenpaging
mkdir -p $RPM_BUILD_ROOT/var/log/xen
ln -s /var/lib/xen/images $RPM_BUILD_ROOT/etc/xen/images
# Bootloader
@@ -889,7 +885,6 @@ rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc32
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-sparc64
rm -f $RPM_BUILD_ROOT/usr/share/xen/qemu/openbios-ppc
rm -f $RPM_BUILD_ROOT/usr/sbin/netfix
#rm -f $RPM_BUILD_ROOT/%pysite/*.egg-info
rm -f $RPM_BUILD_ROOT/%{_libdir}/python%{pyver}/site-packages/*.egg-info
rm -rf $RPM_BUILD_ROOT/html
rm -rf $RPM_BUILD_ROOT/usr/share/doc/xen/README.*
@@ -919,13 +914,7 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
%files libs
%defattr(-,root,root)
%{_libdir}/fs/
%{_libdir}/libblktap.so.*
%{_libdir}/libflask.so.*
%{_libdir}/libfsimage.so.*
%{_libdir}/libxen*.so.*
%{_libdir}/libvhd.so.*
%{_libdir}/libxlutil.so.*
%{_libdir}/libblktapctl.so.*
%{_libdir}/*.so.*
%files tools
%defattr(-,root,root)
@@ -990,18 +979,14 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
%dir /var/lib/xen/xend-db/vnet
%dir /var/lib/xenstored
%dir /var/log/xen
/etc/init.d/xend
/etc/init.d/xendomains
/etc/init.d/xencommons
/etc/init.d/xen-watchdog
%config /etc/init.d/*
%config /etc/logrotate.d/xen
%dir %attr(700,root,root) /etc/xen
/etc/xen/auto
%config /etc/xen/examples
/etc/xen/images
/etc/xen/scripts
/etc/xen/cpupool
#/etc/xen/scripts/qemu-ifup
%config /etc/xen/cpupool
/etc/xen/README*
%config /etc/xen/vm
%config(noreplace) /etc/xen/*.sxp
@@ -1032,7 +1017,6 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
%dir %{_datadir}/xen/man/man1
%dir %{_datadir}/xen/man/man8
%dir %{_datadir}/xen/qemu
#%dir %{_datadir}/xen/qemu/keymaps
%{_datadir}/xen/*.dtd
%{_datadir}/xen/qemu/*
%{_datadir}/xen/man/man1/*
@@ -1055,12 +1039,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
#/usr/lib/xen/bin/xc_kexec
%endif
/usr/lib/xen/boot/hvmloader
#%pysite/xen/*
%{_libdir}/python%{pyver}/site-packages/xen/*
/usr/lib/xen/boot/domUloader.py
#%pysite/grub/*
%{_libdir}/python%{pyver}/site-packages/grub/*
#%pysite/fsimage.so
%{_libdir}/python%{pyver}/site-packages/fsimage.so
%if %{?with_stubdom}0
/usr/lib/xen/boot/ioemu-stubdom.gz
@@ -1078,29 +1059,10 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
%files devel
%defattr(-,root,root)
%{_libdir}/libblktap.a
%{_libdir}/libblktap.so
%{_libdir}/libflask.a
%{_libdir}/libflask.so
%{_libdir}/libfsimage.so
%{_libdir}/libxen*.a
%{_libdir}/libxen*.so
%{_libdir}/libvhd.a
%{_libdir}/libvhd.so
%{_libdir}/libxlutil.a
%{_libdir}/libxlutil.so
%{_libdir}/libblktapctl.a
%{_libdir}/libblktapctl.so
%{_libdir}/*.a
%{_libdir}/*.so
/usr/include/*
/usr/bin/serial-split
/usr/include/blktaplib.h
/usr/include/fsimage*
/usr/include/xen*.h
/usr/include/xen/
/usr/include/xs.h
/usr/include/xs_lib.h
/usr/include/libxl.h
/usr/include/_libxl_types.h
/usr/include/libxl_uuid.h
%files doc-html
%defattr(-,root,root)
@@ -1110,12 +1072,36 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/debug
%defattr(-,root,root)
%{_defaultdocdir}/xen/pdf
%clean
#test ! -z "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" && rm -rf $RPM_BUILD_ROOT
#rm -rf $RPM_BUILD_DIR/%xen_build_dir
%post tools
%if %{?with_xend}0
# with_xend
# 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}
%else
# without_xend
# 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
#
%{fillup_and_insserv -y -n xendomains xendomains}
if [ -f /usr/bin/qemu-img ]; then
if [ -f /usr/bin/qemu-img-xen ]; then
@@ -1131,10 +1117,13 @@ if [ -f /usr/bin/qemu-nbd ]; then
fi
%preun tools
%{stop_on_removal xendomains xend}
%{stop_on_removal xendomains xend xencommons}
%postun tools
%if %{?with_xend}0
# with_xend
%{restart_on_update xend}
%endif
%{insserv_cleanup}
if [ -f /usr/bin/qemu-img-xen ]; then
rm /usr/bin/qemu-img-xen
@@ -1143,10 +1132,8 @@ if [ -f /usr/bin/qemu-nbd-xen ]; then
rm /usr/bin/qemu-nbd-xen
fi
%post libs
/sbin/ldconfig
%post libs -p /sbin/ldconfig
%postun libs
/sbin/ldconfig
%postun libs -p /sbin/ldconfig
%changelog