/[packages]/backports/8/kernel/current/SPECS/kernel.spec
ViewVC logotype

Contents of /backports/8/kernel/current/SPECS/kernel.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1891240 - (show annotations) (download)
Wed Sep 21 15:31:18 2022 UTC (18 months, 4 weeks ago) by tmb
File size: 54955 byte(s)
- block: blk_queue_enter() / __bio_queue_enter() must return -EAGAIN for nowait
- Revert "iommu/vt-d: Fix possible recursive locking in intel_iommu_init()"


1 # -*- Mode: rpm-spec -*-
2 #
3 # This Specfile is based on kernel-tmb spec done by
4 # Thomas Backlund <tmb@mandriva.org>
5 #
6 # The mkflavour() macroization done by Anssi Hannula <anssi@mandriva.org>
7 #
8 # ----------------------------------------------------------------------------
9 # Consult this page for extra docs:
10 #
11 # https://wiki.mageia.org/en/Kernel_update_workflow
12 #
13 # (feel free to adjust the wiki-page when adding or removing features
14 # to the spec file).
15 #
16 # After building a new kernel, remember to push:
17 #
18 # kmod-virtualbox
19 # kmod-vboxadditions
20 # kmod-xtables-addons
21 # drakx-installer-images (both core and nonfree)
22 # ----------------------------------------------------------------------------
23 #
24 # Aarch64 still has problems with multithreaded rpmbuild 4.15-rc
25 %if 0%{?mageia} >= 8
26 %ifarch aarch64
27 %global _smp_nthreads_max 1
28 %endif
29 %endif
30
31 #
32 # Mageia kernels use kernel.org versioning
33 #
34 %define kernelversion 5
35 # WARNING: when patchlevel is bumped, please update drakx/kernel/list_modules.pm for new modules!!!
36 %define patchlevel 19
37 # sublevel is now used for -stable patches
38 %define sublevel 10
39
40 # Package release
41 %define mgarel 2
42
43 # kernel Makefile extraversion is substituted by
44 # rcX which are either 0 (empty), X (as in rcX)
45 %define rcX 0
46
47 # kernel base name (also name of srpm)
48 %define kname kernel
49
50 # Patch tarball tag
51 %define ktag mga
52
53 %define rpmtag %{distsuffix}%{mgaver}
54 %if %{rcX}
55 %define rpmrel %mkrel 0.rc%{rcX}.%{mgarel}
56 %else
57 %define rpmrel %mkrel %{mgarel}
58 %endif
59
60 # fakerel and fakever never change, they are used to fool
61 # rpm/urpmi/smart and ensure the kernels are installed,
62 # not upgraded so old kernel is not overwritten or removed
63 %define fakever 1
64 %define fakerel %mkrel 1
65
66 # version defines
67 %define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
68 %define kverrel %{kversion}-%{rpmrel}
69
70 # When we are using a rcX patch, the tarball is a sublevel -1
71 %if %{rcX}
72 %if %sublevel
73 %define tar_ver %{kernelversion}.%{patchlevel}
74 %else
75 %define tar_ver %{kernelversion}.%(expr %{patchlevel} - 1)
76 %endif
77 %else
78 %define tar_ver %{kernelversion}.%{patchlevel}
79 %endif
80
81 # Used for not making too long names for rpms or search paths
82 %if %rcX
83 %define buildrpmrel 0.rc%{rcX}.%{mgarel}%{rpmtag}
84 %else
85 %define buildrpmrel %{mgarel}%{rpmtag}
86 %endif
87 %define buildrel %{kversion}-%{buildrpmrel}
88
89 # libbpf major
90 %define bpfmajor 1
91
92 # Having different top level names for packges means that you have to remove
93 # them by hard :(
94 %define top_dir_name %{kname}-%{_arch}
95
96 %define build_dir ${RPM_BUILD_DIR}/%{top_dir_name}
97 %define src_dir %{build_dir}/linux-%{tar_ver}
98
99 # Disable useless debug rpms...
100 %global _enable_debug_packages %{nil}
101 %global debug_package %{nil}
102 %global __debug_package %{nil}
103 %global __debug_install_post %{nil}
104 %global _build_id_links none
105
106 # no bytecompiling wanted as it breaks build on selftests we dont even ship
107 # for older buildsystems
108 %global _python_bytecompile_build 0
109 # for systems with >= rpm-mageia-setup-2.29-1.mga7
110 %global __brp_python_bytecompile %nil
111
112 # Build defines
113 %define build_doc 1
114 %define build_uheaders 1
115 %define build_source 1
116 %define build_devel 1
117
118 %define build_debug 0
119
120 # Build desktop i586 / 4GB
121 %ifarch %{ix86}
122 %define build_desktop586 1
123 %endif
124
125 # Build desktop (i686 / 64GB) / x86_64 / arm / aarch64
126 %define build_desktop 1
127
128 # Build server (i686 / 64GB)/x86_64 / aarch64
129 %ifnarch %{arm}
130 %define build_server 1
131 %else
132 %define build_server 0
133 %endif
134
135 # build cpupower
136 %ifnarch %{arm} aarch64
137 %define build_cpupower 1
138 %else
139 %define build_cpupower 0
140 %endif
141
142 # build perf
143 %define build_perf 1
144
145 # bpf
146 %define build_bpftool 1
147 %define build_libbpf 1
148
149 # compress modules with xz
150 %ifnarch %{arm}
151 %define build_modxz 1
152 %else
153 %define build_modxz 0
154 %endif
155 # End of user definitions
156
157 # buildtime override flags
158 %{?_without_desktop586: %global build_desktop586 0}
159 %{?_without_desktop: %global build_desktop 0}
160 %{?_without_server: %global build_server 0}
161 %{?_without_doc: %global build_doc 0}
162 %{?_without_uheaders: %global build_uheaders 0}
163 %{?_without_source: %global build_source 0}
164 %{?_without_devel: %global build_devel 0}
165 %{?_without_debug: %global build_debug 0}
166 %{?_without_perf: %global build_perf 0}
167 %{?_without_cpupower: %global build_cpupower 0}
168 %{?_without_bpftool: %global build_bpftool 0}
169 %{?_without_libbpf: %global build_libbpf 0}
170 %{?_without_modxz: %global build_modxz 0}
171
172 %{?_with_desktop586: %global build_desktop586 1}
173 %{?_with_desktop: %global build_desktop 1}
174 %{?_with_server: %global build_server 1}
175 %{?_with_doc: %global build_doc 1}
176 %{?_with_uheaders: %global build_uheaders 1}
177 %{?_with_source: %global build_source 1}
178 %{?_with_devel: %global build_devel 1}
179 %{?_with_debug: %global build_debug 1}
180 %{?_with_perf: %global build_perf 1}
181 %{?_with_cpupower: %global build_cpupower 1}
182 %{?_with_bpftool: %global build_bpftool 1}
183 %{?_with_libbpf: %global build_libbpf 1}
184 %{?_with_modxz: %global build_modxz 1}
185
186 # For the .nosrc.rpm
187 %define build_nosrc 0
188 %{?_with_nosrc: %global build_nosrc 1}
189
190 %if %(if [ -z "$CC" ] ; then echo 0; else echo 1; fi)
191 %define kmake %make_build CC="$CC"
192 %else
193 %define kmake %make_build
194 %endif
195 # there are places where parallel make don't work
196 %define smake make
197
198 # Parallelize xargs invocations on smp machines
199 %define kxargs xargs %([ -z "$RPM_BUILD_NCPUS" ] \\\
200 && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
201 [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-P $RPM_BUILD_NCPUS")
202
203 # arm(64) arch matching
204 %define target_arch %(echo %{_arch} | sed -e 's/arm.*/arm/' -e 's/aarch64/arm64/')
205
206
207 #
208 # SRC RPM description
209 #
210 Summary: Linux kernel built for Mageia
211 Name: %{kname}
212 Version: %{kversion}
213 Release: %{rpmrel}
214 License: GPLv2
215 Group: System/Kernel and hardware
216 ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
217 ExclusiveOS: Linux
218 URL: https://www.kernel.org/
219
220 ####################################################################
221 #
222 # Sources
223 #
224 ### This is for full SRC RPM
225 Source0: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz
226 Source1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.sign
227 ### This is for stripped SRC RPM
228 %if %build_nosrc
229 NoSource: 0
230 %endif
231 # This is for disabling *config, mrproper, prepare, scripts on -devel rpms
232 Source2: disable-mrproper-in-devel-rpms.patch
233
234 Source4: README.kernel-sources
235
236 # for creating stable queue patchlist
237 Source5: generate-patchlist.sh
238
239 # copy to patched source tree along with the defconfigs and run it
240 Source10: defconfig-updater.sh
241 Source09: defconfig-updater-simple.sh
242 # x86_64 defconfigs
243 Source11: defconfig-x86_64-desktop
244 Source12: defconfig-x86_64-server
245 # i386 defconfigs
246 Source13: defconfig-i386-desktop586
247 Source14: defconfig-i386-desktop
248 Source15: defconfig-i386-server
249 # arm64 defconfigs
250 Source16: defconfig-arm64-desktop
251 Source17: defconfig-arm64-server
252 # arm defconfigs
253 Source18: defconfig-arm-desktop
254
255 # config and systemd service file from fedora
256 Source50: cpupower.service
257 Source51: cpupower.config
258
259 ####################################################################
260 #
261 # Patches
262
263 #
264 # Patch0 to Patch10 are for core kernel upgrades.
265 #
266
267 %if %sublevel
268 Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{sublevel}.xz
269 %endif
270 %if %{rcX}
271 # (tmb) Created with:
272 # wget https://git.kernel.org/torvalds/p/v5.10-rc7/v5.9 -O patch-5.10-rc7
273 # xz -6e patch-5.10-rc7
274 Patch2: patch-%{kernelversion}.%{patchlevel}-rc%{rcX}.xz
275 %endif
276
277 ###
278 ### Stable Queue can be big
279 ### Patches from 100-999
280 ###
281 ### add patches here by copying contents of kernel matching queue-x.y from:
282 ### https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/
283 ### to SOURCES, generate patchlist with generate-patchlist.sh and paste it here
284 ###
285 Patch0100: block-blk_queue_enter-__bio_queue_enter-must-return-.patch
286
287 ###
288 ### Arch
289 ### Patches from 1000
290 ###
291
292 # laptop needing pci=assign-busses (#18989, needs to be submitted upstream)
293 Patch1000: x86-pci-toshiba-equium-a60-assign-busses.patch
294
295 # If users choose a bad video mode, allow to jump to
296 # a working one (TTL: forever)
297 Patch1001: x86-boot-video-80x25-if-break.patch
298
299 # Allow poweroff on UP machines running SMP kernels
300 Patch1005: x86-default_poweroff_up_machines.patch
301
302 # raise vmalloc to fix https://bugs.mageia.org/show_bug.cgi?id=904
303 Patch1010: x86-increase-default-minimum-vmalloc-area-by-64MB-to-192MB.patch
304
305 # slows down boot
306 Patch1015: Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch
307
308 # AMD Zen mwait optimization v3
309 Patch1021: x86-Remove-vendor-checks-from-prefer_mwait_c1_over_h.patch
310 Patch1022: x86-Fix-comment-for-X86_FEATURE_ZEN.patch
311
312 # amd_nb
313 Patch1030: x86-amd_nb-Add-AMD-Family-17h-A0-AF-IDs.patch
314 Patch1031: x86-amd_nb-Add-Family-19h-model-70h-7Fh-IDs.patch
315 Patch1032: x86-amd_nb-Add-Family-19h-model-60h-6Fh-IDs.patch
316
317 # Amd cpufreq
318 Patch1035: cpufreq-amd_pstate-Fix-initial-highest_perf-value.patch
319
320 # Amd Microcode
321 Patch1040: x86-microcode-AMD-Attempt-applying-on-every-logical-thread.patch
322
323 # init
324 Patch1050: init-add-hostname-kernel-parameter.patch
325
326 ###
327 ### ACPI
328 ###
329
330 # CLEVO M360S acpi irq workaround
331 Patch1100: acpi-CLEVO-M360S-disable_acpi_irq.patch
332
333 # Clevo M720SR freezes with C3
334 Patch1105: acpi-processor-M720SR-limit-to-C2.patch
335
336 # ACPI PM fixes (TTL: 5.18)
337 Patch1130: x86-ACPI-State-Optimize-C3-entry-on-AMD-CPUs.patch
338
339 ###
340 ### Block
341 ###
342
343 # FIXME: Don't know know why this is needed
344 Patch1200: scsi-megaraid-new-sysfs-name.patch
345
346 # adds aliases to support upgrade from old dm-raid45 patch
347 Patch1215: dm-raid-aliases.patch
348
349 # disable floppy autoloading (mga #4696)
350 Patch1220: block-floppy-disable-pnp-modalias.patch
351
352 ###
353 ### bpf
354 ###
355
356 ###
357 ### Crypto
358 ###
359
360 ###
361 ### dma
362 ###
363
364 ###
365 ### File-system
366 ###
367
368 ###
369 ### FireWire
370 ###
371
372 # adding module aliases to ease upgrade from ieee1394
373 Patch1400: firewire-ieee1394-module-aliases.patch
374
375 ###
376 ### Firmware
377 ###
378
379 ###
380 ### GPU/DRM
381 ###
382
383 # mga compat option
384 Patch1500: drm-gpu-drm-treat-nokmsboot-as-nomodeset.patch
385
386 # amdgpu
387 # switch SI and CIK from radeon to amdgpu
388 Patch1520: drm-amdgpu-SI-and-CIK-enabled-by-default.patch
389 # 5.19.2 missing audio regression
390 Patch1521: Revert-drm-amdgpu-display-Prepare-for-new-interfaces.patch
391
392 # new Q57 Host Bridge id
393 Patch1530: char-agp-intel-new-Q57-id.patch
394
395 # i915
396 # TGL
397 Patch1546: drm-i915-psr-Disable-PSR2-selective-fetch-for-all-TGL-steps.patch
398
399 # https://bugzilla.kernel.org/show_bug.cgi?id=206653#c19
400 Patch1552: i2c_nvidia_gpu-change-err-into-info.patch
401
402 # nouveau
403 # 5.16.3 regression
404 Patch1560: Revert-drm-nouveau-pmu-gm200-avoid-touching-PMU-outs.patch
405
406 ###
407 ### gpio
408 ###
409
410 ###
411 ### hwmon
412 ###
413
414 # k10temp
415 Patch1600: hwmon-k10temp-Add-support-for-family-17h-models-A0h-AFh.patch
416 Patch1601: hwmon-k10temp-Add-support-for-family-19h-models-70h-7Fh.patch
417 Patch1602: hwmon-k10temp-Add-support-for-family-19h-models-60h-6Fh.patch
418
419 ###
420 ### i2c
421 ###
422
423 ###
424 ### io_uring
425 ###
426
427 ###
428 ### iommu
429 ###
430
431 # 5.19.9 regression
432 Patch1650: revert-iommu-vt-d-fix-possible-recursive-locking-in-intel_iommu_init.patch
433
434 ###
435 ### Input
436 ###
437
438 Patch1700: input-i8042-quirks-for-Fujitsu-Lifebook-A544-and-Lif.patch
439
440 ###
441 ### HID
442 ###
443
444 ###
445 ### kernel
446 ###
447
448 ###
449 ### MFD
450 ###
451
452 ###
453 ### MM
454 ###
455
456 ###
457 ### Network
458 ###
459
460 # SiS 190 fixes
461 Patch1900: net-sis190-fix-list-usage.patch
462
463 # netfilter IFWLOG support
464 Patch1910: net-netfilter-IFWLOG.patch
465 Patch1911: net-netfilter-IFWLOG-mdv.patch
466 Patch1912: net-netfilter-IFWLOG-2.6.35-buildfix.patch
467 Patch1913: net-netfilter-IFWLOG-2.6.37-buildfix.patch
468 Patch1914: net-ipv4-netfilter-ipt_IFWLOG-3.6-buildfix.patch
469 Patch1915: net-netfilter-IFWLOG-3.7-buildfix.patch
470 Patch1916: net-netfilter-IFWLOG-remove-unused-label.patch
471 Patch1917: net-netfilter-ipt_IFWLOG-4.12-buildfix.patch
472 Patch1918: net-netfilter-IFWLOG-5.0-buildfix.patch
473
474 # netfilter psd support
475 Patch1920: net-netfilter-psd.patch
476 Patch1921: net-netfilter-psd-mdv.patch
477 Patch1922: net-netfilter-psd-2.6.35-buildfix.patch
478 Patch1923: net-netfilter-psd-fix-redefines.patch
479
480 # rtw88 wifi
481 # add alias for the replaced r8822be staging driver
482 Patch1930: net-wireless-rtw88-add-r8822be-alias.patch
483 # add alias for the replaced 8723de 3rdparty driver
484 Patch1931: net-wireless-rtw88-add-8723de-alias.patch
485
486 # iwlfiwi
487 Patch1980: net-wireless-iwlwifi-add-new-pci-id-for-6235.patch
488 Patch1981: net-wireless-iwlwifi-dont-spam-logs-with-NSS-2-messages.patch
489 Patch1982: net-wireless-iwlwifi-mark-IWLMEI-as-broken.patch
490
491 ###
492 ### PCI
493 ###
494
495 ###
496 ### pinctrl
497 ###
498
499 ###
500 ### Platform
501 ###
502
503 # Allow access to Shuttle WMI interface controls
504 # (Mainly allow turning on/off webcam and wireless on Shuttle DA18IE and DA18IM)
505 Patch2050: platform-x86-add-shuttle-wmi-driver.patch
506 Patch2051: platform-x86-shuttle-wmi-drop-devinit-exit.patch
507 Patch2052: platform-x86-shuttle-wmi-4.2-buildfix.patch
508 Patch2053: platform-x86-shuttle-wmi-4.13-buildfix.patch
509 Patch2054: platform-x86-shuttle-wmi-kernel-5.5.patch
510
511 ###
512 ### PM
513 ###
514
515 ###
516 ### Sound
517 ###
518
519 ###
520 ### SPI
521 ###
522
523 ###
524 ### Staging
525 ###
526
527 ###
528 ### Thermal
529 ###
530
531 ###
532 ### Thunderbolt
533 ###
534
535 ###
536 ### USB
537 ###
538
539 Patch2300: hid-usbhid-IBM-BladeCenterHS20-quirk.patch
540
541 Patch2310: usb-storage-unusual_devs-add-id.patch
542 Patch2311: usb-storage-unusual_devs-add-id-2.6.37-buildfix.patch
543
544 ###
545 ### V4L
546 ###
547
548 # pwc driver name in /proc/bus/devices, /sys fix and "advertisement" removal
549 Patch2400: media-usb-pwc-lie-in-proc-usb-devices.patch
550
551 ###
552 ### Video
553 ###
554
555 # Mageia framebuffer boot logo
556 Patch2500: video-mageia-logo.patch
557
558 ###
559 ### Virt
560 ###
561
562 # fix gcc-10 build
563 Patch2550: KVM-squelch-uninitialized-variable-warning.patch
564
565 ###
566 ### Tools
567 ###
568
569 # wipe powerpc refrence so we can nuke dangling symlinks (mga#17676)
570 Patch2600: tools-testing-selftest-Makefile-remove-powerpc-reference.patch
571
572 # fix perf build
573 Patch2605: tools-perf-ui-include-slang.patch
574
575 ###
576 ### UAPI
577 ###
578
579 Patch2700: uapi-avoid-namespace-conflict-in-linux-posix_types.h.patch
580
581 ###
582 ### 3rdparty
583 ###
584
585 Patch3000: 3rd-3rdparty-tree.patch
586 Patch3001: 3rd-3rdparty-merge.patch
587
588 # add rtl8812 support (mga#21043)
589 # from https://github.com/aircrack-ng/rtl8812au.git
590 Patch3200: 3rd-rtl8812au.patch
591 Patch3201: 3rd-rtl8812au-Kconfig-Makefile.patch
592 Patch3202: 3rd-rtl8812au-rename.patch
593 Patch3203: 3rd-rtl8812au-kernel-5.17.patch
594 Patch3204: 3rd-rtl8812au-kernel-5.18.patch
595 Patch3205: 3rd-rtl8812au-kernel-5.19.2.patch
596
597 # add rtl8723de support (mga#22559)
598 Patch3300: 3rd-rtl8723de.patch
599 Patch3301: 3rd-rtl8723de-Kconfig-Makefile.patch
600 Patch3302: 3rd-rtl8723de-fix-redefine.patch
601 Patch3303: 3rd-rtl8723de-nodebug.patch
602 Patch3304: 3rd-rtl8223de-kernel-5.6.patch
603 Patch3305: 3rd-rtl8723de-add-kernel-5.8-support.patch
604
605 # viahss
606 Patch3400: 3rd-viahss-0.92.patch
607 Patch3401: 3rd-viahss-config.patch
608 Patch3402: 3rd-viahss-module-license.patch
609 Patch3403: 3rd-viahss-2.6.35-buildfix.patch
610 Patch3404: 3rd-viahss-3.0-buildfix.patch
611 Patch3405: 3rd-viahss-Kconfig-Makefile.patch
612
613 # fix Kconfig files for 3rdparty:
614 Patch3900: 3rd-fix-kconfig.patch
615
616 ###
617 ### Python fixes
618 ###
619 Patch4000: linux-5.19-python3.patch
620
621 ###
622 ### TTY
623 ###
624
625 ###
626 ### Security fixes
627 ###
628 Patch5002: CVE-2019-12379.patch
629 #
630 # CVE-2020-16119
631 # https://bugzilla.redhat.com/show_bug.cgi?id=1886374
632 # https://bugzilla.redhat.com/show_bug.cgi?id=1888083
633 Patch5003: CVE-2020-16119-DCCP-CCID-structure-use-after-free.patch
634
635 ###
636 ### Cosmetic fixes (e.g. typos, spelling, etc.)
637 ###
638
639 # broken rtla cleaner
640 Patch6000: hack-broken-rtla-cleaner.patch
641
642
643 ### Fixes from FC kernel
644 # Inspur Advantech PCI ids
645 Patch7000: 0001-scsi-smartpqi-add-inspur-advantech-ids.patch
646 # Vulcan AHCI PCI bar (aarch64)
647 Patch7001: 0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch
648
649 #END
650 ####################################################################
651
652 # Defines for the things that are needed for all the kernels
653 #
654 %define common_desc_kernel The kernel package contains the Linux kernel (vmlinuz), the core of your \
655 Mageia operating system. The kernel handles the basic functions \
656 of the operating system: memory allocation, process allocation, device \
657 input and output, etc.
658
659 %define common_desc_kernel_smp This kernel relies on in-kernel smp alternatives to switch between up & smp \
660 mode depending on detected hardware. To force the kernel to boot in single \
661 processor mode, use the "nosmp" boot parameter.
662
663 ### Global Requires/Provides
664 %define requires1 bootloader-utils >= 1.16-1
665 %define requires2 dracut >= 046-2
666 %define requires3 kmod >= 12-2
667 %define requires4 sysfsutils >= 2.1.0-16
668 %define requires5 kernel-firmware >= 20190603-1
669 # ldetect-lst with SI/CIK swich from radeon to amdgpu
670 %define requires6 ldetect-lst >= 0.6.25-1
671
672 %define kprovides1 %{kname} = %{kverrel}
673 %define kprovides2 kernel = %{tar_ver}
674 %define kprovides3 alsa = 1.0.26
675 %define kprovides_server drbd-api = 88
676
677 # conflict dkms packages that dont support kernel-5.19
678 %define kconflicts1 dkms-broadcom-wl < 6.30.223.271-64
679 %define kconflicts2 dkms-nvidia-current < 470.141.03-1
680 %define kconflicts3 dkms-nvidia470 < 470.141.03-1
681 %define kconflicts4 dkms-nvidia390 < 390.154-1
682 %define kconflicts5 dkms-virtualbox < 6.1.36-1
683 %define kconflicts6 dkms-xtables-addons < 3.21-1
684 # (tmb) conflict older btrfs-progs to get the new in same transaction and in initrd
685 %define kconflicts8 btrfs-progs < 5.10-1
686 # (tmb) conflict too old radeon-firmware to get the uvd firmwares in initrd
687 %define kconflicts9 radeon-firmware < 20201218-1
688 # (tmb) conflict old firmware to get the firmwares in initrd
689 %define kconflicts10 kernel-firmware-nonfree < 20201230-1
690 # (tmb) conflict old microcode to get updated ones in initrd for early loading
691 %define kconflicts11 microcode < 0.20201118-2
692 # (tmb) conflict old theme to get mga8 theme in initrd
693 %define kconflicts12 mageia-gfxboot-theme < 4.5.14.11-2
694 # (tmb) conflict too old grub2(-efi)
695 %define kconflicts13 grub2 < 2.02.0-15
696 %define kconflicts14 grub2-efi < 2.02.0-15
697 # (tmb) conflict too old efibootmgr
698 %define kconflicts15 efibootmgr < 16-3
699 # (tmb) force new theme in initrd
700 %define kconflicts16 mageia-theme < 8.0-2
701
702 Autoreqprov: no
703
704 # require new gcc & binutils
705 BuildRequires: gcc >= 10.4.0-2
706 BuildRequires: binutils >= 1:2.36.1-1.4
707 #
708 BuildRequires: kmod >= 12-2
709 BuildRequires: bc
710 # for crypto stuff
711 BuildRequires: pkgconfig(openssl)
712 # since 4.16
713 BuildRequires: bison
714 BuildRequires: diffutils
715 BuildRequires: elfutils-devel
716 BuildRequires: flex
717 # for headers_install
718 BuildRequires: rsync
719 # for cpupower
720 %if %{build_cpupower}
721 BuildRequires: pkgconfig(libpci)
722 %endif
723 # for perf
724 %if %{build_perf}
725 BuildRequires: audit-devel
726 BuildRequires: binutils-devel
727 BuildRequires: gtk2-devel
728 BuildRequires: libunwind-devel
729 BuildRequires: newt-devel
730 BuildRequires: python3-devel
731 BuildRequires: zlib-devel
732 BuildRequires: asciidoc
733 BuildRequires: xmlto-notex
734 BuildRequires: perl-devel
735 %if 0%{?mageia} >= 8
736 BuildRequires: systemtap-sdt-devel
737 BuildRequires: babeltrace-devel
738 %else
739 BuildRequires: libbabeltrace-devel
740 %endif
741 %ifarch %{ix86} x86_64
742 BuildRequires: numa-devel
743 %endif
744 %endif
745 %if %{build_bpftool}
746 BuildRequires: python3-docutils
747 BuildRequires: cap-devel
748 %endif
749
750 %description
751 %common_desc_kernel
752 %ifnarch %{arm}
753 %common_desc_kernel_smp
754 %endif
755
756 # mkflavour() name flavour processor
757 # name: the flavour name in the package name
758 # flavour: first parameter of CreateKernel()
759 %define mkflavour() \
760 %package -n %{kname}-%{1}-%{buildrel} \
761 Version: %{fakever} \
762 Release: %{fakerel} \
763 Provides: %kprovides1 %kprovides2 %kprovides3 \
764 %{expand:%%{?kprovides_%{1}:Provides: %{kprovides_%{1}}}} \
765 Provides: %{kname}-%{1} \
766 Requires(pre): %requires1 %requires2 %requires3 %requires4 \
767 Requires: %requires2 %requires5 %requires6 \
768 Conflicts: %kconflicts1 %kconflicts2 %kconflicts3 \
769 Conflicts: %kconflicts4 %kconflicts5 %kconflicts6 \
770 Conflicts: %kconflicts8 %kconflicts9 \
771 Conflicts: %kconflicts10 %kconflicts11 %kconflicts12 \
772 Conflicts: %kconflicts13 %kconflicts14 %kconflicts15 \
773 Conflicts: %kconflicts16 \
774 %if 0%{?mageia} >= 8 \
775 Obsoletes: crda \
776 Obsoletes: crda-devel \
777 Obsoletes: fuse-exfat \
778 %endif \
779 Provides: should-restart = system \
780 Provides: installonlypkg(kernel) \
781 Recommends: iw cpupower microcode \
782 Recommends: %{kname}-%{1}-latest \
783 %ifarch %{ix86} \
784 Conflicts: arch(x86_64) \
785 %endif \
786 Summary: %{expand:%{summary_%(echo %{1} | sed -e "s/-/_/")}} \
787 Group: System/Kernel and hardware \
788 %description -n %{kname}-%{1}-%{buildrel} \
789 %common_desc_kernel %{expand:%{info_%(echo %{1} | sed -e "s/-/_/")}} \
790 %ifnarch %{arm} \
791 %common_desc_kernel_smp \
792 %endif \
793 \
794 %if %build_devel \
795 %package -n %{kname}-%{1}-devel-%{buildrel} \
796 Version: %{fakever} \
797 Release: %{fakerel} \
798 Requires: glibc-devel ncurses-devel make gcc perl \
799 Requires: gcc >= 5.5.0-1 \
800 %ifarch x86_64 \
801 Requires: pkgconfig(libelf) \
802 %endif \
803 Summary: The kernel-devel files for %{kname}-%{1}-%{buildrel} \
804 Group: Development/Kernel \
805 Provides: %{kname}-devel = %{kverrel} \
806 Provides: %{kname}-%{1}-devel \
807 Recommends: %{kname}-%{1}-devel-latest \
808 %ifarch %{ix86} \
809 Conflicts: arch(x86_64) \
810 %endif \
811 %description -n %{kname}-%{1}-devel-%{buildrel} \
812 This package contains the kernel files (headers and build tools) \
813 that should be enough to build additional drivers for \
814 use with %{kname}-%{1}-%{buildrel}. \
815 \
816 If you want to build your own kernel, you need to install the full \
817 %{kname}-source-%{buildrel} rpm. \
818 \
819 %endif \
820 \
821 %if %build_debug \
822 %package -n %{kname}-%{1}-%{buildrel}-debuginfo \
823 Version: %{fakever} \
824 Release: %{fakerel} \
825 Summary: Files with debuginfo for %{kname}-%{1}-%{buildrel} \
826 Group: Development/Debug \
827 Provides: kernel-debug = %{kverrel} \
828 %ifarch %{ix86} \
829 Conflicts: arch(x86_64) \
830 %endif \
831 %description -n %{kname}-%{1}-%{buildrel}-debuginfo \
832 This package contains the files with debuginfo to aid in debug tasks \
833 when using %{kname}-%{1}-%{buildrel}. \
834 \
835 If you need to look at debug information or use some application that \
836 needs debugging info from the kernel, this package may help. \
837 \
838 %endif \
839 \
840 %package -n %{kname}-%{1}-latest \
841 Version: %{kversion} \
842 Release: %{rpmrel} \
843 Summary: Virtual rpm for latest %{kname}-%{1} \
844 Group: System/Kernel and hardware \
845 Requires: %{kname}-%{1}-%{buildrel} \
846 %ifarch %{ix86} \
847 Conflicts: arch(x86_64) \
848 %endif \
849 Obsoletes: vboxadditions-kernel-%{1}-latest \
850 Obsoletes: kernel-tmb-%{1}-latest \
851 %description -n %{kname}-%{1}-latest \
852 This package is a virtual rpm that aims to make sure you always have the \
853 latest %{kname}-%{1} installed... \
854 \
855 %if %build_devel \
856 %package -n %{kname}-%{1}-devel-latest \
857 Version: %{kversion} \
858 Release: %{rpmrel} \
859 Summary: Virtual rpm for latest %{kname}-%{1}-devel \
860 Group: Development/Kernel \
861 Requires: %{kname}-%{1}-devel-%{buildrel} \
862 %ifarch %{ix86} \
863 Conflicts: arch(x86_64) \
864 %endif \
865 Provides: %{kname}-devel-latest \
866 Obsoletes: kernel-tmb-%{1}-devel-latest \
867 %description -n %{kname}-%{1}-devel-latest \
868 This package is a virtual rpm that aims to make sure you always have the \
869 latest %{kname}-%{1}-devel installed... \
870 \
871 %endif \
872 \
873 %posttrans -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-posttrans \
874 %postun -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-postun \
875 \
876 %if %build_devel \
877 %post -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-post \
878 %preun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-preun \
879 %postun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-postun \
880 %endif \
881 \
882 %files -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1} \
883 %files -n %{kname}-%{1}-latest \
884 \
885 %if %build_devel \
886 %files -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1} \
887 %files -n %{kname}-%{1}-devel-latest \
888 %endif \
889 \
890 %if %build_debug \
891 %files -n %{kname}-%{1}-%{buildrel}-debuginfo -f kernel_debug_files.%{1} \
892 %endif
893
894 %ifarch %{ix86}
895 #
896 # kernel-desktop586: i586, smp-alternatives, 4GB
897 #
898 %if %build_desktop586
899 %define summary_desktop586 Linux kernel for desktop use with i586 and less than 4GB RAM
900 %define info_desktop586 This kernel is compiled for desktop use, single or \
901 multiple i586 processor(s)/core(s) and less than 4GB RAM (usually 3-3.5GB \
902 detected, if you need/want to use all 4GB or more, install kernel-server), \
903 using HZ_1000, voluntary preempt, CFS cpu scheduler and cfq i/o scheduler.
904 %mkflavour desktop586
905 %endif
906 %endif
907
908 #
909 # kernel-desktop: i686, smp-alternatives, 64 GB / x86_64 / arm / aarch64
910 #
911 %if %build_desktop
912 %ifarch %{ix86}
913 %define summary_desktop Linux Kernel for desktop use with i686 and up to 64GB RAM
914 %define info_desktop This kernel is compiled for desktop use, single or \
915 multiple i686 processor(s)/core(s) and up to 64GB RAM, using HZ_1000, \
916 voluntary preempt, CFS cpu scheduler and cfq i/o scheduler.
917 %else
918 %define summary_desktop Linux Kernel for desktop use with %{_arch}
919 %define info_desktop This kernel is compiled for desktop use, single or \
920 multiple %{_arch} processor(s)/core(s), using HZ_1000, voluntary preempt, \
921 CFS cpu scheduler and cfq i/o scheduler.
922 %endif
923 %mkflavour desktop
924 %endif
925
926 #
927 # kernel-server: i686, smp-alternatives, 64 GB / x86_64 / aarch64
928 #
929 %if %build_server
930 %ifarch %{ix86}
931 %define summary_server Linux Kernel for server use with i686 & 64GB RAM
932 %define info_server This kernel is compiled for server use, single or \
933 multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using \
934 no preempt, HZ_100, CFS cpu scheduler and cfq i/o scheduler.
935 %else
936 %define summary_server Linux Kernel for server use with %{_arch}
937 %define info_server This kernel is compiled for server use, single or \
938 multiple %{_arch} processor(s)/core(s), using no preempt, HZ_100, \
939 CFS cpu scheduler and cfq i/o scheduler.
940 %endif
941 %mkflavour server
942 %endif
943
944 #
945 # kernel-source
946 #
947 %if %build_source
948 %package -n %{kname}-source-%{buildrel}
949 Version: %{fakever}
950 Release: %{fakerel}
951 Requires: glibc-devel, ncurses-devel, make, gcc, perl, diffutils
952 Summary: The Linux source code for %{kname}-%{buildrel}
953 Group: Development/Kernel
954 Autoreqprov: no
955 Provides: kernel-source = %{kverrel}
956 Buildarch: noarch
957
958 %description -n %{kname}-source-%{buildrel}
959 The %{kname}-source package contains the source code files for the Mageia
960 kernel. Theese source files are only needed if you want to build your
961 own custom kernel that is better tuned to your particular hardware.
962
963 If you only want the files needed to build 3rdparty (nVidia, Ati, dkms-*,...)
964 drivers against, install the *-devel-* rpm that is matching your kernel.
965
966 #
967 # kernel-source-latest: virtual rpm
968 #
969 %package -n %{kname}-source-latest
970 Version: %{kversion}
971 Release: %{rpmrel}
972 Summary: Virtual rpm for latest %{kname}-source
973 Group: Development/Kernel
974 Requires: %{kname}-source-%{buildrel}
975 Buildarch: noarch
976
977 %description -n %{kname}-source-latest
978 This package is a virtual rpm that aims to make sure you always have the
979 latest %{kname}-source installed...
980 %endif
981
982 #
983 # kernel-doc: documentation for the Linux kernel
984 #
985 %if %build_doc
986 %package -n %{kname}-doc
987 Version: %{kversion}
988 Release: %{rpmrel}
989 Summary: Various documentation bits found in the %{kname} source
990 Group: Documentation
991 Buildarch: noarch
992
993 %description -n %{kname}-doc
994 This package contains documentation files from the %{kname} source.
995 Various bits of information about the Linux kernel and the device drivers
996 shipped with it are documented in these files. You also might want install
997 this package if you need a reference to the options that can be passed to
998 Linux kernel modules at load time.
999 %endif
1000
1001 #
1002 # kernel userspace-headers
1003 #
1004 %if %{build_uheaders}
1005 %package -n %{kname}-userspace-headers
1006 Version: %{kversion}
1007 Release: %{rpmrel}
1008 Summary: Linux kernel header files for userspace
1009 Group: System/Kernel and hardware
1010 %rename linux-userspace-headers
1011 Provides: kernel-headers = 1:%{version}-%{release}
1012
1013 %description -n %{kname}-userspace-headers
1014 C header files from the Linux kernel. The header files define structures
1015 and constants that are needed for building most standard programs.
1016
1017 This package is not suitable for building kernel modules.
1018 %endif
1019
1020 #
1021 # kernel/tools
1022 #
1023 %if %{build_perf}
1024 %package -n perf
1025 Version: %{kversion}
1026 Release: %{rpmrel}
1027 Summary: perf tool and the supporting documentation
1028 Group: System/Kernel and hardware
1029
1030 %description -n perf
1031 the perf tool and the supporting documentation.
1032 %endif
1033
1034 %if %{build_cpupower}
1035 %package -n cpupower
1036 Version: %{kversion}
1037 Release: %{rpmrel}
1038 Summary: the cpupower tools
1039 Group: System/Kernel and hardware
1040 Requires(post): rpm-helper >= 0.24.8-1
1041 Requires(preun): rpm-helper >= 0.24.8-1
1042 Obsoletes: cpufreq cpufrequtils
1043
1044 %description -n cpupower
1045 the cpupower tools.
1046
1047 %post -n cpupower
1048 %_post_service cpupower
1049
1050 %preun -n cpupower
1051 %_preun_service cpupower
1052
1053 %package -n cpupower-devel
1054 Version: %{kversion}
1055 Release: %{rpmrel}
1056 Summary: devel files for cpupower
1057 Group: Development/Kernel
1058 Requires: cpupower = %{kversion}-%{rpmrel}
1059 Conflicts: %{_lib}cpufreq-devel
1060
1061 %description -n cpupower-devel
1062 This package contains the development files for cpupower.
1063 %endif
1064
1065 %if %{build_bpftool}
1066 %package -n bpftool
1067 Summary: Inspection and simple manipulation of eBPF programs and maps
1068 Group: System/Kernel and hardware
1069
1070 %description -n bpftool
1071 This package contains the bpftool, which allows inspection and simple
1072 manipulation of eBPF programs and maps.
1073 %endif
1074
1075 %if %{build_libbpf}
1076 %package -n %{_lib}bpf%{bpfmajor}
1077 Summary: The bpf library from kernel source
1078 Group: System/Libraries
1079
1080 %description -n %{_lib}bpf%{bpfmajor}
1081 This package contains the kernel source bpf library.
1082
1083 %package -n %{_lib}bpf-devel
1084 Summary: Developement files for the bpf library from kernel source
1085 Group: Development/Kernel
1086 Requires: %{_lib}bpf%{bpfmajor}
1087
1088 %description -n %{_lib}bpf-devel
1089 This package includes libraries and header files needed for development
1090 of applications which use bpf library from kernel source.
1091 %endif
1092
1093 #
1094 # End packages - here begins build stage
1095 #
1096 %prep
1097 %setup -q -n %top_dir_name -c
1098
1099 cd %src_dir
1100
1101 %autopatch -p1
1102
1103 # PATCH END
1104
1105 #
1106 # Setup Begin
1107 #
1108
1109 # install x86 defconfigs
1110 install -m 644 %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} %{SOURCE15} arch/x86/configs/
1111 # install arm64 defconfigs
1112 install -m 644 %{SOURCE16} %{SOURCE17} arch/arm64/configs/
1113 # install arm defconfigs
1114 install -m 644 %{SOURCE18} arch/arm/configs/
1115
1116 # make sure the kernel has the sublevel we know it has...
1117 LC_ALL=C perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile
1118
1119 # get rid of unwanted files
1120 find . -name '*~' -o -name '*.orig' -o -name '*.append' | %kxargs rm -f
1121
1122 # fix missing exec flag on file introduced in 4.14.10-rc1
1123 chmod 755 tools/objtool/sync-check.sh
1124
1125 %build
1126 # Common target directories
1127 %define _kerneldir /usr/src/kernel-%{kversion}-%{buildrpmrel}
1128 %define _bootdir /boot
1129 %define _modulesdir /lib/modules
1130 %define _efidir %{_bootdir}/efi/mageia
1131
1132 # Directories definition needed for building
1133 %define temp_root %{build_dir}/temp-root
1134 %define temp_source %{temp_root}%{_kerneldir}
1135 %define temp_boot %{temp_root}%{_bootdir}
1136 %define temp_modules %{temp_root}%{_modulesdir}
1137
1138 PrepareKernel() {
1139 name=$1
1140 extension=$2
1141
1142 echo "Make config for kernel $extension"
1143
1144 %smake ARCH=%{target_arch} -s mrproper
1145
1146 if [ "%{target_arch}" == "i386" -o "%{target_arch}" == "x86_64" ]; then
1147 conf_dir=arch/x86/configs
1148 else
1149 conf_dir=arch/%{target_arch}/configs
1150 fi
1151 if [ -z "$name" ]; then
1152 cp $conf_dir/defconfig-%{target_arch}-desktop .config
1153 else
1154 cp $conf_dir/defconfig-%{target_arch}-$name .config
1155 fi
1156
1157 # make sure EXTRAVERSION says what we want it to say
1158 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -$extension/" Makefile
1159
1160 %smake ARCH=%{target_arch} oldconfig
1161 }
1162
1163 BuildKernel() {
1164 KernelVer=$1
1165
1166 echo "Building kernel $KernelVer"
1167
1168 %kmake ARCH=%{target_arch} -s all
1169
1170 # Start installing stuff
1171 install -d %{temp_boot}
1172 install -m 644 System.map %{temp_boot}/System.map-$KernelVer
1173 install -m 644 .config %{temp_boot}/config-$KernelVer
1174 xz -c Module.symvers > %{temp_boot}/symvers-$KernelVer.xz
1175
1176 %ifarch %{arm}
1177 IMAGE=zImage
1178 %else
1179 %ifarch aarch64
1180 IMAGE=Image.gz
1181 %else
1182 IMAGE=bzImage
1183 %endif
1184 %endif
1185 cp -f arch/%{target_arch}/boot/$IMAGE %{temp_boot}/vmlinuz-$KernelVer
1186
1187 %ifarch %{arm} aarch64
1188 install -d %{temp_root}%{_libdir}/linux-$KernelVer/
1189 find arch/%{target_arch}/boot/dts/ -name *.dtb -execdir install -D -m644 {} %{temp_root}%{_libdir}/linux-$KernelVer/{} \;
1190 %endif
1191
1192 # modules
1193 install -d %{temp_modules}/$KernelVer
1194 %smake ARCH=%{target_arch} INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=$KernelVer modules_install
1195 }
1196
1197 SaveDevel() {
1198 devel_flavour=$1
1199
1200 DevelRoot=/usr/src/kernel-%{kversion}-$devel_flavour-%{buildrpmrel}
1201 TempDevelRoot=%{temp_root}$DevelRoot
1202
1203 mkdir -p $TempDevelRoot
1204 for i in $(find . -name 'Makefile*'); do cp -R --parents $i $TempDevelRoot;done
1205 for i in $(find . -name 'Kconfig*' -o -name 'Kbuild*'); do cp -R --parents $i $TempDevelRoot;done
1206 cp -fR include $TempDevelRoot
1207 cp -fR scripts $TempDevelRoot
1208 cp -fR kernel/bounds.c $TempDevelRoot/kernel
1209 cp -fR tools/include $TempDevelRoot/tools/
1210 # needed for selinux
1211 cp -R --parents security/selinux/include/*.h $TempDevelRoot
1212 %ifarch %{arm}
1213 cp -fR arch/%{target_arch}/tools $TempDevelRoot/arch/%{target_arch}/
1214 cp -fR arch/%{target_arch}/kernel/signal.h $TempDevelRoot/arch/%{target_arch}/kernel/
1215 %endif
1216 %ifarch aarch64
1217 cp -fR arch/x86/entry/syscalls/syscall_32.tbl $TempDevelRoot/arch/x86/entry/syscalls/
1218 cp -fR arch/arm64/kernel/vdso/*.{S,sh} $TempDevelRoot/arch/arm64/kernel/vdso/
1219 cp -fR arch/arm64/kernel/vdso/vgettimeofday.c $TempDevelRoot/arch/arm64/kernel/vdso/
1220 cp -fR arch/arm64/tools/{cpucaps,gen-cpucaps.awk,gen-sysreg.awk,sysreg} $TempDevelRoot/arch/arm64/tools/
1221 # aarch64 build wants x86 syscall tables
1222 cp -fR arch/x86/entry/syscalls/syscall_{32,64}.tbl $TempDevelRoot/arch/x86/entry/syscalls/
1223 cp -fR lib/vdso/gettimeofday.c $TempDevelRoot/lib/vdso/
1224 %endif
1225 %ifarch %{ix86} x86_64
1226 cp -fR arch/x86/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/x86/kernel/
1227 cp -fR arch/x86/kernel/asm-offsets_{32,64}.c $TempDevelRoot/arch/x86/kernel/
1228 mkdir -p $TempDevelRoot/arch/x86/kvm/vmx
1229 cp -fR arch/x86/kvm/vmx/*.h $TempDevelRoot/arch/x86/kvm/vmx/
1230 cp -fR arch/x86/kvm/*.h $TempDevelRoot/arch/x86/kvm/
1231 cp -fR arch/x86/lib/insn.c $TempDevelRoot/arch/x86/lib/
1232 cp -fR arch/x86/purgatory/* $TempDevelRoot/arch/x86/purgatory/
1233 cp -fR arch/x86/entry/syscalls/syscall* $TempDevelRoot/arch/x86/entry/syscalls/
1234 cp -fR arch/x86/include $TempDevelRoot/arch/x86/
1235 cp -fR arch/x86/tools $TempDevelRoot/arch/x86/
1236 %else
1237 cp -fR arch/%{target_arch}/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/%{target_arch}/kernel/
1238 for f in $(find arch/%{target_arch} -name include); do cp -fR --parents $f $TempDevelRoot; done
1239 %endif
1240 cp -fR .config Module.symvers $TempDevelRoot
1241
1242 # Needed for truecrypt build (Danny)
1243 cp -fR drivers/md/dm.h $TempDevelRoot/drivers/md/
1244
1245 # needed by include/generated/timeconst.h
1246 cp -fR kernel/time/timeconst.bc $TempDevelRoot/kernel/time/
1247
1248 # Needed for lirc_gpio (#39004)
1249 cp -fR drivers/media/pci/bt8xx/bttv{,p}.h $TempDevelRoot/drivers/media/pci/bt8xx/
1250 cp -fR drivers/media/pci/bt8xx/bt848.h $TempDevelRoot/drivers/media/pci/bt8xx/
1251 cp -fR drivers/media/common/btcx-risc.h $TempDevelRoot/drivers/media/common/
1252
1253 # rtl8812au
1254 mkdir -p $TempDevelRoot/3rdparty/rtl8812au/hal/phydm/
1255 cp -fR 3rdparty/rtl8812au/hal/phydm/phydm.mk $TempDevelRoot/3rdparty/rtl8812au/hal/phydm/
1256
1257 %ifarch x86_64
1258 # orc unwinder needs theese
1259 cp -fR tools/build/Build{,.include} $TempDevelRoot/tools/build
1260 cp -fR tools/build/fixdep.c $TempDevelRoot/tools/build
1261 cp -fR tools/lib/{rbtree.c,ctype.c,str_error_r.c,string.c} $TempDevelRoot/tools/lib
1262 cp -fR tools/lib/subcmd/* $TempDevelRoot/tools/lib/subcmd
1263 cp -fR tools/objtool/* $TempDevelRoot/tools/objtool
1264 cp -fR tools/scripts/utilities.mak $TempDevelRoot/tools/scripts
1265 mkdir -p $TempDevelRoot/tools/arch/x86/tools
1266 cp -fR tools/arch/x86/tools/gen-insn-attr-x86.awk $TempDevelRoot/tools/arch/x86/tools/
1267 mkdir -p $TempDevelRoot/tools/arch/x86/lib
1268 cp -fR tools/arch/x86/lib/{inat.c,insn.c,x86-opcode-map.txt} $TempDevelRoot/tools/arch/x86/lib/
1269 mkdir -p $TempDevelRoot/tools/arch/x86/include/asm
1270 cp -fR tools/arch/x86/include/asm/{asm.h,emulate_prefix.h,inat.h,inat_types.h,insn.h,nops.h,orc_types.h} $TempDevelRoot/tools/arch/x86/include/asm/
1271 %endif
1272
1273 for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 loongarch m32r m68k m68knommu metag microblaze \
1274 mips mn10300 nds32 nios2 openrisc parisc powerpc riscv s390 score sh sparc tile unicore32 xtensa; do
1275 rm -rf $TempDevelRoot/arch/$i
1276 rm -rf $TempDevelRoot/scripts/dtc/include-prefixes/$i
1277 rm -rf $TempDevelRoot/tools/arch/$i
1278 done
1279
1280 %ifnarch %{arm} aarch64
1281 rm -rf $TempDevelRoot/arch/arm*
1282 rm -rf $TempDevelRoot/include/kvm/arm*
1283 rm -rf $TempDevelRoot/include/soc
1284 rm -rf $TempDevelRoot/scripts/dtc/include-prefixes/arm*
1285 rm -rf $TempDevelRoot/tools/arch/arm*
1286 %endif
1287 %ifnarch %{ix86} x86_64
1288 rm -rf $TempDevelRoot/arch/x86
1289 rm -rf $TempDevelRoot/tools/arch/x86
1290 # arch/x86/ras/Kconfig is included by drivers/ras/Kconfig
1291 # and kconfig's source command seems to be evaluated even under a false conditional
1292 mkdir -p $TempDevelRoot/arch/x86/ras
1293 cp -fR arch/x86/ras/Kconfig $TempDevelRoot/arch/x86/ras
1294 %endif
1295
1296 # Clean the scripts tree, and make sure everything is ok (sanity check)
1297 # running prepare+scripts (tree was already "prepared" in build)
1298 pushd $TempDevelRoot >/dev/null
1299 %smake ARCH=%{target_arch} -s prepare scripts
1300 %smake ARCH=%{target_arch} -s clean
1301 popd >/dev/null
1302 rm -f $TempDevelRoot/.config.old
1303
1304 # fix permissions
1305 chmod -R a+rX $TempDevelRoot
1306
1307 # disable mrproper in -devel rpms
1308 patch -p1 --fuzz=0 -d $TempDevelRoot -i %{SOURCE2}
1309
1310 kernel_devel_files=../kernel_devel_files.$devel_flavour
1311
1312
1313 ### Create the kernel_devel_files.*
1314 cat > $kernel_devel_files <<EOF
1315 %dir $DevelRoot
1316 %dir $DevelRoot/arch
1317 %dir $DevelRoot/include
1318 $DevelRoot/3rdparty
1319 $DevelRoot/Documentation
1320 %ifarch %{arm} aarch64
1321 $DevelRoot/arch/arm
1322 $DevelRoot/arch/arm64
1323 %endif
1324 $DevelRoot/arch/um
1325 %ifarch %{ix86} x86_64
1326 $DevelRoot/arch/x86
1327 %else
1328 $DevelRoot/arch/x86/ras
1329 %endif
1330 $DevelRoot/block
1331 $DevelRoot/certs
1332 $DevelRoot/crypto
1333 $DevelRoot/drivers
1334 $DevelRoot/fs
1335 $DevelRoot/include/acpi
1336 $DevelRoot/include/asm-generic
1337 $DevelRoot/include/clocksource
1338 $DevelRoot/include/config
1339 $DevelRoot/include/crypto
1340 $DevelRoot/include/drm
1341 $DevelRoot/include/dt-bindings
1342 $DevelRoot/include/generated
1343 $DevelRoot/include/keys
1344 $DevelRoot/include/kunit
1345 $DevelRoot/include/kvm
1346 $DevelRoot/include/linux
1347 $DevelRoot/include/math-emu
1348 $DevelRoot/include/media
1349 $DevelRoot/include/memory
1350 $DevelRoot/include/misc
1351 $DevelRoot/include/net
1352 $DevelRoot/include/pcmcia
1353 $DevelRoot/include/ras
1354 $DevelRoot/include/rdma
1355 $DevelRoot/include/scsi
1356 %ifarch %{arm} aarch64
1357 $DevelRoot/include/soc
1358 %endif
1359 $DevelRoot/include/sound
1360 $DevelRoot/include/target
1361 $DevelRoot/include/trace
1362 $DevelRoot/include/uapi
1363 $DevelRoot/include/ufs
1364 $DevelRoot/include/vdso/*.h
1365 $DevelRoot/include/video
1366 $DevelRoot/include/xen
1367 $DevelRoot/init
1368 $DevelRoot/io_uring
1369 $DevelRoot/ipc
1370 $DevelRoot/kernel
1371 $DevelRoot/lib
1372 $DevelRoot/mm
1373 $DevelRoot/net
1374 $DevelRoot/samples
1375 $DevelRoot/scripts
1376 $DevelRoot/security
1377 $DevelRoot/sound
1378 $DevelRoot/tools
1379 $DevelRoot/usr
1380 $DevelRoot/virt
1381 $DevelRoot/.config
1382 $DevelRoot/Kbuild
1383 $DevelRoot/Kconfig
1384 $DevelRoot/Makefile
1385 $DevelRoot/Module.symvers
1386 $DevelRoot/arch/Kconfig
1387 EOF
1388
1389
1390 ### Create -devel Post script on the fly
1391 cat > $kernel_devel_files-post <<EOF
1392 if [ -d /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel} ]; then
1393 rm -f /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/{build,source}
1394 ln -sf $DevelRoot /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build
1395 ln -sf $DevelRoot /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/source
1396 fi
1397 EOF
1398
1399
1400 ### Create -devel Preun script on the fly
1401 cat > $kernel_devel_files-preun <<EOF
1402 if [ -L /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build ]; then
1403 rm -f /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build
1404 fi
1405 if [ -L /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/source ]; then
1406 rm -f /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/source
1407 fi
1408 exit 0
1409 EOF
1410
1411 ### Create -devel Postun script on the fly
1412 cat > $kernel_devel_files-postun <<EOF
1413 rm -rf /usr/src/kernel-%{kversion}-$devel_flavour-%{buildrpmrel} >/dev/null
1414 EOF
1415 }
1416
1417 SaveDebug() {
1418 debug_flavour=$1
1419
1420 install -m 644 vmlinux \
1421 %{temp_boot}/vmlinux-%{kversion}-$debug_flavour-%{buildrpmrel}
1422 kernel_debug_files=../kernel_debug_files.$debug_flavour
1423 echo "%{_bootdir}/vmlinux-%{kversion}-$debug_flavour-%{buildrpmrel}" \
1424 >> $kernel_debug_files
1425
1426 find %{temp_modules}/%{kversion}-$debug_flavour-%{buildrpmrel}/kernel \
1427 -name "*.ko" | \
1428 %kxargs -I '{}' objcopy --only-keep-debug '{}' '{}'.debug
1429 find %{temp_modules}/%{kversion}-$debug_flavour-%{buildrpmrel}/kernel \
1430 -name "*.ko" | %kxargs -I '{}' \
1431 sh -c 'cd `dirname {}`; \
1432 objcopy --add-gnu-debuglink=`basename {}`.debug \
1433 --strip-debug `basename {}`'
1434
1435 pushd %{temp_modules}
1436 find %{kversion}-$debug_flavour-%{buildrpmrel}/kernel \
1437 -name "*.ko.debug" > debug_module_list
1438 popd
1439 cat %{temp_modules}/debug_module_list | \
1440 sed 's|\(.*\)|%{_modulesdir}/\1|' >> $kernel_debug_files
1441 cat %{temp_modules}/debug_module_list | \
1442 sed 's|\(.*\)|%exclude %{_modulesdir}/\1|' \
1443 >> ../kernel_exclude_debug_files.$debug_flavour
1444 rm -f %{temp_modules}/debug_module_list
1445 }
1446
1447 CreateFiles() {
1448 kernel_flavour=$1
1449
1450 kernel_files=../kernel_files.$kernel_flavour
1451
1452 ker="vmlinuz"
1453 ### Create the kernel_files.*
1454 cat > $kernel_files <<EOF
1455 %{_bootdir}/System.map-%{kversion}-$kernel_flavour-%{buildrpmrel}
1456 %{_bootdir}/symvers-%{kversion}-$kernel_flavour-%{buildrpmrel}.xz
1457 %{_bootdir}/config-%{kversion}-$kernel_flavour-%{buildrpmrel}
1458 %{_bootdir}/$ker-%{kversion}-$kernel_flavour-%{buildrpmrel}
1459 %dir %{_modulesdir}/%{kversion}-$kernel_flavour-%{buildrpmrel}/
1460 %{_modulesdir}/%{kversion}-$kernel_flavour-%{buildrpmrel}/kernel
1461 %{_modulesdir}/%{kversion}-$kernel_flavour-%{buildrpmrel}/modules.*
1462 %doc README.kernel-sources
1463 %ifarch %arm aarch64
1464 %dir %{_libdir}/linux-%{kversion}-$kernel_flavour-%{buildrpmrel}
1465 %{_libdir}/linux-%{kversion}-$kernel_flavour-%{buildrpmrel}/*.dtb
1466 %endif
1467 EOF
1468
1469 %if %build_debug
1470 cat ../kernel_exclude_debug_files.$kernel_flavour >> $kernel_files
1471 %endif
1472
1473 ### Create kernel Posttrans script
1474 cat > $kernel_files-posttrans <<EOF
1475 %if %build_devel
1476 # create kernel-devel symlinks if matching -devel- rpm is installed
1477 if [ -d /usr/src/kernel-%{kversion}-$kernel_flavour-%{buildrpmrel} ]; then
1478 ln -sf /usr/src/kernel-%{kversion}-$kernel_flavour-%{buildrpmrel} /lib/modules/%{kversion}-$kernel_flavour-%{buildrpmrel}/build
1479 ln -sf /usr/src/kernel-%{kversion}-$kernel_flavour-%{buildrpmrel} /lib/modules/%{kversion}-$kernel_flavour-%{buildrpmrel}/source
1480 fi
1481 %endif
1482 if [ -z "$DURING_INSTALL" ] ; then
1483 if [ -x /usr/sbin/dkms_autoinstaller -a -d /usr/src/kernel-%{kversion}-$kernel_flavour-%{buildrpmrel} ]; then
1484 /usr/sbin/dkms_autoinstaller start %{kversion}-$kernel_flavour-%{buildrpmrel}
1485 fi
1486 fi
1487 /sbin/installkernel %{kversion}-$kernel_flavour-%{buildrpmrel}
1488 pushd /boot > /dev/null
1489 if [ -e initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img ]; then
1490 ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel} vmlinuz-$kernel_flavour
1491 ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel} vmlinuz
1492 ln -sf initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img initrd-$kernel_flavour.img
1493 ln -sf initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img initrd.img
1494 fi
1495 popd > /dev/null
1496 EOF
1497
1498 ### Create kernel Postun script on the fly
1499 cat > $kernel_files-postun <<EOF
1500 pushd /boot > /dev/null
1501 if [ -f "vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel}" ]; then
1502 echo "The kernel is still installed in postun, probably a reinstall, skipping cleanup." >&2
1503 exit
1504 fi
1505 if [ -L vmlinuz-$kernel_flavour ]; then
1506 if [ "$(readlink vmlinuz-$kernel_flavour)" = "vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel}" ]; then
1507 rm -f vmlinuz-$kernel_flavour
1508 fi
1509 fi
1510 if [ -L initrd-$kernel_flavour.img ]; then
1511 if [ "$(readlink initrd-$kernel_flavour.img)" = "initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img" ]; then
1512 rm -f initrd-$kernel_flavour.img
1513 fi
1514 fi
1515 popd > /dev/null
1516 rm -rf /lib/modules/%{kversion}-$kernel_flavour-%{buildrpmrel} >/dev/null
1517 /sbin/kernel_remove_initrd %{kversion}-$kernel_flavour-%{buildrpmrel}
1518 /sbin/installkernel -R %{kversion}-$kernel_flavour-%{buildrpmrel}
1519 if [ -d /var/lib/dkms ]; then
1520 rm -f /var/lib/dkms/*/kernel-%{kversion}-$devel_flavour-%{buildrpmrel}-%{_target_cpu} >/dev/null
1521 rm -rf /var/lib/dkms/*/*/%{kversion}-$devel_flavour-%{buildrpmrel} >/dev/null
1522 rm -f /var/lib/dkms-binary/*/kernel-%{kversion}-$devel_flavour-%{buildrpmrel}-%{_target_cpu} >/dev/null
1523 rm -rf /var/lib/dkms-binary/*/*/%{kversion}-$devel_flavour-%{buildrpmrel} >/dev/null
1524 fi
1525 EOF
1526 }
1527
1528
1529 CreateKernel() {
1530 flavour=$1
1531
1532 PrepareKernel $flavour $flavour-%{buildrpmrel}
1533
1534 BuildKernel %{kversion}-$flavour-%{buildrpmrel}
1535 %if %build_devel
1536 SaveDevel $flavour
1537 %endif
1538 %if %build_debug
1539 SaveDebug $flavour
1540 %endif
1541 CreateFiles $flavour
1542 }
1543
1544
1545 ###
1546 # DO it...
1547 ###
1548
1549
1550 # Create a simulacro of buildroot
1551 rm -rf %{temp_root}
1552 install -d %{temp_root}
1553
1554
1555 # make sure we are in the directory
1556 cd %src_dir
1557
1558 %ifarch %{ix86}
1559 %if %build_desktop586
1560 CreateKernel desktop586
1561 %endif
1562 %endif
1563
1564 %if %build_desktop
1565 CreateKernel desktop
1566 %endif
1567
1568 %if %build_server
1569 CreateKernel server
1570 %endif
1571
1572 # set extraversion to match srpm to get nice version reported by the tools
1573 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile
1574
1575 # build perf
1576 %if %{build_perf}
1577 # perf
1578 %smake -s -C tools/perf NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 \
1579 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 NO_JVMTI=1 prefix=%{_prefix} lib=%{_lib} all
1580 %smake -C tools/perf -s prefix=%{_prefix} man
1581 %endif
1582
1583 %if %{build_cpupower}
1584 # cpupower
1585 # make sure version-gen.sh is executable.
1586 chmod +x tools/power/cpupower/utils/version-gen.sh
1587 %make_build -C tools/power/cpupower CPUFREQ_BENCH=false
1588 %endif
1589
1590 # build bpftool
1591 %if %{build_bpftool}
1592 pushd tools/bpf/bpftool
1593 make
1594 popd
1595 %endif
1596
1597 # build libbpf
1598 %if %{build_libbpf}
1599 pushd tools/lib/bpf
1600 make V=1
1601 popd
1602 %endif
1603
1604 # We don't make to repeat the depend code at the install phase
1605 %if %build_source
1606 PrepareKernel "" %{buildrpmrel}custom
1607 %smake ARCH=%{target_arch} -s mrproper
1608 %endif
1609
1610
1611 ###
1612 ### install
1613 ###
1614 %install
1615 install -m 644 %{SOURCE4} .
1616
1617 cd %src_dir
1618
1619 # Directories definition needed for installing
1620 %define target_source %{buildroot}%{_kerneldir}
1621 %define target_boot %{buildroot}%{_bootdir}
1622 %define target_modules %{buildroot}%{_modulesdir}
1623 %define target_headers %{buildroot}%{_prefix}
1624
1625 # We want to be able to test several times the install part
1626 rm -rf %{buildroot}
1627 cp -a %{temp_root} %{buildroot}
1628
1629 # Create directories infastructure
1630 %if %build_source
1631 install -d %{target_source}
1632
1633 tar cf - . | tar xf - -C %{target_source}
1634 chmod -R a+rX %{target_source}
1635
1636 # we remove all the source files that we don't ship
1637 # first architecture files
1638 for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 loongarch m32r m68k m68knommu metag microblaze \
1639 mips nds32 nios2 openrisc parisc powerpc riscv s390 score sh sh64 sparc tile unicore32 v850 xtensa mn10300; do
1640 rm -rf %{target_source}/arch/$i
1641 rm -rf %{target_source}/scripts/dtc/include-prefixes/$i
1642 rm -rf %{target_source}/tools/arch/$i
1643 rm -rf %{target_source}/tools/testing/selftests/$i
1644 done
1645 %ifnarch %{arm} aarch64
1646 rm -rf %{target_source}/include/kvm/arm*
1647 rm -rf %{target_source}/scripts/dtc/include-prefixes/arm*
1648 rm -rf %{target_source}/tools/arch/arm*
1649 %endif
1650
1651 # other misc files
1652 rm -f %{target_source}/{.clang-format,.config.old,.config.cmd,.lst,.mailmap,.get_maintainer.ignore}
1653 rm -f %{target_source}/{.missing-syscalls.d,.cocciconfig,.gitattributes}
1654 rm -rf %{target_source}/.tmp_depmod/
1655
1656 # more cleaning
1657 pushd %{target_source}
1658 # lots of gitignore files
1659 find -iname ".gitignore" -delete
1660 # clean tools tree
1661 %smake -C tools clean
1662 %smake -C tools/build clean
1663 %smake -C tools/build/feature clean
1664 # dont ship generated vdso.so*
1665 %ifarch aarch64
1666 rm -f arch/arm64/kernel/vdso/vdso.so*
1667 %endif
1668 popd
1669
1670 # nuke last as it gets re-created
1671 rm -f %{target_source}/.cache.mk
1672
1673 #endif %build_source
1674 %endif
1675
1676 # compressing modules
1677 %if %{build_modxz}
1678 find %{target_modules} -name "*.ko" | %kxargs xz -6
1679 %else
1680 find %{target_modules} -name "*.ko" | %kxargs gzip -9
1681 %endif
1682
1683 # We used to have a copy of PrepareKernel here
1684 # Now, we make sure that the thing in the linux dir is what we want it to be
1685 for i in %{target_modules}/*; do
1686 rm -f $i/build $i/source
1687 done
1688
1689 # sniff, if we compressed all the modules, we change the stamp :(
1690 # we really need the depmod -ae here
1691 pushd %{target_modules}
1692 for i in *; do
1693 /sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i
1694 echo $?
1695 done
1696
1697 for i in *; do
1698 pushd $i
1699 echo "Creating modules.description for $i"
1700 modules=`find . -name "*.ko.[g,x]z"`
1701 echo $modules | xargs /sbin/modinfo \
1702 | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!; $name =~ s!.*/!!' > modules.description
1703 popd
1704 done
1705 popd
1706
1707 # need to set extraversion to match srpm again to avoid rebuild
1708 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile
1709
1710 # install userspace-headers
1711 %if %{build_uheaders}
1712 %smake ARCH=%{target_arch} headers_install INSTALL_HDR_PATH=%{target_headers}
1713 # for drakx
1714 cp include/linux/pci_ids.h %{target_headers}/include/linux/
1715 %endif
1716
1717 %if %{build_perf}
1718 # perf tool binary and supporting scripts/binaries
1719 %smake -s -C tools/perf V=1 DESTDIR=%{buildroot} NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 \
1720 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 NO_JVMTI=1 prefix=%{_prefix} lib=%{_lib} install
1721
1722 # perf man pages (note: implicit rpm magic compresses them later)
1723 make -C tools/perf V=1 DESTDIR=%{buildroot} prefix=%{_prefix} install-man
1724
1725 # remove perf files we dont ship
1726 rm -rf %{buildroot}/usr/lib/perf/examples
1727 rm -rf %{buildroot}/usr/lib/perf/include/bpf
1728 rm -rf %{buildroot}/usr/include/perf/perf_dlfilter.h
1729 %endif
1730
1731 %if %{build_cpupower}
1732 make -C tools/power/cpupower DESTDIR=%{buildroot} libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install
1733 rm -f %{buildroot}%{_libdir}/*.{a,la}
1734 %find_lang cpupower
1735 mv cpupower.lang ../
1736 chmod 0755 %{buildroot}%{_libdir}/libcpupower.so*
1737 mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig
1738 install -m644 %{SOURCE50} %{buildroot}%{_unitdir}/cpupower.service
1739 install -m644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/cpupower
1740 %endif
1741
1742 # install bpftool
1743 %if %{build_bpftool}
1744 pushd tools/bpf/bpftool
1745 make DESTDIR=%{buildroot} prefix=%{_prefix} bash_compdir=%{_sysconfdir}/bash_completion.d/ mandir=%{_mandir} install doc-install
1746 popd
1747 %endif
1748
1749 # install libbpf
1750 %if %{build_libbpf}
1751 pushd tools/lib/bpf
1752 make DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} V=1 install install_headers
1753 popd
1754 %endif
1755
1756 ###
1757 ### clean
1758 ###
1759 %clean
1760 rm -rf %{buildroot}
1761
1762
1763 # We don't want to remove this, the whole reason of its existence is to be
1764 # able to do several rpm --short-circuit -bi for testing install
1765 # phase without repeating compilation phase
1766 #rm -rf %{temp_root}
1767
1768 ###
1769 ### source and doc file lists
1770 ###
1771
1772 %if %build_source
1773 %files -n %{kname}-source-%{buildrel}
1774 %doc %{_kerneldir}/LICENSES
1775 %dir %{_kerneldir}
1776 %dir %{_kerneldir}/arch
1777 %dir %{_kerneldir}/include
1778 %{_kerneldir}/3rdparty
1779 %{_kerneldir}/Documentation
1780 %{_kerneldir}/arch/Kconfig
1781 %{_kerneldir}/arch/arm
1782 %{_kerneldir}/arch/arm64
1783 %{_kerneldir}/arch/um
1784 %{_kerneldir}/arch/x86
1785 %{_kerneldir}/block
1786 %{_kerneldir}/certs
1787 %{_kerneldir}/crypto
1788 %{_kerneldir}/drivers
1789 %{_kerneldir}/fs
1790 %{_kerneldir}/include/acpi
1791 %{_kerneldir}/include/asm-generic
1792 %{_kerneldir}/include/clocksource
1793 %{_kerneldir}/include/crypto
1794 %{_kerneldir}/include/drm
1795 %{_kerneldir}/include/dt-bindings
1796 %{_kerneldir}/include/keys
1797 %{_kerneldir}/include/kunit
1798 %{_kerneldir}/include/kvm
1799 %{_kerneldir}/include/linux
1800 %{_kerneldir}/include/math-emu
1801 %{_kerneldir}/include/media
1802 %{_kerneldir}/include/memory
1803 %{_kerneldir}/include/misc
1804 %{_kerneldir}/include/net
1805 %{_kerneldir}/include/pcmcia
1806 %{_kerneldir}/include/ras
1807 %{_kerneldir}/include/rdma
1808 %{_kerneldir}/include/scsi
1809 %{_kerneldir}/include/soc
1810 %{_kerneldir}/include/sound
1811 %{_kerneldir}/include/target
1812 %{_kerneldir}/include/trace
1813 %{_kerneldir}/include/uapi
1814 %{_kerneldir}/include/ufs
1815 %{_kerneldir}/include/vdso/*.h
1816 %{_kerneldir}/include/video
1817 %{_kerneldir}/include/xen
1818 %{_kerneldir}/init
1819 %{_kerneldir}/io_uring
1820 %{_kerneldir}/ipc
1821 %{_kerneldir}/kernel
1822 %{_kerneldir}/lib
1823 %{_kerneldir}/mm
1824 %{_kerneldir}/net
1825 %{_kerneldir}/virt
1826 %{_kerneldir}/samples
1827 %{_kerneldir}/scripts
1828 %{_kerneldir}/security
1829 %{_kerneldir}/sound
1830 %{_kerneldir}/tools
1831 %{_kerneldir}/usr
1832 %{_kerneldir}/COPYING
1833 %{_kerneldir}/CREDITS
1834 %{_kerneldir}/Kbuild
1835 %{_kerneldir}/Kconfig
1836 %{_kerneldir}/MAINTAINERS
1837 %{_kerneldir}/Makefile
1838 %{_kerneldir}/README
1839 %doc README.kernel-sources
1840
1841 %files -n %{kname}-source-latest
1842 %endif
1843
1844 %if %build_doc
1845 %files -n %{kname}-doc
1846 %doc linux-%{tar_ver}/Documentation/*
1847 %endif
1848
1849 %if %build_uheaders
1850 %files -n %{kname}-userspace-headers
1851 %defattr(0644,root,root,0755)
1852 %{_includedir}/asm/
1853 %{_includedir}/asm-generic/
1854 %{_includedir}/drm/
1855 %{_includedir}/linux/
1856 %{_includedir}/misc/
1857 %{_includedir}/mtd/
1858 %{_includedir}/rdma/
1859 %{_includedir}/scsi/
1860 %{_includedir}/sound/
1861 %{_includedir}/video/
1862 %{_includedir}/xen/
1863 %endif
1864
1865 %if %{build_perf}
1866 %files -n perf
1867 %{_bindir}/perf
1868 %{_bindir}/trace
1869 %{_datadir}/perf-core/strace/groups/file
1870 %{_datadir}/perf-core/strace/groups/string
1871 %{_datadir}/doc/perf-tip/tips.txt
1872 %dir %{_libdir}/traceevent
1873 %dir %{_libdir}/traceevent/plugins
1874 %{_libdir}/traceevent/plugins/plugin_*
1875 %dir %{_prefix}/libexec/perf-core
1876 %{_prefix}/libexec/perf-core/*
1877 %{_mandir}/man[1-8]/perf*
1878 %{_sysconfdir}/bash_completion.d/perf
1879 %endif
1880
1881 %if %{build_cpupower}
1882 %files -n cpupower -f cpupower.lang
1883 %config(noreplace) %{_sysconfdir}/sysconfig/cpupower
1884 %{_bindir}/cpupower
1885 %{_datadir}/bash-completion/completions/cpupower
1886 %{_libdir}/libcpupower.so.0
1887 %{_libdir}/libcpupower.so.0.0.1
1888 %{_unitdir}/cpupower.service
1889 %{_mandir}/man[1-8]/cpupower*
1890
1891 %files -n cpupower-devel
1892 %{_libdir}/libcpupower.so
1893 %{_includedir}/cpuidle.h
1894 %{_includedir}/cpufreq.h
1895 %endif
1896
1897 %if %{build_bpftool}
1898 %files -n bpftool
1899 %{_sbindir}/bpftool
1900 %{_sysconfdir}/bash_completion.d/bpftool
1901 %{_mandir}/man8/bpftool-*.8*
1902 %{_mandir}/man8/bpftool.8*
1903 %endif
1904
1905 %if %{build_libbpf}
1906 %files -n %{_lib}bpf%{bpfmajor}
1907 %{_libdir}/libbpf.so.%{bpfmajor}{,.*}
1908
1909 %files -n %{_lib}bpf-devel
1910 %{_libdir}/libbpf.a
1911 %{_libdir}/libbpf.so
1912 %{_libdir}/pkgconfig/libbpf.pc
1913 %{_includedir}/bpf/bpf.h
1914 %{_includedir}/bpf/bpf_core_read.h
1915 %{_includedir}/bpf/bpf_endian.h
1916 %{_includedir}/bpf/bpf_helper_defs.h
1917 %{_includedir}/bpf/bpf_helpers.h
1918 %{_includedir}/bpf/bpf_tracing.h
1919 %{_includedir}/bpf/btf.h
1920 %{_includedir}/bpf/libbpf.h
1921 %{_includedir}/bpf/libbpf_common.h
1922 %{_includedir}/bpf/libbpf_legacy.h
1923 %{_includedir}/bpf/libbpf_version.h
1924 %{_includedir}/bpf/skel_internal.h
1925 %{_includedir}/bpf/usdt.bpf.h
1926 %{_includedir}/bpf/xsk.h
1927 %endif

  ViewVC Help
Powered by ViewVC 1.1.30