# -*- Mode: rpm-spec -*- # # NOTE !!! # (tmb) Do NOT blindly backport this spec to Mageia 8 or older as packages # are renamed and spec is reworked in several incompatible ways... # # This Specfile is based on kernel-tmb spec done by # Thomas Backlund # # The mkflavour() macroization done by Anssi Hannula # # ---------------------------------------------------------------------------- # Consult this page for extra docs: # # https://wiki.mageia.org/en/Kernel_update_workflow # # (feel free to adjust the wiki-page when adding or removing features # to the spec file). # # After building a new kernel, remember to push: # # kmod-virtualbox # kmod-xtables-addons # drakx-installer-images (both core and nonfree) # ---------------------------------------------------------------------------- # # Mageia kernels use kernel.org versioning # %define kernelversion 6 # WARNING: when patchlevel is bumped, please update drakx/kernel/list_modules.pm for new modules!!! %define patchlevel 4 # sublevel is now used for -stable patches %define sublevel 16 # Package release %define mgarel 9.lowlatency # kernel Makefile extraversion is substituted by # rcX which are either 0 (empty), X (as in rcX) %define rcX 0 # kernel base name (also name of srpm) %define kname kernel # Patch tarball tag %define ktag mga %define rpmtag %{distsuffix}%{mgaver} %if %{rcX} %define rpmrel %mkrel 0.rc%{rcX}.%{mgarel} %else %define rpmrel %mkrel %{mgarel} %endif # fakerel and fakever never change, they are used to fool # rpm/urpmi/smart and ensure the kernels are installed, # not upgraded so old kernel is not overwritten or removed %define fakever 1 %define fakerel %mkrel 1 # version defines %define kversion %{kernelversion}.%{patchlevel}.%{sublevel} %define kverrel %{kversion}-%{rpmrel} # When we are using a rcX patch, the tarball is a sublevel -1 %if %{rcX} %if %sublevel %define tar_ver %{kernelversion}.%{patchlevel} %else %define tar_ver %{kernelversion}.%(expr %{patchlevel} - 1) %endif %else %define tar_ver %{kernelversion}.%{patchlevel} %endif # Used for not making too long names for rpms or search paths %if %rcX %define buildrpmrel 0.rc%{rcX}.%{mgarel}%{rpmtag} %else %define buildrpmrel %{mgarel}%{rpmtag} %endif %define buildrel %{kversion}-%{buildrpmrel} # libbpf major %define bpfmajor 1 # Having different top level names for packges means that you have to remove # them by hard :( %define top_dir_name %{kname}-%{_arch} %define build_dir ${RPM_BUILD_DIR}/%{top_dir_name} %define src_dir %{build_dir}/linux-%{tar_ver} # Disable useless debug rpms... %global _enable_debug_packages %{nil} %global debug_package %{nil} %global __debug_package %{nil} %global __debug_install_post %{nil} %global _build_id_links none # no bytecompiling wanted as it breaks build on selftests we dont even ship # for older buildsystems %global _python_bytecompile_build 0 # for systems with >= rpm-mageia-setup-2.29-1.mga7 %global __brp_python_bytecompile %nil # Build defines %define build_doc 1 %define build_uheaders 1 %define build_source 0 %define build_devel 1 %define build_debug 0 # Build desktop i586 / 4GB %ifarch %{ix86} %define build_desktop586 0 %endif # Build desktop (i686 / 64GB) / x86_64 / arm / aarch64 %define build_desktop 1 # Build server (i686 / 64GB)/x86_64 / aarch64 %ifnarch %{arm} %define build_server 0 %else %define build_server 0 %endif # build cpupower %ifnarch %{arm} aarch64 %define build_cpupower 0 %else %define build_cpupower 0 %endif # build perf %define build_perf 0 # bpf %define build_bpftool 0 %define build_libbpf 0 # compress modules with xz %ifnarch %{arm} %define build_modxz 1 %else %define build_modxz 0 %endif # End of user definitions # buildtime override flags %{?_without_desktop586: %global build_desktop586 0} %{?_without_desktop: %global build_desktop 0} %{?_without_server: %global build_server 0} %{?_without_doc: %global build_doc 0} %{?_without_uheaders: %global build_uheaders 0} %{?_without_source: %global build_source 0} %{?_without_devel: %global build_devel 0} %{?_without_debug: %global build_debug 0} %{?_without_perf: %global build_perf 0} %{?_without_cpupower: %global build_cpupower 0} %{?_without_bpftool: %global build_bpftool 0} %{?_without_libbpf: %global build_libbpf 0} %{?_without_modxz: %global build_modxz 0} %{?_with_desktop586: %global build_desktop586 1} %{?_with_desktop: %global build_desktop 1} %{?_with_server: %global build_server 1} %{?_with_doc: %global build_doc 1} %{?_with_uheaders: %global build_uheaders 1} %{?_with_source: %global build_source 1} %{?_with_devel: %global build_devel 1} %{?_with_debug: %global build_debug 1} %{?_with_perf: %global build_perf 1} %{?_with_cpupower: %global build_cpupower 1} %{?_with_bpftool: %global build_bpftool 1} %{?_with_libbpf: %global build_libbpf 1} %{?_with_modxz: %global build_modxz 1} # For the .nosrc.rpm %define build_nosrc 0 %{?_with_nosrc: %global build_nosrc 1} %if %(if [ -z "$CC" ] ; then echo 0; else echo 1; fi) %define kmake %make_build CC="$CC" %else %define kmake %make_build %endif # there are places where parallel make don't work %define smake make # Parallelize xargs invocations on smp machines %define kxargs xargs %([ -z "$RPM_BUILD_NCPUS" ] \\\ && RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\ [ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-P $RPM_BUILD_NCPUS") # arm(64) arch matching %define target_arch %(echo %{_arch} | sed -e 's/arm.*/arm/' -e 's/aarch64/arm64/') # # SRC RPM description # Summary: Linux kernel built for Mageia Name: %{kname} Version: %{kversion} Release: %{rpmrel} License: GPLv2 Group: System/Kernel and hardware ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ExclusiveOS: Linux URL: https://www.kernel.org/ #################################################################### # # Sources # ### This is for full SRC RPM Source0: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz Source1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.sign ### This is for stripped SRC RPM %if %build_nosrc NoSource: 0 %endif # This is for disabling *config, mrproper, prepare, scripts on -devel rpms Source2: disable-mrproper-in-devel-rpms.patch Source4: README.kernel-sources # for creating stable queue patchlist Source5: generate-patchlist.sh # copy to patched source tree along with the defconfigs and run it Source10: defconfig-updater.sh Source09: defconfig-updater-simple.sh # x86_64 defconfigs Source11: defconfig-x86_64-desktop Source12: defconfig-x86_64-server # i386 defconfigs Source13: defconfig-i386-desktop586 Source14: defconfig-i386-desktop Source15: defconfig-i386-server # arm64 defconfigs Source16: defconfig-arm64-desktop Source17: defconfig-arm64-server # arm defconfigs Source18: defconfig-arm-desktop # config and systemd service file from fedora Source50: cpupower.service Source51: cpupower.config #################################################################### # # Patches # # Patch0 to Patch10 are for core kernel upgrades. # %if %sublevel Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{sublevel}.xz %endif %if %{rcX} # (tmb) Created with: # wget https://git.kernel.org/torvalds/p/v5.10-rc7/v5.9 -O patch-5.10-rc7 # xz -6e patch-5.10-rc7 Patch2: patch-%{kernelversion}.%{patchlevel}-rc%{rcX}.xz %endif ### ### Stable Queue coalesced in one single Patch ### #Patch090: stable-queue-coalesced-6.4-20230911.patch ### ### Stable Queue can be big ### Patches from 100-999 ### ### add patches here by copying contents of kernel matching queue-x.y from: ### https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git/tree/ ### to SOURCES, generate patchlist with generate-patchlist.sh and paste it here ### ### ### Arch ### Patches from 1000 ### # laptop needing pci=assign-busses (#18989, needs to be submitted upstream) Patch1000: x86-pci-toshiba-equium-a60-assign-busses.patch # If users choose a bad video mode, allow to jump to # a working one (TTL: forever) Patch1001: x86-boot-video-80x25-if-break.patch # Allow poweroff on UP machines running SMP kernels Patch1005: x86-default_poweroff_up_machines.patch # raise vmalloc to fix https://bugs.mageia.org/show_bug.cgi?id=904 Patch1010: x86-increase-default-minimum-vmalloc-area-by-64MB-to-192MB.patch # slows down boot Source1015: Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch # AMD Patch1020: arch-x86-set-l2-cache-id-on-amd-processors.patch Patch1021: x86-documentation-add-documentation-about-cluster.patch # Disabled for problems with lockups on sleep (see bug #32082) Source1030: sched-fair-Multi-LLC-select_idle_sibling.patch # TTL 6.5 Patch1035: arch-configs-defconfig-Replace-AUTOFS4_FS-by-AUTOFS_.patch # TTL 6.5 Patch1040: x86-amd_nb-Add-MI200-PCI-IDs.patch Patch1041: x86-MCE-AMD-EDAC-mce_amd-Decode-UMC_V2-ECC-errors.patch Patch1042: EDAC-amd64-Add-support-for-AMD-heterogeneous-Family-.patch Patch1043: x86-amd_nb-Re-sort-and-re-indent-PCI-defines.patch Patch1044: x86-amd_nb-Add-PCI-IDs-for-AMD-Family-1Ah-based-mode.patch Patch1045: hwmon-k10temp-Add-thermal-support-for-AMD-Family-1Ah.patch Patch1046: EDAC-amd64-Add-support-for-AMD-Family-1Ah-Models-00h.patch # Disabled for problems with lockups on sleep (see bug #32082) Source1050: x86-fpu-xstate-Fix-PKRU-covert-channel.patch # CVE-2023-46813 (from 6.5) Patch1051: x86-sev-disable-mmio-emulation-from-user-mode.patch Patch1052: x86-sev-check-iobm-for-ioio-exceptions-from-user-space.patch Patch1053: x86-sev-check-for-user-space-ioio-pointing-to-kernel-space.patch ### ### ACPI ### # CLEVO M360S acpi irq workaround Patch1100: acpi-CLEVO-M360S-disable_acpi_irq.patch # Clevo M720SR freezes with C3 Patch1105: acpi-processor-M720SR-limit-to-C2.patch # ACPI PM fixes (TTL: 5.18) Patch1130: x86-ACPI-State-Optimize-C3-entry-on-AMD-CPUs.patch ### ### Block ### # FIXME: Don't know know why this is needed Patch1200: scsi-megaraid-new-sysfs-name.patch # adds aliases to support upgrade from old dm-raid45 patch Patch1215: dm-raid-aliases.patch # disable floppy autoloading (mga #4696) Patch1220: block-floppy-disable-pnp-modalias.patch # Patch1235: ata-scsi-do-not-issue-START-STOP-UNIT-on-resume.patch ### ### bpf ### ### ### Crypto ### Patch1281: tpm_crb-Fix-an-error-handling-path-in-crb_acpi_add.patch ### ### cpufreq ### ### ### dma ### ### ### File-system ### # jbd2 #Patch1366: jbd2-remove-t_checkpoint_io_list.patch #Patch1367: jbd2-remove-journal_clean_one_cp_list.patch #Patch1368: jbd2-fix-a-race-when-checking-checkpoint-buffer-busy.patch Patch1369: jbd2-fix-checkpoint-cleanup-performance-regression.patch Patch1370: jbd2-Check-jh-b_transaction-before-remove-it-from-ch.patch Patch1371: jbd2-remove-unused-function-__cp_buffer_busy.patch # CVE-2023-5345 Patch1380: fs-smb-client-reset-password-pointer-to-null.patch ### ### FireWire ### # adding module aliases to ease upgrade from ieee1394 Patch1400: firewire-ieee1394-module-aliases.patch ### ### Firmware ### ### ### GPU/DRM ### # mga compat option #Patch1500: drm-gpu-drm-treat-nokmsboot-as-nomodeset.patch # fix for CVE-2023-5633 Patch1501: drm-vmwgfx-keep-a-gem-reference-to-user-bos-in-surfaces.patch # amdgpu # switch SI and CIK from radeon to amdgpu Patch1520: drm-amdgpu-SI-and-CIK-enabled-by-default.patch # i915 # new Q57 Host Bridge id Patch1530: char-agp-intel-new-Q57-id.patch # https://bugzilla.kernel.org/show_bug.cgi?id=206653#c19 Patch1552: i2c_nvidia_gpu-change-err-into-info.patch ### ### gpio ### ### ### hwmon ### # TTL 6.5 Patch1600: hwmon-nct6755-Add-support-for-NCT6799D.patch Patch1601: hwmon-add-HP-WMI-Sensors-driver.patch Patch1602: hwmon-hp-wmi-sensors-fix-debugfs-check.patch Patch1603: hwmon-asus-ec-sensors-add-ROG-Crosshair-X670E-Hero.patch Patch1604: hwmon-corsair-psu-add-support-for-reading-PWM-values.patch Patch1605: hwmon-corsair-psu-various-cleanups.patch Patch1606: hwmon-corsair-psu-update-Series-2022-and-2023-suppor.patch Patch1607: hwmon-nct6683-Add-another-customer-ID-for-NCT6687D-s.patch ### ### i2c ### ### ### io_uring ### ### ### iommu ### ### ### Input ### ### ### HID ### # surface bits # from: https://github.com/linux-surface #Patch1750: hid-Add-support-for-Intel-Precise-Touch-and-Stylus.patch #Patch1751: hid-Add-support-for-Intel-Touch-Host-Controller.patch #Patch1752: iommu-intel-Disable-source-id-verification-for-ITHC.patch # amd_sfh Patch1760: hid-amd_sfh-check-that-sensors-are-enabled-before-set-get-report.patch ### ### kernel ### ### ### MFD ### ### ### misc ### Patch1820: Revert-misc-rtsx-judge-ASPM-Mode-to-set-PETXCFG-Reg.patch # CVE-2023-5717 Patch1821: perf-disallow-mis-matched-inherited-group-reads.patch Patch1850: alsa-hda-cs35l41-cleanup-and-fix-double-free-in-firmware-request.patch Patch1851: alsa-hda-realtek-add-quirk-for-asus-rog-gu603zv.patch Patch1852: alsa-hda-realtek-add-quirk-for-hp-victus-16-d1xxx-to.patch Patch1853: alsa-hda-realtek-add-quirk-for-mute-leds-on-hp-envy-.patch Patch1854: alsa-hda-realtek-alc287-i2s-speaker-platform-support.patch Patch1855: alsa-hda-realtek-alc287-merge-rtk-codec-with-cs-cs35.patch Patch1856: alsa-hda-realtek-change-model-for-intel-rvp-board.patch Patch1857: alsa-hda-realtek-fixed-two-speaker-platform.patch Patch1858: alsa-hda-relatek-enable-mute-led-on-hp-laptop-15s-fq5xxx.patch Patch1859: alsa-usb-audio-fix-microphone-sound-on-nexigo-webcam.patch Patch1860: alsa-usb-audio-fix-microphone-sound-on-opencomm2-headset.patch Patch1861: drm-nouveau-disp-fix-dp-capable-dsm-connectors.patch Patch1862: drm-panel-orientation-quirks-add-quirk-for-one-mix-2.patch Patch1863: hid-logitech-hidpp-fix-kernel-crash-on-receiver-usb-disconnect.patch Patch1864: usb-serial-option-add-entry-for-sierra-em9191-with-new-firmware.patch Patch1865: usb-serial-option-add-fibocom-to-dell-custom-modem-fm101r-gl.patch Patch1866: usb-serial-option-add-telit-le910c4-wwx-0x1035-composition.patch Patch1867: x86-cpu-fix-amd-erratum-1485-on-zen4-based-cpus.patch Patch1868: x86-fpu-allow-caller-to-constrain-xfeatures-when-copying-to-uabi-buffer.patch Patch1869: x86-kvm-svm-refresh-avic-inhibition-in-svm_leave_nested.patch ### ### MM ### ### ### Network ### # SiS 190 fixes Patch1900: net-sis190-fix-list-usage.patch # netfilter IFWLOG support Patch1910: net-netfilter-IFWLOG.patch Patch1911: net-netfilter-IFWLOG-mdv.patch Patch1912: net-netfilter-IFWLOG-2.6.35-buildfix.patch Patch1913: net-netfilter-IFWLOG-2.6.37-buildfix.patch Patch1914: net-ipv4-netfilter-ipt_IFWLOG-3.6-buildfix.patch Patch1915: net-netfilter-IFWLOG-3.7-buildfix.patch Patch1916: net-netfilter-IFWLOG-remove-unused-label.patch Patch1917: net-netfilter-ipt_IFWLOG-4.12-buildfix.patch Patch1918: net-netfilter-IFWLOG-5.0-buildfix.patch # netfilter psd support Patch1920: net-netfilter-psd.patch Patch1921: net-netfilter-psd-mdv.patch Patch1922: net-netfilter-psd-2.6.35-buildfix.patch Patch1923: net-netfilter-psd-fix-redefines.patch # backported from git upstream (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/) # CVE-2023-4921 Patch1925: 0001-net-sched-sch_qfq-Fix-UAF-in-qfq_dequeue.patch # CVE-2023-5197 Patch1926: 0001-netfilter-nf_tables-disallow-rule-removal-from-chain.patch # CVE-2023-42756 Patch1927: 0001-netfilter-ipset-Fix-race-between-IPSET_CMD_CREATE-an.patch # CVE-2023-42754 Patch1928: 0001-ipv4-fix-null-deref-in-ipv4_link_failure.patch # CVE-2023-5178 Patch1929: nvmet-tcp-fix-a-possible-uaf-in-queue-intialization-setup.patch # CVE-2023-39189 Patch1931: netfilter-nfnetlink_osf-avoid-oob-read.patch # rtw88 wifi # add alias for the replaced r8822be staging driver Patch1950: net-wireless-rtw88-add-r8822be-alias.patch # add alias for the replaced 8723de 3rdparty driver Patch1951: net-wireless-rtw88-add-8723de-alias.patch # prereq for 8723DS support Patch1952: mmc-sdio-Add-rename-SDIO-ID-of-the-RTL8723DS-SDIO-wi.patch # TTL 6.5 Patch1953: wifi-rtw88-Add-support-for-the-SDIO-based-RTL8723DS-.patch Patch1954: wifi-rtw88-rtw8723d-Implement-RTL8723DS-SDIO-efuse-p.patch # iwlfiwi Patch1980: net-wireless-iwlwifi-add-new-pci-id-for-6235.patch Patch1981: wifi-iwlwifi-pcie-add-support-for-AX101NGW.patch Source1982: iwlwifi-cfg-Add-missing-MODULE_FIRMWARE-for-pnvm.patch ### ### PCI ### Patch2001: PCI-Delay-after-FLR-of-Solidigm-P44-Pro-NVMe.patch ### ### pinctrl ### ### ### Platform ### # Allow access to Shuttle WMI interface controls # (Mainly allow turning on/off webcam and wireless on Shuttle DA18IE and DA18IM) Patch2050: platform-x86-add-shuttle-wmi-driver.patch Patch2051: platform-x86-shuttle-wmi-drop-devinit-exit.patch Patch2052: platform-x86-shuttle-wmi-4.2-buildfix.patch Patch2053: platform-x86-shuttle-wmi-4.13-buildfix.patch Patch2054: platform-x86-shuttle-wmi-kernel-5.5.patch ### ### PM ### ### ### Sound ### ### ### SPI ### ### ### Staging ### # add rtl8812 support (mga#21043) # from https://github.com/aircrack-ng/rtl8812au.git Patch2200: staging-rtl8812au.patch Patch2201: staging-rtl8812au-rename.patch Patch2202: staging-rtl8812au-Kconfig-Makefile.patch ### ### Thermal ### ### ### Thunderbolt ### ### ### tpm ### Patch2282: tpm-tpm_tis-Disable-interrupts-categorically-for-Lenovo.patch ### ### USB ### Patch2300: hid-usbhid-IBM-BladeCenterHS20-quirk.patch Patch2310: usb-storage-unusual_devs-add-id.patch Patch2311: usb-storage-unusual_devs-add-id-2.6.37-buildfix.patch ### ### V4L ### # pwc driver name in /proc/bus/devices, /sys fix and "advertisement" removal Patch2400: media-usb-pwc-lie-in-proc-usb-devices.patch ### ### Video ### # Mageia framebuffer boot logo Patch2500: video-mageia-logo.patch ### ### Virt ### # fix gcc-10 build Patch2550: KVM-squelch-uninitialized-variable-warning.patch # CVE-2023-5090 Patch2551: x86-kvm-svm-always-update-the-x2avic-msr-interception.patch # CVE-2023-34324 Patch2552: xen-events-replace-evtchn_rwlock-with-rcu.patch ### ### Tools ### # wipe powerpc refrence so we can nuke dangling symlinks (mga#17676) Patch2600: tools-testing-selftest-Makefile-remove-powerpc-reference.patch # fix perf build Patch2605: tools-perf-ui-include-slang.patch ### ### UAPI ### Patch2700: uapi-avoid-namespace-conflict-in-linux-posix_types.h.patch ### ### Python fixes ### Patch4000: linux-6.4-python3.patch ### ### TTY ### # broken rtla cleaner Patch6000: hack-broken-rtla-cleaner.patch ### Fixes from FC kernel # Inspur Advantech PCI ids Patch7000: 0001-scsi-smartpqi-add-inspur-advantech-ids.patch # Vulcan AHCI PCI bar (aarch64) Patch7001: 0001-Vulcan-AHCI-PCI-bar-fix-for-Broadcom-Vulcan-early-si.patch # Low Latency patchset # # BORE Patch20000: 0001-linux6.4-bore3.1.2.patch # Futex Patch20100: 0001-futex-6.4-Add-entry-point-for-FUTEX_WAIT_MULTIPLE-op.patch # Steam Patch20200: 0001-x86-Introduce-Steam-Deck-Patches.patch # ZEN Patch20300: 0002-ZEN-mm-Lower-the-non-hugetlbpage-pageblock-size-to-r.patch Patch20301: 0020-ZEN-INTERACTIVE-Use-BFQ-as-the-elevator-for-SQ-devic.patch Patch20302: 0021-ZEN-INTERACTIVE-Base-config-item.patch Patch20303: 0002-ZEN-Add-VHBA-driver.patch Patch20304: 0003-ZEN-Add-OpenRGB-patches.patch Patch20305: 0005-ZEN-PCI-Add-Intel-remapped-NVMe-device-support.patch Patch20306: 0007-ZEN-Restore-CONFIG_OPTIMIZE_FOR_PERFORMANCE_O3.patch Patch20307: 0010-ZEN-Initialize-ata-before-graphics.patch Patch20308: 0014-ZEN-intel-pstate-Implement-enable-parameter.patch Patch20309: 0015-ZEN-Set-default-max-map-count-to-INT_MAX-5.patch Patch20310: 0016-ZEN-mm-Stop-kswapd-early-when-nothing-s-waiting-for-.patch Patch20311: 0031-ZEN-mm-Don-t-hog-the-CPU-and-zone-lock-in-rmqueue_bu.patch Patch20312: 0003-ZEN-Add-OpenRGB-patches-fix.patch # Arch/manj Patch20400: 0003-cpufreq-intel_pstate-Fix-scaling-for-hybrid-capable-.patch # (sleep) Patch20401: 0001-ALSA-cs35l41-Use-mbox-command-to-enable-speaker-outp.patch Patch20402: 0002-ALSA-cs35l41-Poll-for-Power-Up-Down-rather-than-wait.patch Patch20403: 0003-ALSA-hda-cs35l41-Check-mailbox-status-of-pause-comma.patch Patch20404: 0004-ALSA-hda-cs35l41-Ensure-we-correctly-re-sync-regmap-.patch Patch20405: 0005-ALSA-hda-cs35l41-Ensure-we-pass-up-any-errors-during.patch Patch20406: 0006-ALSA-hda-cs35l41-Move-Play-and-Pause-into-separate-f.patch Patch20407: 0007-ALSA-hda-hda_component-Add-pre-and-post-playback-hoo.patch Patch20408: 0008-ALSA-hda-cs35l41-Use-pre-and-post-playback-hooks.patch Patch20409: 0009-ALSA-hda-cs35l41-Rework-System-Suspend-to-ensure-cor.patch Patch20410: 0010-ALSA-hda-cs35l41-Add-device_link-between-HDA-and-cs3.patch Patch20411: 0011-ALSA-hda-cs35l41-Ensure-amp-is-only-unmuted-during-p.patch Patch20412: 0999-patch_realtek.patch # Misc Patch20504: 0004-drivers-firmware-skip-simpledrm-if-nvidia-drm.modese.patch Patch20505: 0005-Fix-sound-on-ASUS-Zenbook-UM5302TA.patch Patch20507: 0007-Bluetooth-btusb-work-around-command-0xfc05-tx-timeou.patch Patch20510: 0010-decompressor-provide-missing-prototypes.patch Patch20511: 0011-x86-csum-Improve-performance-of-csum_partial.patch Patch20512: 0012-mm-compaction-skip-all-non-migratable-pages-during-s.patch Patch20514: 0014-readahead-correct-the-start-and-size-in-ondemand_rea.patch # AMD P-State Patch20600: 0001-cpufreq-amd-pstate-Set-default-governor-to-schedutil.patch Patch20601: 0002-cpufreq-Fail-driver-register-if-it-has-adjust_perf-w.patch Patch20602: 0003-cpufreq-amd-pstate-Write-CPPC-enable-bit-per-socket.patch Patch20603: 0004-ACPI-CPPC-Add-definition-for-undefined-FADT-preferre.patch Patch20604: 0005-cpufreq-amd-pstate-Set-a-fallback-policy-based-on-pr.patch Patch20605: 0006-cpufreq-amd-pstate-Add-a-kernel-config-option-to-set.patch Patch20606: 0007-cpufreq-amd-pstate-ut-Modify-the-function-to-get-the-rediff.patch Patch20607: 0008-x86-Drop-CPU_SUP_INTEL-from-SCHED_MC_PRIO-for-the-ex.patch Patch20608: 0009-acpi-cppc-Add-get-the-highest-performance-cppc-contr.patch Patch20609: 0010-cpufreq-amd-pstate-Enable-AMD-Pstate-Preferred-Core-.patch Patch20610: 0011-cpufreq-Add-a-notification-message-that-the-highest-.patch Patch20611: 0012-cpufreq-amd-pstate-Update-AMD-Pstate-Preferred-Core-.patch Patch20612: 0013-Documentation-amd-pstate-introduce-AMD-Pstate-Prefer.patch Patch20613: 0014-Documentation-introduce-AMD-Pstate-Preferrd-Core-mod.patch # fixes Patch20700: 0013-x86-barrier-Do-not-serialize-MSR-accesses-on-AMD.patch Patch20701: 0016-x86-mm-Remove-INVPCID-single-feature-tracking.patch #Already applied since 6.4.16. #Patch20702: 0017-block-mq-deadline-use-correct-way-to-throttling-writ.patch # V4L2 LOOPBACK Patch20900: 0001-media-v4l2-core-add-v4l2loopback.patch # ROG Ally Patch21000: 0203-asus-ally-asus-hid-6.3-v2.patch Source21001: 0206-asus-ally-bluetooth.patch # BBR3 (replaces BBR) Patch22000: 0001-bbr3-6.4-initial-import.patch # Graysky Patch23000: 0001-cpu-6.4-merge-graysky-s-patchset.patch # AMD RAPL Patch24000: 0004-perf-x86-rapl-Enable-Core-RAPL-for-AMD.patch Patch24001: 0005-perf-x86-rapl-Fix-energy-cores-event.patch # HHoffstaette Patch25000: net-20230717-get-rid-of-sysctl_tcp_adv_win_scale.patch # xfs Patch25501: 0001-xfs-don-t-reverse-order-of-items-in-bulk-AIL-inserti.patch Patch25502: 0002-xfs-use-deferred-frees-for-btree-block-freeing.patch Patch25503: 0003-xfs-pass-alloc-flags-through-to-xfs_extent_busy_flus.patch Patch25504: 0004-xfs-allow-extent-free-intents-to-be-retried.patch Patch25505: 0005-xfs-don-t-block-in-busy-flushing-when-freeing-extent.patch Patch25506: 0006-xfs-journal-geometry-is-not-properly-bounds-checked.patch Patch25507: 0007-xfs-AGF-length-has-never-been-bounds-checked.patch Patch25508: 0008-xfs-fix-bounds-check-in-xfs_defer_agfl_block.patch Patch25509: 0009-xfs-AGI-length-should-be-bounds-checked.patch # Clearlinux Patch26000: 0101-i8042-decrease-debug-message-level-to-info.patch Patch26001: 0102-increase-the-ext4-default-commit-age.patch Patch26002: 0103-silence-rapl.patch Patch26003: 0108-smpboot-reuse-timer-calibration.patch Patch26004: 0112-init-wait-for-partition-and-retry-scan.patch Patch26005: 0118-add-scheduler-turbo3-patch.patch Patch26006: 0120-do-accept-in-LIFO-order-for-cache-efficiency.patch Patch26007: 0121-locking-rwsem-spin-faster.patch Patch26008: 0123-print-CPU-that-faults.patch Patch26009: 0125-nvme-workaround.patch Patch26010: 0126-don-t-report-an-error-if-PowerClamp-run-on-other-CPU.patch Patch26011: 0127-lib-raid6-add-patch.patch Patch26012: 0128-itmt_epb-use-epb-to-scale-itmt.patch Patch26013: 0130-itmt2-ADL-fixes.patch Patch26014: 0131-add-a-per-cpu-minimum-high-watermark-an-tune-batch-s.patch # uses -mpopcnt (to review, missed on some CPU to be used only for >= march=westmere|x86_64-v2) Patch26015: 0133-novector-new.patch # doesn't work on i586 Source26016: 0134-md-raid6-algorithms-scale-test-duration-for-speedier.patch # Patch26017: 0135-initcall-only-print-non-zero-initcall-debug-to-speed.patch Patch26018: scale-rebased.patch Patch26019: libsgrowdown.patch Patch26020: adlrdt.patch Patch26021: epp-retune.patch Patch26022: tcptuning.patch Patch26023: 0001-mm-memcontrol-add-some-branch-hints-based-on-gcov-an.patch Patch26024: 0002-sched-core-add-some-branch-hints-based-on-gcov-analy.patch Patch26025: 0136-crypto-kdf-make-the-module-init-call-a-late-init-cal.patch Patch26026: ratelimit-sched-yield.patch Patch26027: scale-net-alloc.patch Patch26028: 0158-clocksource-only-perform-extended-clocksource-checks.patch Patch26029: better_idle_balance.patch Patch26030: 0161-ACPI-align-slab-buffers-for-improved-memory-performa.patch # tied to patch 0133-novector-new above Patch26031: 0162-extra-optmization-flags-new.patch # don't use -mpopcnt for now Patch26032: 0162-extra-optmization-flags-new2.patch # Patch26033: sched-hybrid1.patch #Patch26034: sched-hybrid2.patch Patch26035: sched-hybrid3.patch Patch26036: sched-hybrid4-rebased.patch Patch26037: 0001-sched-migrate-rebased.patch Patch26038: 0002-sched-migrate.patch # maple-LRU # opensuse Patch29000: ACPI-video-Add-backlight-native-DMI-quirk-for-Lenovo.patch Patch29001: HID-microsoft-Add-rumble-support-to-latest-xbox-cont.patch Patch29002: Input-elan_i2c-Add-deny-list-for-Lenovo-Yoga-Slim-7.patch # surface (https://github.com/linux-surface/kernel) Patch30001: 0001-surface3-oemb-add-DMI-matches-for-Surface-3-with-bro.patch Patch30002: 0002-mwifiex-Add-quirk-resetting-the-PCI-bridge-on-MS-Sur.patch Patch30003: 0003-mwifiex-pcie-disable-bridge_d3-for-Surface-gen4.patch Patch30004: 0004-Bluetooth-btusb-Lower-passive-lescan-interval-on-Mar.patch Patch30005: 0005-ath10k-Add-module-parameters-to-override-board-files.patch Patch30006: 0006-misc-mei-Add-missing-IPTS-device-IDs.patch Patch30007: 0007-iommu-ipts-use-IOMMU-passthrough-mode-for-IPTS.patch Patch30008: 0008-hid-Add-support-for-Intel-Precise-Touch-and-Stylus.patch Patch30009: 0009-Update-IPTS-from-module-repo.patch Patch30010: 0010-iommu-intel-Disable-source-id-verification-for-ITHC.patch Patch30011: 0011-hid-Add-support-for-Intel-Touch-Host-Controller.patch Patch30012: 0012-i2c-acpi-Implement-RawBytes-read-access.patch Patch30013: 0013-platform-surface-Add-driver-for-Surface-Book-1-dGPU-.patch Patch30014: 0014-Input-soc_button_array-support-AMD-variant-Surface-d.patch Patch30015: 0015-platform-surface-surfacepro3_button-don-t-load-on-am.patch Patch30016: 0016-USB-quirks-Add-USB_QUIRK_DELAY_INIT-for-Surface-Go-3.patch Patch30017: 0017-hid-multitouch-Turn-off-Type-Cover-keyboard-backligh.patch Patch30018: 0018-hid-multitouch-Add-support-for-surface-pro-type-cove.patch Patch30019: 0019-PCI-Add-quirk-to-prevent-calling-shutdown-mehtod.patch Patch30020: 0020-platform-surface-gpe-Add-support-for-Surface-Pro-9.patch Patch30021: 0021-ACPI-delay-enumeration-of-devices-with-a-_DEP-pointi.patch Patch30022: 0022-iommu-intel-ipu-use-IOMMU-passthrough-mode-for-Intel.patch Patch30023: 0023-platform-x86-int3472-Enable-I2c-daisy-chain.patch Patch30024: 0024-media-ipu3-cio2-Move-functionality-from-.complete-to.patch Patch30025: 0025-media-ipu3-cio2-Re-add-.complete-to-ipu3-cio2.patch Patch30026: 0026-media-i2c-Add-driver-for-DW9719-VCM.patch Patch30027: 0027-drivers-media-i2c-Fix-DW9719-dependencies.patch Patch30028: 0028-platform-x86-int3472-Remap-reset-GPIO-for-INT347E.patch Patch30029: 0029-media-i2c-Clarify-that-gain-is-Analogue-gain-in-OV72.patch Patch30030: 0030-media-v4l2-core-Acquire-privacy-led-in-v4l2_async_re.patch Patch30031: 0031-platform-x86-int3472-Add-MFD-cell-for-tps68470-LED.patch Patch30032: 0032-include-mfd-tps68470-Add-masks-for-LEDA-and-LEDB.patch Patch30033: 0033-leds-tps68470-Add-LED-control-for-tps68470.patch Patch30034: 0034-ACPI-Add-quirk-for-Surface-Laptop-4-AMD-missing-irq-.patch Patch30035: 0035-ACPI-Add-AMD-13-Surface-Laptop-4-model-to-irq-7-over.patch Patch30036: 0036-acpi-allow-usage-of-acpi_tad-on-HW-reduced-platforms.patch # Patch30038: 0024-platform-x86-int3472-Enable-I2c-daisy-chain.patch Patch30039: 0038-Update-IPTS-from-module-repo.patch Patch30040: 0039-Update-IPTS-from-module-repo.patch Patch30041: 0040-Update-IPTS-from-module-repo.patch # Fedora Patch31000: 5087-ACPI-button-Add-lid-disable-DMI-quirk-for-Nextbook-A.patch # OpenMandriva # android ashmem Patch32001: revert-721412ed3d819e767cac2b06646bf03aa158aaec.patch Patch32002: android-enable-building-ashmem-and-binder-as-modules.patch Patch32003: export-symbols-needed-by-android-drivers.patch # # Imagination PowerVR (arm64 only) Source32004: imagination-drm-01.patch Source32005: imagination-drm-02.patch Source32006: imagination-drm-03.patch Source32007: imagination-drm-04.patch Source32008: imagination-drm-05.patch Source32009: imagination-drm-06.patch Source32010: imagination-drm-07.patch Source32011: imagination-drm-08.patch Source32012: imagination-drm-09.patch Source32013: imagination-drm-10.patch Source32014: imagination-drm-11.patch Source32015: imagination-drm-12.patch Source32016: imagination-drm-13.patch Source32017: imagination-drm-14.patch Source32018: imagination-drm-15.patch Source32019: imagination-drm-16.patch Source32020: imagination-drm-17.patch # misc Patch32021: Unknow-SSD-HFM128GDHTNG-8310B-QUIRK_NO_APST.patch Patch32022: linux-5.5-corsair-strafe-quirks.patch Patch32023: linux-6.4-GameSir-T4.patch # Ubuntu Patch33000: 2003-drm-amd-display-edp-do-not-add-non-edid-timings.patch # xammod Patch34000: 0003-XANMOD-block-mq-deadline-Increase-write-priority-to-.patch Patch34001: 0004-XANMOD-block-mq-deadline-Disable-front_merges-by-def.patch Patch34002: 0011-XANMOD-Makefile-Disable-GCC-vectorization-on-trees.patch # disable SMT at boot Patch43000: 0001-disable-smt-at-boot.patch # fix fmt argument Patch43001: 0001-fix-printf-drivers-hid-ips-cmd.patch # fix 64bit division on 32bit arch Patch43002: 0001-fix-bbr-64bit-division.patch #END #################################################################### # Defines for the things that are needed for all the kernels # %define common_desc_kernel The kernel package contains the Linux kernel (vmlinuz), the core of your \ Mageia operating system. The kernel handles the basic functions \ of the operating system: memory allocation, process allocation, device \ input and output, etc. %define common_desc_kernel_smp This kernel relies on in-kernel smp alternatives to switch between up & smp \ mode depending on detected hardware. To force the kernel to boot in single \ processor mode, use the "nosmp" boot parameter. ### Global Requires/Provides %define requires1 bootloader-utils >= 1.16-1 %define requires2 dracut >= 046-2 %define requires3 kmod >= 12-2 %define requires4 sysfsutils >= 2.1.0-16 %define requires5 kernel-firmware >= 20190603-1 # ldetect-lst with SI/CIK swich from radeon to amdgpu %define requires6 ldetect-lst >= 0.6.25-1 %define kprovides1 %{kname} = %{kverrel} %define kprovides2 kernel = %{tar_ver} %define kprovides3 alsa = 1.0.26 %define kprovides_server drbd-api = 88 # conflict dkms packages that dont support kernel-6.2 %define kconflicts1 dkms-broadcom-wl < 6.30.223.271-66 %define kconflicts2 dkms-nvidia-current < 525.89.02-1 %define kconflicts3 dkms-nvidia470 < 470.161.03-2 # EOL upstream 12/2022 %define kconflicts4 dkms-nvidia390 < 390.157-2 %define kconflicts5 dkms-virtualbox < 7.0.6-1 %define kconflicts6 dkms-xtables-addons < 3.23-2 # (tmb) conflict older btrfs-progs to get the new in same transaction and in initrd %define kconflicts7 btrfs-progs < 6.2.2-1 # (tmb) conflict too old radeon-firmware to get the uvd firmwares in initrd %define kconflicts8 radeon-firmware < 20230310-1 # (tmb) conflict old firmware to get the firmwares in initrd %define kconflicts9 kernel-firmware-nonfree < 20230320-1 # (tmb) conflict old microcode to get updated ones in initrd for early loading %define kconflicts10 microcode < 0.20230214-1 # (tmb) conflict old theme to get mga8 theme in initrd %define kconflicts11 mageia-gfxboot-theme < 4.5.14.11-2 # (tmb) conflict too old grub2(-efi) %define kconflicts12 grub2 < 2.02.0-15 %define kconflicts13 grub2-efi < 2.02.0-15 # (tmb) conflict too old efibootmgr %define kconflicts14 efibootmgr < 16-3 # (tmb) force new theme in initrd %define kconflicts15 mageia-theme < 8.0-2 Autoreqprov: no BuildRequires: gcc >= 12.2.1-0.20230121.1 BuildRequires: binutils >= 1:2.40-1 BuildRequires: kmod >= 12-2 BuildRequires: bc BuildRequires: gawk >= 5.2.0-4 # for crypto stuff BuildRequires: pkgconfig(openssl) # since 4.16 BuildRequires: bison BuildRequires: diffutils BuildRequires: elfutils-devel BuildRequires: flex # for headers_install BuildRequires: rsync # for cpupower %if %{build_cpupower} BuildRequires: pkgconfig(libpci) %endif # for perf %if %{build_perf} BuildRequires: audit-devel BuildRequires: binutils-devel BuildRequires: gtk2-devel BuildRequires: libunwind-devel BuildRequires: newt-devel BuildRequires: python3-devel BuildRequires: zlib-devel BuildRequires: asciidoc BuildRequires: xmlto-notex BuildRequires: perl-devel BuildRequires: systemtap-sdt-devel BuildRequires: babeltrace-devel %ifarch %{ix86} x86_64 BuildRequires: numa-devel %endif %endif %if %{build_bpftool} BuildRequires: python3-docutils BuildRequires: cap-devel %endif %description %common_desc_kernel %ifnarch %{arm} %common_desc_kernel_smp %endif # mkflavour() name flavour processor # name: the flavour name in the package name # flavour: first parameter of CreateKernel() %define mkflavour() \ %package -n %{kname}-%{1}-%{buildrel} \ Version: %{fakever} \ Release: %{fakerel} \ Provides: %kprovides1 %kprovides2 %kprovides3 \ %{expand:%%{?kprovides_%{1}:Provides: %{kprovides_%{1}}}} \ Provides: %{kname}-%{1} \ Requires(pre): %requires1 %requires2 %requires3 %requires4 \ Requires: %requires2 %requires5 %requires6 \ Conflicts: %kconflicts1 %kconflicts2 %kconflicts3 \ Conflicts: %kconflicts4 %kconflicts5 %kconflicts6 \ Conflicts: %kconflicts7 %kconflicts8 %kconflicts9 \ Conflicts: %kconflicts10 %kconflicts11 %kconflicts12 \ Conflicts: %kconflicts13 %kconflicts14 %kconflicts15 \ Provides: should-restart = system \ Provides: installonlypkg(kernel) \ Recommends: %{kname}-%{1}-latest \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ Recommends: iw cpupower microcode \ Summary: %{expand:%{summary_%(echo %{1} | sed -e "s/-/_/")}} \ Group: System/Kernel and hardware \ %description -n %{kname}-%{1}-%{buildrel} \ %common_desc_kernel %{expand:%{info_%(echo %{1} | sed -e "s/-/_/")}} \ %ifnarch %{arm} \ %common_desc_kernel_smp \ %endif \ \ %if %build_devel \ %package -n %{kname}-%{1}-devel-%{buildrel} \ Version: %{fakever} \ Release: %{fakerel} \ Requires: glibc-devel ncurses-devel make gcc perl \ Requires: gcc \ %ifarch x86_64 \ Requires: pkgconfig(libelf) \ %endif \ Summary: The kernel-devel files for %{kname}-%{1}-%{buildrel} \ Group: Development/Kernel \ Provides: %{kname}-devel = %{kverrel} \ Provides: %{kname}-%{1}-devel \ Recommends: %{kname}-%{1}-devel-latest \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ %description -n %{kname}-%{1}-devel-%{buildrel} \ This package contains the kernel files (headers and build tools) \ that should be enough to build additional drivers for \ use with %{kname}-%{1}-%{buildrel}. \ \ If you want to build your own kernel, you need to install the full \ %{kname}-source-%{buildrel} rpm. \ %endif \ \ %if %build_debug \ %package -n %{kname}-%{1}-%{buildrel}-debuginfo \ Version: %{fakever} \ Release: %{fakerel} \ Summary: Files with debuginfo for %{kname}-%{1}-%{buildrel} \ Group: Development/Debug \ Provides: kernel-debug = %{kverrel} \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ %description -n %{kname}-%{1}-%{buildrel}-debuginfo \ This package contains the files with debuginfo to aid in debug tasks \ when using %{kname}-%{1}-%{buildrel}. \ \ If you need to look at debug information or use some application that \ needs debugging info from the kernel, this package may help. \ %endif \ \ %package -n %{kname}-%{1}-latest \ Version: %{kversion} \ Release: %{rpmrel} \ Summary: Virtual rpm for latest %{kname}-%{1} \ Group: System/Kernel and hardware \ Requires: %{kname}-%{1}-%{buildrel} \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ Obsoletes: vboxadditions-kernel-%{1}-latest \ Obsoletes: kernel-tmb-%{1}-latest \ %description -n %{kname}-%{1}-latest \ This package is a virtual rpm that aims to make sure you always have the \ latest %{kname}-%{1} installed... \ \ %if %build_devel \ %package -n %{kname}-%{1}-devel-latest \ Version: %{kversion} \ Release: %{rpmrel} \ Summary: Virtual rpm for latest %{kname}-%{1}-devel \ Group: Development/Kernel \ Requires: %{kname}-%{1}-devel-%{buildrel} \ %ifarch %{ix86} \ Conflicts: arch(x86_64) \ %endif \ Provides: %{kname}-devel-latest \ %description -n %{kname}-%{1}-devel-latest \ This package is a virtual rpm that aims to make sure you always have the \ latest %{kname}-%{1}-devel installed... \ %endif \ \ %posttrans -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-posttrans \ %postun -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-postun \ \ %if %build_devel \ %post -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-post \ %preun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-preun \ %postun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-postun \ %endif \ \ %files -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1} \ %files -n %{kname}-%{1}-latest \ \ %if %build_devel \ %files -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1} \ %files -n %{kname}-%{1}-devel-latest \ %endif \ \ %if %build_debug \ %files -n %{kname}-%{1}-%{buildrel}-debuginfo -f kernel_debug_files.%{1} \ %endif %ifarch %{ix86} # # kernel-desktop586: i586, smp-alternatives, 4GB # %if %build_desktop586 %define summary_desktop586 Linux kernel for desktop use with i586 and less than 4GB RAM %define info_desktop586 This kernel is compiled for desktop use, single or \ multiple i586 processor(s)/core(s) and less than 4GB RAM (usually 3-3.5GB \ detected, if you need/want to use all 4GB or more, install kernel-server), \ using HZ_1000, voluntary preempt, CFS cpu scheduler and cfq i/o scheduler. %mkflavour desktop586 %endif %endif # # kernel-desktop: i686, smp-alternatives, 64 GB / x86_64 / arm / aarch64 # %if %build_desktop %ifarch %{ix86} %define summary_desktop Linux Kernel for desktop use with i686 and up to 64GB RAM %define info_desktop This kernel is compiled for desktop use, single or \ multiple i686 processor(s)/core(s) and up to 64GB RAM, using HZ_1000, \ voluntary preempt, CFS cpu scheduler and cfq i/o scheduler. %else %define summary_desktop Linux Kernel for desktop use with %{_arch} %define info_desktop This kernel is compiled for desktop use, single or \ multiple %{_arch} processor(s)/core(s), using HZ_1000, voluntary preempt, \ CFS cpu scheduler and cfq i/o scheduler. %endif %mkflavour desktop %endif # # kernel-server: i686, smp-alternatives, 64 GB / x86_64 / aarch64 # %if %build_server %ifarch %{ix86} %define summary_server Linux Kernel for server use with i686 & 64GB RAM %define info_server This kernel is compiled for server use, single or \ multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using \ no preempt, HZ_100, CFS cpu scheduler and cfq i/o scheduler. %else %define summary_server Linux Kernel for server use with %{_arch} %define info_server This kernel is compiled for server use, single or \ multiple %{_arch} processor(s)/core(s), using no preempt, HZ_100, \ CFS cpu scheduler and cfq i/o scheduler. %endif %mkflavour server %endif # # kernel-source # %if %build_source %package -n %{kname}-source-%{buildrel} Version: %{fakever} Release: %{fakerel} Requires: glibc-devel, ncurses-devel, make, gcc, perl, diffutils Summary: The Linux source code for %{kname}-%{buildrel} Group: Development/Kernel Autoreqprov: no Provides: kernel-source = %{kverrel} Buildarch: noarch %description -n %{kname}-source-%{buildrel} The %{kname}-source package contains the source code files for the Mageia kernel. Theese source files are only needed if you want to build your own custom kernel that is better tuned to your particular hardware. If you only want the files needed to build 3rdparty (nVidia, Ati, dkms-*,...) drivers against, install the *-devel-* rpm that is matching your kernel. # # kernel-source-latest: virtual rpm # %package -n %{kname}-source-latest Version: %{kversion} Release: %{rpmrel} Summary: Virtual rpm for latest %{kname}-source Group: Development/Kernel Requires: %{kname}-source-%{buildrel} Buildarch: noarch %description -n %{kname}-source-latest This package is a virtual rpm that aims to make sure you always have the latest %{kname}-source installed... %endif # # kernel-doc: documentation for the Linux kernel # %if %build_doc %package -n %{kname}-doc Version: %{kversion} Release: %{rpmrel} Summary: Various documentation bits found in the %{kname} source Group: Documentation Buildarch: noarch %description -n %{kname}-doc This package contains documentation files from the %{kname} source. Various bits of information about the Linux kernel and the device drivers shipped with it are documented in these files. You also might want install this package if you need a reference to the options that can be passed to Linux kernel modules at load time. %endif # # kernel userspace-headers # %if %{build_uheaders} %package -n %{kname}-userspace-headers Version: %{kversion} Release: %{rpmrel} Summary: Linux kernel header files for userspace Group: System/Kernel and hardware %rename linux-userspace-headers Provides: kernel-headers = 1:%{version}-%{release} %description -n %{kname}-userspace-headers C header files from the Linux kernel. The header files define structures and constants that are needed for building most standard programs. This package is not suitable for building kernel modules. %endif # # kernel/tools # %if %{build_perf} %package -n perf Version: %{kversion} Release: %{rpmrel} Summary: perf tool and the supporting documentation Group: System/Kernel and hardware %description -n perf the perf tool and the supporting documentation. %endif %if %{build_cpupower} %package -n cpupower Version: %{kversion} Release: %{rpmrel} Summary: the cpupower tools Group: System/Kernel and hardware Requires(post): rpm-helper >= 0.24.8-1 Requires(preun): rpm-helper >= 0.24.8-1 %description -n cpupower the cpupower tools. %post -n cpupower %_post_service cpupower %preun -n cpupower %_preun_service cpupower %package -n cpupower-devel Version: %{kversion} Release: %{rpmrel} Summary: devel files for cpupower Group: Development/Kernel Requires: cpupower = %{kversion}-%{rpmrel} Conflicts: %{_lib}cpufreq-devel %description -n cpupower-devel This package contains the development files for cpupower. %endif %if %{build_bpftool} %package -n bpftool Summary: Inspection and simple manipulation of eBPF programs and maps Group: System/Kernel and hardware %description -n bpftool This package contains the bpftool, which allows inspection and simple manipulation of eBPF programs and maps. %endif %if %{build_libbpf} %package -n %{_lib}bpf%{bpfmajor} Summary: The bpf library from kernel source Group: System/Libraries %description -n %{_lib}bpf%{bpfmajor} This package contains the kernel source bpf library. %package -n %{_lib}bpf-devel Summary: Developement files for the bpf library from kernel source Group: Development/Kernel Requires: %{_lib}bpf%{bpfmajor} %description -n %{_lib}bpf-devel This package includes libraries and header files needed for development of applications which use bpf library from kernel source. %endif # # End packages - here begins build stage # %prep %setup -q -n %top_dir_name -c cd %src_dir %autopatch -p1 # PATCH END # # Setup Begin # # install x86 defconfigs install -m 644 %{SOURCE11} %{SOURCE12} %{SOURCE13} %{SOURCE14} %{SOURCE15} arch/x86/configs/ # install arm64 defconfigs install -m 644 %{SOURCE16} %{SOURCE17} arch/arm64/configs/ # install arm defconfigs install -m 644 %{SOURCE18} arch/arm/configs/ # make sure the kernel has the sublevel we know it has... LC_ALL=C perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile # get rid of unwanted files find . -name '*~' -o -name '*.orig' -o -name '*.append' | %kxargs rm -f # fix missing exec flag on file introduced in 4.14.10-rc1 chmod 755 tools/objtool/sync-check.sh %build # Common target directories %define _kerneldir /usr/src/kernel-%{kversion}-%{buildrpmrel} %define _bootdir /boot %define _modulesdir /lib/modules %define _efidir %{_bootdir}/efi/mageia # Directories definition needed for building %define temp_root %{build_dir}/temp-root %define temp_boot %{temp_root}%{_bootdir} %define temp_modules %{temp_root}%{_modulesdir} %define temp_source %{temp_root}%{_kerneldir} PrepareKernel() { name=$1 extension=$2 echo "Make config for kernel $extension" %smake ARCH=%{target_arch} -s mrproper if [ "%{target_arch}" == "i386" -o "%{target_arch}" == "x86_64" ]; then conf_dir=arch/x86/configs else conf_dir=arch/%{target_arch}/configs fi if [ -z "$name" ]; then cp $conf_dir/defconfig-%{target_arch}-desktop .config else cp $conf_dir/defconfig-%{target_arch}-$name .config fi # make sure EXTRAVERSION says what we want it to say LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -$extension/" Makefile %smake ARCH=%{target_arch} oldconfig } BuildKernel() { KernelVer=$1 echo "Building kernel $KernelVer" %kmake ARCH=%{target_arch} -s all # Start installing stuff install -d %{temp_boot} install -m 644 System.map %{temp_boot}/System.map-$KernelVer install -m 644 .config %{temp_boot}/config-$KernelVer xz -c Module.symvers > %{temp_boot}/symvers-$KernelVer.xz %ifarch %{arm} IMAGE=zImage %else %ifarch aarch64 IMAGE=Image.gz %else IMAGE=bzImage %endif %endif cp -f arch/%{target_arch}/boot/$IMAGE %{temp_boot}/vmlinuz-$KernelVer %ifarch %{arm} aarch64 install -d %{temp_root}%{_libdir}/linux-$KernelVer/ find arch/%{target_arch}/boot/dts/ -name *.dtb -execdir install -D -m644 {} %{temp_root}%{_libdir}/linux-$KernelVer/{} \; %endif # modules install -d %{temp_modules}/$KernelVer %smake ARCH=%{target_arch} INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=$KernelVer modules_install } SaveDevel() { devel_flavour=$1 DevelRoot=/usr/src/kernel-%{kversion}-$devel_flavour-%{buildrpmrel} TempDevelRoot=%{temp_root}$DevelRoot mkdir -p $TempDevelRoot for i in $(find . -name 'Makefile*'); do cp -R --parents $i $TempDevelRoot;done for i in $(find . -name 'Kconfig*' -o -name 'Kbuild*'); do cp -R --parents $i $TempDevelRoot;done cp -fR include $TempDevelRoot cp -fR scripts $TempDevelRoot cp -fR kernel/bounds.c $TempDevelRoot/kernel cp -fR tools/include $TempDevelRoot/tools/ # needed for selinux cp -R --parents security/selinux/include/*.h $TempDevelRoot %ifarch %{arm} cp -fR arch/%{target_arch}/tools $TempDevelRoot/arch/%{target_arch}/ cp -fR arch/%{target_arch}/kernel/signal.h $TempDevelRoot/arch/%{target_arch}/kernel/ %endif %ifarch aarch64 cp -fR arch/x86/entry/syscalls/syscall_32.tbl $TempDevelRoot/arch/x86/entry/syscalls/ cp -fR arch/arm64/kernel/vdso/*.{S,sh} $TempDevelRoot/arch/arm64/kernel/vdso/ cp -fR arch/arm64/kernel/vdso/vgettimeofday.c $TempDevelRoot/arch/arm64/kernel/vdso/ cp -fR arch/arm64/tools/{cpucaps,gen-cpucaps.awk,gen-sysreg.awk,sysreg} $TempDevelRoot/arch/arm64/tools/ # aarch64 build wants x86 syscall tables cp -fR arch/x86/entry/syscalls/syscall_{32,64}.tbl $TempDevelRoot/arch/x86/entry/syscalls/ cp -fR lib/vdso/gettimeofday.c $TempDevelRoot/lib/vdso/ %endif %ifarch %{ix86} x86_64 cp -fR arch/x86/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/x86/kernel/ cp -fR arch/x86/kernel/asm-offsets_{32,64}.c $TempDevelRoot/arch/x86/kernel/ mkdir -p $TempDevelRoot/arch/x86/kvm/vmx cp -fR arch/x86/kvm/vmx/*.h $TempDevelRoot/arch/x86/kvm/vmx/ cp -fR arch/x86/kvm/*.h $TempDevelRoot/arch/x86/kvm/ cp -fR arch/x86/lib/insn.c $TempDevelRoot/arch/x86/lib/ cp -fR arch/x86/purgatory/* $TempDevelRoot/arch/x86/purgatory/ cp -fR arch/x86/entry/syscalls/syscall* $TempDevelRoot/arch/x86/entry/syscalls/ cp -fR arch/x86/include $TempDevelRoot/arch/x86/ cp -fR arch/x86/tools $TempDevelRoot/arch/x86/ %else cp -fR arch/%{target_arch}/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/%{target_arch}/kernel/ for f in $(find arch/%{target_arch} -name include); do cp -fR --parents $f $TempDevelRoot; done %endif cp -fR .config Module.symvers $TempDevelRoot # Needed for truecrypt build (Danny) cp -fR drivers/md/dm.h $TempDevelRoot/drivers/md/ # needed by include/generated/timeconst.h cp -fR kernel/time/timeconst.bc $TempDevelRoot/kernel/time/ # Needed for lirc_gpio (#39004) cp -fR drivers/media/pci/bt8xx/bttv{,p}.h $TempDevelRoot/drivers/media/pci/bt8xx/ cp -fR drivers/media/pci/bt8xx/bt848.h $TempDevelRoot/drivers/media/pci/bt8xx/ # rtl8812au mkdir -p $TempDevelRoot/drivers/staging/rtl8812au/hal/phydm/ cp -f drivers/staging/rtl8812au/hal/phydm/phydm.mk $TempDevelRoot/drivers/staging/rtl8812au/hal/phydm/ %ifarch x86_64 # orc unwinder needs theese cp -fR tools/build/Build{,.include} $TempDevelRoot/tools/build cp -fR tools/build/fixdep.c $TempDevelRoot/tools/build cp -fR tools/lib/{rbtree.c,ctype.c,str_error_r.c,string.c} $TempDevelRoot/tools/lib cp -fR tools/lib/subcmd/* $TempDevelRoot/tools/lib/subcmd cp -fR tools/objtool/* $TempDevelRoot/tools/objtool cp -fR tools/scripts/utilities.mak $TempDevelRoot/tools/scripts mkdir -p $TempDevelRoot/tools/arch/x86/tools cp -fR tools/arch/x86/tools/gen-insn-attr-x86.awk $TempDevelRoot/tools/arch/x86/tools/ mkdir -p $TempDevelRoot/tools/arch/x86/lib cp -fR tools/arch/x86/lib/{inat.c,insn.c,x86-opcode-map.txt} $TempDevelRoot/tools/arch/x86/lib/ mkdir -p $TempDevelRoot/tools/arch/x86/include/asm 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/ %endif for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 loongarch m32r m68k m68knommu metag microblaze \ mips mn10300 nds32 nios2 openrisc parisc powerpc riscv s390 score sh sparc tile unicore32 xtensa; do rm -rf $TempDevelRoot/arch/$i rm -rf $TempDevelRoot/scripts/dtc/include-prefixes/$i rm -rf $TempDevelRoot/tools/arch/$i done %ifnarch %{arm} aarch64 rm -rf $TempDevelRoot/arch/arm* rm -rf $TempDevelRoot/include/kvm/arm* rm -rf $TempDevelRoot/include/soc rm -rf $TempDevelRoot/scripts/dtc/include-prefixes/arm* rm -rf $TempDevelRoot/tools/arch/arm* %endif %ifnarch %{ix86} x86_64 rm -rf $TempDevelRoot/arch/x86 rm -rf $TempDevelRoot/tools/arch/x86 # arch/x86/ras/Kconfig is included by drivers/ras/Kconfig # and kconfig's source command seems to be evaluated even under a false conditional mkdir -p $TempDevelRoot/arch/x86/ras cp -fR arch/x86/ras/Kconfig $TempDevelRoot/arch/x86/ras %endif # (6.1 breakage) keep crypto Kconfig deps happy cp --parents arch/arm/crypto/Kconfig $TempDevelRoot cp --parents arch/arm64/crypto/Kconfig $TempDevelRoot cp --parents arch/loongarch/crypto/Kconfig $TempDevelRoot cp --parents arch/mips/crypto/Kconfig $TempDevelRoot cp --parents arch/powerpc/crypto/Kconfig $TempDevelRoot cp --parents arch/s390/crypto/Kconfig $TempDevelRoot cp --parents arch/sparc/crypto/Kconfig $TempDevelRoot cp --parents arch/x86/crypto/Kconfig $TempDevelRoot # Clean the scripts tree, and make sure everything is ok (sanity check) # running prepare+scripts (tree was already "prepared" in build) pushd $TempDevelRoot >/dev/null %smake ARCH=%{target_arch} -s prepare scripts %smake ARCH=%{target_arch} -s clean popd >/dev/null rm -f $TempDevelRoot/.config.old # fix permissions chmod -R a+rX $TempDevelRoot # disable mrproper in -devel rpms patch -p1 --fuzz=0 -d $TempDevelRoot -i %{SOURCE2} kernel_devel_files=../kernel_devel_files.$devel_flavour ### Create the kernel_devel_files.* cat > $kernel_devel_files < $kernel_devel_files-post < $kernel_devel_files-preun < $kernel_devel_files-postun </dev/null EOF } SaveDebug() { debug_flavour=$1 install -m 644 vmlinux \ %{temp_boot}/vmlinux-%{kversion}-$debug_flavour-%{buildrpmrel} kernel_debug_files=../kernel_debug_files.$debug_flavour echo "%{_bootdir}/vmlinux-%{kversion}-$debug_flavour-%{buildrpmrel}" \ >> $kernel_debug_files find %{temp_modules}/%{kversion}-$debug_flavour-%{buildrpmrel}/kernel \ -name "*.ko" | \ %kxargs -I '{}' objcopy --only-keep-debug '{}' '{}'.debug find %{temp_modules}/%{kversion}-$debug_flavour-%{buildrpmrel}/kernel \ -name "*.ko" | %kxargs -I '{}' \ sh -c 'cd `dirname {}`; \ objcopy --add-gnu-debuglink=`basename {}`.debug \ --strip-debug `basename {}`' pushd %{temp_modules} find %{kversion}-$debug_flavour-%{buildrpmrel}/kernel \ -name "*.ko.debug" > debug_module_list popd cat %{temp_modules}/debug_module_list | \ sed 's|\(.*\)|%{_modulesdir}/\1|' >> $kernel_debug_files cat %{temp_modules}/debug_module_list | \ sed 's|\(.*\)|%exclude %{_modulesdir}/\1|' \ >> ../kernel_exclude_debug_files.$debug_flavour rm -f %{temp_modules}/debug_module_list } CreateFiles() { kernel_flavour=$1 kernel_files=../kernel_files.$kernel_flavour ker="vmlinuz" ### Create the kernel_files.* cat > $kernel_files <> $kernel_files %endif ### Create kernel Posttrans script cat > $kernel_files-posttrans < /dev/null if [ -e initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img ]; then ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel} vmlinuz-$kernel_flavour ln -sf vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel} vmlinuz ln -sf initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img initrd-$kernel_flavour.img ln -sf initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img initrd.img fi popd > /dev/null EOF ### Create kernel Postun script on the fly cat > $kernel_files-postun < /dev/null if [ -f "vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel}" ]; then echo "The kernel is still installed in postun, probably a reinstall, skipping cleanup." >&2 exit fi if [ -L vmlinuz-$kernel_flavour ]; then if [ "$(readlink vmlinuz-$kernel_flavour)" = "vmlinuz-%{kversion}-$kernel_flavour-%{buildrpmrel}" ]; then rm -f vmlinuz-$kernel_flavour fi fi if [ -L initrd-$kernel_flavour.img ]; then if [ "$(readlink initrd-$kernel_flavour.img)" = "initrd-%{kversion}-$kernel_flavour-%{buildrpmrel}.img" ]; then rm -f initrd-$kernel_flavour.img fi fi popd > /dev/null rm -rf /lib/modules/%{kversion}-$kernel_flavour-%{buildrpmrel} >/dev/null /sbin/kernel_remove_initrd %{kversion}-$kernel_flavour-%{buildrpmrel} /sbin/installkernel -R %{kversion}-$kernel_flavour-%{buildrpmrel} if [ -d /var/lib/dkms ]; then rm -f /var/lib/dkms/*/kernel-%{kversion}-$devel_flavour-%{buildrpmrel}-%{_target_cpu} >/dev/null rm -rf /var/lib/dkms/*/*/%{kversion}-$devel_flavour-%{buildrpmrel} >/dev/null rm -f /var/lib/dkms-binary/*/kernel-%{kversion}-$devel_flavour-%{buildrpmrel}-%{_target_cpu} >/dev/null rm -rf /var/lib/dkms-binary/*/*/%{kversion}-$devel_flavour-%{buildrpmrel} >/dev/null fi EOF } CreateKernel() { flavour=$1 PrepareKernel $flavour $flavour-%{buildrpmrel} BuildKernel %{kversion}-$flavour-%{buildrpmrel} %if %build_devel SaveDevel $flavour %endif %if %build_debug SaveDebug $flavour %endif CreateFiles $flavour } ### # DO it... ### # Create a simulacro of buildroot rm -rf %{temp_root} install -d %{temp_root} # make sure we are in the directory cd %src_dir %ifarch %{ix86} %if %build_desktop586 CreateKernel desktop586 %endif %endif %if %build_desktop CreateKernel desktop %endif %if %build_server CreateKernel server %endif # set extraversion to match srpm to get nice version reported by the tools LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile # build perf %if %{build_perf} # perf %smake -s -C tools/perf NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 NO_LIBTRACEEVENT=1 \ HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 NO_JVMTI=1 prefix=%{_prefix} lib=%{_lib} all %smake -C tools/perf -s NO_LIBTRACEEVENT=1 prefix=%{_prefix} man %endif %if %{build_cpupower} # cpupower # make sure version-gen.sh is executable. chmod +x tools/power/cpupower/utils/version-gen.sh %make_build -C tools/power/cpupower CPUFREQ_BENCH=false %endif # build bpftool %if %{build_bpftool} pushd tools/bpf/bpftool make popd %endif # build libbpf %if %{build_libbpf} pushd tools/lib/bpf make V=1 popd %endif # We don't make to repeat the depend code at the install phase %if %build_source PrepareKernel "" %{buildrpmrel}custom %smake ARCH=%{target_arch} -s mrproper %endif ### ### install ### %install install -m 644 %{SOURCE4} . cd %src_dir # Directories definition needed for installing %define target_boot %{buildroot}%{_bootdir} %define target_modules %{buildroot}%{_modulesdir} %define target_headers %{buildroot}%{_prefix} %define target_source %{buildroot}%{_kerneldir} # We want to be able to test several times the install part rm -rf %{buildroot} cp -a %{temp_root} %{buildroot} # Create directories infastructure %if %build_source install -d %{target_source} tar cf - . | tar xf - -C %{target_source} chmod -R a+rX %{target_source} # we remove all the source files that we don't ship # first architecture files for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 loongarch m32r m68k m68knommu metag microblaze \ mips nds32 nios2 openrisc parisc powerpc riscv s390 score sh sh64 sparc tile unicore32 v850 xtensa mn10300; do rm -rf %{target_source}/arch/$i rm -rf %{target_source}/scripts/dtc/include-prefixes/$i rm -rf %{target_source}/tools/arch/$i rm -rf %{target_source}/tools/testing/selftests/$i done %ifnarch %{arm} aarch64 rm -rf %{target_source}/include/kvm/arm* rm -rf %{target_source}/scripts/dtc/include-prefixes/arm* rm -rf %{target_source}/tools/arch/arm* %endif # other misc files 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} rm -rf %{target_source}/.tmp_depmod/ # more cleaning pushd %{target_source} # lots of gitignore files find -iname ".gitignore" -delete # clean tools tree %smake -C tools clean %smake -C tools/build clean %smake -C tools/build/feature clean # dont ship generated vdso.so* %ifarch aarch64 rm -f arch/arm64/kernel/vdso/vdso.so* %endif popd # nuke last as it gets re-created rm -f %{target_source}/.cache.mk #endif %build_source %endif # compressing modules %if %{build_modxz} find %{target_modules} -name "*.ko" | %kxargs xz -6 %else find %{target_modules} -name "*.ko" | %kxargs gzip -9 %endif # We used to have a copy of PrepareKernel here # Now, we make sure that the thing in the linux dir is what we want it to be for i in %{target_modules}/*; do rm -f $i/build $i/source done # sniff, if we compressed all the modules, we change the stamp :( # we really need the depmod -ae here pushd %{target_modules} for i in *; do /sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i echo $? done for i in *; do pushd $i echo "Creating modules.description for $i" modules=`find . -name "*.ko.[g,x]z"` echo $modules | xargs /sbin/modinfo \ | perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!; $name =~ s!.*/!!' > modules.description popd done popd # need to set extraversion to match srpm again to avoid rebuild LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile # install userspace-headers %if %{build_uheaders} %smake ARCH=%{target_arch} headers_install INSTALL_HDR_PATH=%{target_headers} # for drakx cp include/linux/pci_ids.h %{target_headers}/include/linux/ %endif %if %{build_perf} # perf tool binary and supporting scripts/binaries %smake -s -C tools/perf V=1 DESTDIR=%{buildroot} NO_PERF_READ_VDSO32=1 NO_PERF_READ_VDSOX32=1 WERROR=0 NO_LIBUNWIND=1 \ HAVE_CPLUS_DEMANGLE=1 NO_GTK2=1 NO_STRLCPY=1 NO_BIONIC=1 NO_JVMTI=1 NO_LIBTRACEEVENT=1 prefix=%{_prefix} lib=%{_lib} install # perf man pages (note: implicit rpm magic compresses them later) make -C tools/perf V=1 NO_LIBTRACEEVENT=1 DESTDIR=%{buildroot} prefix=%{_prefix} install-man # remove perf files we dont ship rm -rf %{buildroot}/usr/lib/perf/examples rm -rf %{buildroot}/usr/lib/perf/include/bpf rm -rf %{buildroot}/usr/include/perf/perf_dlfilter.h %endif %if %{build_cpupower} make -C tools/power/cpupower DESTDIR=%{buildroot} libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install rm -f %{buildroot}%{_libdir}/*.{a,la} %find_lang cpupower mv cpupower.lang ../ chmod 0755 %{buildroot}%{_libdir}/libcpupower.so* mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig install -m644 %{SOURCE50} %{buildroot}%{_unitdir}/cpupower.service install -m644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/cpupower %endif # install bpftool %if %{build_bpftool} pushd tools/bpf/bpftool make DESTDIR=%{buildroot} prefix=%{_prefix} bash_compdir=%{_sysconfdir}/bash_completion.d/ mandir=%{_mandir} install doc-install popd %endif # install libbpf %if %{build_libbpf} pushd tools/lib/bpf make DESTDIR=%{buildroot} prefix=%{_prefix} libdir=%{_libdir} V=1 install install_headers popd %endif ### ### clean ### %clean rm -rf %{buildroot} # We don't want to remove this, the whole reason of its existence is to be # able to do several rpm --short-circuit -bi for testing install # phase without repeating compilation phase #rm -rf %{temp_root} ### ### source and doc file lists ### %if %build_source %files -n %{kname}-source-%{buildrel} %doc %{_kerneldir}/LICENSES %dir %{_kerneldir} %dir %{_kerneldir}/arch %dir %{_kerneldir}/include %{_kerneldir}/.rustfmt.toml %{_kerneldir}/Documentation %{_kerneldir}/arch/Kconfig %{_kerneldir}/arch/arm %{_kerneldir}/arch/arm64 %{_kerneldir}/arch/um %{_kerneldir}/arch/x86 %{_kerneldir}/block %{_kerneldir}/certs %{_kerneldir}/crypto %{_kerneldir}/drivers %{_kerneldir}/fs %{_kerneldir}/include/acpi %{_kerneldir}/include/asm-generic %{_kerneldir}/include/clocksource %{_kerneldir}/include/crypto %{_kerneldir}/include/drm %{_kerneldir}/include/dt-bindings %{_kerneldir}/include/keys %{_kerneldir}/include/kunit %{_kerneldir}/include/kvm %{_kerneldir}/include/linux %{_kerneldir}/include/math-emu %{_kerneldir}/include/media %{_kerneldir}/include/memory %{_kerneldir}/include/misc %{_kerneldir}/include/net %{_kerneldir}/include/pcmcia %{_kerneldir}/include/ras %{_kerneldir}/include/rdma %{_kerneldir}/include/rv %{_kerneldir}/include/scsi %{_kerneldir}/include/soc %{_kerneldir}/include/sound %{_kerneldir}/include/target %{_kerneldir}/include/trace %{_kerneldir}/include/uapi %{_kerneldir}/include/ufs %{_kerneldir}/include/vdso/*.h %{_kerneldir}/include/video %{_kerneldir}/include/xen %{_kerneldir}/init %{_kerneldir}/io_uring %{_kerneldir}/ipc %{_kerneldir}/kernel %{_kerneldir}/lib %{_kerneldir}/mm %{_kerneldir}/net %{_kerneldir}/rust %{_kerneldir}/samples %{_kerneldir}/scripts %{_kerneldir}/security %{_kerneldir}/sound %{_kerneldir}/tools %{_kerneldir}/usr %{_kerneldir}/virt %{_kerneldir}/COPYING %{_kerneldir}/CREDITS %{_kerneldir}/Kbuild %{_kerneldir}/Kconfig %{_kerneldir}/MAINTAINERS %{_kerneldir}/Makefile %{_kerneldir}/README %doc README.kernel-sources %files -n %{kname}-source-latest %endif %if %build_doc %files -n %{kname}-doc %doc linux-%{tar_ver}/Documentation/* %endif %if %build_uheaders %files -n %{kname}-userspace-headers %defattr(0644,root,root,0755) %{_includedir}/asm/ %{_includedir}/asm-generic/ %{_includedir}/drm/ %{_includedir}/linux/ %{_includedir}/misc/ %{_includedir}/mtd/ %{_includedir}/rdma/ %{_includedir}/scsi/ %{_includedir}/sound/ %{_includedir}/video/ %{_includedir}/xen/ %endif %if %{build_perf} %files -n perf %{_bindir}/perf %{_bindir}/trace %{_datadir}/perf-core/strace/groups/file %{_datadir}/perf-core/strace/groups/string %{_datadir}/doc/perf-tip/tips.txt %dir %{_libdir}/traceevent %dir %{_libdir}/traceevent/plugins %{_libdir}/traceevent/plugins/plugin_* %dir %{_prefix}/libexec/perf-core %{_prefix}/libexec/perf-core/* %{_mandir}/man[1-8]/perf* %{_sysconfdir}/bash_completion.d/perf %endif %if %{build_cpupower} %files -n cpupower -f cpupower.lang %config(noreplace) %{_sysconfdir}/sysconfig/cpupower %{_bindir}/cpupower %{_datadir}/bash-completion/completions/cpupower %{_libdir}/libcpupower.so.0 %{_libdir}/libcpupower.so.0.0.1 %{_unitdir}/cpupower.service %{_mandir}/man[1-8]/cpupower* %files -n cpupower-devel %{_libdir}/libcpupower.so %{_includedir}/cpuidle.h %{_includedir}/cpufreq.h %{_includedir}/powercap.h %endif %if %{build_bpftool} %files -n bpftool %{_sbindir}/bpftool %{_sysconfdir}/bash_completion.d/bpftool %{_mandir}/man8/bpftool-*.8* %{_mandir}/man8/bpftool.8* %endif %if %{build_libbpf} %files -n %{_lib}bpf%{bpfmajor} %{_libdir}/libbpf.so.%{bpfmajor}{,.*} %files -n %{_lib}bpf-devel %{_libdir}/libbpf.a %{_libdir}/libbpf.so %{_libdir}/pkgconfig/libbpf.pc %{_includedir}/bpf/bpf.h %{_includedir}/bpf/bpf_core_read.h %{_includedir}/bpf/bpf_endian.h %{_includedir}/bpf/bpf_helper_defs.h %{_includedir}/bpf/bpf_helpers.h %{_includedir}/bpf/bpf_tracing.h %{_includedir}/bpf/btf.h %{_includedir}/bpf/libbpf.h %{_includedir}/bpf/libbpf_common.h %{_includedir}/bpf/libbpf_legacy.h %{_includedir}/bpf/libbpf_version.h %{_includedir}/bpf/skel_internal.h %{_includedir}/bpf/usdt.bpf.h %endif