/[packages]/cauldron/kernel/current/SPECS/kernel.spec
ViewVC logotype

Contents of /cauldron/kernel/current/SPECS/kernel.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2058375 - (show annotations) (download)
Wed Apr 17 15:52:15 2024 UTC (45 hours, 40 minutes ago) by ghibo
File size: 69134 byte(s)
Update to version 6.6.28
1 # -*- Mode: rpm-spec -*-
2 #
3 # NOTE !!!
4 # (tmb) Do NOT blindly backport this spec to Mageia 8 or older as packages
5 # are renamed and spec is reworked in several incompatible ways...
6 #
7 # This Specfile is based on kernel-tmb spec done by
8 # Thomas Backlund <tmb@mandriva.org>
9 #
10 # The mkflavour() macroization done by Anssi Hannula <anssi@mandriva.org>
11 #
12 # ----------------------------------------------------------------------------
13 # Consult this page for extra docs:
14 #
15 # https://wiki.mageia.org/en/Kernel_update_workflow
16 #
17 # (feel free to adjust the wiki-page when adding or removing features
18 # to the spec file).
19 #
20 # After building a new kernel, remember to push:
21 #
22 # kmod-virtualbox
23 # kmod-xtables-addons
24 # drakx-installer-images (both core and nonfree)
25 # ----------------------------------------------------------------------------
26
27 #
28 # Mageia kernels use kernel.org versioning
29 #
30
31 # Use %versionednamingscheme -> 1 to include versioning into package name, like in mga8 scheme
32 %define versionednamingscheme 1
33
34 %if !%{versionednamingscheme}
35 # kernel base name (for easy renaming of forked builds)
36 %define kname kernel
37 %endif
38
39 %define kernelversion 6
40 # WARNING: when patchlevel is bumped, please update drakx/kernel/list_modules.pm for new modules!!!
41 %define patchlevel 6
42 # sublevel is now used for -stable patches
43 %define sublevel 28
44
45 # Package release
46 %if %{versionednamingscheme}
47 %define mgarel 1
48 %else
49 %define rel 1
50 %endif
51
52 # kernel Makefile extraversion is substituted by
53 # rcX which are either 0 (empty), X (as in rcX)
54 %define rcX 0
55
56 %if %{versionednamingscheme}
57 # kernel base name (also name of srpm)
58 %define kname kernel
59
60 # Patch tarball tag
61 %define ktag mga
62
63 %define rpmtag %{distsuffix}%{mgaver}
64 %endif
65
66 %if %{versionednamingscheme}
67 %if %{rcX}
68 %define rpmrel %mkrel 0.rc%{rcX}.%{mgarel}
69 %else
70 %define rpmrel %mkrel %{mgarel}
71 %endif
72 %else
73 %if %{rcX}
74 %define rpmrel %mkrel 0.rc%{rcX}.%{rel}
75 %else
76 %define rpmrel %mkrel %{rel}
77 %endif
78 %endif
79
80 %if %{versionednamingscheme}
81 # fakerel and fakever never change, they are used to fool
82 # rpm/urpmi/smart and ensure the kernels are installed,
83 # not upgraded so old kernel is not overwritten or removed
84 %define fakever 1
85 %define fakerel %mkrel 1
86 %endif
87
88 # version defines
89 %define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
90 %define kverrel %{kversion}-%{rpmrel}
91
92 # When we are using a rcX patch, the tarball is a sublevel -1
93 %if %{rcX}
94 %if %sublevel
95 %define tar_ver %{kernelversion}.%{patchlevel}
96 %else
97 %define tar_ver %{kernelversion}.%(expr %{patchlevel} - 1)
98 %endif
99 %else
100 %define tar_ver %{kernelversion}.%{patchlevel}
101 %endif
102
103 %if %{versionednamingscheme}
104 # Used for not making too long names for rpms or search paths
105 %if %rcX
106 %define buildrpmrel 0.rc%{rcX}.%{mgarel}%{rpmtag}
107 %else
108 %define buildrpmrel %{mgarel}%{rpmtag}
109 %endif
110 %define buildrel %{kversion}-%{buildrpmrel}
111 %endif
112
113 # Having different top level names for packges means that you have to remove
114 # them by hard :(
115 %define top_dir_name %{kname}-%{_arch}
116
117 %define build_dir ${RPM_BUILD_DIR}/%{top_dir_name}
118 %define src_dir %{build_dir}/linux-%{tar_ver}
119
120 # Disable useless debug rpms...
121 %global _enable_debug_packages %{nil}
122 %global debug_package %{nil}
123 %global __debug_package %{nil}
124 %global __debug_install_post %{nil}
125 %global _build_id_links none
126
127 # no bytecompiling wanted as it breaks build on selftests we dont even ship
128 # for older buildsystems
129 %global _python_bytecompile_build 0
130 # for systems with >= rpm-mageia-setup-2.29-1.mga7
131 %global __brp_python_bytecompile %nil
132
133 # Speed-up package building
134 %global _binary_payload w9T0.zstdio
135
136 # Build defines
137 %define build_doc 1
138 %define build_uheaders 1
139 %define build_source 1
140 %define build_devel 1
141
142 %define build_debug 0
143
144 # Build desktop i586 / 4GB
145 %ifarch %{ix86}
146 %if %{mgaver} >= 10
147 %define build_desktop586 0
148 %else
149 %define build_desktop586 1
150 %endif
151 %endif
152
153 # Build desktop (i686 / 64GB) / x86_64 / arm / aarch64
154 %define build_desktop 1
155
156 # Build server (i686 / 64GB)/x86_64 / aarch64
157 %ifnarch %{arm}
158 %define build_server 1
159 %else
160 %define build_server 0
161 %endif
162
163 # build cpupower
164 %ifnarch %{arm} aarch64
165 %define build_cpupower 1
166 %else
167 %define build_cpupower 0
168 %endif
169
170 # build perf
171 %define build_perf 1
172
173 # bpf
174 %define build_bpftool 1
175 %define build_libbpf 1
176
177 # compress modules with xz
178 %ifnarch %{arm}
179 %define build_modxz 1
180 %else
181 %define build_modxz 0
182 %endif
183 # End of user definitions
184
185 # buildtime override flags
186 %{?_without_desktop586: %global build_desktop586 0}
187 %{?_without_desktop: %global build_desktop 0}
188 %{?_without_server: %global build_server 0}
189 %{?_without_doc: %global build_doc 0}
190 %{?_without_uheaders: %global build_uheaders 0}
191 %{?_without_source: %global build_source 0}
192 %{?_without_devel: %global build_devel 0}
193 %{?_without_debug: %global build_debug 0}
194 %{?_without_perf: %global build_perf 0}
195 %{?_without_cpupower: %global build_cpupower 0}
196 %{?_without_bpftool: %global build_bpftool 0}
197 %{?_without_libbpf: %global build_libbpf 0}
198 %{?_without_modxz: %global build_modxz 0}
199
200 %{?_with_desktop586: %global build_desktop586 1}
201 %{?_with_desktop: %global build_desktop 1}
202 %{?_with_server: %global build_server 1}
203 %{?_with_doc: %global build_doc 1}
204 %{?_with_uheaders: %global build_uheaders 1}
205 %{?_with_source: %global build_source 1}
206 %{?_with_devel: %global build_devel 1}
207 %{?_with_debug: %global build_debug 1}
208 %{?_with_perf: %global build_perf 1}
209 %{?_with_cpupower: %global build_cpupower 1}
210 %{?_with_bpftool: %global build_bpftool 1}
211 %{?_with_libbpf: %global build_libbpf 1}
212 %{?_with_modxz: %global build_modxz 1}
213
214 # For the .nosrc.rpm
215 %define build_nosrc 0
216 %{?_with_nosrc: %global build_nosrc 1}
217
218 %if %(if [ -z "$CC" ] ; then echo 0; else echo 1; fi)
219 %define kmake %make_build CC="$CC"
220 %else
221 %define kmake %make_build
222 %endif
223 # there are places where parallel make don't work
224 %define smake make
225
226 # Parallelize xargs invocations on smp machines
227 %define kxargs xargs %([ -z "$RPM_BUILD_NCPUS" ] \\\
228 && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
229 [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-P $RPM_BUILD_NCPUS")
230
231 # arm(64) arch matching
232 %define target_arch %(echo %{_arch} | sed -e 's/arm.*/arm/' -e 's/aarch64/arm64/')
233
234
235 #
236 # SRC RPM description
237 #
238 Summary: Linux kernel built for Mageia
239 Name: %{kname}
240 Version: %{kversion}
241 Release: %{rpmrel}
242 License: GPLv2
243 Group: System/Kernel and hardware
244 ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
245 ExclusiveOS: Linux
246 URL: https://www.kernel.org/
247
248 ####################################################################
249 #
250 # Sources
251 #
252 ### This is for full SRC RPM
253 Source0: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz
254 Source1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.sign
255 ### This is for stripped SRC RPM
256 %if %build_nosrc
257 NoSource: 0
258 %endif
259 # This is for disabling *config, mrproper, prepare, scripts on -devel rpms
260 Source2: disable-mrproper-in-devel-rpms.patch
261
262 Source4: README.kernel-sources
263
264 # for creating stable queue patchlist
265 Source5: generate-patchlist.sh
266
267 # copy to patched source tree along with the defconfigs and run it
268 Source10: defconfig-updater.sh
269 Source09: defconfig-updater-simple.sh
270 # x86_64 defconfigs
271 Source11: defconfig-x86_64-desktop
272 Source12: defconfig-x86_64-server
273 # i386 defconfigs
274 Source13: defconfig-i386-desktop586
275 Source14: defconfig-i386-desktop
276 Source15: defconfig-i386-server
277 # arm64 defconfigs
278 Source16: defconfig-arm64-desktop
279 Source17: defconfig-arm64-server
280 # arm defconfigs
281 Source18: defconfig-arm-desktop
282
283 # config and systemd service file from fedora
284 Source50: cpupower.service
285 Source51: cpupower.config
286
287 ####################################################################
288 #
289 # Patches
290
291 #
292 # Patch0 to Patch10 are for core kernel upgrades.
293 #
294
295 %if %sublevel
296 Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{sublevel}.xz
297 %endif
298 %if %{rcX}
299 # (tmb) Created with:
300 # wget https://git.kernel.org/torvalds/p/v5.10-rc7/v5.9 -O patch-5.10-rc7
301 # xz -6e patch-5.10-rc7
302 Patch2: patch-%{kernelversion}.%{patchlevel}-rc%{rcX}.xz
303 %endif
304
305 ###
306 ### Stable Queue coalesced in one single Patch
307 ###
308
309 #
310 # stable-queue coalesced into a single patch
311 #Patch0100: stable-queue-coalesced-6.6-20240316.patch
312
313 ###
314 ### Stable Queue can be big
315 ### Patches from 100-999
316 ###
317
318 ### add patches here by copying contents of kernel matching queue-x.y from:
319 ### https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/
320 ### to SOURCES, generate patchlist with generate-patchlist.sh and paste it here
321 ###
322
323 ###
324 ### Arch
325 ### Patches from 1000
326 ###
327
328 # laptop needing pci=assign-busses (#18989, needs to be submitted upstream)
329 Patch1000: x86-pci-toshiba-equium-a60-assign-busses.patch
330
331 # If users choose a bad video mode, allow to jump to
332 # a working one (TTL: forever)
333 Patch1001: x86-boot-video-80x25-if-break.patch
334
335 # Allow poweroff on UP machines running SMP kernels
336 Patch1005: x86-default_poweroff_up_machines.patch
337
338 # raise vmalloc to fix https://bugs.mageia.org/show_bug.cgi?id=904
339 Patch1010: x86-increase-default-minimum-vmalloc-area-by-64MB-to-192MB.patch
340
341 # slows down boot
342 Source1015: Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch
343
344 # AMD
345 Patch1020: arch-x86-set-l2-cache-id-on-amd-processors.patch
346 Patch1021: x86-documentation-add-documentation-about-cluster.patch
347
348 # temporarily disabled (see bug#32082)
349 Source1030: sched-fair-Multi-LLC-select_idle_sibling.patch
350
351 # temporarily disabled (see bug#32082)
352 Source1050: x86-fpu-xstate-Fix-PKRU-covert-channel.patch
353
354 ###
355 ### ACPI
356 ###
357
358 # CLEVO M360S acpi irq workaround
359 Patch1100: acpi-CLEVO-M360S-disable_acpi_irq.patch
360
361 # Clevo M720SR freezes with C3
362 Patch1105: acpi-processor-M720SR-limit-to-C2.patch
363
364 ###
365 ### Block
366 ###
367
368 # FIXME: Don't know know why this is needed
369 Patch1200: scsi-megaraid-new-sysfs-name.patch
370
371 # adds aliases to support upgrade from old dm-raid45 patch
372 Patch1215: dm-raid-aliases.patch
373
374 # [disable floppy autoloading (mga #4696)]
375 # disable this patch as breaks resume from suspend (see bug #31695)
376 Source1220: block-floppy-disable-pnp-modalias.patch
377
378 ###
379 ### bpf
380 ###
381
382 ###
383 ### Crypto
384 ###
385
386 ###
387 ### cpufreq
388 ###
389
390 ###
391 ### dma
392 ###
393
394 ###
395 ### File-system
396 ###
397
398 # jbd2
399
400 ###
401 ### FireWire
402 ###
403
404 # adding module aliases to ease upgrade from ieee1394
405 Patch1400: firewire-ieee1394-module-aliases.patch
406
407 ###
408 ### Firmware
409 ###
410
411 ###
412 ### GPU/DRM
413 ###
414
415 # mga compat option
416 #Patch1500: drm-gpu-drm-treat-nokmsboot-as-nomodeset.patch
417
418 # Fix problems with DRM an libvibrant (https://bugs.mageia.org/show_bug.cgi?id=32235)
419 # (to be reviewed since 6.6.9)
420 Source1501: 0001-Revert-drm-amd-display-don-t-enable-DRM-CRTC-degamma.patch
421
422 # amdgpu
423 # switch SI and CIK from radeon to amdgpu
424 Patch1520: drm-amdgpu-SI-and-CIK-enabled-by-default.patch
425
426 # i915
427 # new Q57 Host Bridge id
428 Patch1530: char-agp-intel-new-Q57-id.patch
429
430 # https://bugzilla.kernel.org/show_bug.cgi?id=206653#c19
431 Patch1552: i2c_nvidia_gpu-change-err-into-info.patch
432
433 # https://bugzilla.redhat.com/show_bug.cgi?id=2071209
434 Patch1553: 0001-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch
435
436 # EVDI DisplayLink patchset (from https://github.com/DisplayLink/evdi)
437 Patch1560: 0001-import-evdi-driver-1.14.2.patch
438
439 ###
440 ### gpio
441 ###
442
443 ###
444 ### hwmon
445 ###
446
447 ###
448 ### i2c
449 ###
450
451 ###
452 ### io_uring
453 ###
454
455 ###
456 ### iommu
457 ###
458
459 ###
460 ### Input
461 ###
462
463 ###
464 ### HID
465 ###
466
467 # surface bits
468 # https://github.com/linux-surface/kernel/
469 Patch1751: 0002-surface3-oemb-add-DMI-matches-for-Surface-3-with-bro.patch
470 Patch1752: 0003-mwifiex-Add-quirk-resetting-the-PCI-bridge-on-MS-Sur.patch
471 Patch1753: 0004-mwifiex-pcie-disable-bridge_d3-for-Surface-gen4.patch
472 Patch1754: 0005-Bluetooth-btusb-Lower-passive-lescan-interval-on-Mar.patch
473 Patch1755: 0006-ath10k-Add-module-parameters-to-override-board-files.patch
474 Patch1756: 0007-misc-mei-Add-missing-IPTS-device-IDs.patch
475 Patch1757: 0008-iommu-ipts-use-IOMMU-passthrough-mode-for-IPTS.patch
476 Patch1758: 0009-hid-Add-support-for-Intel-Precise-Touch-and-Stylus.patch
477 Patch1759: 0010-iommu-intel-Disable-source-id-verification-for-ITHC.patch
478 Patch1760: 0011-hid-Add-support-for-Intel-Touch-Host-Controller.patch
479 Patch1761: 0012-Update-ITHC-from-module-repo.patch
480 Patch1762: 0013-platform-surface-aggregator_registry-Add-support-for.patch
481 Patch1763: 0014-platform-surface-aggregator_registry-Add-support-for.patch
482 Patch1764: 0015-i2c-acpi-Implement-RawBytes-read-access.patch
483 Patch1765: 0016-platform-surface-Add-driver-for-Surface-Book-1-dGPU-.patch
484 Patch1766: 0017-Input-soc_button_array-support-AMD-variant-Surface-d.patch
485 Patch1767: 0018-platform-surface-surfacepro3_button-don-t-load-on-am.patch
486 Patch1768: 0019-USB-quirks-Add-USB_QUIRK_DELAY_INIT-for-Surface-Go-3.patch
487 Patch1769: 0020-hid-multitouch-Turn-off-Type-Cover-keyboard-backligh.patch
488 Patch1770: 0021-hid-multitouch-Add-support-for-surface-pro-type-cove.patch
489 Patch1771: 0023-platform-surface-gpe-Add-support-for-Surface-Pro-9.patch
490 Patch1772: 0024-ACPI-delay-enumeration-of-devices-with-a-_DEP-pointi.patch
491 Patch1773: 0025-iommu-intel-ipu-use-IOMMU-passthrough-mode-for-Intel.patch
492 Patch1774: 0026-platform-x86-int3472-Enable-I2c-daisy-chain.patch
493 Patch1775: 0027-platform-x86-int3472-Remap-reset-GPIO-for-INT347E.patch
494 Patch1776: 0028-media-i2c-Clarify-that-gain-is-Analogue-gain-in-OV72.patch
495 Patch1777: 0029-media-v4l2-core-Acquire-privacy-led-in-v4l2_async_re.patch
496 Patch1778: 0030-platform-x86-int3472-Add-MFD-cell-for-tps68470-LED.patch
497 Patch1779: 0031-include-mfd-tps68470-Add-masks-for-LEDA-and-LEDB.patch
498 Patch1780: 0032-leds-tps68470-Add-LED-control-for-tps68470.patch
499 Patch1781: 0033-ACPI-Add-quirk-for-Surface-Laptop-4-AMD-missing-irq-.patch
500 Patch1782: 0034-ACPI-Add-AMD-13-Surface-Laptop-4-model-to-irq-7-over.patch
501 Patch1783: 0035-acpi-allow-usage-of-acpi_tad-on-HW-reduced-platforms.patch
502 Patch1784: 0036-platform-surface-aggregator_registry-add-entry-for-f.patch
503 Patch1785: 0037-hwmon-add-fan-speed-monitoring-driver-for-Surface-de.patch
504 Patch1786: 0038-hwmon-Add-thermal-sensor-driver-for-Surface-Aggregat.patch
505 Patch1787: 0039-hwmon-surface_temp-Add-support-for-sensor-names.patch
506 Patch1788: 0040-platform-surface-aggregator_registry-Add-support-for.patch
507 #
508 Patch1799: 0001-fix-size_t-printf-arguments.patch
509
510 # amd_sfh
511 Patch1800: hid-amd_sfh-check-that-sensors-are-enabled-before-set-get-report.patch
512
513 ###
514 ### kernel
515 ###
516
517 ###
518 ### MFD
519 ###
520
521 ###
522 ### misc
523 ###
524
525 ###
526 ### MM
527 ###
528
529 ###
530 ### Network
531 ###
532
533 # SiS 190 fixes
534 Patch1900: net-sis190-fix-list-usage.patch
535
536 # netfilter IFWLOG support
537 Patch1910: net-netfilter-IFWLOG.patch
538 Patch1911: net-netfilter-IFWLOG-mdv.patch
539 Patch1912: net-netfilter-IFWLOG-2.6.35-buildfix.patch
540 Patch1913: net-netfilter-IFWLOG-2.6.37-buildfix.patch
541 Patch1914: net-ipv4-netfilter-ipt_IFWLOG-3.6-buildfix.patch
542 Patch1915: net-netfilter-IFWLOG-3.7-buildfix.patch
543 Patch1916: net-netfilter-IFWLOG-remove-unused-label.patch
544 Patch1917: net-netfilter-ipt_IFWLOG-4.12-buildfix.patch
545 Patch1918: net-netfilter-IFWLOG-5.0-buildfix.patch
546
547 # netfilter psd support
548 Patch1920: net-netfilter-psd.patch
549 Patch1921: net-netfilter-psd-mdv.patch
550 Patch1922: net-netfilter-psd-2.6.35-buildfix.patch
551 Patch1923: net-netfilter-psd-fix-redefines.patch
552
553 # rtw88 wifi
554 # add alias for the replaced r8822be staging driver
555 Patch1930: net-wireless-rtw88-add-r8822be-alias.patch
556 # add alias for the replaced 8723de 3rdparty driver
557 Patch1931: net-wireless-rtw88-add-8723de-alias.patch
558
559 # iwlfiwi
560 Patch1980: net-wireless-iwlwifi-add-new-pci-id-for-6235.patch
561 Patch1981: wifi-iwlwifi-pcie-add-support-for-AX101NGW.patch
562 Source1982: iwlwifi-cfg-Add-missing-MODULE_FIRMWARE-for-pnvm.patch
563
564 ###
565 ### PCI
566 ###
567
568 ###
569 ### pinctrl
570 ###
571
572 ###
573 ### Platform
574 ###
575
576 # Allow access to Shuttle WMI interface controls
577 # (Mainly allow turning on/off webcam and wireless on Shuttle DA18IE and DA18IM)
578 Patch2050: platform-x86-add-shuttle-wmi-driver.patch
579 Patch2051: platform-x86-shuttle-wmi-drop-devinit-exit.patch
580 Patch2052: platform-x86-shuttle-wmi-4.2-buildfix.patch
581 Patch2053: platform-x86-shuttle-wmi-4.13-buildfix.patch
582 Patch2054: platform-x86-shuttle-wmi-kernel-5.5.patch
583
584 ###
585 ### PM
586 ###
587
588 ###
589 ### Sound
590 ###
591
592 ###
593 ### SPI
594 ###
595
596 ###
597 ### Staging
598 ###
599
600 # add rtl8812 support (mga#21043)
601 # from https://github.com/aircrack-ng/rtl8812au.git
602 Patch2200: staging-rtl8812au.patch
603 Patch2201: staging-rtl8812au-rename.patch
604 Patch2202: staging-rtl8812au-Kconfig-Makefile.patch
605 Patch2203: staging-rtl8812au-20231117.patch
606 # bug mga#31965
607 Patch2204: 0001-Pull-device-0x0821-from-list-of-device-supported-by-.patch
608
609 ###
610 ### Thermal
611 ###
612
613 ###
614 ### Thunderbolt
615 ###
616
617 ###
618 ### tpm
619 ###
620
621 # (to be reviewed since 6.6.9)
622 Source2282: tpm-tpm_tis-Disable-interrupts-categorically-for-Lenovo.patch
623
624 ###
625 ### USB
626 ###
627
628 Patch2300: hid-usbhid-IBM-BladeCenterHS20-quirk.patch
629
630 Patch2310: usb-storage-unusual_devs-add-id.patch
631 Patch2311: usb-storage-unusual_devs-add-id-2.6.37-buildfix.patch
632
633 ###
634 ### V4L
635 ###
636
637 # pwc driver name in /proc/bus/devices, /sys fix and "advertisement" removal
638 Patch2400: media-usb-pwc-lie-in-proc-usb-devices.patch
639
640 ###
641 ### Video
642 ###
643
644 # Mageia framebuffer boot logo
645 Patch2500: video-mageia-logo.patch
646
647 ###
648 ### Virt
649 ###
650
651 # fix gcc-10 build
652 Patch2550: KVM-squelch-uninitialized-variable-warning.patch
653
654 ###
655 ### Tools
656 ###
657
658 # wipe powerpc reference so we can nuke dangling symlinks (mga#17676)
659 # to be reviewed since 6.6.9
660 Source2600: tools-testing-selftest-Makefile-remove-powerpc-reference.patch
661
662 # fix perf build
663 # to be reviewed since 6.6.9
664 Source2605: tools-perf-ui-include-slang.patch
665
666 ###
667 ### UAPI
668 ###
669
670 Patch2700: uapi-avoid-namespace-conflict-in-linux-posix_types.h.patch
671
672 ###
673 ### Python fixes
674 ###
675 Patch4000: linux-6.5-python3.patch
676
677 ###
678 ### TTY
679 ###
680
681 # broken rtla cleaner
682 Patch6000: hack-broken-rtla-cleaner.patch
683
684 # build binder_linux as module instead of builtin (from debian)
685 Patch6001: android-enable-building-ashmem-and-binder-as-modules.patch
686 Patch6002: export-symbols-needed-by-android-drivers.patch
687 # still export some missed symbol for binder_linux
688 Patch6003: export-symbols-needed-by-android-drivers-ipc-ns.patch
689
690 ### Fixes from FC kernel
691 # Inspur Advantech PCI ids
692 Patch7000: 0001-scsi-smartpqi-add-inspur-advantech-ids.patch
693 # Vulcan AHCI PCI bar (aarch64)
694 Patch7001: 0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch
695
696 ###
697 ### Potpourri fixes from other distro kernels
698 ###
699
700 ### misc
701 Patch20301: 0001-Use-BFQ-as-elevator-for-SQ-devices.patch
702
703 ### from opensuse
704 Patch29000: ACPI-video-Add-backlight-native-DMI-quirk-for-Lenovo.patch
705 Patch29001: Input-elan_i2c-Add-deny-list-for-Lenovo-Yoga-Slim-7.patch
706 Patch29003: ALSA-hda-cs35l41-Add-notification-support-into-compo.patch
707 Patch29004: ALSA-hda-realtek-Support-ACPI-Notification-framework.patch
708 Patch29005: ALSA-hda-cs35l41-Support-mute-notifications-for-CS35.patch
709 Patch29006: ALSA-hda-cs35l41-Add-read-only-ALSA-control-for-forc.patch
710 Patch29007: ASoC-cs35l41-Make-use-of-dev_err_probe.patch
711 Patch29008: ASoC-cs35l41-Use-modern-pm_ops.patch
712 Patch29009: ALSA-hda-cs35l41-Consistently-use-dev_err_probe.patch
713 Patch29010: ALSA-hda-cs35l41-Use-reset-label-to-get-GPIO-for-HP-.patch
714 Patch29011: ALSA-hda-cs35l41-Assert-reset-before-system-suspend.patch
715 Patch29012: ALSA-hda-cs35l41-Assert-Reset-prior-to-de-asserting-.patch
716 Patch29013: ALSA-hda-cs35l41-Run-boot-process-during-resume-call.patch
717 Patch29014: ALSA-hda-cs35l41-Force-a-software-reset-after-hardwa.patch
718 Patch29015: ALSA-hda-cs35l41-Do-not-unload-firmware-before-reset.patch
719 Patch29016: ALSA-hda-cs35l41-Check-CSPL-state-after-loading-firm.patch
720 Patch29017: ASoC-cs35l41-Detect-CSPL-errors-when-sending-CSPL-co.patch
721 Patch29018: ALSA-hda-cs35l41-mark-cs35l41_verify_id-static.patch
722 Patch29019: ALSA-hda-cs35l41-Fix-missing-error-code-in-cs35l41_s.patch
723
724 ### debian/ubuntu
725 Patch30005: 2838-ata-ahci-Add-Intel-Alder-Lake-P-AHCI-controller-to-l.patch
726 Patch30006: 2905-ASoC-Intel-soc-acpi-intel-rpl-match-add-rt711-l0-rt1.patch
727 Patch30007: 2923-ASoC-Intel-soc-acpi-intel-mtl-match-add-rt713-rt1316.patch
728 Patch30008: 2925-ASoC-Intel-sof_sdw_rt712_sdca-construct-cards-compon.patch
729 Patch30009: 2926-ASoC-Intel-soc-acpi-rt713-rt1316-no-sdw-dmic-config.patch
730 Patch30010: 3376-drm-i915-rpl-Update-pci-ids-for-RPL-P-U.patch
731
732 # from fedora kernel
733 Patch31000: 0575-ACPI-APEI-arm64-Ignore-broken-HPE-moonshot-APEI-supp.patch
734 Source31001: 0577-ACPI-irq-Workaround-firmware-issue-on-X-Gene-based-m.patch
735 Source31002: 0578-aarch64-acpi-scan-Fix-regression-related-to-X-Gene-U.patch
736 Patch31003: 0582-ahci-thunderx2-Fix-for-errata-that-affects-stop-engi.patch
737 Patch31004: 0584-ipmi-do-not-configure-ipmi-for-HPE-m400.patch
738 Patch31005: 0585-iommu-arm-smmu-workaround-DMA-mode-issues.patch
739 Patch31006: 0586-Add-efi_status_to_str-and-rework-efi_status_to_err.patch
740 Patch31007: 0587-Make-get_cert_list-use-efi_status_to_str-to-print-er.patch
741 Patch31008: 0593-Input-rmi4-remove-the-need-for-artificial-IRQ-in-cas.patch
742 Patch31009: 3929-scsi-sd-Add-probe_type-module-parameter-to-allow-syn-rediff.patch
743
744 # from popos kernel
745 Patch32000: 0014-Mixer-Maps-Add-alternate-ALC4080.patch
746 Patch32002: 0016-ALSA-hda-Improve-3.5mm-hotplug-w-ROG-strix-B550.patch
747 Patch32003: 0017-ALSA-hda-conexant-add-a-new-hda-codec-CX11970.patch
748
749 ### BORE scheduler for better latency on desktop (https://github.com/firelzrd/bore-scheduler)
750 Patch40000: 0001-linux6.6.y-bore5.0.3.patch
751
752 #
753 #END
754 ####################################################################
755
756 # Defines for the things that are needed for all the kernels
757 #
758 %define common_desc_kernel The kernel package contains the Linux kernel (vmlinuz), the core of your \
759 Mageia operating system. The kernel handles the basic functions \
760 of the operating system: memory allocation, process allocation, device \
761 input and output, etc.
762
763 %define common_desc_kernel_smp This kernel relies on in-kernel smp alternatives to switch between up & smp \
764 mode depending on detected hardware. To force the kernel to boot in single \
765 processor mode, use the "nosmp" boot parameter.
766
767 ### Global Requires/Provides
768 %define requires1 bootloader-utils >= 1.16-1
769 %define requires2 dracut >= 046-2
770 %define requires3 kmod >= 12-2
771 %define requires4 sysfsutils >= 2.1.0-16
772 %define requires5 kernel-firmware >= 20190603-1
773 # ldetect-lst with SI/CIK swich from radeon to amdgpu
774 %define requires6 ldetect-lst >= 0.6.25-1
775
776 %define kprovides1 %{kname} = %{kverrel}
777 %define kprovides2 kernel = %{tar_ver}
778 %define kprovides3 alsa = 1.0.26
779 %define kprovides_server drbd-api = 88
780
781 # conflict dkms packages that dont support kernel-6.2
782 %define kconflicts1 dkms-broadcom-wl < 6.30.223.271-66
783 %define kconflicts2 dkms-nvidia-current < 525.89.02-1
784 %define kconflicts3 dkms-nvidia470 < 470.161.03-2
785 # EOL upstream 12/2022
786 %define kconflicts4 dkms-nvidia390 < 390.157-2
787 %define kconflicts5 dkms-virtualbox < 7.0.6-1
788 %define kconflicts6 dkms-xtables-addons < 3.23-2
789 # (tmb) conflict older btrfs-progs to get the new in same transaction and in initrd
790 %define kconflicts7 btrfs-progs < 6.2.2-1
791 # (tmb) conflict too old radeon-firmware to get the uvd firmwares in initrd
792 %define kconflicts8 radeon-firmware < 20230310-1
793 # (tmb) conflict old firmware to get the firmwares in initrd
794 %define kconflicts9 kernel-firmware-nonfree < 20230320-1
795 # (tmb) conflict old microcode to get updated ones in initrd for early loading
796 %define kconflicts10 microcode < 0.20230214-1
797 # (tmb) conflict old theme to get mga8 theme in initrd
798 %define kconflicts11 mageia-gfxboot-theme < 4.5.14.11-2
799 # (tmb) conflict too old grub2(-efi)
800 %define kconflicts12 grub2 < 2.02.0-15
801 %define kconflicts13 grub2-efi < 2.02.0-15
802 # (tmb) conflict too old efibootmgr
803 %define kconflicts14 efibootmgr < 16-3
804 # (tmb) force new theme in initrd
805 %define kconflicts15 mageia-theme < 8.0-2
806 # dkms-anbox < 0.0.3-5 can't coexist with builtin one
807 %define kconflicts16 dkms-anbox < 0.0.3-5
808
809 Autoreqprov: no
810
811 BuildRequires: gcc >= 12.2.1-0.20230121.1
812 BuildRequires: binutils >= 1:2.40-1
813 BuildRequires: kmod >= 12-2
814 BuildRequires: bc
815 BuildRequires: gawk >= 5.2.0-4
816 # for crypto stuff
817 BuildRequires: pkgconfig(openssl)
818 # since 4.16
819 BuildRequires: bison
820 BuildRequires: diffutils
821 BuildRequires: dwarves
822 BuildRequires: elfutils-devel
823 BuildRequires: flex
824 # for headers_install
825 BuildRequires: rsync
826 # for cpupower
827 %if %{build_cpupower}
828 BuildRequires: pkgconfig(libpci)
829 %endif
830 # for perf
831 %if %{build_perf}
832 BuildRequires: audit-devel
833 BuildRequires: binutils-devel
834 BuildRequires: gtk2-devel
835 BuildRequires: libunwind-devel
836 BuildRequires: newt-devel
837 BuildRequires: python3-devel
838 BuildRequires: zlib-devel
839 BuildRequires: asciidoc
840 BuildRequires: xmlto-notex
841 BuildRequires: perl-devel
842 BuildRequires: systemtap-sdt-devel
843 BuildRequires: babeltrace-devel
844 %ifarch %{ix86} x86_64
845 BuildRequires: numa-devel
846 %endif
847 %endif
848 %if %{build_bpftool}
849 BuildRequires: python3-docutils
850 BuildRequires: cap-devel
851 %endif
852
853 %description
854 %common_desc_kernel
855 %ifnarch %{arm}
856 %common_desc_kernel_smp
857 %endif
858
859 # mkflavour() name flavour processor
860 # name: the flavour name in the package name
861 # flavour: first parameter of CreateKernel()
862 %define mkflavour() \
863 %if %{versionednamingscheme} \
864 %package -n %{kname}-%{1}-%{buildrel} \
865 Version: %{fakever} \
866 Release: %{fakerel} \
867 %else \
868 %package -n %{kname}-%{1} \
869 Version: %{kversion} \
870 Release: %{rpmrel} \
871 %endif \
872 Summary: %{expand:%{summary_%(echo %{1} | sed -e "s/-/_/")}} \
873 Group: System/Kernel and hardware \
874 Provides: should-restart = system \
875 Provides: installonlypkg(kernel) \
876 %if %{versionednamingscheme} \
877 Provides: %{kname}-%{1} \
878 Recommends: %{kname}-%{1}-latest \
879 %else \
880 Provides: %{kname}-%{1}-%{kverrel} \
881 %endif \
882 Provides: %kprovides1 %kprovides2 %kprovides3 \
883 %{expand:%%{?kprovides_%{1}:Provides: %{kprovides_%{1}}}} \
884 Requires(pre): %requires1 %requires2 %requires3 %requires4 \
885 Requires: %requires2 %requires5 %requires6 \
886 Conflicts: %kconflicts1 %kconflicts2 %kconflicts3 \
887 Conflicts: %kconflicts4 %kconflicts5 %kconflicts6 \
888 Conflicts: %kconflicts7 %kconflicts8 %kconflicts9 \
889 Conflicts: %kconflicts10 %kconflicts11 %kconflicts12 \
890 Conflicts: %kconflicts13 %kconflicts14 %kconflicts15 \
891 Conflicts: %kconflicts16 \
892 %ifarch %{ix86} \
893 Conflicts: arch(x86_64) \
894 %endif \
895 Recommends: iw cpupower microcode \
896 %if %{versionednamingscheme} \
897 %description -n %{kname}-%{1}-%{buildrel} \
898 %else \
899 %description -n %{kname}-%{1} \
900 %endif \
901 %common_desc_kernel %{expand:%{info_%(echo %{1} | sed -e "s/-/_/")}} \
902 %ifnarch %{arm} \
903 %common_desc_kernel_smp \
904 %endif \
905 \
906 %if %build_devel \
907 %if %{versionednamingscheme} \
908 %package -n %{kname}-%{1}-devel-%{buildrel} \
909 Version: %{fakever} \
910 Release: %{fakerel} \
911 Summary: The kernel-devel files for %{kname}-%{1}-%{buildrel} \
912 %else \
913 %package -n %{kname}-%{1}-devel \
914 Version: %{kversion} \
915 Release: %{rpmrel} \
916 Summary: The kernel-devel files for %{kname}-%{1}-%{kverrel} \
917 %endif \
918 %if %{versionednamingscheme} \
919 Provides: %{kname}-devel = %{kverrel} \
920 Provides: %{kname}-%{1}-devel \
921 Recommends: %{kname}-%{1}-devel-latest \
922 %else \
923 Provides: installonlypkg(kernel) \
924 Provides: kernel-devel = %{kverrel} \
925 Provides: %{kname}-%{1}-devel-%{kverrel} \
926 %endif \
927 Group: Development/Kernel \
928 Requires: glibc-devel ncurses-devel make gcc perl \
929 Requires: gcc \
930 %ifarch x86_64 \
931 Requires: pkgconfig(libelf) \
932 %endif \
933 %ifarch %{ix86} \
934 Conflicts: arch(x86_64) \
935 %endif \
936 %if %{versionednamingscheme} \
937 %description -n %{kname}-%{1}-devel-%{buildrel} \
938 %else \
939 %description -n %{kname}-%{1}-devel \
940 %endif \
941 This package contains the kernel files (headers and build tools) \
942 that should be enough to build additional drivers for \
943 %if %{versionednamingscheme} \
944 use with %{kname}-%{1}-%{buildrel}. \
945 %else \
946 use with %{kname}-%{1}-%{kverrel}. \
947 %endif \
948 \
949 If you want to build your own kernel, you need to install the full \
950 %if %{versionednamingscheme} \
951 %{kname}-source-%{buildrel} rpm. \
952 %else \
953 %{kname}-source rpm. \
954 %endif \
955 %endif \
956 \
957 %if %build_debug \
958 %if %{versionednamingscheme} \
959 %package -n %{kname}-%{1}-%{buildrel}-debuginfo \
960 Version: %{fakever} \
961 Release: %{fakerel} \
962 Summary: Files with debuginfo for %{kname}-%{1}-%{buildrel} \
963 %else \
964 %package -n %{kname}-%{1}-debuginfo \
965 Version: %{kversion} \
966 Release: %{rpmrel} \
967 Summary: Files with debuginfo for %{kname}-%{1}-%{kverrel} \
968 %endif \
969 Group: Development/Debug \
970 Provides: kernel-debug = %{kverrel} \
971 %ifarch %{ix86} \
972 Conflicts: arch(x86_64) \
973 %endif \
974 %if %{versionednamingscheme} \
975 %description -n %{kname}-%{1}-%{buildrel}-debuginfo \
976 This package contains the files with debuginfo to aid in debug tasks \
977 when using %{kname}-%{1}-%{buildrel}. \
978 %else \
979 %description -n %{kname}-%{1}-debuginfo \
980 This package contains the files with debuginfo to aid in debug tasks \
981 when using %{kname}-%{1}-%{kverrel}. \
982 %endif \
983 \
984 If you need to look at debug information or use some application that \
985 needs debugging info from the kernel, this package may help. \
986 %endif \
987 \
988 %package -n %{kname}-%{1}-latest \
989 Version: %{kversion} \
990 Release: %{rpmrel} \
991 Summary: Virtual rpm for latest %{kname}-%{1} \
992 Group: System/Kernel and hardware \
993 %if %{versionednamingscheme} \
994 Requires: %{kname}-%{1}-%{buildrel} \
995 %else \
996 Requires: %{kname}-%{1}-%{kverrel} \
997 %endif \
998 %ifarch %{ix86} \
999 Conflicts: arch(x86_64) \
1000 %endif \
1001 %if %{versionednamingscheme} \
1002 Obsoletes: vboxadditions-kernel-%{1}-latest \
1003 Obsoletes: kernel-tmb-%{1}-latest \
1004 %endif \
1005 %description -n %{kname}-%{1}-latest \
1006 This package is a virtual rpm that aims to make sure you always have the \
1007 latest %{kname}-%{1} installed... \
1008 \
1009 %if %build_devel \
1010 %package -n %{kname}-%{1}-devel-latest \
1011 Version: %{kversion} \
1012 Release: %{rpmrel} \
1013 Summary: Virtual rpm for latest %{kname}-%{1}-devel \
1014 Group: Development/Kernel \
1015 %if %{versionednamingscheme} \
1016 Requires: %{kname}-%{1}-devel-%{buildrel} \
1017 %else \
1018 Requires: %{kname}-%{1}-devel-%{kverrel} \
1019 %endif \
1020 %ifarch %{ix86} \
1021 Conflicts: arch(x86_64) \
1022 %endif \
1023 %if %{versionednamingscheme} \
1024 Provides: %{kname}-devel-latest \
1025 %endif \
1026 %description -n %{kname}-%{1}-devel-latest \
1027 This package is a virtual rpm that aims to make sure you always have the \
1028 latest %{kname}-%{1}-devel installed... \
1029 %endif \
1030 \
1031 %if %{versionednamingscheme} \
1032 %posttrans -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-posttrans \
1033 %postun -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-postun \
1034 %else \
1035 %posttrans -n %{kname}-%{1} -f kernel_files.%{1}-posttrans \
1036 %postun -n %{kname}-%{1} -f kernel_files.%{1}-postun \
1037 %endif \
1038 \
1039 %if %build_devel \
1040 %if %{versionednamingscheme} \
1041 %post -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-post \
1042 %preun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-preun \
1043 %postun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-postun \
1044 %else \
1045 %post -n %{kname}-%{1}-devel -f kernel_devel_files.%{1}-post \
1046 %preun -n %{kname}-%{1}-devel -f kernel_devel_files.%{1}-preun \
1047 %postun -n %{kname}-%{1}-devel -f kernel_devel_files.%{1}-postun \
1048 %endif \
1049 %endif \
1050 \
1051 %if %{versionednamingscheme} \
1052 %files -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1} \
1053 %else \
1054 %files -n %{kname}-%{1} -f kernel_files.%{1} \
1055 %endif \
1056 %files -n %{kname}-%{1}-latest \
1057 \
1058 %if %build_devel \
1059 %if %{versionednamingscheme} \
1060 %files -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1} \
1061 %else \
1062 %files -n %{kname}-%{1}-devel -f kernel_devel_files.%{1} \
1063 %endif \
1064 %files -n %{kname}-%{1}-devel-latest \
1065 %endif \
1066 \
1067 %if %build_debug \
1068 %if %{versionednamingscheme} \
1069 %files -n %{kname}-%{1}-%{buildrel}-debuginfo -f kernel_debug_files.%{1} \
1070 %else \
1071 %files -n %{kname}-%{1}-debuginfo -f kernel_debug_files.%{1} \
1072 %endif \
1073 %endif
1074
1075 %ifarch %{ix86}
1076 #
1077 # kernel-desktop586: i586, smp-alternatives, 4GB
1078 #
1079 %if %build_desktop586
1080 %define summary_desktop586 Linux kernel for desktop use with i586 and less than 4GB RAM
1081 %define info_desktop586 This kernel is compiled for desktop use, single or \
1082 multiple i586 processor(s)/core(s) and less than 4GB RAM (usually 3-3.5GB \
1083 detected, if you need/want to use all 4GB or more, install kernel-server), \
1084 using HZ_1000, voluntary preempt, CFS cpu scheduler and cfq i/o scheduler.
1085 %mkflavour desktop586
1086 %endif
1087 %endif
1088
1089 #
1090 # kernel-desktop: i686, smp-alternatives, 64 GB / x86_64 / arm / aarch64
1091 #
1092 %if %build_desktop
1093 %ifarch %{ix86}
1094 %define summary_desktop Linux Kernel for desktop use with i686 and up to 64GB RAM
1095 %define info_desktop This kernel is compiled for desktop use, single or \
1096 multiple i686 processor(s)/core(s) and up to 64GB RAM, using HZ_1000, \
1097 voluntary preempt, CFS cpu scheduler and cfq i/o scheduler.
1098 %else
1099 %define summary_desktop Linux Kernel for desktop use with %{_arch}
1100 %define info_desktop This kernel is compiled for desktop use, single or \
1101 multiple %{_arch} processor(s)/core(s), using HZ_1000, voluntary preempt, \
1102 CFS cpu scheduler and cfq i/o scheduler.
1103 %endif
1104 %mkflavour desktop
1105 %endif
1106
1107 #
1108 # kernel-server: i686, smp-alternatives, 64 GB / x86_64 / aarch64
1109 #
1110 %if %build_server
1111 %ifarch %{ix86}
1112 %define summary_server Linux Kernel for server use with i686 & 64GB RAM
1113 %define info_server This kernel is compiled for server use, single or \
1114 multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using \
1115 no preempt, HZ_100, CFS cpu scheduler and cfq i/o scheduler.
1116 %else
1117 %define summary_server Linux Kernel for server use with %{_arch}
1118 %define info_server This kernel is compiled for server use, single or \
1119 multiple %{_arch} processor(s)/core(s), using no preempt, HZ_100, \
1120 CFS cpu scheduler and cfq i/o scheduler.
1121 %endif
1122 %mkflavour server
1123 %endif
1124
1125 #
1126 # kernel-source
1127 #
1128 %if %build_source
1129 %if %{versionednamingscheme}
1130 %package -n %{kname}-source-%{buildrel}
1131 Version: %{fakever}
1132 Release: %{fakerel}
1133 %else
1134 %package -n %{kname}-source
1135 Version: %{kversion}
1136 Release: %{rpmrel}
1137 Summary: The Linux source code for %{kname}
1138 Group: Development/Kernel
1139 Obsoletes: %{kname}-source-latest < %{kverrel}
1140 %endif
1141 Requires: glibc-devel, ncurses-devel, make, gcc, perl, diffutils
1142 %if %{versionednamingscheme}
1143 Summary: The Linux source code for %{kname}-%{buildrel}
1144 Group: Development/Kernel
1145 Provides: kernel-source = %{kverrel}
1146 %endif
1147 Autoreqprov: no
1148 Buildarch: noarch
1149
1150 %if %{versionednamingscheme}
1151 %description -n %{kname}-source-%{buildrel}
1152 %else
1153 %description -n %{kname}-source
1154 %endif
1155 The %{kname}-source package contains the source code files for the Mageia
1156 kernel. Theese source files are only needed if you want to build your
1157 own custom kernel that is better tuned to your particular hardware.
1158
1159 If you only want the files needed to build 3rdparty (nVidia, Ati, dkms-*,...)
1160 drivers against, install the *-devel-* rpm that is matching your kernel.
1161
1162 %if %{versionednamingscheme}
1163 #
1164 # kernel-source-latest: virtual rpm
1165 #
1166 %package -n %{kname}-source-latest
1167 Version: %{kversion}
1168 Release: %{rpmrel}
1169 Summary: Virtual rpm for latest %{kname}-source
1170 Group: Development/Kernel
1171 Requires: %{kname}-source-%{buildrel}
1172 Buildarch: noarch
1173
1174 %description -n %{kname}-source-latest
1175 This package is a virtual rpm that aims to make sure you always have the
1176 latest %{kname}-source installed...
1177 %endif
1178 %endif
1179
1180 #
1181 # kernel-doc: documentation for the Linux kernel
1182 #
1183 %if %build_doc
1184 %package -n %{kname}-doc
1185 Version: %{kversion}
1186 Release: %{rpmrel}
1187 Summary: Various documentation bits found in the %{kname} source
1188 Group: Documentation
1189 Buildarch: noarch
1190
1191 %description -n %{kname}-doc
1192 This package contains documentation files from the %{kname} source.
1193 Various bits of information about the Linux kernel and the device drivers
1194 shipped with it are documented in these files. You also might want install
1195 this package if you need a reference to the options that can be passed to
1196 Linux kernel modules at load time.
1197 %endif
1198
1199 #
1200 # kernel userspace-headers
1201 #
1202 %if %{build_uheaders}
1203 %package -n %{kname}-userspace-headers
1204 Version: %{kversion}
1205 Release: %{rpmrel}
1206 Summary: Linux kernel header files for userspace
1207 Group: System/Kernel and hardware
1208 %rename linux-userspace-headers
1209 Provides: kernel-headers = 1:%{version}-%{release}
1210
1211 %description -n %{kname}-userspace-headers
1212 C header files from the Linux kernel. The header files define structures
1213 and constants that are needed for building most standard programs.
1214
1215 This package is not suitable for building kernel modules.
1216 %endif
1217
1218 #
1219 # kernel/tools
1220 #
1221 %if %{build_perf}
1222 %package -n perf
1223 Version: %{kversion}
1224 Release: %{rpmrel}
1225 Summary: perf tool and the supporting documentation
1226 Group: System/Kernel and hardware
1227
1228 %description -n perf
1229 the perf tool and the supporting documentation.
1230 %endif
1231
1232 %if %{build_cpupower}
1233 %package -n cpupower
1234 Version: %{kversion}
1235 Release: %{rpmrel}
1236 Summary: the cpupower tools
1237 Group: System/Kernel and hardware
1238 Requires(post): rpm-helper >= 0.24.8-1
1239 Requires(preun): rpm-helper >= 0.24.8-1
1240
1241 %description -n cpupower
1242 the cpupower tools.
1243
1244 %post -n cpupower
1245 %_post_service cpupower
1246
1247 %preun -n cpupower
1248 %_preun_service cpupower
1249
1250 %package -n cpupower-devel
1251 Version: %{kversion}
1252 Release: %{rpmrel}
1253 Summary: devel files for cpupower
1254 Group: Development/Kernel
1255 Requires: cpupower = %{kversion}-%{rpmrel}
1256 Conflicts: %{_lib}cpufreq-devel
1257
1258 %description -n cpupower-devel
1259 This package contains the development files for cpupower.
1260 %endif
1261
1262 %if %{build_bpftool}
1263 %package -n bpftool
1264 %if !%{versionednamingscheme}
1265 Version: %{kversion}
1266 Release: %{rpmrel}
1267 %endif
1268 Summary: Inspection and simple manipulation of eBPF programs and maps
1269 Group: System/Kernel and hardware
1270
1271 %description -n bpftool
1272 This package contains the bpftool, which allows inspection and simple
1273 manipulation of eBPF programs and maps.
1274 %endif
1275
1276 %if %{build_libbpf}
1277 %define bpfmajor 1
1278 %package -n %{_lib}bpf%{bpfmajor}
1279 %if !%{versionednamingscheme}
1280 Version: %{kversion}
1281 Release: %{rpmrel}
1282 %endif
1283 Summary: The bpf library from kernel source
1284 Group: System/Libraries
1285
1286 %description -n %{_lib}bpf%{bpfmajor}
1287 This package contains the kernel source bpf library.
1288
1289 %package -n %{_lib}bpf-devel
1290 %if %{versionednamingscheme}
1291 Version: %{kversion}
1292 Release: %{rpmrel}
1293 %endif
1294 Summary: Developement files for the bpf library from kernel source
1295 Group: Development/Kernel
1296 Requires: %{_lib}bpf%{bpfmajor}
1297
1298 %description -n %{_lib}bpf-devel
1299 This package includes libraries and header files needed for development
1300 of applications which use bpf library from kernel source.
1301 %endif
1302
1303 #
1304 # End packages - here begins build stage
1305 #
1306 %prep
1307 %setup -q -n %top_dir_name -c
1308
1309 cd %src_dir
1310
1311 %autopatch -p1
1312
1313 # PATCH END
1314
1315 #
1316 # Setup Begin
1317 #
1318
1319 # install x86 defconfigs
1320 install -m 644 %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} %{SOURCE15} arch/x86/configs/
1321 # install arm64 defconfigs
1322 install -m 644 %{SOURCE16} %{SOURCE17} arch/arm64/configs/
1323 # install arm defconfigs
1324 install -m 644 %{SOURCE18} arch/arm/configs/
1325
1326 # make sure the kernel has the sublevel we know it has...
1327 LC_ALL=C perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile
1328
1329 # get rid of unwanted files
1330 find . -name '*~' -o -name '*.orig' -o -name '*.append' | %kxargs rm -f
1331
1332 # fix missing exec flag on file introduced in 4.14.10-rc1
1333 chmod 755 tools/objtool/sync-check.sh
1334
1335 %build
1336 # Common target directories
1337 %if %{versionednamingscheme}
1338 %define _kerneldir /usr/src/kernel-%{kversion}-%{buildrpmrel}
1339 %endif
1340 %define _bootdir /boot
1341 %define _modulesdir /lib/modules
1342 %if %{versionednamingscheme}
1343 %define _srcdir /usr/src/kernel-%{kversion}-%{buildrpmrel}
1344 %define _efidir %{_bootdir}/efi/mageia
1345 %else
1346 %define _srcdir /usr/src/kernel-%{kversion}-%{rpmrel}
1347 %endif
1348
1349 # Directories definition needed for building
1350 %define temp_root %{build_dir}/temp-root
1351 %define temp_boot %{temp_root}%{_bootdir}
1352 %define temp_modules %{temp_root}%{_modulesdir}
1353 %define temp_source %{temp_root}%{_srcdir}
1354
1355 PrepareKernel() {
1356 name=$1
1357 extension=$2
1358
1359 %if %{versionednamingscheme}
1360 echo "Make config for kernel $extension"
1361 %else
1362 echo "Make config for kernel %{kversion}-$extension"
1363 %endif
1364
1365 %smake ARCH=%{target_arch} -s mrproper
1366
1367 if [ "%{target_arch}" == "i386" -o "%{target_arch}" == "x86_64" ]; then
1368 conf_dir=arch/x86/configs
1369 else
1370 conf_dir=arch/%{target_arch}/configs
1371 fi
1372 if [ -z "$name" ]; then
1373 cp $conf_dir/defconfig-%{target_arch}-desktop .config
1374 else
1375 cp $conf_dir/defconfig-%{target_arch}-$name .config
1376 fi
1377
1378 # make sure EXTRAVERSION says what we want it to say
1379 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -$extension/" Makefile
1380
1381 %smake ARCH=%{target_arch} oldconfig
1382 }
1383
1384 BuildKernel() {
1385 KernelVer=$1
1386
1387 echo "Building kernel $KernelVer"
1388
1389 %kmake ARCH=%{target_arch} -s all
1390
1391 # Start installing stuff
1392 install -d %{temp_boot}
1393 install -m 644 System.map %{temp_boot}/System.map-$KernelVer
1394 install -m 644 .config %{temp_boot}/config-$KernelVer
1395 xz -c Module.symvers > %{temp_boot}/symvers-$KernelVer.xz
1396
1397 %ifarch %{arm}
1398 IMAGE=zImage
1399 %else
1400 %ifarch aarch64
1401 IMAGE=Image.gz
1402 %else
1403 IMAGE=bzImage
1404 %endif
1405 %endif
1406 cp -f arch/%{target_arch}/boot/$IMAGE %{temp_boot}/vmlinuz-$KernelVer
1407
1408 %ifarch %{arm} aarch64
1409 %if %{versionednamingscheme}
1410 install -d %{temp_root}%{_libdir}/linux-$KernelVer/
1411 find arch/%{target_arch}/boot/dts/ -name *.dtb -execdir install -D -m644 {} %{temp_root}%{_libdir}/linux-$KernelVer/{} \;
1412 %else
1413 install -d %{temp_modules}/$KernelVer/dtb
1414 %{make} ARCH=%{target_arch} dtbs INSTALL_DTBS_PATH=%{temp_modules}/$KernelVer/dtb
1415 %{make} ARCH=%{target_arch} dtbs_install INSTALL_DTBS_PATH=%{temp_modules}/$KernelVer/dtb
1416 %endif
1417 %endif
1418
1419 # modules
1420 install -d %{temp_modules}/$KernelVer
1421 %smake ARCH=%{target_arch} INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=$KernelVer modules_install
1422 }
1423
1424 SaveDevel() {
1425 devel_flavour=$1
1426
1427 %if %{versionednamingscheme}
1428 DevelRoot=/usr/src/kernel-%{kversion}-$devel_flavour-%{buildrpmrel}
1429 %else
1430 DevelRoot=/usr/src/kernel-%{kversion}-$devel_flavour-%{rpmrel}
1431 %endif
1432 TempDevelRoot=%{temp_root}$DevelRoot
1433
1434 mkdir -p $TempDevelRoot
1435 for i in $(find . -name 'Makefile*'); do cp -R --parents $i $TempDevelRoot;done
1436 for i in $(find . -name 'Kconfig*' -o -name 'Kbuild*'); do cp -R --parents $i $TempDevelRoot;done
1437 cp -fR include $TempDevelRoot
1438 cp -fR scripts $TempDevelRoot
1439 cp -fR kernel/bounds.c $TempDevelRoot/kernel
1440 cp -fR tools/include $TempDevelRoot/tools/
1441 # needed for selinux
1442 cp -R --parents security/selinux/include/*.h $TempDevelRoot
1443 %ifarch %{arm}
1444 cp -fR arch/%{target_arch}/tools $TempDevelRoot/arch/%{target_arch}/
1445 cp -fR arch/%{target_arch}/kernel/signal.h $TempDevelRoot/arch/%{target_arch}/kernel/
1446 %endif
1447 %ifarch aarch64
1448 cp -fR arch/x86/entry/syscalls/syscall_32.tbl $TempDevelRoot/arch/x86/entry/syscalls/
1449 cp -fR arch/arm64/kernel/vdso/*.{S,sh} $TempDevelRoot/arch/arm64/kernel/vdso/
1450 cp -fR arch/arm64/kernel/vdso/vgettimeofday.c $TempDevelRoot/arch/arm64/kernel/vdso/
1451 cp -fR arch/arm64/tools/{cpucaps,gen-cpucaps.awk,gen-sysreg.awk,sysreg} $TempDevelRoot/arch/arm64/tools/
1452 # aarch64 build wants x86 syscall tables
1453 cp -fR arch/x86/entry/syscalls/syscall_{32,64}.tbl $TempDevelRoot/arch/x86/entry/syscalls/
1454 cp -fR lib/vdso/gettimeofday.c $TempDevelRoot/lib/vdso/
1455 %endif
1456 %ifarch %{ix86} x86_64
1457 cp -fR arch/x86/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/x86/kernel/
1458 cp -fR arch/x86/kernel/asm-offsets_{32,64}.c $TempDevelRoot/arch/x86/kernel/
1459 mkdir -p $TempDevelRoot/arch/x86/kvm/vmx
1460 cp -fR arch/x86/kvm/vmx/*.h $TempDevelRoot/arch/x86/kvm/vmx/
1461 cp -fR arch/x86/kvm/*.h $TempDevelRoot/arch/x86/kvm/
1462 cp -fR arch/x86/lib/insn.c $TempDevelRoot/arch/x86/lib/
1463 cp -fR arch/x86/purgatory/* $TempDevelRoot/arch/x86/purgatory/
1464 cp -fR arch/x86/entry/syscalls/syscall* $TempDevelRoot/arch/x86/entry/syscalls/
1465 cp -fR arch/x86/include $TempDevelRoot/arch/x86/
1466 cp -fR arch/x86/tools $TempDevelRoot/arch/x86/
1467 %else
1468 cp -fR arch/%{target_arch}/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/%{target_arch}/kernel/
1469 for f in $(find arch/%{target_arch} -name include); do cp -fR --parents $f $TempDevelRoot; done
1470 %endif
1471 cp -fR .config Module.symvers $TempDevelRoot
1472
1473 # Needed for truecrypt build (Danny)
1474 cp -fR drivers/md/dm.h $TempDevelRoot/drivers/md/
1475
1476 # needed by include/generated/timeconst.h
1477 cp -fR kernel/time/timeconst.bc $TempDevelRoot/kernel/time/
1478
1479 # Needed for lirc_gpio (#39004)
1480 cp -fR drivers/media/pci/bt8xx/bttv{,p}.h $TempDevelRoot/drivers/media/pci/bt8xx/
1481 cp -fR drivers/media/pci/bt8xx/bt848.h $TempDevelRoot/drivers/media/pci/bt8xx/
1482
1483 # rtl8812au
1484 mkdir -p $TempDevelRoot/drivers/staging/rtl8812au/hal/phydm/
1485 cp -f drivers/staging/rtl8812au/hal/phydm/phydm.mk $TempDevelRoot/drivers/staging/rtl8812au/hal/phydm/
1486
1487 %ifarch x86_64
1488 # orc unwinder needs theese
1489 cp -fR tools/build/Build{,.include} $TempDevelRoot/tools/build
1490 cp -fR tools/build/fixdep.c $TempDevelRoot/tools/build
1491 cp -fR tools/lib/{rbtree.c,ctype.c,str_error_r.c,string.c} $TempDevelRoot/tools/lib
1492 cp -fR tools/lib/subcmd/* $TempDevelRoot/tools/lib/subcmd
1493 cp -fR tools/objtool/* $TempDevelRoot/tools/objtool
1494 cp -fR tools/scripts/utilities.mak $TempDevelRoot/tools/scripts
1495 mkdir -p $TempDevelRoot/tools/arch/x86/tools
1496 cp -fR tools/arch/x86/tools/gen-insn-attr-x86.awk $TempDevelRoot/tools/arch/x86/tools/
1497 mkdir -p $TempDevelRoot/tools/arch/x86/lib
1498 cp -fR tools/arch/x86/lib/{inat.c,insn.c,x86-opcode-map.txt} $TempDevelRoot/tools/arch/x86/lib/
1499 mkdir -p $TempDevelRoot/tools/arch/x86/include/asm
1500 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/
1501 %endif
1502
1503 for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 loongarch m32r m68k m68knommu metag microblaze \
1504 mips mn10300 nds32 nios2 openrisc parisc powerpc riscv s390 score sh sparc tile unicore32 xtensa; do
1505 rm -rf $TempDevelRoot/arch/$i
1506 rm -rf $TempDevelRoot/scripts/dtc/include-prefixes/$i
1507 rm -rf $TempDevelRoot/tools/arch/$i
1508 done
1509
1510 %ifnarch %{arm} aarch64
1511 rm -rf $TempDevelRoot/arch/arm*
1512 rm -rf $TempDevelRoot/include/kvm/arm*
1513 rm -rf $TempDevelRoot/include/soc
1514 rm -rf $TempDevelRoot/scripts/dtc/include-prefixes/arm*
1515 rm -rf $TempDevelRoot/tools/arch/arm*
1516 %endif
1517 %ifnarch %{ix86} x86_64
1518 rm -rf $TempDevelRoot/arch/x86
1519 rm -rf $TempDevelRoot/tools/arch/x86
1520 # arch/x86/ras/Kconfig is included by drivers/ras/Kconfig
1521 # and kconfig's source command seems to be evaluated even under a false conditional
1522 mkdir -p $TempDevelRoot/arch/x86/ras
1523 cp -fR arch/x86/ras/Kconfig $TempDevelRoot/arch/x86/ras
1524 %endif
1525
1526 # (6.1 breakage) keep crypto Kconfig deps happy
1527 cp --parents arch/arm/crypto/Kconfig $TempDevelRoot
1528 cp --parents arch/arm64/crypto/Kconfig $TempDevelRoot
1529 cp --parents arch/loongarch/crypto/Kconfig $TempDevelRoot
1530 cp --parents arch/mips/crypto/Kconfig $TempDevelRoot
1531 cp --parents arch/powerpc/crypto/Kconfig $TempDevelRoot
1532 cp --parents arch/s390/crypto/Kconfig $TempDevelRoot
1533 cp --parents arch/sparc/crypto/Kconfig $TempDevelRoot
1534 cp --parents arch/x86/crypto/Kconfig $TempDevelRoot
1535
1536 # Clean the scripts tree, and make sure everything is ok (sanity check)
1537 # running prepare+scripts (tree was already "prepared" in build)
1538 pushd $TempDevelRoot >/dev/null
1539 %smake ARCH=%{target_arch} -s prepare scripts
1540 %smake ARCH=%{target_arch} -s clean
1541 popd >/dev/null
1542 rm -f $TempDevelRoot/.config.old
1543
1544 # fix permissions
1545 chmod -R a+rX $TempDevelRoot
1546
1547 # disable mrproper in -devel rpms
1548 patch -p1 --fuzz=0 -d $TempDevelRoot -i %{SOURCE2}
1549
1550 kernel_devel_files=../kernel_devel_files.$devel_flavour
1551
1552
1553 ### Create the kernel_devel_files.*
1554 cat > $kernel_devel_files <<EOF
1555 %dir $DevelRoot
1556 %dir $DevelRoot/arch
1557 %dir $DevelRoot/include
1558 $DevelRoot/Documentation
1559 $DevelRoot/arch/arm
1560 $DevelRoot/arch/arm64
1561 $DevelRoot/arch/loongarch
1562 $DevelRoot/arch/mips
1563 $DevelRoot/arch/powerpc
1564 $DevelRoot/arch/s390
1565 $DevelRoot/arch/sparc
1566 $DevelRoot/arch/um
1567 $DevelRoot/arch/x86
1568 $DevelRoot/block
1569 $DevelRoot/certs
1570 $DevelRoot/crypto
1571 $DevelRoot/drivers
1572 $DevelRoot/fs
1573 $DevelRoot/include/acpi
1574 $DevelRoot/include/asm-generic
1575 $DevelRoot/include/clocksource
1576 $DevelRoot/include/config
1577 $DevelRoot/include/crypto
1578 $DevelRoot/include/drm
1579 $DevelRoot/include/dt-bindings
1580 $DevelRoot/include/generated
1581 $DevelRoot/include/keys
1582 $DevelRoot/include/kunit
1583 $DevelRoot/include/kvm
1584 $DevelRoot/include/linux
1585 $DevelRoot/include/math-emu
1586 $DevelRoot/include/media
1587 $DevelRoot/include/memory
1588 $DevelRoot/include/misc
1589 $DevelRoot/include/net
1590 $DevelRoot/include/pcmcia
1591 $DevelRoot/include/ras
1592 $DevelRoot/include/rdma
1593 $DevelRoot/include/rv
1594 $DevelRoot/include/scsi
1595 %ifarch %{arm} aarch64
1596 $DevelRoot/include/soc
1597 %endif
1598 $DevelRoot/include/sound
1599 $DevelRoot/include/target
1600 $DevelRoot/include/trace
1601 $DevelRoot/include/uapi
1602 $DevelRoot/include/ufs
1603 $DevelRoot/include/vdso/*.h
1604 $DevelRoot/include/video
1605 $DevelRoot/include/xen
1606 $DevelRoot/init
1607 $DevelRoot/io_uring
1608 $DevelRoot/ipc
1609 $DevelRoot/kernel
1610 $DevelRoot/lib
1611 $DevelRoot/mm
1612 $DevelRoot/net
1613 $DevelRoot/rust
1614 $DevelRoot/samples
1615 $DevelRoot/scripts
1616 $DevelRoot/security
1617 $DevelRoot/sound
1618 $DevelRoot/tools
1619 $DevelRoot/usr
1620 $DevelRoot/virt
1621 $DevelRoot/.config
1622 $DevelRoot/Kbuild
1623 $DevelRoot/Kconfig
1624 $DevelRoot/Makefile
1625 $DevelRoot/Module.symvers
1626 $DevelRoot/arch/Kconfig
1627 EOF
1628
1629
1630 ### Create -devel Post script on the fly
1631 cat > $kernel_devel_files-post <<EOF
1632 %if %{versionednamingscheme}
1633 if [ -d /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel} ]; then
1634 rm -f /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/{build,source}
1635 ln -sf $DevelRoot /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build
1636 ln -sf $DevelRoot /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/source
1637 %else
1638 if [ -d /lib/modules/%{kversion}-$devel_flavour-%{rpmrel} ]; then
1639 rm -f /lib/modules/%{kversion}-$devel_flavour-%{rpmrel}/{build,source}
1640 ln -sf $DevelRoot /lib/modules/%{kversion}-$devel_flavour-%{rpmrel}/build
1641 ln -sf $DevelRoot /lib/modules/%{kversion}-$devel_flavour-%{rpmrel}/source
1642 %endif
1643 fi
1644 EOF
1645
1646
1647 ### Create -devel Preun script on the fly
1648 cat > $kernel_devel_files-preun <<EOF
1649 %if %{versionednamingscheme}
1650 if [ -L /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build ]; then
1651 rm -f /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build
1652 fi
1653 if [ -L /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/source ]; then
1654 rm -f /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/source
1655 fi
1656 %else
1657 if [ -L /lib/modules/%{kversion}-$devel_flavour-%{rpmrel}/build ]; then
1658 rm -f /lib/modules/%{kversion}-$devel_flavour-%{rpmrel}/build
1659 fi
1660 if [ -L /lib/modules/%{kversion}-$devel_flavour-%{rpmrel}/source ]; then
1661 rm -f /lib/modules/%{kversion}-$devel_flavour-%{rpmrel}/source
1662 fi
1663 %endif
1664 exit 0
1665 EOF
1666
1667 ### Create -devel Postun script on the fly
1668 cat > $kernel_devel_files-postun <<EOF
1669 %if %{versionednamingscheme}
1670 rm -rf /usr/src/kernel-%{kversion}-$devel_flavour-%{buildrpmrel} >/dev/null
1671 %else
1672 rm -rf /usr/src/kernel-%{kversion}-$devel_flavour-%{rpmrel} >/dev/null
1673 %endif
1674 EOF
1675 }
1676
1677 SaveDebug() {
1678 debug_flavour=$1
1679
1680 install -m 644 vmlinux \
1681 %if %{versionednamingscheme}
1682 %{temp_boot}/vmlinux-%{kversion}-$debug_flavour-%{buildrpmrel}
1683 %else
1684 %{temp_boot}/vmlinux-%{kversion}-$debug_flavour-%{rpmrel}
1685 %endif
1686 kernel_debug_files=../kernel_debug_files.$debug_flavour
1687 %if %{versionednamingscheme}
1688 echo "%{_bootdir}/vmlinux-%{kversion}-$debug_flavour-%{buildrpmrel}" \
1689 %else
1690 echo "%{_bootdir}/vmlinux-%{kversion}-$debug_flavour-%{rpmrel}" \
1691 %endif
1692 >> $kernel_debug_files
1693
1694 %if %{versionednamingscheme}
1695 find %{temp_modules}/%{kversion}-$debug_flavour-%{buildrpmrel}/kernel \
1696 %else
1697 find %{temp_modules}/%{kversion}-$debug_flavour-%{rpmrel}/kernel \
1698 %endif
1699 -name "*.ko" | \
1700 %kxargs -I '{}' objcopy --only-keep-debug '{}' '{}'.debug
1701 %if %{versionednamingscheme}
1702 find %{temp_modules}/%{kversion}-$debug_flavour-%{buildrpmrel}/kernel \
1703 %else
1704 find %{temp_modules}/%{kversion}-$debug_flavour-%{rpmrel}/kernel \
1705 %endif
1706 -name "*.ko" | %kxargs -I '{}' \
1707 sh -c 'cd `dirname {}`; \
1708 objcopy --add-gnu-debuglink=`basename {}`.debug \
1709 --strip-debug `basename {}`'
1710
1711 pushd %{temp_modules}
1712 %if %{versionednamingscheme}
1713 find %{kversion}-$debug_flavour-%{buildrpmrel}/kernel \
1714 %else
1715 find %{kversion}-$debug_flavour-%{rpmrel}/kernel \
1716 %endif
1717 -name "*.ko.debug" > debug_module_list
1718 popd
1719 cat %{temp_modules}/debug_module_list | \
1720 sed 's|\(.*\)|%{_modulesdir}/\1|' >> $kernel_debug_files
1721 cat %{temp_modules}/debug_module_list | \
1722 sed 's|\(.*\)|%exclude %{_modulesdir}/\1|' \
1723 >> ../kernel_exclude_debug_files.$debug_flavour
1724 rm -f %{temp_modules}/debug_module_list
1725 }
1726
1727 CreateFiles() {
1728 kernel_flavour=$1
1729
1730 kernel_files=../kernel_files.$kernel_flavour
1731
1732 ker="vmlinuz"
1733 ### Create the kernel_files.*
1734 cat > $kernel_files <<EOF
1735 %if %{versionednamingscheme}
1736 %{_bootdir}/System.map-%{kversion}-$kernel_flavour-%{buildrpmrel}
1737 %{_bootdir}/symvers-%{kversion}-$kernel_flavour-%{buildrpmrel}.xz
1738 %{_bootdir}/config-%{kversion}-$kernel_flavour-%{buildrpmrel}
1739 %{_bootdir}/$ker-%{kversion}-$kernel_flavour-%{buildrpmrel}
1740 %dir %{_modulesdir}/%{kversion}-$kernel_flavour-%{buildrpmrel}/
1741 %{_modulesdir}/%{kversion}-$kernel_flavour-%{buildrpmrel}/kernel
1742 %{_modulesdir}/%{kversion}-$kernel_flavour-%{buildrpmrel}/modules.*
1743 %doc README.kernel-sources
1744 %ifarch %arm aarch64
1745 %dir %{_libdir}/linux-%{kversion}-$kernel_flavour-%{buildrpmrel}
1746 %{_libdir}/linux-%{kversion}-$kernel_flavour-%{buildrpmrel}/*.dtb
1747 %endif
1748 %else
1749 %{_bootdir}/System.map-%{kversion}-$kernel_flavour-%{rpmrel}
1750 %{_bootdir}/symvers-%{kversion}-$kernel_flavour-%{rpmrel}.xz
1751 %{_bootdir}/config-%{kversion}-$kernel_flavour-%{rpmrel}
1752 %{_bootdir}/$ker-%{kversion}-$kernel_flavour-%{rpmrel}
1753 %dir %{_modulesdir}/%{kversion}-$kernel_flavour-%{rpmrel}/
1754 %ifarch %{arm} aarch64
1755 %{_modulesdir}/%{kversion}-$kernel_flavour-%{rpmrel}/dtb
1756 %endif
1757 %{_modulesdir}/%{kversion}-$kernel_flavour-%{rpmrel}/kernel
1758 %{_modulesdir}/%{kversion}-$kernel_flavour-%{rpmrel}/modules.*
1759 %endif
1760 EOF
1761
1762 %if %build_debug
1763 cat ../kernel_exclude_debug_files.$kernel_flavour >> $kernel_files
1764 %endif
1765
1766 ### Create kernel Posttrans script
1767 cat > $kernel_files-posttrans <<EOF
1768 %if %build_devel
1769 # create kernel-devel symlinks if matching -devel- rpm is installed
1770 %if %{versionednamingscheme}
1771 if [ -d /usr/src/kernel-%{kversion}-$kernel_flavour-%{buildrpmrel} ]; then
1772 ln -sf /usr/src/kernel-%{kversion}-$kernel_flavour-%{buildrpmrel} /lib/modules/%{kversion}-$kernel_flavour-%{buildrpmrel}/build
1773 ln -sf /usr/src/kernel-%{kversion}-$kernel_flavour-%{buildrpmrel} /lib/modules/%{kversion}-$kernel_flavour-%{buildrpmrel}/source
1774 %else
1775 if [ -d /usr/src/kernel-%{kversion}-$kernel_flavour-%{rpmrel} ]; then
1776 ln -sf /usr/src/kernel-%{kversion}-$kernel_flavour-%{rpmrel} /lib/modules/%{kversion}-$kernel_flavour-%{rpmrel}/build
1777 ln -sf /usr/src/kernel-%{kversion}-$kernel_flavour-%{rpmrel} /lib/modules/%{kversion}-$kernel_flavour-%{rpmrel}/source
1778 %endif
1779 fi
1780 %endif
1781 if [ -z "$DURING_INSTALL" ] ; then
1782 %if %{versionednamingscheme}
1783 if [ -x /usr/sbin/dkms_autoinstaller -a -d /usr/src/kernel-%{kversion}-$kernel_flavour-%{buildrpmrel} ]; then
1784 /usr/sbin/dkms_autoinstaller start %{kversion}-$kernel_flavour-%{buildrpmrel}
1785 %else
1786 if [ -x /usr/sbin/dkms_autoinstaller -a -d /usr/src/kernel-%{kversion}-$kernel_flavour-%{rpmrel} ]; then
1787 /usr/sbin/dkms_autoinstaller start %{kversion}-$kernel_flavour-%{rpmrel}
1788 %endif
1789 fi
1790 fi
1791 %if %{versionednamingscheme}
1792 /sbin/installkernel %{kversion}-$kernel_flavour-%{buildrpmrel}
1793 %else
1794 /sbin/installkernel %{kversion}-$kernel_flavour-%{rpmrel}
1795 %endif
1796 pushd /boot > /dev/null
1797 %if %{versionednamingscheme}
1798 if [ -e initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img ]; then
1799 ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel} vmlinuz-$kernel_flavour
1800 ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel} vmlinuz
1801 ln -sf initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img initrd-$kernel_flavour.img
1802 ln -sf initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img initrd.img
1803 %else
1804 if [ -e initrd-%{kversion}-$kernel_flavour-%{rpmrel}.img ]; then
1805 ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{rpmrel} vmlinuz-$kernel_flavour
1806 ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{rpmrel} vmlinuz
1807 ln -sf initrd-%{kversion}-$kernel_flavour-%{rpmrel}.img initrd-$kernel_flavour.img
1808 ln -sf initrd-%{kversion}-$kernel_flavour-%{rpmrel}.img initrd.img
1809 %endif
1810 fi
1811 popd > /dev/null
1812 EOF
1813
1814 ### Create kernel Postun script on the fly
1815 cat > $kernel_files-postun <<EOF
1816 pushd /boot > /dev/null
1817 %if %{versionednamingscheme}
1818 if [ -f "vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel}" ]; then
1819 %else
1820 if [ -f "vmlinuz-%{kversion}-$kernel_flavour-%{rpmrel}" ]; then
1821 %endif
1822 echo "The kernel is still installed in postun, probably a reinstall, skipping cleanup." >&2
1823 exit
1824 fi
1825 if [ -L vmlinuz-$kernel_flavour ]; then
1826 %if %{versionednamingscheme}
1827 if [ "$(readlink vmlinuz-$kernel_flavour)" = "vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel}" ]; then
1828 %else
1829 if [ "$(readlink vmlinuz-$kernel_flavour)" = "vmlinuz-%{kversion}-$kernel_flavour-%{rpmrel}" ]; then
1830 %endif
1831 rm -f vmlinuz-$kernel_flavour
1832 fi
1833 fi
1834 if [ -L initrd-$kernel_flavour.img ]; then
1835 %if %{versionednamingscheme}
1836 if [ "$(readlink initrd-$kernel_flavour.img)" = "initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img" ]; then
1837 %else
1838 if [ "$(readlink initrd-$kernel_flavour.img)" = "initrd-%{kversion}-$kernel_flavour-%{rpmrel}.img" ]; then
1839 %endif
1840 rm -f initrd-$kernel_flavour.img
1841 fi
1842 fi
1843 popd > /dev/null
1844 %if %{versionednamingscheme}
1845 rm -rf /lib/modules/%{kversion}-$kernel_flavour-%{buildrpmrel} >/dev/null
1846 /sbin/kernel_remove_initrd %{kversion}-$kernel_flavour-%{buildrpmrel}
1847 /sbin/installkernel -R %{kversion}-$kernel_flavour-%{buildrpmrel}
1848 %else
1849 rm -rf /lib/modules/%{kversion}-$kernel_flavour-%{rpmrel} >/dev/null
1850 /sbin/kernel_remove_initrd %{kversion}-$kernel_flavour-%{rpmrel}
1851 /sbin/installkernel -R %{kversion}-$kernel_flavour-%{rpmrel}
1852 %endif
1853 if [ -d /var/lib/dkms ]; then
1854 %if %{versionednamingscheme}
1855 rm -f /var/lib/dkms/*/kernel-%{kversion}-$devel_flavour-%{buildrpmrel}-%{_target_cpu} >/dev/null
1856 rm -rf /var/lib/dkms/*/*/%{kversion}-$devel_flavour-%{buildrpmrel} >/dev/null
1857 rm -f /var/lib/dkms-binary/*/kernel-%{kversion}-$devel_flavour-%{buildrpmrel}-%{_target_cpu} >/dev/null
1858 rm -rf /var/lib/dkms-binary/*/*/%{kversion}-$devel_flavour-%{buildrpmrel} >/dev/null
1859 %else
1860 rm -f /var/lib/dkms/*/kernel-%{kversion}-$devel_flavour-%{rpmrel}-%{_target_cpu} >/dev/null
1861 rm -rf /var/lib/dkms/*/*/%{kversion}-$devel_flavour-%{rpmrel} >/dev/null
1862 rm -f /var/lib/dkms-binary/*/kernel-%{kversion}-$devel_flavour-%{rpmrel}-%{_target_cpu} >/dev/null
1863 rm -rf /var/lib/dkms-binary/*/*/%{kversion}-$devel_flavour-%{rpmrel} >/dev/null
1864 %endif
1865 fi
1866 EOF
1867 }
1868
1869
1870 CreateKernel() {
1871 flavour=$1
1872
1873 %if %{versionednamingscheme}
1874 PrepareKernel $flavour $flavour-%{buildrpmrel}
1875
1876 BuildKernel %{kversion}-$flavour-%{buildrpmrel}
1877 %else
1878 PrepareKernel $flavour $flavour-%{rpmrel}
1879
1880 BuildKernel %{kversion}-$flavour-%{rpmrel}
1881 %endif
1882
1883 %if %build_devel
1884 SaveDevel $flavour
1885 %endif
1886 %if %build_debug
1887 SaveDebug $flavour
1888 %endif
1889 CreateFiles $flavour
1890 }
1891
1892
1893 ###
1894 # DO it...
1895 ###
1896
1897
1898 # Create a simulacro of buildroot
1899 rm -rf %{temp_root}
1900 install -d %{temp_root}
1901
1902
1903 # make sure we are in the directory
1904 cd %src_dir
1905
1906 %ifarch %{ix86}
1907 %if %build_desktop586
1908 CreateKernel desktop586
1909 %endif
1910 %endif
1911
1912 %if %build_desktop
1913 CreateKernel desktop
1914 %endif
1915
1916 %if %build_server
1917 CreateKernel server
1918 %endif
1919
1920 # set extraversion to match srpm to get nice version reported by the tools
1921 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile
1922
1923 # build perf
1924 %if %{build_perf}
1925 # perf
1926 %smake -s -C tools/perf NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 NO_LIBTRACEEVENT=1 \
1927 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 NO_JVMTI=1 prefix=%{_prefix} lib=%{_lib} all
1928 %smake -C tools/perf -s NO_LIBTRACEEVENT=1 prefix=%{_prefix} man
1929 %endif
1930
1931 %if %{build_cpupower}
1932 # cpupower
1933 # make sure version-gen.sh is executable.
1934 chmod +x tools/power/cpupower/utils/version-gen.sh
1935 %make_build -C tools/power/cpupower CPUFREQ_BENCH=false
1936 %endif
1937
1938 # build bpftool
1939 %if %{build_bpftool}
1940 pushd tools/bpf/bpftool
1941 make
1942 popd
1943 %endif
1944
1945 # build libbpf
1946 %if %{build_libbpf}
1947 pushd tools/lib/bpf
1948 make V=1
1949 popd
1950 %endif
1951
1952 # We don't make to repeat the depend code at the install phase
1953 %if %build_source
1954 %if %{versionednamingscheme}
1955 PrepareKernel "" %{buildrpmrel}custom
1956 %else
1957 PrepareKernel "" %{rpmrel}custom
1958 %endif
1959 %smake ARCH=%{target_arch} -s mrproper
1960 %endif
1961
1962
1963 ###
1964 ### install
1965 ###
1966 %install
1967 install -m 644 %{SOURCE4} .
1968
1969 cd %src_dir
1970
1971 # Directories definition needed for installing
1972 %define target_boot %{buildroot}%{_bootdir}
1973 %define target_modules %{buildroot}%{_modulesdir}
1974 %define target_headers %{buildroot}%{_prefix}
1975 %if %{versionednamingscheme}
1976 %define target_source %{buildroot}%{_kerneldir}
1977 %else
1978 %define target_source %{buildroot}%{_srcdir}
1979 %endif
1980
1981 # We want to be able to test several times the install part
1982 rm -rf %{buildroot}
1983 cp -a %{temp_root} %{buildroot}
1984
1985 # Create directories infastructure
1986 %if %build_source
1987 install -d %{target_source}
1988
1989 tar cf - . | tar xf - -C %{target_source}
1990 chmod -R a+rX %{target_source}
1991
1992 # we remove all the source files that we don't ship
1993 # first architecture files
1994 for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 loongarch m32r m68k m68knommu metag microblaze \
1995 mips nds32 nios2 openrisc parisc powerpc riscv s390 score sh sh64 sparc tile unicore32 v850 xtensa mn10300; do
1996 rm -rf %{target_source}/arch/$i
1997 rm -rf %{target_source}/scripts/dtc/include-prefixes/$i
1998 rm -rf %{target_source}/tools/arch/$i
1999 rm -rf %{target_source}/tools/testing/selftests/$i
2000 done
2001 %ifnarch %{arm} aarch64
2002 rm -rf %{target_source}/include/kvm/arm*
2003 rm -rf %{target_source}/scripts/dtc/include-prefixes/arm*
2004 rm -rf %{target_source}/tools/arch/arm*
2005 %endif
2006
2007 # other misc files
2008 rm -f %{target_source}/{.clang-format,.cocciconfig,.config.cmd,.config.old,.get_maintainer.ignore,.gitattributes,.gitignore,.tmp_gas_check,.mailmap,.missing-syscalls.d,arch/.gitignore,rust/.gitignore}
2009 rm -rf %{target_source}/.tmp_depmod/
2010
2011 # more cleaning
2012 pushd %{target_source}
2013 # lots of gitignore files
2014 find -iname ".gitignore" -delete
2015 # clean tools tree
2016 %smake -C tools clean
2017 %smake -C tools/build clean
2018 %smake -C tools/build/feature clean
2019 # dont ship generated vdso.so*
2020 %ifarch aarch64
2021 rm -f arch/arm64/kernel/vdso/vdso.so*
2022 %endif
2023 popd
2024
2025 # nuke last as it gets re-created
2026 rm -f %{target_source}/.cache.mk
2027
2028 #endif %build_source
2029 %endif
2030
2031 # compressing modules
2032 %if %{build_modxz}
2033 find %{target_modules} -name "*.ko" | %kxargs xz -6
2034 %else
2035 find %{target_modules} -name "*.ko" | %kxargs gzip -9
2036 %endif
2037
2038 # We used to have a copy of PrepareKernel here
2039 # Now, we make sure that the thing in the linux dir is what we want it to be
2040 for i in %{target_modules}/*; do
2041 rm -f $i/build $i/source
2042 done
2043
2044 # sniff, if we compressed all the modules, we change the stamp :(
2045 # we really need the depmod -ae here
2046 pushd %{target_modules}
2047 for i in *; do
2048 /sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i
2049 echo $?
2050 done
2051
2052 for i in *; do
2053 pushd $i
2054 echo "Creating modules.description for $i"
2055 modules=`find . -name "*.ko.[g,x]z"`
2056 echo $modules | xargs /sbin/modinfo \
2057 | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!; $name =~ s!.*/!!' > modules.description
2058 popd
2059 done
2060 popd
2061
2062 # need to set extraversion to match srpm again to avoid rebuild
2063 LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile
2064
2065 # install userspace-headers
2066 %if %{build_uheaders}
2067 %smake ARCH=%{target_arch} headers_install INSTALL_HDR_PATH=%{target_headers}
2068 # for drakx
2069 cp include/linux/pci_ids.h %{target_headers}/include/linux/
2070 %endif
2071
2072 %if %{build_perf}
2073 # perf tool binary and supporting scripts/binaries
2074 %smake -s -C tools/perf V=1 DESTDIR=%{buildroot} NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 \
2075 HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 prefix=%{_prefix} lib=%{_lib} install
2076
2077 # perf man pages (note: implicit rpm magic compresses them later)
2078 make -C tools/perf V=1 NO_LIBTRACEEVENT=1 DESTDIR=%{buildroot} prefix=%{_prefix} install-man
2079
2080 # remove perf files we dont ship
2081 rm -rf %{buildroot}/usr/lib/perf/examples
2082 rm -rf %{buildroot}/usr/lib/perf/include/bpf
2083 rm -rf %{buildroot}/usr/include/perf/perf_dlfilter.h
2084 %endif
2085
2086 %if %{build_cpupower}
2087 make -C tools/power/cpupower DESTDIR=%{buildroot} libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install
2088 rm -f %{buildroot}%{_libdir}/*.{a,la}
2089 %find_lang cpupower
2090 mv cpupower.lang ../
2091 chmod 0755 %{buildroot}%{_libdir}/libcpupower.so*
2092 mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig
2093 install -m644 %{SOURCE50} %{buildroot}%{_unitdir}/cpupower.service
2094 install -m644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/cpupower
2095 %endif
2096
2097 # install bpftool
2098 %if %{build_bpftool}
2099 pushd tools/bpf/bpftool
2100 make DESTDIR=%{buildroot} prefix=%{_prefix} bash_compdir=%{_sysconfdir}/bash_completion.d/ mandir=%{_mandir} install doc-install
2101 popd
2102 %endif
2103
2104 # install libbpf
2105 %if %{build_libbpf}
2106 pushd tools/lib/bpf
2107 make DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} V=1 install install_headers
2108 popd
2109 %endif
2110
2111 ###
2112 ### clean
2113 ###
2114 %clean
2115 rm -rf %{buildroot}
2116
2117
2118 # We don't want to remove this, the whole reason of its existence is to be
2119 # able to do several rpm --short-circuit -bi for testing install
2120 # phase without repeating compilation phase
2121 #rm -rf %{temp_root}
2122
2123 ###
2124 ### source and doc file lists
2125 ###
2126
2127 %if %build_source
2128 %if %{versionednamingscheme}
2129 %files -n %{kname}-source-%{buildrel}
2130 %else
2131 %files -n %{kname}-source
2132 %endif
2133 %doc %{_srcdir}/LICENSES
2134 %dir %{_srcdir}
2135 %dir %{_srcdir}/arch
2136 %dir %{_srcdir}/include
2137 %{_srcdir}/.rustfmt.toml
2138 %{_srcdir}/Documentation
2139 %{_srcdir}/arch/Kconfig
2140 %{_srcdir}/arch/arm
2141 %{_srcdir}/arch/arm64
2142 %{_srcdir}/arch/um
2143 %{_srcdir}/arch/x86
2144 %{_srcdir}/block
2145 %{_srcdir}/certs
2146 %{_srcdir}/crypto
2147 %{_srcdir}/drivers
2148 %{_srcdir}/fs
2149 %{_srcdir}/include/acpi
2150 %{_srcdir}/include/asm-generic
2151 %{_srcdir}/include/clocksource
2152 %{_srcdir}/include/crypto
2153 %{_srcdir}/include/drm
2154 %{_srcdir}/include/dt-bindings
2155 %{_srcdir}/include/keys
2156 %{_srcdir}/include/kunit
2157 %{_srcdir}/include/kvm
2158 %{_srcdir}/include/linux
2159 %{_srcdir}/include/math-emu
2160 %{_srcdir}/include/media
2161 %{_srcdir}/include/memory
2162 %{_srcdir}/include/misc
2163 %{_srcdir}/include/net
2164 %{_srcdir}/include/pcmcia
2165 %{_srcdir}/include/ras
2166 %{_srcdir}/include/rdma
2167 %{_srcdir}/include/rv
2168 %{_srcdir}/include/scsi
2169 %{_srcdir}/include/soc
2170 %{_srcdir}/include/sound
2171 %{_srcdir}/include/target
2172 %{_srcdir}/include/trace
2173 %{_srcdir}/include/uapi
2174 %{_srcdir}/include/ufs
2175 %{_srcdir}/include/vdso/*.h
2176 %{_srcdir}/include/video
2177 %{_srcdir}/include/xen
2178 %{_srcdir}/init
2179 %{_srcdir}/io_uring
2180 %{_srcdir}/ipc
2181 %{_srcdir}/kernel
2182 %{_srcdir}/lib
2183 %{_srcdir}/mm
2184 %{_srcdir}/net
2185 %{_srcdir}/rust
2186 %{_srcdir}/samples
2187 %{_srcdir}/scripts
2188 %{_srcdir}/security
2189 %{_srcdir}/sound
2190 %{_srcdir}/tools
2191 %{_srcdir}/usr
2192 %{_srcdir}/virt
2193 %{_srcdir}/COPYING
2194 %{_srcdir}/CREDITS
2195 %{_srcdir}/Kbuild
2196 %{_srcdir}/Kconfig
2197 %{_srcdir}/MAINTAINERS
2198 %{_srcdir}/Makefile
2199 %{_srcdir}/README
2200 %doc README.kernel-sources
2201
2202 %if %{versionednamingscheme}
2203 %files -n %{kname}-source-latest
2204 %endif
2205 %endif
2206
2207 %if %build_doc
2208 %files -n %{kname}-doc
2209 %doc linux-%{tar_ver}/Documentation/*
2210 %endif
2211
2212 %if %build_uheaders
2213 %files -n %{kname}-userspace-headers
2214 %defattr(0644,root,root,0755)
2215 %{_includedir}/asm/
2216 %{_includedir}/asm-generic/
2217 %{_includedir}/drm/
2218 %{_includedir}/linux/
2219 %{_includedir}/misc/
2220 %{_includedir}/mtd/
2221 %{_includedir}/rdma/
2222 %{_includedir}/scsi/
2223 %{_includedir}/sound/
2224 %{_includedir}/video/
2225 %{_includedir}/xen/
2226 %endif
2227
2228 %if %{build_perf}
2229 %files -n perf
2230 %{_bindir}/perf
2231 %{_bindir}/trace
2232 %{_datadir}/perf-core/strace/groups/file
2233 %{_datadir}/perf-core/strace/groups/string
2234 %{_datadir}/doc/perf-tip/tips.txt
2235 #dir #{_libdir}/traceevent
2236 #dir #{_libdir}/traceevent/plugins
2237 #{_libdir}/traceevent/plugins/plugin_*
2238 %dir %{_prefix}/libexec/perf-core
2239 %{_prefix}/libexec/perf-core/*
2240 %{_mandir}/man[1-8]/perf*
2241 %{_sysconfdir}/bash_completion.d/perf
2242 %endif
2243
2244 %if %{build_cpupower}
2245 %files -n cpupower -f cpupower.lang
2246 %config(noreplace) %{_sysconfdir}/sysconfig/cpupower
2247 %{_bindir}/cpupower
2248 %{_datadir}/bash-completion/completions/cpupower
2249 %{_libdir}/libcpupower.so.1
2250 %{_libdir}/libcpupower.so.0.0.1
2251 %{_unitdir}/cpupower.service
2252 %{_mandir}/man[1-8]/cpupower*
2253
2254 %files -n cpupower-devel
2255 %{_libdir}/libcpupower.so
2256 %{_includedir}/cpuidle.h
2257 %{_includedir}/cpufreq.h
2258 %{_includedir}/powercap.h
2259 %endif
2260
2261 %if %{build_bpftool}
2262 %files -n bpftool
2263 %{_sbindir}/bpftool
2264 %{_sysconfdir}/bash_completion.d/bpftool
2265 %{_mandir}/man8/bpftool-*.8*
2266 %{_mandir}/man8/bpftool.8*
2267 %endif
2268
2269 %if %{build_libbpf}
2270 %files -n %{_lib}bpf%{bpfmajor}
2271 %{_libdir}/libbpf.so.%{bpfmajor}{,.*}
2272
2273 %files -n %{_lib}bpf-devel
2274 %{_libdir}/libbpf.a
2275 %{_libdir}/libbpf.so
2276 %{_libdir}/pkgconfig/libbpf.pc
2277 %{_includedir}/bpf/bpf.h
2278 %{_includedir}/bpf/bpf_core_read.h
2279 %{_includedir}/bpf/bpf_endian.h
2280 %{_includedir}/bpf/bpf_helper_defs.h
2281 %{_includedir}/bpf/bpf_helpers.h
2282 %{_includedir}/bpf/bpf_tracing.h
2283 %{_includedir}/bpf/btf.h
2284 %{_includedir}/bpf/libbpf.h
2285 %{_includedir}/bpf/libbpf_common.h
2286 %{_includedir}/bpf/libbpf_legacy.h
2287 %{_includedir}/bpf/libbpf_version.h
2288 %{_includedir}/bpf/skel_internal.h
2289 %{_includedir}/bpf/usdt.bpf.h
2290 %endif

  ViewVC Help
Powered by ViewVC 1.1.30