/[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 1858154 - (show annotations) (download)
Sat May 14 15:23:18 2022 UTC (6 weeks, 4 days ago) by tmb
File size: 54428 byte(s)
- Revert "drm/amd/pm: keep the BACO feature enabled for suspend"


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

  ViewVC Help
Powered by ViewVC 1.1.28