forked from marmarek/old-qubes-vmm-xen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xen.spec
2143 lines (1720 loc) · 75.1 KB
/
xen.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%define with_ocaml 0
%define build_ocaml 0
%define with_xsm 0
%define build_xsm 0
# cross compile 64-bit hypervisor on ix86 unless rpmbuild was run
# with --without crosshyp
%define build_crosshyp %{?_without_crosshyp: 0} %{?!_without_crosshyp: 1}
%ifnarch %{ix86}
%define build_crosshyp 0
%define build_hyp 1
%else
%if %build_crosshyp
%define build_hyp 1
%else
%define build_hyp 0
# no point in trying to build xsm on ix86 without a hypervisor
%define build_xsm 0
%endif
%endif
# build an efi boot image (where supported) unless rpmbuild was run with
# --without efi
%define build_efi %{?_without_efi: 0} %{?!_without_efi: 1}
# xen only supports efi boot images on x86_64
%ifnarch x86_64
%define build_efi 0
%endif
%if "%dist" >= ".fc17"
%define with_sysv 0
%else
%define with_sysv 1
%endif
%if "%dist" >= ".fc15"
%define with_systemd 1
%else
%define with_systemd 0
%endif
%if "%dist" >= ".fc20"
%define with_systemd_presets 1
%else
%define with_systemd_presets 0
%endif
# Hypervisor ABI
%define hv_abi 4.4
%{!?version: %define version %(cat version)}
%{!?rel: %define rel %(cat rel)}
%define _sourcedir %(pwd)
Summary: Xen is a virtual machine monitor
Name: xen
Version: %{version}
Release: %{rel}%{?dist}
Epoch: 2001
Group: Development/Libraries
License: GPLv2+ and LGPLv2+ and BSD
URL: http://xen.org/
Source0: xen-%{version}.tar.gz
Source1: %{name}.modules-load.conf
Source2: %{name}.logrotate
# used by stubdoms
Source10: lwip-1.3.0.tar.gz
Source11: newlib-1.16.0.tar.gz
Source12: zlib-1.2.3.tar.gz
Source13: pciutils-2.2.9.tar.bz2
Source14: grub-0.97.tar.gz
Source15: gmp-4.3.2.tar.bz2
Source16: polarssl-1.1.4-gpl.tgz
#Source17: gc.tar.gz
Source18: tpm_emulator-0.7.4.tar.gz
#Source19: tboot-20090330.tar.gz
# init.d bits
Source20: init.xenstored
Source21: init.xenconsoled
Source22: init.blktapctrl
Source23: init.xend
# sysconfig bits
Source30: sysconfig.xenstored
Source31: sysconfig.xenconsoled
Source32: sysconfig.blktapctrl
# Qubes components for stubdom
Source33: gui-agent-xen-hvm-stubdom
Source34: core-vchan-xen
Source35: stubdom-dhcp
Source36: gui-common
# systemd bits
Source40: proc-xen.mount
Source41: var-lib-xenstored.mount
Source42: xenstored.service
Source43: blktapctrl.service
Source44: xend.service
Source45: xenconsoled.service
Source46: xen-watchdog.service
Source47: xendomains.service
Source48: libexec.xendomains
Source49: tmpfiles.d.xen.conf
Source98: apply-patches
Source99: series.conf
Source100: patches.fedora
Source101: patches.libxl
Source102: patches.misc
Source103: patches.qubes
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: transfig libidn-devel zlib-devel texi2html SDL-devel curl-devel
BuildRequires: libX11-devel python-devel ghostscript texlive-latex
BuildRequires: autoconf automake
BuildRequires: cmake
%if "%dist" >= ".fc18"
BuildRequires: texlive-times texlive-courier texlive-helvetic texlive-ntgclass
%endif
BuildRequires: ncurses-devel gtk2-devel libaio-devel
# for the docs
BuildRequires: perl perl(Pod::Man) perl(Pod::Text) texinfo graphviz
# so that the makefile knows to install udev rules
BuildRequires: udev
%ifarch %{ix86} x86_64
# so that x86_64 builds pick up glibc32 correctly
BuildRequires: /usr/include/gnu/stubs-32.h
# for the VMX "bios"
BuildRequires: dev86
%endif
BuildRequires: gettext
BuildRequires: gnutls-devel
BuildRequires: openssl-devel
# For ioemu PCI passthrough
BuildRequires: pciutils-devel
# Several tools now use uuid
BuildRequires: libuuid-devel
# iasl needed to build hvmloader
BuildRequires: iasl
# build using Fedora seabios and ipxe packages for roms
BuildRequires: seabios-bin ipxe-roms-qemu
# modern compressed kernels
BuildRequires: bzip2-devel xz-devel
# libfsimage
BuildRequires: e2fsprogs-devel
# tools now require yajl
BuildRequires: yajl-devel
%if %with_xsm
# xsm policy file needs needs checkpolicy and m4
BuildRequires: checkpolicy m4
%endif
%if %build_crosshyp
# cross compiler for building 64-bit hypervisor on ix86
BuildRequires: gcc-x86_64-linux-gnu
%endif
Requires: bridge-utils
Requires: python-lxml
Requires: udev >= 059
Requires: xen-runtime = %{version}-%{release}
# Not strictly a dependency, but kpartx is by far the most useful tool right
# now for accessing domU data from within a dom0 so bring it in when the user
# installs xen.
Requires: kpartx
Requires: chkconfig
ExclusiveArch: %{ix86} x86_64
#ExclusiveArch: %{ix86} x86_64 ia64 noarch
%if %with_ocaml
BuildRequires: ocaml, ocaml-findlib
%endif
# efi image needs an ld that has -mi386pep option
%if %build_efi
BuildRequires: mingw64-binutils
%endif
%if %with_systemd_presets
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
BuildRequires: systemd
%endif
%description
This package contains the XenD daemon and xm command line
tools, needed to manage virtual machines running under the
Xen hypervisor
%package libs
Summary: Libraries for Xen tools
Group: Development/Libraries
Requires(pre): /sbin/ldconfig
Requires(post): /sbin/ldconfig
Requires: xen-licenses
Provides: xen-libs = %{version}-%{release}
Obsoletes: xen-qubes-vm-libs < %{epoch}:%{version}-%{release}
%description libs
This package contains the libraries needed to run applications
which manage Xen virtual machines.
%package runtime
Summary: Core Xen runtime environment
Group: Development/Libraries
Requires: xen-libs = %{version}-%{release}
Requires: python-lxml
# Ensure we at least have a suitable kernel installed, though we can't
# force user to actually boot it.
Requires: xen-hypervisor-abi = %{hv_abi}
Provides: xen-runtime = %{version}-%{release}
%if %with_systemd
Requires(post): /bin/systemctl
%endif
%description runtime
This package contains the runtime programs and daemons which
form the core Xen userspace environment.
%package hypervisor
Summary: Libraries for Xen tools
Group: Development/Libraries
Provides: xen-hypervisor-abi = %{hv_abi}
Requires: xen-licenses
%description hypervisor
This package contains the Xen hypervisor
%package doc
Summary: Xen documentation
Group: Documentation
#BuildArch: noarch
Requires: xen-licenses
%description doc
This package contains the Xen documentation.
%package devel
Summary: Development libraries for Xen tools
Group: Development/Libraries
Requires: xen-libs = %{version}-%{release}
Requires: libuuid-devel
Provides: xen-devel = %{version}-%{release}
Obsoletes: xen-qubes-vm-devel
%description devel
This package contains what's needed to develop applications
which manage Xen virtual machines.
%package licenses
Summary: License files from Xen source
Group: Documentation
%description licenses
This package contains the license files from the source used
to build the xen packages.
%if %build_ocaml
%package ocaml
Summary: Ocaml libraries for Xen tools
Group: Development/Libraries
Requires: ocaml-runtime, xen-libs = %{version}-%{release}
%description ocaml
This package contains libraries for ocaml tools to manage Xen
virtual machines.
%package ocaml-devel
Summary: Ocaml development libraries for Xen tools
Group: Development/Libraries
Requires: xen-ocaml = %{version}-%{release}
%description ocaml-devel
This package contains libraries for developing ocaml tools to
manage Xen virtual machines.
%endif
%package hvm
Summary: Loader and device-model for HVM
Requires: xen-libs = %{version}-%{release}
Requires: xen-runtime = %{version}-%{release}
%description hvm
This package contains files for HVM domains, especially stubdomain with device model.
%package qemu-tools
Summary: Qemu disk tools bundled with Xen
Requires: xen-hvm = %{version}-%{release}
Provides: qemu-img
Conflicts: qemu-img
%description qemu-tools
This package contains symlinks to qemu tools (qemu-img, qemu-nbd, qemu-io)
budled with Xen, making them available for general use.
%package qubes-vm
Summary: Xen files required in Qubes VM
Requires: xen-libs = %{epoch}:%{version}-%{release}
Conflicts: xen
Provides: xen-qubes-vm-essentials = %{epoch}:%{version}-%{release}
%description qubes-vm
Just a few xenstore-* tools and Xen hotplug scripts needed by Qubes VMs
%prep
%setup -q
# Apply patches
%{SOURCE98} %{SOURCE99} %{_sourcedir}
# Fix for glibc 2.7
#FIXME sed 's:LIBS+=-lutil:LIBS+=-lutil -lrt:' -i tools/ioemu-qemu-xen/Makefile.target
# stubdom sources
cp -v %{SOURCE10} %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} stubdom
cp -v %{SOURCE15} %{SOURCE16} %{SOURCE18} stubdom
#FIXME cp -v %{SOURCE15} tools/firmware/etherboot/ipxe.tar.gz
#FIXME cp -v %{SOURCE17} tools/vnet/
#FIXME cp -v %{SOURCE18} tools/vtpm/
# qubes specific parts of stubdom
mkdir tools/qubes-gui/
cp -a %{SOURCE33}/* tools/qubes-gui/
cp -a %{SOURCE36}/include/qubes-gui*.h tools/qubes-gui/include/
make -C tools/qubes-gui clean
cp -a %{SOURCE34}/vchan tools/
make -C tools/vchan -f Makefile.stubdom clean
sed -e 's/ioemu-qemu-xen/qemu-xen-traditional/g' tools/qubes-gui/gui-agent-qemu/qemu-glue.patch | patch -p1
cp -a %{SOURCE35}/* tools/qemu-xen-traditional/
patch -d tools/qemu-xen-traditional -p4 < %{SOURCE35}/lwip-dhcp-qemu-glue.patch
#FIXME mkdir -p tboot
#FIXME cp -v %{SOURCE19} tboot/
%build
%if !%build_ocaml
%define ocaml_flags OCAML_TOOLS=n
%endif
%if %build_efi
%define efi_flags LD_EFI=/usr/x86_64-w64-mingw32/bin/ld EFI_VENDOR=qubes
mkdir -p dist/install/boot/efi/efi/qubes
%endif
export XEN_VENDORVERSION="-%{release}"
export CFLAGS="$RPM_OPT_FLAGS"
export PYTHON=/usr/bin/python
export PYTHON_PATH=/usr/bin/python
autoreconf
make %{?_smp_mflags} %{?efi_flags} prefix=/usr dist-xen
./configure --libdir=%{_libdir} --with-system-seabios=/usr/share/seabios/bios.bin --enable-vtpm-stubdom --enable-vtpmmgr-stubdom
make %{?_smp_mflags} %{?ocaml_flags} prefix=/usr dist-tools
make prefix=/usr dist-docs
unset CFLAGS
make %{?ocaml_flags} dist-stubdom
%install
rm -rf %{buildroot}
%if %build_ocaml
mkdir -p %{buildroot}%{_libdir}/ocaml/stublibs
%endif
%if %build_efi
mkdir -p %{buildroot}/boot/efi/efi/qubes
%endif
make DESTDIR=%{buildroot} %{?efi_flags} prefix=/usr install-xen
make DESTDIR=%{buildroot} %{?ocaml_flags} prefix=/usr install-tools
make DESTDIR=%{buildroot} prefix=/usr install-docs
make DESTDIR=%{buildroot} %{?ocaml_flags} prefix=/usr install-stubdom
%if %build_efi
mv %{buildroot}/boot/efi/efi %{buildroot}/boot/efi/EFI
%endif
%if %build_xsm
# policy file should be in /boot/flask
mkdir %{buildroot}/boot/flask
mv %{buildroot}/boot/xenpolicy.* %{buildroot}/boot/flask
%else
rm -f %{buildroot}/boot/xenpolicy.*
%endif
# qemu symlinks
ln -s ../lib/%{name}/bin/qemu-img %{buildroot}/usr/bin/
ln -s ../lib/%{name}/bin/qemu-io %{buildroot}/usr/bin/
ln -s ../lib/%{name}/bin/qemu-nbd %{buildroot}/usr/bin/
############ debug packaging: list files ############
find %{buildroot} -print | xargs ls -ld | sed -e 's|.*%{buildroot}||' > f1.list
############ kill unwanted stuff ############
# stubdom: newlib
rm -rf %{buildroot}/usr/*-xen-elf
# hypervisor symlinks
rm -rf %{buildroot}/boot/xen-4.4.gz
rm -rf %{buildroot}/boot/xen-4.gz
rm -rf %{buildroot}/boot/xen.gz
%if !%build_hyp
rm -rf %{buildroot}/boot
%endif
# silly doc dir fun
rm -fr %{buildroot}%{_datadir}/doc/xen
rm -rf %{buildroot}%{_datadir}/doc/qemu
# Pointless helper
rm -f %{buildroot}%{_sbindir}/xen-python-path
# qemu stuff (unused or available from upstream)
rm -rf %{buildroot}/usr/share/xen/man
for file in bios.bin openbios-sparc32 openbios-sparc64 ppc_rom.bin \
pxe-e1000.bin pxe-ne2k_pci.bin pxe-pcnet.bin pxe-rtl8139.bin \
vgabios.bin vgabios-cirrus.bin video.x openbios-ppc bamboo.dtb
do
rm -f %{buildroot}/%{_datadir}/xen/qemu/$file
done
rm -f %{buildroot}/usr/etc/qemu/target-x86_64.conf
# README's not intended for end users
rm -f %{buildroot}/%{_sysconfdir}/xen/README*
# standard gnu info files
rm -rf %{buildroot}/usr/info
# adhere to Static Library Packaging Guidelines
rm -rf %{buildroot}/%{_libdir}/*.a
%if %build_efi
# clean up extra efi files
rm -rf %{buildroot}/%{_libdir}/efi
%endif
# obsolete xend
rm -f %{buildroot}/%{_sbindir}/xend
rm -f %{buildroot}/%{_sbindir}/xm
rm -f %{buildroot}%{_mandir}/man1/xm.1
rm -f %{buildroot}%{_mandir}/man5/xend-config.sxp.5
rm -f %{buildroot}%{_mandir}/man5/xmdomain.cfg.5
############ fixup files in /etc ############
# udev
#rm -rf %{buildroot}/etc/udev/rules.d/xen*.rules
#mv %{buildroot}/etc/udev/xen*.rules %{buildroot}/etc/udev/rules.d
rm -f %{buildroot}/etc/udev/rules.d/xend.rules
# modules
mkdir -p %{buildroot}/usr/lib/modules-load.d
install -m 644 %{SOURCE1} %{buildroot}/usr/lib/modules-load.d/%{name}.conf
# logrotate
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d/
install -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
# init scripts
#mkdir -p %{buildroot}%{_sysconfdir}/rc.d/init.d
#mv %{buildroot}%{_sysconfdir}/init.d/* %{buildroot}%{_sysconfdir}/rc.d/init.d
#rmdir %{buildroot}%{_sysconfdir}/init.d
rm %{buildroot}%{_sysconfdir}/rc.d/init.d/xen-watchdog
rm %{buildroot}%{_sysconfdir}/rc.d/init.d/xencommons
rm %{buildroot}%{_sysconfdir}/rc.d/init.d/xendomains
rm %{buildroot}%{_sysconfdir}/sysconfig/xendomains
# sysconfig
mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
install -m 644 %{SOURCE30} %{buildroot}%{_sysconfdir}/sysconfig/xenstored
install -m 644 %{SOURCE31} %{buildroot}%{_sysconfdir}/sysconfig/xenconsoled
install -m 644 %{SOURCE32} %{buildroot}%{_sysconfdir}/sysconfig/blktapctrl
# systemd
%if %with_systemd
mkdir -p %{buildroot}%{_unitdir}
install -m 644 %{SOURCE40} %{buildroot}%{_unitdir}/proc-xen.mount
install -m 644 %{SOURCE41} %{buildroot}%{_unitdir}/var-lib-xenstored.mount
install -m 644 %{SOURCE42} %{buildroot}%{_unitdir}/xenstored.service
install -m 644 %{SOURCE43} %{buildroot}%{_unitdir}/blktapctrl.service
install -m 644 %{SOURCE45} %{buildroot}%{_unitdir}/xenconsoled.service
install -m 644 %{SOURCE46} %{buildroot}%{_unitdir}/xen-watchdog.service
mkdir -p %{buildroot}/usr/lib/tmpfiles.d
install -m 644 %{SOURCE49} %{buildroot}/usr/lib/tmpfiles.d/xen.conf
%endif
%if %build_ocaml
install -m 644 %{SOURCE50} %{buildroot}%{_unitdir}/oxenstored.service
%endif
# config file only used for hotplug, Fedora uses udev instead
rm -f %{buildroot}/%{_sysconfdir}/sysconfig/xend
############ create dirs in /var ############
mkdir -p %{buildroot}%{_localstatedir}/lib/xen/xend-db/domain
mkdir -p %{buildroot}%{_localstatedir}/lib/xen/xend-db/vnet
mkdir -p %{buildroot}%{_localstatedir}/lib/xen/xend-db/migrate
mkdir -p %{buildroot}%{_localstatedir}/lib/xen/images
mkdir -p %{buildroot}%{_localstatedir}/log/xen/console
############ create symlink for x86_64 for compatibility with 3.4 ############
%if "%{_libdir}" != "/usr/lib"
ln -s /usr/lib/%{name}/bin/qemu-dm %{buildroot}/%{_libdir}/%{name}/bin/qemu-dm
%endif
ln -s ../sbin/xl %{buildroot}/%{_bindir}/xl
############ debug packaging: list files ############
find %{buildroot} -print | xargs ls -ld | sed -e 's|.*%{buildroot}||' > f2.list
diff -u f1.list f2.list || true
############ assemble license files ############
mkdir licensedir
# avoid licensedir to avoid recursion, also stubdom/ioemu and dist
# which are copies of files elsewhere
find . -path licensedir -prune -o -path stubdom/ioemu -prune -o \
-path dist -prune -o -name COPYING -o -name LICENSE | while read file; do
mkdir -p licensedir/`dirname $file`
install -m 644 $file licensedir/$file
done
############ all done now ############
%post runtime
%if %with_sysv
/sbin/chkconfig --add xenconsoled
/sbin/chkconfig --add xenstored
#/sbin/chkconfig --add blktapctrl
%endif
%if %with_systemd
%if %with_systemd_presets
%systemd_post xenstored.service xenconsoled.service
%else
if [ $1 == 1 ]; then
/bin/systemctl enable xenstored.service
/bin/systemctl enable xenconsoled.service
fi
%endif
%endif
%if %with_sysv
if [ $1 != 0 ]; then
service xenconsoled condrestart
fi
%endif
%preun runtime
%if %with_systemd_presets
%systemd_preun xenstored.service xenconsoled.service
%else
if [ $1 == 0 ]; then
%if %with_sysv
/sbin/chkconfig --del xenconsoled
/sbin/chkconfig --del xenstored
/sbin/chkconfig --del blktapctrl
%endif
%if %with_systemd
/bin/systemctl disable xenstored.service
/bin/systemctl disable xenconsoled.service
%endif
fi
%endif
%if %with_systemd_presets
%postun runtime
%systemd_postun
%endif
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%if %build_hyp
%post hypervisor
if [ $1 == 1 -a -f /sbin/grub2-mkconfig -a -f /boot/grub2/grub.cfg ]; then
/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
fi
%postun hypervisor
if [ -f /sbin/grub2-mkconfig -a -f /boot/grub2/grub.cfg ]; then
/sbin/grub2-mkconfig -o /boot/grub2/grub.cfg
fi
%endif
%if %build_ocaml
%post ocaml
%if %with_systemd
%if %with_systemd_presets
%systemd_post oxenstored.service
%else
if [ $1 == 1 ]; then
/bin/systemctl enable oxenstored.service
fi
%endif
%endif
%preun ocaml
%if %with_systemd
%if %with_systemd_presets
%systemd_post oxenstored.service
%else
if [ $1 == 0 ]; then
/bin/systemctl disable oxenstored.service
fi
%endif
%endif
%if %with_systemd_presets
%postun ocaml
%systemd_postun
%endif
%endif
%clean
rm -rf %{buildroot}
# Base package only contains XenD/xm python stuff
#files -f xen-xm.lang
%files
%defattr(-,root,root)
%doc COPYING README
%{_bindir}/xencons
%{python_sitearch}/%{name}
%{python_sitearch}/xen-*.egg-info
%files libs
%defattr(-,root,root)
%{_libdir}/*.so.*
%{_libdir}/fs
# All runtime stuff except for XenD/xm python stuff
%files runtime
%defattr(-,root,root)
# Hotplug rules
%config(noreplace) %{_sysconfdir}/udev/rules.d/xen-backend.rules
%dir %attr(0700,root,root) %{_sysconfdir}/%{name}
%dir %attr(0700,root,root) %{_sysconfdir}/%{name}/scripts/
%config %attr(0700,root,root) %{_sysconfdir}/%{name}/scripts/*
%if %with_sysv
%{_sysconfdir}/rc.d/init.d/blktapctrl
%{_sysconfdir}/rc.d/init.d/xenstored
%{_sysconfdir}/rc.d/init.d/xenconsoled
%{_sysconfdir}/rc.d/init.d/xen-watchdog
%{_sysconfdir}/rc.d/init.d/xencommons
%endif
%{_sysconfdir}/bash_completion.d/xl.sh
%if %with_systemd
%{_unitdir}/proc-xen.mount
%{_unitdir}/var-lib-xenstored.mount
%{_unitdir}/xenstored.service
%{_unitdir}/blktapctrl.service
%{_unitdir}/xenconsoled.service
%{_unitdir}/xen-watchdog.service
/usr/lib/tmpfiles.d/xen.conf
%endif
%config(noreplace) %{_sysconfdir}/sysconfig/xenstored
%config(noreplace) %{_sysconfdir}/sysconfig/xenconsoled
%config(noreplace) %{_sysconfdir}/sysconfig/blktapctrl
%config(noreplace) %{_sysconfdir}/sysconfig/xencommons
%config(noreplace) %{_sysconfdir}/xen/xl.conf
%config(noreplace) %{_sysconfdir}/xen/cpupool
%config(noreplace) %{_sysconfdir}/xen/xlexample*
# Auto-load xen backend drivers
%attr(0755,root,root) /usr/lib/modules-load.d/%{name}.conf
# Rotate console log files
%config(noreplace) %{_sysconfdir}/logrotate.d/xen
# Programs run by other programs
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/bin
%attr(0700,root,root) %{_libdir}/%{name}/bin/*
# QEMU runtime files
%dir %{_datadir}/%{name}/qemu
%dir %{_datadir}/%{name}/qemu/keymaps
%{_datadir}/%{name}/qemu/keymaps/*
%dir %{_datadir}/qemu-xen
%dir %{_datadir}/qemu-xen/qemu
%{_datadir}/qemu-xen/qemu/*
# man pages
%{_mandir}/man1/xentop.1*
%{_mandir}/man1/xentrace_format.1*
%{_mandir}/man1/xenstore-chmod.1*
%{_mandir}/man1/xenstore-ls.1*
%{_mandir}/man1/xenstore.1*
%{_mandir}/man8/xentrace.8*
%{_mandir}/man1/xl.1*
%{_mandir}/man5/xl.cfg.5*
%{_mandir}/man5/xl.conf.5*
%{_mandir}/man5/xlcpupool.cfg.5*
%{python_sitearch}/fsimage.so
%{python_sitearch}/grub
%{python_sitearch}/pygrub-*.egg-info
# General Xen state
%dir %{_localstatedir}/lib/%{name}
%dir %{_localstatedir}/lib/%{name}/dump
%dir %{_localstatedir}/lib/%{name}/images
# Xenstore persistent state
%dir %{_localstatedir}/lib/xenstored
# Xenstore runtime state
%ghost %{_localstatedir}/run/xenstored
# XenD runtime state
%ghost %attr(0700,root,root) %{_localstatedir}/run/xend
# All xenstore CLI tools
%{_bindir}/qemu-*-xen
%{_bindir}/xenstore
%{_bindir}/xenstore-*
%{_bindir}/pygrub
%{_bindir}/xentrace*
%{_bindir}/remus
# blktap daemon
%{_sbindir}/tapdisk*
# Disk utils
%{_sbindir}/qcow-create
%{_sbindir}/qcow2raw
%{_sbindir}/img2qcow
# Misc stuff
%{_bindir}/xen-detect
%{_bindir}/xencov_split
%{_sbindir}/gdbsx
%{_sbindir}/gtrace*
%{_sbindir}/kdd
%{_sbindir}/lock-util
%{_sbindir}/tap-ctl
%{_sbindir}/td-util
%{_sbindir}/vhd-*
%{_sbindir}/xen-bugtool
%{_sbindir}/xen-hptool
%{_sbindir}/xen-hvmcrash
%{_sbindir}/xen-hvmctx
%{_sbindir}/xen-tmem-list-parse
%{_sbindir}/xenconsoled
%{_sbindir}/xenlockprof
%{_sbindir}/xenmon.py*
%{_sbindir}/xentop
%{_sbindir}/xentrace_setmask
%{_sbindir}/xenbaked
%{_sbindir}/xenstored
%{_sbindir}/xenpm
%{_sbindir}/xenpmd
%{_sbindir}/xenperf
%{_sbindir}/xenwatchdogd
%{_sbindir}/xl
%{_sbindir}/xen-lowmemd
%{_sbindir}/xen-ringwatch
%{_sbindir}/xen-mfndump
%{_sbindir}/xencov
/usr/libexec/qemu-bridge-helper
%{_bindir}/xl
# Xen logfiles
%dir %attr(0700,root,root) %{_localstatedir}/log/xen
# Guest/HV console logs
%dir %attr(0700,root,root) %{_localstatedir}/log/xen/console
%files hypervisor
%defattr(-,root,root)
/boot/xen-syms-*
/boot/xen-*.gz
%if %build_xsm
%dir %attr(0755,root,root) /boot/flask
/boot/flask/xenpolicy.*
%endif
%if %build_efi
/boot/efi/EFI/qubes/*.efi
%endif
%files doc
%defattr(-,root,root)
%doc docs/misc/
%doc dist/install/usr/share/doc/xen/html
%files devel
%defattr(-,root,root)
%{_includedir}/*.h
%dir %{_includedir}/xen
%{_includedir}/xen/*
%dir %{_includedir}/xenstore-compat
%{_includedir}/xenstore-compat/*
%{_libdir}/*.so
%files licenses
%defattr(-,root,root)
%doc licensedir/*
%if %build_ocaml
%files ocaml
%defattr(-,root,root)
%{_libdir}/ocaml/xen*
%exclude %{_libdir}/ocaml/xen*/*.a
%exclude %{_libdir}/ocaml/xen*/*.cmxa
%exclude %{_libdir}/ocaml/xen*/*.cmx
%{_libdir}/ocaml/stublibs/*.so
%{_libdir}/ocaml/stublibs/*.so.owner
%{_sbindir}/oxenstored
%config(noreplace) %{_sysconfdir}/xen/oxenstored.conf
%{_unitdir}/oxenstored.service
%files ocaml-devel
%defattr(-,root,root)
%{_libdir}/ocaml/xen*/*.a
%{_libdir}/ocaml/xen*/*.cmxa
%{_libdir}/ocaml/xen*/*.cmx
%endif
%files hvm
# The firmware
%ifnarch ia64
# Avoid owning /usr/lib twice on i386
%if "%{_libdir}" != "/usr/lib"
%dir /usr/lib/%{name}
%dir /usr/lib/%{name}/bin
/usr/lib/%{name}/bin/stubdom-dm
/usr/lib/%{name}/bin/qemu-dm
/usr/lib/%{name}/bin/qemu-img
/usr/lib/%{name}/bin/qemu-io
/usr/lib/%{name}/bin/qemu-nbd
/usr/lib/%{name}/bin/qemu-system-i386
/usr/lib/%{name}/bin/stubdompath.sh
/usr/lib/%{name}/bin/xenpaging
%endif
%dir /usr/lib/%{name}/boot
# HVM loader is always in /usr/lib regardless of multilib
/usr/lib/xen/boot/hvmloader
/usr/lib/xen/boot/ioemu-stubdom.gz
/usr/lib/xen/boot/xenstore-stubdom.gz
/usr/lib/xen/boot/pv-grub*.gz
/usr/lib/xen/boot/vtpm-stubdom.gz
/usr/lib/xen/boot/vtpmmgr-stubdom.gz
%endif
%files qemu-tools
/usr/bin/qemu-img
/usr/bin/qemu-io
/usr/bin/qemu-nbd
%files qubes-vm
%{_bindir}/xenstore
%{_bindir}/xenstore-*
# Hotplug rules
%config(noreplace) %{_sysconfdir}/udev/rules.d/xen-backend.rules
%dir %attr(0700,root,root) %{_sysconfdir}/xen
%dir %attr(0700,root,root) %{_sysconfdir}/xen/scripts/
%config %attr(0700,root,root) %{_sysconfdir}/xen/scripts/*
# General Xen state
%dir %{_localstatedir}/lib/xen
%dir %{_localstatedir}/lib/xen/dump
# Xen logfiles
%dir %attr(0700,root,root) %{_localstatedir}/log/xen
# Python modules
%dir %{python_sitearch}/xen
%{python_sitearch}/xen/__init__.*
%{python_sitearch}/xen/lowlevel
%{python_sitearch}/xen/util
%{python_sitearch}/xen-*.egg-info
%changelog
* Sun May 11 2014 Michael Young <[email protected]> - 4.3.2-4
- add systemd preset support (#1094938)
* Thu May 01 2014 Michael Young <[email protected]> - 4.3.2-3
- HVMOP_set_mem_type allows invalid P2M entries to be created
[XSA-92, CVE-2014-3124] (#1093315)
* Wed Mar 26 2014 Michael Young <[email protected]> - 4.3.2-2
- HVMOP_set_mem_access is not preemptible [XSA-89, CVE-2014-2599] (#1080425)
* Tue Feb 18 2014 Michael Young <[email protected]> - 4.3.2-1
- update to xen-4.3.2
includes fix for "Excessive time to disable caching with HVM guests with
PCI passthrough" [XSA-60, CVE-2013-2212] (#987914)
- remove patches that are now included
* Wed Feb 12 2014 Michael Young <[email protected]> - 4.3.1-10
- use-after-free in xc_cpupool_getinfo() under memory pressure [XSA-88,
CVE-2014-1950] (#1064491)
* Thu Feb 06 2014 Michael Young <[email protected]> - 4.3.1-9
- integer overflow in several XSM/Flask hypercalls [XSA-84, CVE-2014-1891,
CVE-2014-1892, CVE-2014-1893, CVE-2014-1894]
Off-by-one error in FLASK_AVC_CACHESTAT hypercall [XSA-85, CVE-2014-1895]
libvchan failure handling malicious ring indexes [XSA-86, CVE-2014-1896]
(#1062335)
* Fri Jan 24 2014 Michael Young <[email protected]> - 4.3.1-8
- PHYSDEVOP_{prepare,release}_msix exposed to unprivileged pv guests
[XSA-87, CVE-2014-1666] (#1058398)
* Thu Jan 23 2014 Michael Young <[email protected]> - 4.3.1-7
- Out-of-memory condition yielding memory corruption during IRQ setup
[XSA-83, CVE-2014-1642] (#1057142)
* Wed Dec 11 2013 Michael Young <[email protected]> - 4.3.1-6
- Disaggregated domain management security status update [XSA-77]
- IOMMU TLB flushing may be inadvertently suppressed [XSA-80, CVE-2013-6400]
(#1040024)
* Mon Dec 02 2013 Michael Young <[email protected]> - 4.3.1-5
- HVM guest triggerable AMD CPU erratum may cause host hang
[XSA-82, CVE-2013-6885]
* Tue Nov 26 2013 Michael Young <[email protected]> - 4.3.1-4
- Lock order reversal between page_alloc_lock and mm_rwlock
[XSA-74, CVE-2013-4553] (#1034925)
- Hypercalls exposed to privilege rings 1 and 2 of HVM guests
[XSA-76, CVE-2013-4554] (#1034923)
* Thu Nov 21 2013 Michael Young <[email protected]> - 4.3.1-3
- Insufficient TLB flushing in VT-d (iommu) code
[XSA-78, CVE-2013-6375] (#1033149)
* Sat Nov 09 2013 Michael Young <[email protected]> - 4.3.1-2
- Host crash due to HVM guest VMX instruction execution
[XSA-75, CVE-2013-4551] (#1029055)
* Fri Nov 01 2013 Michael Young <[email protected]> - 4.3.1-1
- update to xen-4.3.1
- Lock order reversal between page allocation and grant table locks
[XSA-73, CVE-2013-4494] (#1026248)
* Tue Oct 29 2013 Michael Young <[email protected]> - 4.3.0-10
- ocaml xenstored mishandles oversized message replies
[XSA-72, CVE-2013-4416] (#1024450)
* Thu Oct 24 2013 Michael Young <[email protected]> - 4.3.0-9
- systemd changes to allow oxenstored to be used instead of xenstored (#1022640)
* Thu Oct 10 2013 Michael Young <[email protected]> - 4.3.0-8
- security fixes (#1017843)
Information leak through outs instruction emulation in 64-bit PV guests
[XSA-67, CVE-2013-4368]
possible null dereference when parsing vif ratelimiting info
[XSA-68, CVE-2013-4369]
misplaced free in ocaml xc_vcpu_getaffinity stub
[XSA-69, CVE-2013-4370]
use-after-free in libxl_list_cpupool under memory pressure
[XSA-70, CVE-2013-4371]
qemu disk backend (qdisk) resource leak (Fedora doesn't build this qemu)
[XSA-71, CVE-2013-4375]
* Wed Oct 02 2013 Michael Young <[email protected]> - 4.3.0-7
- Set "Domain-0" label in xenstored.service systemd file to match
xencommons init.d script.
- security fixes (#1013748)
Information leaks to HVM guests through I/O instruction emulation
[XSA-63, CVE-2013-4355]
Memory accessible by 64-bit PV guests under live migration
[XSA-64, CVE-2013-4356]
Information leak to HVM guests through fbld instruction emulation
[XSA-66, CVE-2013-4361]
* Wed Sep 25 2013 Michael Young <[email protected]> - 4.3.0-6
- Information leak on AVX and/or LWP capable CPUs [XSA-62, CVE-2013-1442]
(#1012056)
* Sat Sep 14 2013 Richard W.M. Jones <[email protected]> - 4.3.0-5
- Rebuild for OCaml 4.01.0.
* Sun Aug 04 2013 Fedora Release Engineering <[email protected]> - 4.3.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Sat Jul 20 2013 Michael Young <[email protected]> - 4.3.0-2 4.3.0-3
- build a 64-bit hypervisor on ix86
* Tue Jul 16 2013 Michael Young <[email protected]> - 4.3.0-1
- update to xen-4.3.0
- rebase xen.use.fedora.ipxe.patch
- remove patches that are now included or no longer needed
- add polarssl source needed for stubdom build
- remove references to ia64 in spec file (dropped upstream)
- don't build hypervisor on ix86 (dropped upstream)
- tools want wget (or ftp) to build
- build XSM FLASK support into hypervisor with policy file
- add xencov_split and xencov to files packaged, remove pdf docs
- tidy up rpm scripts and stop enabling systemctl services on upgrade
now sysv is gone from Fedora
- re-number patches
* Wed Jun 26 2013 Michael Young <[email protected]> - 4.2.2-10
- XSA-45/CVE-2013-1918 breaks page reference counting [XSA-58,
CVE-2013-1432] (#978383)
- let pygrub handle set default="${next_entry}" line in F19 (#978036)
- libxl: Set vfb and vkb devid if not done so by the caller (#977987)
* Mon Jun 24 2013 Michael Young <[email protected]> - 4.2.2-9