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

  ViewVC Help
Powered by ViewVC 1.1.30