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