-
Notifications
You must be signed in to change notification settings - Fork 3
/
kernel-alt.spec
5365 lines (5003 loc) · 362 KB
/
kernel-alt.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
# We have to override the new %%install behavior because, well... the kernel is special.
%global __spec_install_pre %{___build_pre}
%global src_pkg_name kernel-alt
%global bin_pkg_name kernel
%global bin_suffix_name %{nil}
Summary: The Linux kernel
# % define buildid .local
# For a kernel released for public testing, released_kernel should be 1.
# For internal testing builds during development, it should be 0.
%global released_kernel 0
%global distro_build 115
%define rpmversion 4.14.0
%define pkgrelease 115.el7a
# allow pkg_release to have configurable %{?dist} tag
%define specrelease 115%{?dist}.0.2
%define pkg_release %{specrelease}%{?buildid}
# The kernel tarball/base version
%define rheltarball %{rpmversion}-%{pkgrelease}
# What parts do we want to build? We must build at least one kernel.
# These are the kernels that are built IF the architecture allows it.
# All should default to 1 (enabled) and be flipped to 0 (disabled)
# by later arch-specific checks.
# The following build options are enabled by default.
# Use either --without <opt> in your rpmbuild command or force values
# to 0 in here to disable them.
#
# kernel
%define with_default %{?_without_default: 0} %{?!_without_default: 1}
# kernel-debug
%define with_debug %{?_without_debug: 0} %{?!_without_debug: 1}
# kernel-doc
%define with_doc %{?_without_doc: 0} %{?!_without_doc: 1}
# kernel-headers
%define with_headers %{?_without_headers: 0} %{?!_without_headers: 1}
# perf
%define with_perf %{?_without_perf: 0} %{?!_without_perf: 1}
# tools
%define with_tools %{?_without_tools: 0} %{?!_without_tools: 1}
# kernel-debuginfo
%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}
# kernel-kdump (only for s390x)
%define with_kdump %{?_without_kdump: 0} %{?!_without_kdump: 0}
# kernel-bootwrapper (for creating zImages from kernel + initrd)
%define with_bootwrapper %{?_without_bootwrapper: 0} %{?!_without_bootwrapper: 0}
# kernel-abi-whitelists
%define with_kernel_abi_whitelists %{?_with_kernel_abi_whitelists: 0} %{?!_with_kernel_abi_whitelists: 1}
# In RHEL, we always want the doc build failing to build to be a failure,
# which means settings this to false.
%define doc_build_fail false
# Additional options for user-friendly one-off kernel building:
#
# Only build the base kernel (--with baseonly):
%define with_baseonly %{?_with_baseonly: 1} %{?!_with_baseonly: 0}
# Only build the debug kernel (--with dbgonly):
%define with_dbgonly %{?_with_dbgonly: 1} %{?!_with_dbgonly: 0}
# Control whether we perform a compat. check against published ABI.
%define with_kabichk %{?_without_kabichk: 0} %{?!_without_kabichk: 1}
# should we do C=1 builds with sparse
%define with_sparse %{?_with_sparse: 1} %{?!_with_sparse: 0}
# Cross compile requested?
%define with_cross %{?_with_cross: 1} %{?!_with_cross: 0}
# Set debugbuildsenabled to 1 for production (build separate debug kernels)
# and 0 for rawhide (all kernels are debug kernels).
# See also 'make debug' and 'make release'. RHEL only ever does 1.
%define debugbuildsenabled 1
%define with_gcov %{?_with_gcov: 1} %{?!_with_gcov: 0}
# turn off debug kernel and kabichk for gcov builds
%if %{with_gcov}
%define with_debug 0
%define with_kabichk 0
%endif
%define make_target bzImage
# Kernel Version Release + Arch -> KVRA
%define KVRA %{version}-%{release}.%{_target_cpu}
%define hdrarch %{_target_cpu}
%define asmarch %{_target_cpu}
%define cross_target %{_target_cpu}
%if !%{debugbuildsenabled}
%define with_debug 0
%endif
%if !%{with_debuginfo}
%define _enable_debug_packages 0
%endif
%define debuginfodir /usr/lib/debug
# if requested, only build base kernel
%if %{with_baseonly}
%define with_debug 0
%define with_kdump 0
%endif
# if requested, only build debug kernel
%if %{with_dbgonly}
%define with_default 0
%define with_kdump 0
%define with_tools 0
%define with_perf 0
%endif
# These arches install vdso/ directories.
%define vdso_arches aarch64 ppc64le s390x x86_64
# Overrides for generic default options
# only build debug kernel on architectures below
%ifnarch aarch64 ppc64le s390x x86_64
%define with_debug 0
%endif
# only package docs noarch
%ifnarch noarch
%define with_doc 0
%define with_kernel_abi_whitelists 0
%endif
# don't build noarch kernels or headers (duh)
%ifarch noarch
%define with_default 0
%define with_headers 0
%define with_tools 0
%define with_perf 0
%define all_arch_configs %{src_pkg_name}-%{version}-*.config
%endif
# sparse blows up on ppc*
%ifarch ppc64 ppc64le ppc
%define with_sparse 0
%endif
# Per-arch tweaks
%ifarch aarch64
%define asmarch arm64
%define hdrarch arm64
%define all_arch_configs %{src_pkg_name}-%{version}-aarch64*.config
%define make_target Image.gz
%define kernel_image arch/arm64/boot/Image.gz
%define image_install_path boot
%endif
%ifarch i686
%define asmarch x86
%define hdrarch i386
%endif
%ifarch x86_64
%define asmarch x86
%define all_arch_configs %{src_pkg_name}-%{version}-x86_64*.config
%define image_install_path boot
%define kernel_image arch/x86/boot/bzImage
%endif
%ifarch ppc
%define asmarch powerpc
%define hdrarch powerpc
%endif
%ifarch ppc64 ppc64le
%define asmarch powerpc
%define hdrarch powerpc
%define all_arch_configs %{src_pkg_name}-%{version}-ppc64*.config
%define image_install_path boot
%define make_target vmlinux
%define kernel_image vmlinux
%define kernel_image_elf 1
%define with_bootwrapper 1
%define cross_target powerpc64
%define kcflags -O3
%endif
%ifarch s390x
%define asmarch s390
%define hdrarch s390
%define all_arch_configs %{src_pkg_name}-%{version}-s390x*.config
%define image_install_path boot
%define kernel_image arch/s390/boot/bzImage
%define with_tools 0
%define with_kdump 1
%endif
#cross compile make
%if %{with_cross}
%define cross_opts CROSS_COMPILE=%{cross_target}-linux-gnu-
%define with_perf 0
%define with_tools 0
%endif
# Should make listnewconfig fail if there's config options
# printed out?
%define listnewconfig_fail 1
# We only build kernel headers package on the following, for being able to do
# builds with a different bit length (eg. 32-bit build on a 64-bit environment).
# Do not remove them from ExclusiveArch tag below
%define nobuildarches i686 ppc s390
%ifarch %nobuildarches
%define with_bootwrapper 0
%define with_default 0
%define with_debug 0
%define with_debuginfo 0
%define with_kdump 0
%define with_tools 0
%define with_perf 0
%define _enable_debug_packages 0
%endif
# Architectures we build tools/cpupower on
%define cpupowerarchs aarch64 ppc64le x86_64
%define zipmodules 1
#
# Three sets of minimum package version requirements in the form of Conflicts:
# to versions below the minimum
#
#
# First the general kernel 2.6 required versions as per
# Documentation/Changes
#
%define kernel_dot_org_conflicts ppp < 2.4.3-3, isdn4k-utils < 3.2-32, nfs-utils < 1.0.7-12, e2fsprogs < 1.37-4, util-linux < 2.12, jfsutils < 1.1.7-2, reiserfs-utils < 3.6.19-2, xfsprogs < 2.6.13-4, procps < 3.2.5-6.3, oprofile < 0.9.1-2, device-mapper-libs < 1.02.63-2, mdadm < 3.2.1-5
#
# Then a series of requirements that are distribution specific, either
# because we add patches for something, or the older versions have
# problems with the newer kernel or lack certain things that make
# integration in the distro harder than needed.
#
%define package_conflicts initscripts < 7.23, udev < 063-6, iptables < 1.3.2-1, ipw2200-firmware < 2.4, iwl4965-firmware < 228.57.2, selinux-policy-targeted < 1.25.3-14, squashfs-tools < 4.0, wireless-tools < 29-3, xfsprogs < 4.3.0, kmod < 20-9
# We moved the drm include files into kernel headers, make sure there's
# a recent enough libdrm-devel on the system that doesn't have those.
%define kernel_headers_conflicts libdrm-devel < 2.4.0-0.15
#
# Packages that need to be installed before the kernel is, because the %%post
# scripts use them.
#
%define kernel_prereq fileutils, module-init-tools >= 3.16-2, initscripts >= 8.11.1-1, grubby >= 8.28-2
%define initrd_prereq dracut >= 033-283
#
# This macro does requires, provides, conflicts, obsoletes for a kernel package.
# %%kernel_reqprovconf <subpackage>
# It uses any kernel_<subpackage>_conflicts and kernel_<subpackage>_obsoletes
# macros defined above.
#
%define kernel_reqprovconf \
Provides: kernel = %{rpmversion}-%{pkg_release}\
Provides: kernel-%{_target_cpu} = %{rpmversion}-%{pkg_release}%{?1:.%{1}}\
Provides: kernel-drm = 4.3.0\
Provides: kernel-drm-nouveau = 16\
Provides: kernel-modeset = 1\
Provides: kernel-uname-r = %{KVRA}%{?1:.%{1}}\
Requires(pre): %{kernel_prereq}\
Requires(pre): %{initrd_prereq}\
Requires(pre): linux-firmware >= 20160615-46\
Requires(post): %{_sbindir}/new-kernel-pkg\
Requires(post): system-release\
Requires(preun): %{_sbindir}/new-kernel-pkg\
Conflicts: %{kernel_dot_org_conflicts}\
Conflicts: %{package_conflicts}\
%{expand:%%{?kernel%{?1:_%{1}}_conflicts:Conflicts: %%{kernel%{?1:_%{1}}_conflicts}}}\
%{expand:%%{?kernel%{?1:_%{1}}_obsoletes:Obsoletes: %%{kernel%{?1:_%{1}}_obsoletes}}}\
%{expand:%%{?kernel%{?1:_%{1}}_provides:Provides: %%{kernel%{?1:_%{1}}_provides}}}\
# We can't let RPM do the dependencies automatic because it'll then pick up\
# a correct but undesirable perl dependency from the module headers which\
# isn't required for the kernel proper to function\
AutoReq: no\
AutoProv: yes\
%{nil}
Name: %{src_pkg_name}
Group: System Environment/Kernel
License: GPLv2
URL: http://www.kernel.org/
Version: %{rpmversion}
Release: %{pkg_release}
# Some architectures need a different headers version for user space builds with
# a different bit length environment (eg. 32-bit user space build on 64-bit).
# For architectures we support, where we must provide a compatible kernel-headers
# package, don't exclude them in ExclusiveArch below, but add them to
# %%nobuildarches (above) instead. Example: if we support x86_64, we must build
# the i686 (32-bit) headers and provide a package with them
ExclusiveArch: aarch64 i686 noarch ppc ppc64le s390 s390x x86_64
ExclusiveOS: Linux
#
# List the packages used during the kernel build
#
BuildRequires: module-init-tools, patch >= 2.5.4, bash >= 2.03, sh-utils, tar
BuildRequires: xz, findutils, gzip, m4, perl, make >= 3.78, diffutils, gawk
BuildRequires: gcc >= 4.8.5-29, binutils >= 2.12, redhat-rpm-config >= 9.1.0-55
BuildRequires: hostname, net-tools, bc
BuildRequires: xmlto, asciidoc
BuildRequires: openssl openssl-devel
BuildRequires: hmaccalc
BuildRequires: python-devel, newt-devel, perl(ExtUtils::Embed)
BuildRequires: git
%ifarch x86_64
BuildRequires: pesign >= 0.109-4
%endif
%if %{with_sparse}
BuildRequires: sparse >= 0.4.1
%endif
%if %{with_perf}
BuildRequires: elfutils-devel zlib-devel binutils-devel bison
BuildRequires: audit-libs-devel
BuildRequires: java-devel
%ifnarch s390 s390x
BuildRequires: numactl-devel
%endif
%endif
%if %{with_tools}
BuildRequires: pciutils-devel gettext ncurses-devel
%endif
%if %{with_debuginfo}
# Fancy new debuginfo generation introduced in Fedora 8/RHEL 6.
# The -r flag to find-debuginfo.sh invokes eu-strip --reloc-debug-sections
# which reduces the number of relocations in kernel module .ko.debug files and
# was introduced with rpm 4.9 and elfutils 0.153.
BuildRequires: rpm-build >= 4.9.0-1, elfutils >= 0.153-1
%define debuginfo_args --strict-build-id -r
%endif
%ifarch s390x
# required for zfcpdump
BuildRequires: glibc-static
%endif
Source0: linux-%{rpmversion}-%{pkgrelease}.tar.xz
Source1: Makefile.common
Source10: sign-modules
%define modsign_cmd %{SOURCE10}
Source11: x509.genkey
%if %{?released_kernel}
Source13: centos-ca-secureboot.der
Source14: centossecureboot001.crt
%define pesign_name centossecureboot001
%else
Source13: centos-ca-secureboot.der
Source14: centossecureboot001.crt
%define pesign_name centossecureboot001
%endif
Source15: centos-ldup.x509
Source16: centos-kpatch.x509
Source18: check-kabi
Source20: Module.kabi_x86_64
Source21: Module.kabi_ppc64le
Source22: Module.kabi_aarch64
Source23: Module.kabi_s390x
Source25: kernel-abi-whitelists-%{distro_build}.tar.bz2
Source50: %{src_pkg_name}-%{version}-x86_64.config
Source51: %{src_pkg_name}-%{version}-x86_64-debug.config
# Source60: %{src_pkg_name}-%{version}-ppc64.config
# Source61: %{src_pkg_name}-%{version}-ppc64-debug.config
Source62: %{src_pkg_name}-%{version}-ppc64le.config
Source63: %{src_pkg_name}-%{version}-ppc64le-debug.config
Source70: %{src_pkg_name}-%{version}-s390x.config
Source71: %{src_pkg_name}-%{version}-s390x-debug.config
Source72: %{src_pkg_name}-%{version}-s390x-kdump.config
Source80: %{src_pkg_name}-%{version}-aarch64.config
Source81: %{src_pkg_name}-%{version}-aarch64-debug.config
# Sources for kernel tools
Source2000: cpupower.service
Source2001: cpupower.config
# empty final patch to facilitate testing of kernel patches
Patch999999: linux-kernel-test.patch
#Marvell Patches
Patch8001: 0001-net-mvpp2-remove-useless-goto.patch
Patch8002: 0002-net-mvpp2-set-the-Rx-FIFO-size-depending-on-the-port.patch
Patch8003: 0003-net-mvpp2-initialize-the-Tx-FIFO-size.patch
Patch8004: 0004-net-mvpp2-initialize-the-RSS-tables.patch
Patch8005: 0005-net-mvpp2-limit-TSO-segments-and-use-stop-wake-thres.patch
Patch8006: 0006-net-mvpp2-use-the-aggr-txq-size-define-everywhere.patch
Patch8007: 0007-net-mvpp2-simplify-the-Tx-desc-set-DMA-logic.patch
Patch8008: 0008-net-mvpp2-add-ethtool-GOP-statistics.patch
Patch8009: 0009-net-mvpp2-fix-GOP-statistics-loop-start-and-stop-con.patch
Patch8010: 0010-net-mvpp2-fix-the-txq_init-error-path.patch
Patch8011: 0011-net-mvpp2-cleanup-probed-ports-in-the-probe-error-pa.patch
Patch8012: 0012-net-mvpp2-do-not-disable-GMAC-padding.patch
Patch8013: 0013-net-mvpp2-check-ethtool-sets-the-Tx-ring-size-is-to-.patch
Patch8014: 0014-net-mvpp2-allocate-zeroed-tx-descriptors.patch
Patch8015: 0015-net-mvpp2-fix-the-RSS-table-entry-offset.patch
Patch8016: 0016-net-mvpp2-only-free-the-TSO-header-buffers-when-it-w.patch
Patch8017: 0017-net-mvpp2-split-the-max-ring-size-from-the-default-o.patch
Patch8018: 0018-net-mvpp2-align-values-in-ethtool-get_coalesce.patch
Patch8019: 0019-net-mvpp2-report-the-tx-usec-coalescing-information-.patch
Patch8020: 0020-net-mvpp2-adjust-the-coalescing-parameters.patch
Patch8021: 0021-device-property-Introduce-fwnode_get_mac_address.patch
Patch8022: 0022-device-property-Introduce-fwnode_get_phy_mode.patch
Patch8023: 0023-device-property-Introduce-fwnode_irq_get.patch
Patch8024: 0024-device-property-Allow-iterating-over-available-child.patch
Patch8025: 0025-net-mvpp2-simplify-maintaining-enabled-ports-list.patch
Patch8026: 0026-net-mvpp2-use-device_-fwnode_-APIs-instead-of-of_.patch
Patch8027: 0027-net-mvpp2-enable-ACPI-support-in-the-driver.patch
Patch8028: 0028-mvpp2-fix-multicast-address-filter.patch
Patch8029: 0029-net-mvpp2-Add-hardware-offloading-for-VLAN-filtering.patch
Patch8030: 0030-net-mvpp2-use-the-same-buffer-pool-for-all-ports.patch
Patch8031: 0031-net-mvpp2-update-the-BM-buffer-free-destroy-logic.patch
Patch8032: 0032-net-mvpp2-use-a-data-size-of-10kB-for-Tx-FIFO-on-por.patch
Patch8033: 0033-net-mvpp2-enable-UDP-TCP-checksum-over-IPv6.patch
Patch8034: 0034-net-mvpp2-jumbo-frames-support.patch
Patch8035: 0035-net-mvpp2-mvpp2_check_hw_buf_num-can-be-static.patch
Patch8036: 0036-net-mvpp2-Simplify-MAC-filtering-function-parameters.patch
Patch8037: 0037-net-mvpp2-Add-support-for-unicast-filtering.patch
Patch8038: 0038-net-mvpp2-use-correct-index-on-array-mvpp2_pools.patch
Patch8039: 0039-net-mvpp2-Make-mvpp2_prs_hw_read-a-parser-entry-init.patch
Patch8040: 0040-net-mvpp2-Don-t-use-dynamic-allocs-for-local-variabl.patch
Patch8041: 0041-net-mvpp2-Use-relaxed-I-O-in-data-path.patch
Patch8042: 0042-net-mvpp2-Fix-parser-entry-init-boundary-check.patch
Patch8043: 0043-net-mvpp2-Fix-TCAM-filter-reserved-range.patch
Patch8044: 0044-net-mvpp2-Fix-DMA-address-mask-size.patch
Patch8045: 0045-net-mvpp2-Fix-clk-error-path-in-mvpp2_probe.patch
Patch8046: 0046-net-mvpp2-Fix-clock-resource-by-adding-missing-mg_co.patch
#Ampere patches
Patch9001: 0001-BACKPORT-arm64-cmpwait-Clear-event-register-before-a.patch
Patch9002: 0002-BACKPORT-arm64-barrier-Implement-smp_cond_load_relax.patch
Patch9003: 0003-BACKPORT-arm64-locking-Replace-ticket-lock-implement.patch
Patch9004: 0004-BACKPORT-arm64-kconfig-Ensure-spinlock-fastpaths-are.patch
Patch9005: 0005-BACKPORT-ahci-Disable-LPM-on-Lenovo-50-series-laptop.patch
Patch9006: 0006-BACKPORT-ACPI-bus-Introduce-acpi_get_match_data-func.patch
Patch9007: 0007-BACKPORT-ACPI-bus-Remove-checks-in-acpi_get_match_da.patch
Patch9008: 0008-BACKPORT-ACPI-bus-Rename-acpi_get_match_data-to-acpi.patch
Patch9009: 0009-BACKPORT-ata-Disable-AHCI-ALPM-feature-for-Ampere-Co.patch
Patch9010: 0010-BACKPORT-perf-xgene-Fix-IOB-SLOW-PMU-parser-error.patch
Patch9011: 0011-BACKPORT-iommu-enable-bypass-transaction-caching-for.patch
#Pvsched patches
Patch9051: 0001-arm-paravirt-Use-a-single-ops-structure.patch
Patch9052: 0002-KVM-arm-arm64-Factor-out-hypercall-handling-from-PSC.patch
Patch9053: 0003-KVM-Implement-kvm_put_guest.patch
Patch9054: 0004-arm-arm64-Provide-a-wrapper-for-SMCCC-1.1-calls.patch
Patch9055: 0005-locking-osq-Use-optimized-spinning-loop-for-arm64.patch
Patch9056: 0006-arm64-spinlock-fix-a-Wunused-function-warning.patch
Patch9057: 0007-KVM-Boost-vCPUs-that-are-delivering-interrupts.patch
Patch9058: 0008-KVM-Check-preempted_in_kernel-for-involuntary-preemp.patch
Patch9059: 0009-KVM-arm64-Document-PV-sched-interface.patch
Patch9060: 0010-KVM-arm64-Implement-PV_SCHED_FEATURES-call.patch
Patch9061: 0011-KVM-arm64-Support-pvsched-preempted-via-shared-struc.patch
Patch9062: 0012-KVM-arm64-Add-interface-to-support-vCPU-preempted-ch.patch
Patch9063: 0013-KVM-arm64-Support-the-vCPU-preemption-check.patch
Patch9064: 0014-KVM-arm64-Add-SMCCC-PV-sched-to-kick-cpu.patch
Patch9065: 0015-KVM-arm64-Implement-PV_SCHED_KICK_CPU-call.patch
Patch9066: 0016-qspinlock-CNA-Add-ARM64-support.patch
Patch9067: 0017-locking-pvqspinlock-Extend-node-size-when-pvqspinloc.patch
Patch9068: 0018-locking-qspinlock-Introduce-CNA-into-the-slow-path-o.patch
Patch9069: 0019-locking-qspinlock-Introduce-starvation-avoidance-int.patch
Patch9070: 0020-locking-qspinlock-Introduce-the-shuffle-reduction-op.patch
Patch9071: 0021-KVM-arm64-Add-interface-to-support-PV-qspinlock.patch
Patch9072: 0022-locking-qspinlock-Merge-struct-__qspinlock-into-stru.patch
Patch9073: 0023-locking-qspinlock-Fix-build-for-anonymous-union-in-o.patch
Patch9074: 0024-KVM-arm64-Enable-PV-qspinlock.patch
Patch9075: 0025-KVM-arm64-Add-tracepoints-for-PV-qspinlock.patch
#Guest smt determination
Patch10001: 0001-ACPICA-ACPI-6.3-PPTT-add-additional-fields-in-Proces.patch
Patch10002: 0002-ACPI-PPTT-Add-support-for-ACPI-6.3-thread-flag.patch
Patch10003: 0003-arm64-topology-Use-PPTT-to-determine-if-PE-is-a-thre.patch
BuildRoot: %{_tmppath}/%{src_pkg_name}-%{KVRA}-root
%description
The %{src_pkg_name} package contains the Linux kernel sources. The Linux kernel
is the core of any Linux operating system. The kernel handles the basic
functions of the operating system: memory allocation, process allocation, device
input and output, etc.
%package -n %{bin_pkg_name}
Summary: The Linux kernel
Group: System Environment/Kernel
%kernel_reqprovconf
%description -n %{bin_pkg_name}
The %{bin_pkg_name} package contains the Linux kernel (vmlinuz), the core of any
Linux operating system. The kernel handles the basic functions of the operating
system: memory allocation, process allocation, device input and output, etc.
%package -n %{bin_pkg_name}-doc
Summary: Various documentation bits found in the kernel source
Group: Documentation
AutoReqProv: no
%description -n %{bin_pkg_name}-doc
This package contains documentation files from the kernel
source. Various bits of information about the Linux kernel and the
device drivers shipped with it are documented in these files.
You'll want to install this package if you need a reference to the
options that can be passed to Linux kernel modules at load time.
%package -n %{bin_pkg_name}-headers
Summary: Header files for the Linux kernel for use by glibc
Group: Development/System
Obsoletes: glibc-kernheaders < 3.0-46
Provides: glibc-kernheaders = 3.0-46
%description -n %{bin_pkg_name}-headers
%{bin_pkg_name}-headers includes the C header files that specify the interface
between the Linux kernel and userspace libraries and programs. The
header files define structures and constants that are needed for
building most standard programs and are also needed for rebuilding the
glibc package.
%package -n %{bin_pkg_name}-bootwrapper
Summary: Boot wrapper files for generating combined kernel + initrd images
Group: Development/System
Requires: gzip binutils
%description -n %{bin_pkg_name}-bootwrapper
%{bin_pkg_name}-bootwrapper contains the wrapper code which makes bootable "zImage"
files combining both kernel and initial ramdisk.
%package -n %{bin_pkg_name}-debuginfo-common-%{_target_cpu}
Summary: Kernel source files used by %{bin_pkg_name}-debuginfo packages
Group: Development/Debug
%description -n %{bin_pkg_name}-debuginfo-common-%{_target_cpu}
This package is required by %{bin_pkg_name}-debuginfo subpackages.
It provides the kernel source files common to all builds.
%if %{with_perf}
%package -n perf%{?bin_suffix:-%{bin_suffix}}
Summary: Performance monitoring for the Linux kernel
Group: Development/System
License: GPLv2
%description -n perf%{?bin_suffix:-%{bin_suffix}}
This package contains the perf tool, which enables performance monitoring
of the Linux kernel.
%package -n perf%{?bin_suffix:-%{bin_suffix}}-debuginfo
Summary: Debug information for package perf
Group: Development/Debug
Requires: %{bin_pkg_name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
AutoReqProv: no
%description -n perf%{?bin_suffix:-%{bin_suffix}}-debuginfo
This package provides debug information for the perf package.
# Note that this pattern only works right to match the .build-id
# symlinks because of the trailing nonmatching alternation and
# the leading .*, because of find-debuginfo.sh's buggy handling
# of matching the pattern against the symlinks file.
%{expand:%%global debuginfo_args %{?debuginfo_args} -p '.*%%{_bindir}/perf(\.debug)?|.*%%{_libexecdir}/perf-core/.*|XXX' -o perf-debuginfo.list}
%package -n python-perf%{?bin_suffix:-%{bin_suffix}}
Summary: Python bindings for apps which will manipulate perf events
Group: Development/Libraries
%description -n python-perf%{?bin_suffix:-%{bin_suffix}}
The python-perf%{?bin_suffix:-%{bin_suffix}} package contains a module that permits applications
written in the Python programming language to use the interface
to manipulate perf events.
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
%package -n python-perf%{?bin_suffix:-%{bin_suffix}}-debuginfo
Summary: Debug information for package perf python bindings
Group: Development/Debug
Requires: %{bin_pkg_name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
AutoReqProv: no
%description -n python-perf%{?bin_suffix:-%{bin_suffix}}-debuginfo
This package provides debug information for the perf python bindings.
# the python_sitearch macro should already be defined from above
%{expand:%%global debuginfo_args %{?debuginfo_args} -p '.*%%{python_sitearch}/perf.so(\.debug)?|XXX' -o python-perf-debuginfo.list}
%endif # with_perf
%if %{with_tools}
%package -n %{bin_pkg_name}-tools
Summary: Assortment of tools for the Linux kernel
Group: Development/System
License: GPLv2
Provides: cpupowerutils = 1:009-0.6.p1
Obsoletes: cpupowerutils < 1:009-0.6.p1
Provides: cpufreq-utils = 1:009-0.6.p1
Provides: cpufrequtils = 1:009-0.6.p1
Obsoletes: cpufreq-utils < 1:009-0.6.p1
Obsoletes: cpufrequtils < 1:009-0.6.p1
Obsoletes: cpuspeed < 1:2.0
Requires: %{bin_pkg_name}-tools-libs = %{version}-%{release}
%description -n %{bin_pkg_name}-tools
This package contains the tools/ directory from the kernel source
and the supporting documentation.
%package -n %{bin_pkg_name}-tools-libs
Summary: Libraries for the %{bin_pkg_name}-tools
Group: Development/System
License: GPLv2
%description -n %{bin_pkg_name}-tools-libs
This package contains the libraries built from the tools/ directory
from the kernel source.
%package -n %{bin_pkg_name}-tools-libs-devel
Summary: Assortment of tools for the Linux kernel
Group: Development/System
License: GPLv2
Requires: %{bin_pkg_name}-tools = %{version}-%{release}
Provides: cpupowerutils-devel = 1:009-0.6.p1
Obsoletes: cpupowerutils-devel < 1:009-0.6.p1
Requires: %{bin_pkg_name}-tools-libs = %{version}-%{release}
%description -n %{bin_pkg_name}-tools-libs-devel
This package contains the development files for the tools/ directory from
the kernel source.
%package -n %{bin_pkg_name}-tools-debuginfo
Summary: Debug information for package %{bin_pkg_name}-tools
Group: Development/Debug
Requires: %{bin_pkg_name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
AutoReqProv: no
%description -n %{bin_pkg_name}-tools-debuginfo
This package provides debug information for package %{bin_pkg_name}-tools.
# Note that this pattern only works right to match the .build-id
# symlinks because of the trailing nonmatching alternation and
# the leading .*, because of find-debuginfo.sh's buggy handling
# of matching the pattern against the symlinks file.
%{expand:%%global debuginfo_args %{?debuginfo_args} -p '.*%%{_bindir}/centrino-decode(\.debug)?|.*%%{_bindir}/powernow-k8-decode(\.debug)?|.*%%{_bindir}/cpupower(\.debug)?|.*%%{_libdir}/libcpupower.*|.*%%{_libdir}/libcpupower.*|.*%%{_bindir}/turbostat(\.debug)?|.*%%{_bindir}/x86_energy_perf_policy(\.debug)?|.*%%{_bindir}/tmon(\.debug)?|XXX' -o tools-debuginfo.list}
%endif # with_tools
%if %{with_gcov}
%package -n %{bin_pkg_name}-gcov
Summary: gcov graph and source files for coverage data collection.
Group: Development/System
%description -n %{bin_pkg_name}-gcov
kernel-gcov includes the gcov graph and source files for gcov coverage collection.
%endif
%package -n %{bin_pkg_name}-abi-whitelists
Summary: The Red Hat Enterprise Linux kernel ABI symbol whitelists
Group: System Environment/Kernel
AutoReqProv: no
%description -n %{bin_pkg_name}-abi-whitelists
The kABI package contains information pertaining to the Red Hat Enterprise
Linux kernel ABI, including lists of kernel symbols that are needed by
external Linux kernel modules, and a yum plugin to aid enforcement.
#
# This macro creates a kernel-<subpackage>-debuginfo package.
# %%kernel_debuginfo_package <subpackage>
#
%define kernel_debuginfo_package() \
%package -n %{bin_pkg_name}-%{?1:%{1}-}debuginfo\
Summary: Debug information for package %{bin_pkg_name}%{?1:-%{1}}\
Group: Development/Debug\
Requires: %{bin_pkg_name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}\
Provides: %{bin_pkg_name}-%{?1:%{1}-}debuginfo-%{_target_cpu} = %{version}-%{release}\
AutoReqProv: no\
%description -n %{bin_pkg_name}-%{?1:%{1}-}debuginfo\
This package provides debug information for package %{bin_pkg_name}%{?1:-%{1}}.\
This is required to use SystemTap with %{bin_pkg_name}%{?1:-%{1}}-%{KVRA}.\
%{expand:%%global debuginfo_args %{?debuginfo_args} -p '/.*/%%{KVRA}%{?1:\.%{1}}/.*|/.*%%{KVRA}%{?1:\.%{1}}(\.debug)?' -o debuginfo%{?1}.list}\
%{nil}
#
# This macro creates a kernel-<subpackage>-devel package.
# %%kernel_devel_package <subpackage> <pretty-name>
#
%define kernel_devel_package() \
%package -n %{bin_pkg_name}-%{?1:%{1}-}devel\
Summary: Development package for building kernel modules to match the %{?2:%{2} }kernel\
Group: System Environment/Kernel\
Provides: %{bin_pkg_name}-%{?1:%{1}-}devel-%{_target_cpu} = %{version}-%{release}\
Provides: kernel-devel-%{_target_cpu} = %{version}-%{release}%{?1:.%{1}}\
Provides: kernel-devel-uname-r = %{KVRA}%{?1:.%{1}}\
AutoReqProv: no\
Requires(pre): /usr/bin/find\
Requires: perl\
%description -n %{bin_pkg_name}-%{?1:%{1}-}devel\
This package provides kernel headers and makefiles sufficient to build modules\
against the %{?2:%{2} }kernel package.\
%{nil}
#
# This macro creates a kernel-<subpackage> and its -devel and -debuginfo too.
# %%define variant_summary The Linux kernel compiled for <configuration>
# %%kernel_variant_package [-n <pretty-name>] <subpackage>
#
%define kernel_variant_package(n:) \
%package -n %{bin_pkg_name}-%1\
Summary: %{variant_summary}\
Group: System Environment/Kernel\
%kernel_reqprovconf\
%{expand:%%kernel_devel_package %1 %{!?-n:%1}%{?-n:%{-n*}}}\
%{expand:%%kernel_debuginfo_package %1}\
%{nil}
# First the auxiliary packages of the main kernel package.
%kernel_devel_package
%kernel_debuginfo_package
# Now, each variant package.
%define variant_summary The Linux kernel compiled with extra debugging enabled
%kernel_variant_package debug
%description -n %{bin_pkg_name}-debug
The kernel package contains the Linux kernel (vmlinuz), the core of any
Linux operating system. The kernel handles the basic functions
of the operating system: memory allocation, process allocation, device
input and output, etc.
This variant of the kernel has numerous debugging options enabled.
It should only be installed when trying to gather additional information
on kernel bugs, as some of these options impact performance noticably.
%define variant_summary A minimal Linux kernel compiled for crash dumps
%kernel_variant_package kdump
%description -n %{bin_pkg_name}-kdump
This package includes a kdump version of the Linux kernel. It is
required only on machines which will use the kexec-based kernel crash dump
mechanism.
%prep
# do a few sanity-checks for --with *only builds
%if %{with_baseonly}
%if !%{with_default}
echo "Cannot build --with baseonly, default kernel build is disabled"
exit 1
%endif
%endif
# more sanity checking; do it quietly
if [ "%{patches}" != "%%{patches}" ] ; then
for patch in %{patches} ; do
if [ ! -f $patch ] ; then
echo "ERROR: Patch ${patch##/*/} listed in specfile but is missing"
exit 1
fi
done
fi 2>/dev/null
patch_command='patch -p1 -F1 -s'
ApplyPatch()
{
local patch=$1
shift
if [ ! -f $RPM_SOURCE_DIR/$patch ]; then
exit 1
fi
if ! grep -E "^Patch[0-9]+: $patch\$" %{_specdir}/${RPM_PACKAGE_NAME}.spec ; then
if [ "${patch:0:8}" != "patch-3." ] ; then
echo "ERROR: Patch $patch not listed as a source patch in specfile"
exit 1
fi
fi 2>/dev/null
case "$patch" in
*.bz2) bunzip2 < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
*.gz) gunzip < "$RPM_SOURCE_DIR/$patch" | $patch_command ${1+"$@"} ;;
*) $patch_command ${1+"$@"} < "$RPM_SOURCE_DIR/$patch" ;;
esac
}
# don't apply patch if it's empty
ApplyOptionalPatch()
{
local patch=$1
shift
if [ ! -f $RPM_SOURCE_DIR/$patch ]; then
exit 1
fi
local C=$(wc -l $RPM_SOURCE_DIR/$patch | awk '{print $1}')
if [ "$C" -gt 9 ]; then
ApplyPatch $patch ${1+"$@"}
fi
}
%setup -q -n %{src_pkg_name}-%{rheltarball} -c
mv linux-%{rheltarball} linux-%{KVRA}
cd linux-%{KVRA}
# Drop some necessary files from the source dir into the buildroot
cp $RPM_SOURCE_DIR/%{src_pkg_name}-%{version}-*.config .
ApplyOptionalPatch linux-kernel-test.patch
# Any further pre-build tree manipulations happen here.
if [ ! -d .git ]; then
git init
git config user.email "[email protected]"
git config user.name "AltArch Kernel"
git config gc.auto 0
git add .
git commit -a -q -m "baseline"
fi
#Altarch patches
git am %{PATCH8001}
git am %{PATCH8002}
git am %{PATCH8003}
git am %{PATCH8004}
git am %{PATCH8005}
git am %{PATCH8006}
git am %{PATCH8007}
git am %{PATCH8008}
git am %{PATCH8009}
git am %{PATCH8010}
git am %{PATCH8011}
git am %{PATCH8012}
git am %{PATCH8013}
git am %{PATCH8014}
git am %{PATCH8015}
git am %{PATCH8016}
git am %{PATCH8017}
git am %{PATCH8018}
git am %{PATCH8019}
git am %{PATCH8020}
git am %{PATCH8021}
git am %{PATCH8022}
git am %{PATCH8023}
git am %{PATCH8024}
git am %{PATCH8025}
git am %{PATCH8026}
git am %{PATCH8027}
git am %{PATCH8028}
git am %{PATCH8029}
git am %{PATCH8030}
git am %{PATCH8031}
git am %{PATCH8032}
git am %{PATCH8033}
git am %{PATCH8034}
git am %{PATCH8035}
git am %{PATCH8036}
git am %{PATCH8037}
git am %{PATCH8038}
git am %{PATCH8039}
git am %{PATCH8040}
git am %{PATCH8041}
git am %{PATCH8042}
git am %{PATCH8043}
git am %{PATCH8044}
git am %{PATCH8045}
git am %{PATCH8046}
git am %{PATCH9001}
git am %{PATCH9002}
git am %{PATCH9003}
git am %{PATCH9004}
git am %{PATCH9005}
git am %{PATCH9006}
git am %{PATCH9007}
git am %{PATCH9008}
git am %{PATCH9009}
git am %{PATCH9010}
git am %{PATCH9011}
git am %{PATCH9051}
git am %{PATCH9052}
git am %{PATCH9053}
git am %{PATCH9054}
git am %{PATCH9055}
git am %{PATCH9056}
git am %{PATCH9057}
git am %{PATCH9058}
git am %{PATCH9059}
git am %{PATCH9060}
git am %{PATCH9061}
git am %{PATCH9062}
git am %{PATCH9063}
git am %{PATCH9064}
git am %{PATCH9065}
git am %{PATCH9066}
git am %{PATCH9067}
git am %{PATCH9068}
git am %{PATCH9069}
git am %{PATCH9070}
git am %{PATCH9071}
git am %{PATCH9072}
git am %{PATCH9073}
git am %{PATCH9074}
git am %{PATCH9075}
git am %{PATCH10001}
git am %{PATCH10002}
git am %{PATCH10003}
chmod +x scripts/checkpatch.pl
# This Prevents scripts/setlocalversion from mucking with our version numbers.
touch .scmversion
# only deal with configs if we are going to build for the arch
%ifnarch %nobuildarches
if [ -L configs ]; then
rm -f configs
mkdir configs
fi
# Remove configs not for the buildarch
for cfg in %{src_pkg_name}-%{version}-*.config; do
if [ `echo %{all_arch_configs} | grep -c $cfg` -eq 0 ]; then
rm -f $cfg
fi
done
%if !%{debugbuildsenabled}
rm -f %{src_pkg_name}-%{version}-*debug.config
%endif
# enable GCOV kernel config options if gcov is on
%if %{with_gcov}
for i in *.config
do
sed -i 's/# CONFIG_GCOV_KERNEL is not set/CONFIG_GCOV_KERNEL=y\nCONFIG_GCOV_PROFILE_ALL=y\n/' $i
done
%endif
# Setup CONFIG_SYSTEM_TRUSTED_KEYS="certs/rhel.pem" for module signing. And make
# sure we create the file with certificates and copy key generation configuration
for i in *.config
do
sed -i 's@CONFIG_SYSTEM_TRUSTED_KEYS=.*@CONFIG_SYSTEM_TRUSTED_KEYS="certs/centos.pem"@' $i
done
cp %{SOURCE11} ./certs # x509.genkey
openssl x509 -inform der -in %{_sourcedir}/centos-ldup.x509 -out centos-ldup.pem
openssl x509 -inform der -in %{_sourcedir}/centos-kpatch.x509 -out centos-kpatch.pem
cat centos-ldup.pem centos-kpatch.pem > ./certs/centos.pem
# now run oldconfig over all the config files
for i in *.config
do
mv $i .config
Arch=`head -1 .config | cut -b 3-`
make %{?cross_opts} ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true
%if %{listnewconfig_fail}
if [ -s .newoptions ]; then
cat .newoptions
exit 1
fi
%endif
rm -f .newoptions
make %{?cross_opts} ARCH=$Arch oldnoconfig
echo "# $Arch" > configs/$i
cat .config >> configs/$i
done
# end of kernel config
%endif
# get rid of unwanted files resulting from patch fuzz
find . \( -name "*.orig" -o -name "*~" \) -exec rm -f {} \; >/dev/null
# remove unnecessary SCM files
find . -name .gitignore -exec rm -f {} \; >/dev/null
cd ..
###
### build
###
%build
%if %{with_sparse}
%define sparse_mflags C=1
%endif
%if %{with_debuginfo}
# This override tweaks the kernel makefiles so that we run debugedit on an
# object before embedding it. When we later run find-debuginfo.sh, it will
# run debugedit again. The edits it does change the build ID bits embedded
# in the stripped object, but repeating debugedit is a no-op. We do it
# beforehand to get the proper final build ID bits into the embedded image.
# This affects the vDSO images in vmlinux, and the vmlinux image in bzImage.
export AFTER_LINK='sh -xc "/usr/lib/rpm/debugedit -b $$RPM_BUILD_DIR -d /usr/src/debug -i $@ > [email protected]"'
%endif