kernel-5.15/kernel.spec
Mikhail Novosyolov f239385089 [bot] upd: 5.15.117 -> 5.15.126
Changelog:

ACPI: processor: perflib: Avoid updating frequency QoS unnecessarily
ACPI: processor: perflib: Use the "no limit" frequency QoS
ACPI: sleep: Avoid breaking S3 wakeup due to might_sleep()
ACPI: utils: Fix acpi_evaluate_dsm_typed() redefinition error
act_mirred: remove unneded merge conflict markers
Add MODULE_FIRMWARE() for FIRMWARE_TG357766.
afs: Fix vlserver probe RTT handling
ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer
ALSA: emu10k1: roll up loops in DSP setup code for Audigy
ALSA: hda/realtek: Add a quirk for Compaq N14JP6
ALSA: hda/realtek: Add quirk for Clevo NPx0SNx
ALSA: hda/realtek: Add quirk for Clevo NS70AU
ALSA: hda/realtek: Enable Mute LED on HP Laptop 15s-eq2xxx
ALSA: hda/realtek - remove 3k pull low procedure
ALSA: hda/relatek: Enable Mute LED on HP 250 G8
ALSA: jack: Fix mutex call in snd_jack_report()
ALSA: usb-audio: Add quirk flag for HEM devices to enable native DSD playback
amdgpu: validate offset_in_bo of drm_amdgpu_gem_va
apparmor: fix missing error check for rhashtable_insert_fast
ARC: define ASM_NL and __ALIGN(_STR) outside #ifdef __ASSEMBLY__ guard
arm64: Add missing Set/Way CMO encodings
arm64: dts: imx8mn-var-som: add missing pull-up for onboard PHY reset pinmux
arm64: dts: mediatek: Add cpufreq nodes for MT8192
arm64: dts: mediatek: mt8183: Add mediatek,broken-save-restore-fw to kukui
arm64: dts: mediatek: mt8192: Fix CPUs capacity-dmips-mhz
arm64: dts: microchip: sparx5: do not use PSCI on reference boards
arm64: dts: qcom: apq8016-sbc: Clarify firmware-names
arm64: dts: qcom: apq8016-sbc: Fix 1.8V power rail on LS expansion
arm64: dts: qcom: apq8016-sbc: fix mpps state names
arm64: dts: qcom: apq8016-sbc: Fix regulator constraints
arm64: dts: qcom: apq8016-sbc: Update modem and WiFi firmware path
arm64: dts: qcom: apq8096: fix fixed regulator name property
arm64: dts: qcom: db820c: Move blsp1_uart2 pin states to msm8996.dtsi
arm64: dts: qcom: Drop unneeded extra device-specific includes
arm64: dts: qcom: msm8916: correct camss unit address
arm64: dts: qcom: msm8994: correct SPMI unit address
arm64: dts: qcom: msm8996: correct camss unit address
arm64: dts: qcom: sdm630: correct camss unit address
arm64: dts: qcom: sdm845: correct camss unit address
arm64: dts: qcom: sm8250-edo: Panel framebuffer is 2.5k instead of 4k
arm64: dts: renesas: ulcb-kf: Remove flow control for SCIF1
arm64: dts: stratix10: fix incorrect I2C property for SCL signal
arm64: dts: ti: k3-j7200: Fix physical address of pin
arm64: errata: Add detection for TRBE overwrite in FILL mode
arm64: errata: Add detection for TRBE write to out-of-range
arm64: errata: Add workaround for TSB flush failures
ARM: 9303/1: kprobes: avoid missing-declaration warnings
ARM: cpu: Switch to arch_cpu_finalize_init()
ARM: dts: BCM5301X: Drop "clock-names" from the SPI node
ARM: dts: BCM5301X: fix duplex-full => full-duplex
ARM: dts: Fix erroneous ADS touchscreen polarities
ARM: dts: gta04: Move model property out of pinctrl node
ARM: dts: iwg20d-q7-common: Fix backlight pwm specifier
ARM: dts: meson8b: correct uart_B and uart_C clock references
ARM: dts: meson8: correct uart_B and uart_C clock references
ARM: dts: qcom: ipq4019: fix broken NAND controller properties override
ARM: dts: stm32: Fix audio routing on STM32MP15xx DHCOM PDK2
ARM: dts: stm32: fix i2s endpoint format property for stm32mp15xx-dkx
ARM: dts: stm32: Move ethernet MAC EEPROM from SoM to carrier boards
ARM: dts: stm32: Shorten the AV96 HDMI sound card name
ARM: dts: vexpress: add missing cache properties
ARM: ep93xx: fix missing-prototype warnings
ARM: omap2: fix missing tick_broadcast() prototype
ARM: orion5x: fix d2net gpio initialization
ASoC: codecs: wcd934x: fix resource leaks on component remove
ASoC: codecs: wcd938x: fix codec initialisation race
ASoC: codecs: wcd938x: fix missing clsh ctrl error handling
ASoC: codecs: wcd938x: fix missing mbhc init error handling
ASoC: codecs: wcd938x: fix resource leaks on component remove
ASoC: codecs: wcd938x: fix soundwire initialisation race
ASoC: codecs: wcd-mbhc-v2: fix resource leaks on component remove
ASoC: cs42l51: fix driver to properly autoload with automatic module loading
ASoC: dwc: move DMA init to snd_soc_dai_driver probe()
ASoC: es8316: Do not set rate constraints for unsupported MCLKs
ASoC: es8316: Increment max value for ALC Capture Target Volume control
ASoC: fsl_sai: Disable bit clock with transmitter
ASoC: fsl_spdif: Silence output on stop
ASoC: imx-audmix: check return value of devm_kasprintf()
ASoC: mediatek: mt8173: Fix irq error path
ASoC: mediatek: mt8173: Fix snd_soc_component_initialize error path
ASoC: nau8824: Add quirk to active-high jack-detect
ASoC: simple-card: Add missing of_node_put() in case of error
ASoC: soc-pcm: test if a BE can be prepared
ASoC: wm8904: Fill the cache for WM8904_ADC_TEST_0 register
ata: pata_ns87415: mark ns87560_tf_read static
autofs: use flexible array in ioctl structure
bcache: Fix __bch_btree_node_alloc to make the failure behavior consistent
bcache: fixup btree_cache_wait list damage
bcache: Remove unnecessary NULL point check in node allocations
be2net: Extend xmit workaround to BE3 chip
benet: fix return value check in be_lancer_xmit_workarounds()
blk-iocost: use spin_lock_irqsave in adjust_inuse_and_calc_cost
block: add overflow checks for Amiga partition support
block: change all __u32 annotations to __be32 in affs_hardblocks.h
block: Fix a source code comment in include/uapi/linux/blkzoned.h
block: fix signed int overflow in Amiga partition support
block: increment diskseq on all media change events
block/partition: fix signedness issue for Amiga partitions
Bluetooth: L2CAP: Fix use-after-free in l2cap_sock_ready_cb
bonding: do not assume skb mac_header is set
bonding: reset bond's flags when down link is P2P device
bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page
bpf: Add length check for SK_DIAG_BPF_STORAGE_REQ_MAP_FD parsing
bpf/btf: Accept function names that contain dots
bpf: Call __bpf_sk_lookup()/__bpf_skc_lookup() directly via TC hookpoint
bpf: cpumap: Fix memory leak in cpu_map_update_elem
bpf, cpumap: Handle skb as well when clean up ptr_ring
bpf, cpumap: Make sure kthread is running before map update returns
bpf: Disable preemption in bpf_event_output
bpf: Don't EFAULT for {g,s}setsockopt with wrong optlen
bpf: ensure main program has an extable
bpf: Factor out socket lookup functions for the TC hookpoint.
bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings
bpf: Fix max stack depth check for async callbacks
bpf: Fix subprog idx logic in check_max_stack_depth
bpf: Fix verifier id tracking of scalars on spill
bpf: Omit superfluous address family check in __bpf_skc_lookup
bpf, riscv: Support riscv jit to provide bpf_line_info
bpf: sockmap: Remove preempt_disable in sock_map_sk_acquire
bpftool: JIT limited misreported as negative value on aarch64
bpf: track immediate values written to stack by BPF_ST instruction
bridge: Add extack warning when enabling STP in netns.
btrfs: add handling for RAID1C23/DUP to btrfs_reduce_alloc_profile
btrfs: bail out reclaim process if filesystem is read-only
btrfs: check for commit error at btrfs_attach_transaction_barrier()
btrfs: check if the transaction was aborted at btrfs_wait_for_commit()
btrfs: delete unused BGs while reclaiming BGs
btrfs: do not BUG_ON() on tree mod log failure at balance_level()
btrfs: do not BUG_ON() on tree mod log failure at __btrfs_cow_block()
btrfs: fix extent buffer leak after tree mod log failure at split_node()
btrfs: fix race between quota disable and relocation
btrfs: fix race when deleting quota root from the dirty cow roots list
btrfs: fix warning when putting transaction with qgroups enabled after abort
btrfs: handle memory allocation failure in btrfs_csum_one_bio
btrfs: reinsert BGs failed to reclaim
btrfs: scrub: try harder to mark RAID56 block groups read-only
btrfs: zoned: fix memory leak after finding block group with super blocks
bus: ixp4xx: fix IXP4XX_EXP_T1_MASK
bus: ti-sysc: Fix dispc quirk masking bool variables
can: bcm: Fix UAF in bcm_proc_show()
can: gs_usb: gs_can_close(): add missing set of CAN state to CAN_STATE_STOPPED
can: isotp: isotp_sendmsg(): fix return error fix on TX path
can: length: fix bitstuffing count
ceph: defer stopping mdsc delayed_work
ceph: don't let check_caps skip sending responses for revoke msgs
ceph: never send metrics if disable_send_metrics is set
cgroup: always put cset in cgroup_css_set_put_fork
cgroup: Do not corrupt task iteration when rebinding subsystem
cifs: fix lease break oops in xfstest generic/098
cifs: if deferred close is disabled then close files immediately
cifs: missing directory in MAINTAINERS file
cifs: use fs_context for automounts
clk: cdce925: check return value of kasprintf()
clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider()
clk: Fix memory leak in devm_clk_notifier_register()
clk: imx: clk-imx8mn: fix memory leak in imx8mn_clocks_probe
clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe()
clk: imx: scu: use _safe list iterator to avoid a use after free
clk: keystone: sci-clk: check return value of kasprintf()
clk: qcom: camcc-sc7180: Add parent dependency to all camera GDSCs
clk: qcom: gcc-ipq6018: Use floor ops for sdcc clocks
clk: qcom: ipq6018: fix networking resets
clk: qcom: reset: Allow specifying custom reset delay
clk: qcom: reset: support resetting multiple bits
clk: si5341: check return value of {devm_}kasprintf()
clk: si5341: free unused memory on probe failure
clk: si5341: return error if one synth clock registration fails
clk: tegra: tegra124-emc: Fix potential memory leak
clk: ti: clkctrl: check return value of kasprintf()
clk: vc5: check memory returned by kasprintf()
clocksource/drivers/cadence-ttc: Fix memory leak in ttc_timer_probe
coresight: Fix loss of connection info when a module is unloaded
cpufreq: intel_pstate: Drop ACPI _PSS states table patching
cpufreq: intel_pstate: Fix energy_performance_preference for passive
crypto: kpp - Add helper to set reqsize
crypto: marvell/cesa - Fix type mismatch warning
crypto: nx - fix build warnings when DEBUG_FS is not enabled
crypto: qat - honor CRYPTO_TFM_REQ_MAY_SLEEP flag
crypto: qat - replace get_current_node() with numa_node_id()
crypto: qat - unmap buffer before free for DH
crypto: qat - unmap buffers before free for RSA
crypto: qat - Use helper to set reqsize
crypto: qat - use reference to structure in dma_map_single()
dax: Fix dax_mapping_release() use after free
dax: Introduce alloc_dev_dax_id()
dax/kmem: Pass valid argument to memory_group_register_static
dlm: cleanup plock_op vs plock_xop
dlm: rearrange async condition return
dm cache policy smq: ensure IO doesn't prevent cleaner policy progress
dm: don't lock fs when the map is NULL during suspend or resume
dm init: add dm-mod.waitfor to wait for asynchronously probed block devices
dm integrity: reduce vmalloc space footprint on 32-bit architectures
dm raid: clean up four equivalent goto tags in raid_ctr()
dm raid: fix missing reconfig_mutex unlock in raid_ctr() error paths
dm raid: protect md_stop() with 'reconfig_mutex'
dm thin metadata: check fail_io before using data_sm
Documentation: security-bugs.rst: clarify CVE handling
Documentation: security-bugs.rst: update preferences when dealing with the linux-distros group
Documentation/x86: Fix backwards on/off logic about YMM support
Drivers: hv: vmbus: Call hv_synic_free() if hv_synic_alloc() fails
Drivers: hv: vmbus: Fix vmbus_wait_for_unload() to scan present CPUs
drivers: meson: secure-pwrc: always enable DMA domain
drm:amd:amdgpu: Fix missing buffer object unlock in failure path
drm/amd/display: Add logging for display MALL refresh setting
drm/amd/display: Add minimal pipe split transition state
drm/amd/display: Add wrapper to call planes and stream update
drm/amd/display: Correct `DMUB_FW_VERSION` macro
drm/amd/display: Disable MPC split by default on special asic
drm/amd/display: edp do not add non-edid timings
drm/amd/display: Explicitly specify update type per plane info change
drm/amd/display: Fix artifacting on eDP panels when engaging freesync video mode
drm/amd/display: fix the system hang while disable PSR
drm/amd/display: Keep PHY active for DP displays on DCN31
drm/amd/display: Use dc_update_planes_and_stream
drm/amd: Fix an error handling mistake in psp_sw_init()
drm/amdgpu: add missing radeon secondary PCI ID
drm/amdgpu: avoid restore process run into dead loop.
drm/amdgpu: fix clearing mappings for BOs that are always valid in VM
drm/amdgpu: fix Null pointer dereference error in amdgpu_device_recover_vram
drm/amdgpu: fix vkms crtc settings
drm/amdgpu: Set vmbo destroy after pt bo is created
drm/amdgpu: Validate VM ioctl flags.
drm/amdgpu/vkms: relax timer deactivation by hrtimer_try_to_cancel
drm/amdkfd: Fix potential deallocation of previously deallocated memory.
drm/atomic: Allow vblank-enabled + self-refresh "disable"
drm/atomic: Fix potential use-after-free in nonblocking commits
drm/bridge: tc358768: Add atomic_get_input_bus_fmts() implementation
drm/bridge: tc358768: always enable HS video mode
drm/bridge: tc358768: fix PLL parameters computation
drm/bridge: tc358768: fix PLL target frequency
drm/bridge: tc358768: fix TCLK_TRAILCNT computation
drm/bridge: tc358768: fix TCLK_ZEROCNT computation
drm/bridge: tc358768: fix THS_TRAILCNT computation
drm/bridge: tc358768: fix THS_ZEROCNT computation
drm/bridge: tc358768: fix TXTAGOCNT computation
drm/bridge: ti-sn65dsi86: Fix auxiliary bus lifetime
drm/client: Fix memory leak in drm_client_modeset_probe
drm/client: Fix memory leak in drm_client_target_cloned
drm/exynos: fix race condition UAF in exynos_g2d_exec_ioctl
drm/exynos: vidi: fix a wrong error return
drm/i915: Fix one wrong caching mode enum usage
drm/i915/psr: Use hw.adjusted mode when calculating io/fast wake times
drm/imx/ipuv3: Fix front porch adjustment upon hactive aligning
drm/msm/a5xx: really check for A510 in a5xx_gpu_init
drm/msm/adreno: Fix snapshot BINDLESS_DATA size
drm/msm/disp/dpu: get timing engine status from intf status register
drm/msm/dp: Free resources after unregistering them
drm/msm/dpu: correct MERGE_3D length
drm/msm/dpu: do not enable color-management if DSPPs are not available
drm/msm/dpu: drop enum dpu_core_perf_data_bus_id
drm/msm/dpu: Set DPU_DATA_HCTL_EN for in INTF_SC7180_MASK
drm/msm/dsi: don't allow enabling 14nm VCO with unprogrammed rate
drm/msm: Fix IS_ERR_OR_NULL() vs NULL check in a5xx_submit_in_rb()
drm/nouveau: add nv_encoder pointer check for NULL
drm/nouveau: don't detect DSM for non-NVIDIA device
drm/nouveau/dp: check for NULL nv_connector->native_mode
drm/panel: sharp-ls043t1le01: adjust mode settings
drm/panel: simple: Add connector_type for innolux_at043tn24
drm/panel: simple: Add Powertip PH800480T013 drm_display_mode flags
drm/panel: simple: fix active size for Ampire AM-480272H3TMQW-T01H
drm/radeon: Fix integer overflow in radeon_cs_parser_init
drm/radeon: fix possible division-by-zero errors
drm/radeon: fix race condition UAF in radeon_gem_set_domain_ioctl
drm/rockchip: vop: Leave vblank enabled in self-refresh
drm: sun4i_tcon: use devm_clk_get_enabled in `sun4i_tcon_init_clocks`
drm/ttm: check null pointer before accessing when swapping
drm/ttm: Don't leak a resource on eviction error
drm/ttm: Don't leak a resource on swapout move error
drm/ttm: Don't print error message if eviction was interrupted
drm/ttm: never consider pinned BOs for eviction&swap
drm/vram-helper: fix function names in vram helper doc
efi/libstub: Disable PCI DMA before grabbing the EFI memory map
epoll: ep_autoremove_wake_function should use list_del_init_careful
erofs: avoid infinite loop in z_erofs_do_read_page() when reading beyond EOF
erofs: decouple basic mount options from fs_context
erofs: fix compact 4B support for 16k block size
erofs: fix fsdax unavailability for chunk-based regular files
ethernet: atheros: fix return value check in atl1e_tso_csum()
ethernet: use eth_hw_addr_set() instead of ether_addr_copy()
ethernet: use of_get_ethdev_address()
evm: Complete description of evm_inode_setattr()
evm: Fix build warnings
exfat: release s_lock before calling dir_emit()
exfat: use kvmalloc_array/kvfree instead of kmalloc_array/kfree
ext2: Drop fragment support
ext4: correct inline offset when handling xattrs in inode body
ext4: drop the call to ext4_error() from ext4_get_group_info()
ext4: Fix reusing stale buffer heads from last failed mounting
ext4: fix to check return value of freeze_bdev() in ext4_shutdown()
ext4: fix wrong unit use in ext4_mb_clear_bb
ext4: fix wrong unit use in ext4_mb_new_blocks
ext4: get block from bh in ext4_free_blocks for fast commit replay
ext4: only update i_reserved_data_blocks on successful block allocation
ext4: Remove ext4 locking of moved directory
ext4: turn quotas off if mount failed after enabling quotas
extcon: Fix kernel doc of property capability fields to avoid warnings
extcon: Fix kernel doc of property fields to avoid warnings
extcon: usbc-tusb320: Convert to i2c's .probe_new()
f2fs: fix error path handling in truncate_dnode()
f2fs: fix to avoid NULL pointer dereference f2fs_write_end_io()
fanotify: disallow mount/sb marks on kernel internal pseudo fs
fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe
fbdev: imxfb: warn about invalid left/right margin
fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe()
file: always lock position for FMODE_ATOMIC_POS
file: reinstate f_pos locking optimization for regular files
firmware: arm_scmi: Drop OF node reference in the transport channel setup
firmware: stratix10-svc: Fix a potential resource leak in svc_create_memory_pool()
fs: avoid empty option when generating legacy mount string
fs: dlm: interrupt posix locks only when process is killed
fs: dlm: return positive pid value for F_GETLK
fs: Establish locking order for unrelated directories
FS: JFS: Check for read-only mounted filesystem in txBegin
FS: JFS: Fix null-ptr-deref Read in txBegin
fs: jfs: Fix UBSAN: array-index-out-of-bounds in dbAllocDmapLev
fs: Lock moved directories
fs: no need to check source
fs/ntfs3: Check fields while reading
fs/ntfs3: Use __GFP_NOWARN allocation at ntfs_load_attr_list()
fs: pipe: reveal missing function protoypes
fs: Protect reconfiguration of sb read-write from racing writes
fs/sysv: Null check to prevent null-ptr-deref bug
ftrace: Fix possible warning on checking all pages used in ftrace_process_locs()
fuse: ioctl: translate ENOSYS in outarg
fuse: revalidate: don't invalidate if interrupted
gpio: Allow per-parent interrupt data
gpiolib: Fix GPIO chip IRQ initialization restriction
gpio: mvebu: fix irq domain leak
gpio: mvebu: Make use of devm_pwmchip_add
gpio: sifive: add missing check for platform_get_irq
gpio: tps68470: Make tps68470_gpio_output() always set the initial value
gtp: Fix use-after-free in __gtp_encap_destroy().
gve: Set default duplex configuration to full
HID: logitech-hidpp: add HIDPP_QUIRK_DELAYED_INIT for the T651.
HID: wacom: Add error check to wacom_parse_and_register()
HID: wacom: Use ktime_t rather than int when dealing with timestamps
hwmon: (adm1275) Allow setting sample averaging
hwmon: (gsc-hwmon) fix fan pwm temperature scaling
hwmon: (k10temp) Enable AMD3255 Proc to show negative temperature
hwmon: (nct7802) Fix for temp6 (PECI1) processed even if PECI1 disabled
hwmon: (pmbus/adm1275) Fix problems with temperature monitoring on ADM1272
hwrng: imx-rngc - fix the timeout for init and self check
hwrng: st - keep clock enabled while hwrng is registered
hwrng: virtio - add an internal buffer
hwrng: virtio - always add a pending request
hwrng: virtio - don't wait on cleanup
hwrng: virtio - don't waste entropy
hwrng: virtio - Fix race on data_avail and actual data
i2c: Delete error messages for failed memory allocations
i2c: Improve size determinations
i2c: imx-lpi2c: fix type char overflow issue when calculating the clock cycle
i2c: nomadik: Remove a useless call in the remove function
i2c: nomadik: Remove unnecessary goto label
i2c: nomadik: Use devm_clk_get_enabled()
i2c: qup: Add missing unwind goto in qup_i2c_probe()
i2c: xiic: Defer xiic_wakeup() and __xiic_start_xfer() in xiic_process()
i2c: xiic: Don't try to handle more interrupt events after error
i40e: Fix an NULL vs IS_ERR() bug for debugfs_create_dir()
ia64/cpu: Switch to arch_cpu_finalize_init()
iavf: check for removal state before IAVF_FLAG_PF_COMMS_FAILED
iavf: Fix out-of-bounds when setting channels on remove
iavf: fix potential deadlock on allocation failure
iavf: Fix use-after-free in free_netdev
iavf: remove mask from iavf_irq_enable_queues()
IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate
IB/hfi1: Use bitmap_zalloc() when applicable
IB/isert: Fix dead lock in ib_isert
IB/isert: Fix incorrect release of isert connection
IB/isert: Fix possible list corruption in CMA handler
ibmvnic: Do not reset dql stats on NON_FATAL err
IB/uverbs: Fix to consider event queue closing also upon non-blocking mode
ice: Fix memory management in ice_ethtool_fdir.c
icmp6: Fix null-ptr-deref of ip6_null_entry->rt6i_idev in icmp6_dev().
ieee802154: hwsim: Fix possible memory leaks
igb: fix nvm.ops.read() error handling
igc: Clean the TX buffer and TX descriptor ring
igc: Enable and fix RX hash usage by netstack
igc: Fix inserting of empty frame for launchtime
igc: Fix Kernel Panic during ndo_tx_timeout callback
igc: Fix launchtime before start of cycle
igc: Fix race condition in PTP tx code
igc: Handle PPS start time programming for past time values
igc: Prevent garbled TX queue with XDP ZEROCOPY
igc: Remove delay during TX ring configuration
igc: set TP bit in 'supported' and 'advertising' fields of ethtool_link_ksettings
iio: accel: fxls8962af: errata bug only applicable for FXLS8962AF
iio: accel: fxls8962af: fixup buffer scan element type
iio: adc: ad7192: Fix internal/external clock selection
iio: adc: ad7192: Fix null ad7192_state pointer access
ima: Fix build warnings
init: Invoke arch_cpu_finalize_init() earlier
init: Provide arch_cpu_finalize_init()
init: Remove check_bugs() leftovers
init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init()
Input: adxl34x - do not hardcode interrupt trigger type
Input: drv260x - sleep between polling GO bit
Input: soc_button_array - add invalid acpi_index DMI quirk handling
integrity: Fix possible multiple allocation in integrity_inode_get()
iommu/arm-smmu-v3: Add explicit feature for nesting
iommu/arm-smmu-v3: Document MMU-700 erratum 2812531
iommu/arm-smmu-v3: Document nesting-related errata
iommu/arm-smmu-v3: Work around MMU-600 erratum 1076982
ionic: remove WARN_ON to prevent panic_on_warn
io_uring: add reschedule point to handle_tw_list()
io_uring: don't audit the capability check in io_uring_create()
io_uring: ensure IOPOLL locks around deferred work
io_uring: gate iowait schedule on having pending requests
io_uring: hold uring mutex around poll removal
io_uring/net: clear msg_controllen on partial sendmsg retry
io_uring/net: disable partial retries for recvmsg with cmsg
io_uring/net: save msghdr->msg_control for retries
io_uring: treat -EAGAIN for REQ_F_NOWAIT as final for io-wq
io_uring: Use io_schedule* in cqring wait
io_uring: wait interruptibly for request completions on exit
ip6mr: Fix skb_under_panic in ip6mr_cache_report()
ip_tunnels: allow VXLAN/GENEVE to inherit TOS/TTL from VLAN
ipv6/addrconf: fix a potential refcount underflow for idev
ipv6 addrconf: fix bug where deleting a mngtmpaddr can create a new temporary address
ipvlan: fix bound dev checking for IPv6 l3s mode
ipvlan: Fix return value of ipvlan_queue_xmit()
ipvs: align inner_mac_header for encapsulation
ipvs: increase ip_vs_conn_tab_bits range for 64BIT
irq-bcm6345-l1: Do not assume a fixed block to cpu mapping
irqchip/gic: Correctly validate OF quirk descriptors
irqchip/gic-v3: Disable pseudo NMIs on Mediatek devices w/ firmware issues
irqchip/gic-v4.1: Properly lock VPEs when doing a directLPI invalidation
irqchip/jcore-aic: Fix missing allocation of IRQ descriptors
iwlwifi: don't dump_stack() when we get an unexpected interrupt
jbd2: Fix wrongly judgement for buffer head removing while doing checkpoint
jbd2: recheck chechpointing non-dirty buffer
jffs2: reduce stack usage in jffs2_build_xattr_subsystem()
jfs: jfs_dmap: Validate db_l2nbperpage while mounting
kbuild: Disable GCOV for *.mod.o
kcsan: Don't expect 64 bits atomic builtins from 32 bits architectures
kernel/trace: Fix cleanup logic of enable_trace_eprobe
kernfs: fix missing kernfs_idr_lock to remove an ID from the IDR
kexec: fix a memory leak in crash_shrink_memory()
kexec: support purgatories with .text.hot sections
keys: Fix linking a duplicate key to a keyring's assoc_array
kselftest: vDSO: Fix accumulation of uninitialized ret when CLOCK_REALTIME is undefined
ksmbd: avoid field overflow warning
ksmbd: fix out-of-bound read in smb2_write
ksmbd: fix slab-out-of-bounds read in smb2_handle_negotiate
ksmbd: remove internal.h include
ksmbd: use ksmbd_req_buf_next() in ksmbd_smb2_check_message()
ksmbd: validate command payload size
ksmbd: validate session id and tree id in the compound request
KVM: Add GDS_NO support to KVM
KVM: Avoid illegal stage2 mapping on invalid memory slot
KVM: Grab a reference to KVM for VM and vCPU stats file descriptors
KVM: s390/diag: fix racy access of physical cpu number in diag 9c handler
KVM: s390: fix KVM_S390_GET_CMMA_BITS for GFNs in memslot holes
KVM: s390: fix sthyi error handling
KVM: s390: pv: fix index value of replaced ASCE
KVM: s390: vsie: fix the length of APCB bitmap
KVM: VMX: Don't fudge CR0 and CR4 for restricted L2 guest
KVM: x86: Disallow KVM_SET_SREGS{2} if incoming CR0 is invalid
leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename
libbpf: btf_dump_type_data_check_overflow needs to consider BTF_MEMBER_BITFIELD_SIZE
libbpf: fix offsetof() and container_of() to work with CO-RE
libceph: fix potential hang in ceph_osdc_notify()
libceph: harden msgr2.1 frame segment length checks
lib/ts_bm: reset initial match offset for every block of text
llc: Don't drop packet from non-root netns.
locking/atomic: arm: fix sync ops
locking/rtmutex: Fix task->pi_waiters integrity
m68k/cpu: Switch to arch_cpu_finalize_init()
mailbox: ti-msgmgr: Fill non-message tx data fields with 0x0
md/raid0: add discard support for the 'original' layout
md/raid10: check slab-out-of-bounds in md_bitmap_get_counter
md/raid10: fix io loss while replacement replace rdev
md/raid10: fix null-ptr-deref of mreplace in raid10_sync_request
md/raid10: fix overflow of md/safe_mode_delay
md/raid10: fix the condition to call bio_end_io_acct()
md/raid10: fix wrong setting of max_corr_read_errors
media: atomisp: gmin_platform: fix out_len in gmin_get_config_dsm_var()
media: cec: core: don't set last_initiator if tx in progress
media: cec: i2c: ch7322: also select REGMAP
media: i2c: Correct format propagation for st-mipid02
media: staging: atomisp: select V4L2_FWNODE
media: usb: Check az6007_read() return value
media: usb: siano: Fix warning due to null work_func_t function pointer
media: venus: helpers: Fix ALIGN() of non power of two
media: videodev2.h: Fix struct v4l2_input tuner index comment
memfd: check for non-NULL file_seals in memfd_create() syscall
memory: brcmstb_dpfe: fix testing array offset after use
memstick r592: make memstick_debug_get_tpc_name() static
meson saradc: fix clock divider mask length
mfd: intel-lpss: Add missing check for platform_get_resource
mfd: pm8008: Fix module autoloading
mfd: rt5033: Drop rt5033-battery sub-device
mfd: stmfx: Fix error path in stmfx_chip_init
mfd: stmfx: Nullify stmfx->vdd in case of error
mfd: stmpe: Only disable the regulators if they are enabled
MIPS: Alchemy: fix dbdma2
mips/cpu: Switch to arch_cpu_finalize_init()
MIPS: dec: prom: Address -Warray-bounds warning
MIPS: kvm: Fix build error with KVM_MIPS_DEBUG_COP0_COUNTERS enabled
MIPS: KVM: Fix NULL pointer dereference
MIPS: Loongson: Fix cpu_probe_loongson() again
mips: Move initrd_start check after initrd address sanitisation.
MIPS: unhide PATA_PLATFORM
misc: fastrpc: Create fastrpc scalar with correct buffer count
misc: pci_endpoint_test: Free IRQs before removing the device
misc: pci_endpoint_test: Re-init completion for every test
mISDN: hfcpci: Fix potential deadlock on &hc->lock
mmc: block: ensure error propagation for non-blk
mmc: core: disable TRIM on Kingston EMMC04G-M627
mmc: core: disable TRIM on Micron MTFC4GACAJCN-1M
mmc: meson-gx: fix deferred probing
mmc: meson-gx: remove redundant mmc_request_done() call from irq context
mmc: mmci: Set PROBE_PREFER_ASYNCHRONOUS
mmc: mmci: stm32: fix max busy timeout calculation
mmc: mtk-sd: fix deferred probing
mmc: mvsdio: fix deferred probing
mmc: omap: fix deferred probing
mmc: omap_hsmmc: fix deferred probing
mmc: owl: fix deferred probing
mmc: sdhci-acpi: fix deferred probing
mmc: sdhci: fix DMA configure compatibility issue when 64bit DMA mode is used.
mmc: sdhci-msm: Disable broken 64-bit DMA on MSM8916
mmc: sh_mmcif: fix deferred probing
mmc: usdhi60rol0: fix deferred probing
mm/damon/ops-common: atomically test and clear young on ptes and pmds
mm, hwpoison: try to recover from copy-on write faults
mm, hwpoison: when copy-on-write hits poison, take page offline
mm: Move mm_cachep initialization to mm_init()
modpost: fix off by one in is_executable_section()
modpost: fix section mismatch message for R_ARM_ABS32
modpost: fix section mismatch message for R_ARM_{PC24,CALL,JUMP24}
modpost: remove broken calculation of exception_table_entry size
mptcp: consolidate fallback and non fallback state machine
mptcp: fix possible divide by zero in recvmsg()
mtd: rawnand: fsl_upm: Fix an off-by one test in fun_exec_op()
mtd: rawnand: meson: fix OOB available bytes for ECC
mtd: rawnand: meson: fix unaligned DMA buffers handling
mtd: rawnand: omap_elm: Fix incorrect type in assignment
mtd: rawnand: rockchip: Align hwecc vs. raw page helper layouts
mtd: rawnand: rockchip: fix oobfree offset and description
mtd: spinand: toshiba: Fix ecc_get_status
neighbour: delete neigh_lookup_nodev as not used
neighbour: Remove unused inline function neigh_key_eq16()
net: add missing data-race annotation for sk_ll_usec
net: add missing data-race annotations around sk->sk_peek_off
net: add missing READ_ONCE(sk->sk_rcvbuf) annotation
net: add missing READ_ONCE(sk->sk_rcvlowat) annotation
net: add missing READ_ONCE(sk->sk_sndbuf) annotation
net: annotate data-races around sk->sk_max_pacing_rate
net: axienet: Move reset before 64-bit DMA detection
net: bcmgenet: Ensure MDIO unregistration has clocks enabled
net: bgmac: postpone turning IRQs off to avoid SoC hangs
net: bridge: keep ports without IFF_UNICAST_FLT in BR_PROMISC mode
net: dcb: choose correct policy to parse DCB_ATTR_BCN
netdevsim: fix uninitialized data in nsim_dev_trap_fa_cookie_write()
net: dsa: fix value check in bcm_sf2_sw_probe()
net: dsa: mt7530: fix handling of BPDUs on MT7530 switch
net: dsa: mt7530: fix trapping frames on non-MT7621 SoC MT7530 switch
net: dsa: tag_sja1105: fix MAC DA patching from meta frames
net: dsa: vsc73xx: fix MTU configuration
net: ena: fix shift-out-of-bounds in exponential backoff
net: enetc: correct the indexes of highest and 2nd highest TCs
net: ethernet: mtk_eth_soc: handle probe deferral
net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field()/cpsw_ale_set_field()
net: ethtool: correct MAX attribute value for stats
netfilter: conntrack: Avoid nf_ct_helper_hash uses after free
netfilter: conntrack: dccp: copy entire header to stack buffer, not just basic one
netfilter: nf_conntrack_sip: fix the ct_sip_parse_numerical_param() return value.
netfilter: nfnetlink_osf: fix module autoload
netfilter: nfnetlink: skip error delivery on batch in case of ENOMEM
netfilter: nf_tables: add NFT_TRANS_PREPARE_ERROR to deal with bound set/chain
netfilter: nf_tables: disallow element updates of bound anonymous sets
netfilter: nf_tables: disallow rule addition to bound chain via NFTA_RULE_CHAIN_ID
netfilter: nf_tables: disallow updates of anonymous sets
netfilter: nf_tables: do not ignore genmask when looking up chain by id
netfilter: nf_tables: drop map element references from preparation phase
netfilter: nf_tables: fix chain binding transaction logic
netfilter: nf_tables: fix spurious set element insertion failure
netfilter: nf_tables: incorrect error path handling with NFT_MSG_NEWRULE
netfilter: nf_tables: integrate pipapo into commit protocol
netfilter: nf_tables: prevent OOB access in nft_byteorder_eval
netfilter: nf_tables: reject unbound anonymous set before commit phase
netfilter: nf_tables: reject unbound chain set before commit phase
netfilter: nf_tables: skip bound chain in netns release path
netfilter: nf_tables: skip bound chain on rule flush
netfilter: nf_tables: skip immediate deactivate in _PREPARE_ERROR
netfilter: nf_tables: unbind non-anonymous set if rule construction fails
netfilter: nft_set_pipapo: fix improper element removal
netfilter: nft_set_pipapo: .walk does not deal with generations
netfilter: nft_set_rbtree: fix overlap expiration walk
net: hns3: fix wrong bw weight of disabled tc issue
net: hns3: fix wrong tc bandwidth weight data issue
net: ipv4: Use kfree_sensitive instead of kfree
net:ipv6: check return value of pskb_trim()
net: korina: handle clk prepare error in korina_probe()
net: lan743x: Don't sleep in atomic context
net: lapbether: only support ethernet devices
netlink: Add __sock_i_ino() for __netlink_diag_dump().
netlink: do not hard code device address lenth in fdb dumps
netlink: fix potential deadlock in netlink_set_err()
net: ll_temac: fix error checking of irq_of_parse_and_map()
net: ll_temac: Switch to use dev_err_probe() helper
net/mlx5: DR, fix memory leak in mlx5dr_cmd_create_reformat_ctx
net/mlx5e: Check for NOT_READY flag state after locking
net/mlx5e: fix double free in mlx5e_destroy_flow_table
net/mlx5e: fix memory leak in mlx5e_ptp_open
net/mlx5e: fix return value check in mlx5e_ipsec_remove_trailer()
net/mlx5: Free irqs only on shutdown callback
net/mlx5: fs_core: Make find_closest_ft more generic
net/mlx5: fs_core: Skip the FTs in the same FS_TYPE_PRIO_CHAINS fs_prio
net: mvneta: fix txq_map in case of txq_number==1
net: netsec: Ignore 'phy-mode' on SynQuacer in DT mode
net: nfc: Fix use-after-free caused by nfc_llcp_find_local
net: phy: marvell10g: fix 88x3310 power up
net: phy: prevent stale pointer dereference in phy_init()
net: prevent skb corruption on frag list segmentation
net: qca_spi: Avoid high load if QCA7000 is not available
net: Remove DECnet leftovers from flow.h.
net: Remove unused inline function dst_hold_and_use()
net/sched: act_ipt: add sanity checks on table name and hook locations
net/sched: act_pedit: Add size check for TCA_PEDIT_PARMS_EX
net/sched: act_pedit: Parse L3 Header for L4 offset
net/sched: act_pedit: remove extra check for key type
net/sched: cls_api: Fix lockup on flushing explicitly created chain
net: sched: cls_bpf: Undo tcf_bind_filter in case of an error
net/sched: cls_fw: Fix improper refcount update leads to use-after-free
net/sched: cls_fw: No longer copy tcf_result on update to avoid use-after-free
net/sched: cls_route: No longer copy tcf_result on update to avoid use-after-free
net: sched: cls_u32: Fix match key mis-addressing
net/sched: cls_u32: Fix reference counter leak leading to overflow
net/sched: cls_u32: No longer copy tcf_result on update to avoid use-after-free
net/sched: flower: Ensure both minimum and maximum ports are specified
net/sched: make psched_mtu() RTNL-less safe
net/sched: mqprio: add extack to mqprio_parse_nlattr()
net/sched: mqprio: Add length check for TCA_MQPRIO_{MAX/MIN}_RATE64
net/sched: mqprio: refactor nlattr parsing to a separate function
net/sched: sch_qfq: account for stab overhead in qfq_enqueue
net/sched: sch_qfq: refactor parsing of netlink parameters
net/sched: sch_qfq: reintroduce lmax bound check for MTU
net/sched: simplify tcf_pedit_act
net/sched: taprio: Limit TCA_TAPRIO_ATTR_SCHED_CYCLE_TIME to INT_MAX.
net: stmmac: Apply redundant write work around on 4.xx too
net: stmmac: fix double serdes powerdown
net: tap_open(): set sk_uid from current_fsuid()
net: tipc: resize nlattr array to correct size
net: tun_chr_open(): set sk_uid from current_fsuid()
net: usbnet: Fix WARNING in usbnet_start_xmit/usb_submit_urb
net: usb: qmi_wwan: add support for Compal RXM-G1
nfc: llcp: fix possible use of uninitialized variable in nfc_llcp_send_connect()
nfc: llcp: simplify llcp_sock_connect() error paths
nfcsim.c: Fix error checking for debugfs_create_dir
NFSD: add encoding of op_recall flag for write delegation
nfsd: Remove incorrect check in nfsd4_validate_stateid
NFSv4.1: freeze the session table upon receiving NFS4ERR_BADSESSION
nilfs2: fix buffer corruption due to concurrent device reads
nilfs2: fix incomplete buffer cleanup in nilfs_btnode_abort_change_key()
nilfs2: fix possible out-of-bounds segment allocation in resize ioctl
nilfs2: prevent general protection fault in nilfs_clear_dirty_page()
nilfs2: reject devices with insufficient block count
nios2: dts: Fix tse_mac "max-frame-size" property
nixge: fix mac address error handling again
nouveau: fix client work fence deletion race
NTB: amd: Fix error handling in amd_ntb_pci_driver_init()
ntb: idt: Fix error handling in idt_pci_driver_init()
ntb: intel: Fix error handling in intel_ntb_pci_driver_init()
NTB: ntb_tool: Add check for devm_kcalloc
NTB: ntb_transport: fix possible memory leak while device_register() fails
ntfs: Fix panic about slab-out-of-bounds caused by ntfs_listxattr()
n_tty: Rename tail to old_tail in n_tty_read()
nubus: Partially revert proc_create_single_data() conversion
NVMe: Add MAXIO 1602 to bogus nid list.
nvme: double KA polling frequency to avoid KATO with TBKAS on
nvmem: rmem: Use NVMEM_DEVID_AUTO
nvme-pci: fix DMA direction of unmapping integrity data
nvme-pci: remove nvme_queue from nvme_iod
ocfs2: check new file size on fallocate call
ocfs2: fix use-after-free when unmounting read-only filesystem
octeontx2-af: Add validation before accessing cgx and lmac
octeontx2-af: fixed resource availability check
octeontx2-af: fix lbk link credits on cn10k
octeontx2-af: Fix mapping for NIX block from CGX connection
octeontx2-pf: Add additional check for MCAM rules
octeontx2-pf: Dont allocate BPIDs for LBK interfaces
octeontx-af: fix hardware timestamp configuration
of: net: add a helper for loading netdev->dev_addr
of: overlay: add entry to of_overlay_action_name[]
of: overlay: Fix missing of_node_put() in error case of init_overlay_changeset()
of: overlay: rename variables to be consistent
of: overlay: rework overlay apply and remove kfree()s
open: make RESOLVE_CACHED correctly test for O_TMPFILE
opp: Fix use-after-free in lazy_opp_tables after probe deferral
ovl: fix null pointer dereference in ovl_get_acl_rcu()
ovl: update of dentry revalidate flags after copy up
parisc: Delete redundant register definitions in <asm/assembly.h>
parisc: Flush gatt writes and adjust gatt mask in parisc_agp_mask_memory()
parisc: Improve cache flushing for PCXL in arch_sync_dma_for_cpu()
PCI: Add function 1 DMA alias quirk for Marvell 88SE9235
PCI: Add pci_clear_master() stub for non-CONFIG_PCI
PCI/ASPM: Avoid link retraining race
PCI/ASPM: Disable ASPM on MFD function removal to avoid use-after-free
PCI/ASPM: Factor out pcie_wait_for_retrain()
PCI/ASPM: Return 0 or -ETIMEDOUT from pcie_retrain_link()
PCI: cadence: Fix Gen2 Link Retraining process
PCI: ftpci100: Release the clock resources
PCI: hv: Add a per-bus mutex state_lock
PCI: hv: Fix a race condition bug in hv_pci_query_relations()
PCI: hv: Fix a race condition in hv_irq_unmask() that can cause panic
PCI: hv: Remove the useless hv_pcichild_state from struct hv_pci_dev
PCI: pciehp: Cancel bringup sequence if card is not present
PCI/PM: Avoid putting EloPOS E2/S2/H2 PCIe Ports in D3cold
PCI: qcom: Disable write access to read only registers for IP v2.3.3
PCI: rockchip: Add poll and timeout to wait for PHY PLLs to be locked
PCI: rockchip: Assert PCI Configuration Enable bit after probe
PCI: rockchip: Don't advertise MSI-X in PCIe capabilities
PCI: rockchip: Fix legacy IRQ generation for RK3399 PCIe endpoint core
PCI: rockchip: Fix window mapping and address translation for endpoint
PCI: rockchip: Remove writes to unused registers
PCI: rockchip: Set address alignment for endpoint mode
PCI: rockchip: Use u32 variable to access 32-bit registers
PCI: rockchip: Write PCI Device ID to correct register
PCI: vmd: Reset VMD config register between soft reboots
perf/arm-cmn: Fix DTC reset
perf bench: Add missing setlocale() call to allow usage of %'d style formatting
perf bench: Use unbuffered output when pipe/tee'ing to a file
perf build: Fix library not found error when using CSLIBS
perf dwarf-aux: Fix off-by-one in die_get_varname()
perf: Fix function pointer case
perf/ibs: Fix interface via core pmu events
perf probe: Add test for regression introduced by switch to die_get_decl_file()
perf script: Fix allocation of evsel->priv related to per-event dump files
perf symbols: Symbol lookup with kcore can fail if multiple segments match stext
perf test uprobe_from_different_cu: Skip if there is no gcc
phy: hisilicon: Fix an out of bounds check in hisi_inno_phy_probe()
phy: qcom-snps: correct struct qcom_snps_hsphy kerneldoc
phy: qcom-snps-femto-v2: keep cfg_ahb_clk enabled during runtime suspend
phy: qcom-snps-femto-v2: properly enable ref clock
phy: qcom-snps: Use dev_err_probe() to simplify code
phy: tegra: xusb: check return value of devm_kzalloc()
phy: tegra: xusb: Clear the driver reference in usb-phy dev
pinctrl: amd: Detect and mask spurious interrupts
pinctrl: amd: Detect internal GPIO0 debounce handling
pinctrl: amd: Fix mistake in handling clearing pins at startup
pinctrl: amd: Only use special debounce behavior for GPIO 0
pinctrl: amd: Use amd_pinconf_set() for all config options
pinctrl: at91-pio4: check return value of devm_kasprintf()
pinctrl: bcm2835: Handle gpiochip_add_pin_range() errors
pinctrl: cherryview: Return correct value if pin in push-pull mode
pinctrl: microchip-sgpio: check return value of devm_kasprintf()
ping6: Fix send to link-local addresses with VRF.
platform/x86: asus-wmi: Ignore WMI events with codes 0x7B, 0xC0
platform/x86: msi-laptop: Fix rfkill out-of-sync on MSI Wind U100
platform/x86: wmi: Break possible infinite loop when parsing GUID
platform/x86: wmi: move variables
platform/x86: wmi: remove unnecessary argument
platform/x86: wmi: use guid_t and guid_equal()
PM: domains: fix integer overflow issues in genpd_parse_state()
PM: sleep: wakeirq: fix wake irq arming
PM / wakeirq: support enabling wake-up irq after runtime_suspend called
posix-timers: Prevent RT livelock in itimer_delete()
powercap: RAPL: Fix CONFIG_IOSF_MBI dependency
powerpc/64s: Fix VAS mm use after free
powerpc: allow PPC_EARLY_DEBUG_CPM only when SERIAL_CPM=y
powerpc/book3s64/mm: Fix DirectMap stats in /proc/meminfo
powerpc: Fail build if using recordmcount with binutils v2.37
powerpc/interrupt: Don't read MSR from interrupt_exit_kernel_prepare()
powerpc/mm/altmap: Fix altmap boundary check
powerpc/mm/dax: Fix the condition when checking if altmap vmemap can cross-boundary
powerpc/powernv/sriov: perform null check on iov before dereferencing iov
powerpc/purgatory: remove PGO flags
powerpc/security: Fix Speculation_Store_Bypass reporting on Power10
powerpc/signal32: Force inlining of __unsafe_save_user_regs() and save_tm_user_regs_unsafe()
powerpc: simplify ppc_save_regs
powerpc: update ppc_save_regs to save current r1 in pt_regs
power: supply: ab8500: Fix external_power_changed race
power: supply: bq27xxx: Use mod_delayed_work() instead of cancel() + schedule()
power: supply: Fix logic checking if system is running from battery
power: supply: Ratelimit no data debug output
power: supply: sc27xx: Fix external_power_changed race
pptp: Fix fib lookup calls.
prestera: fix fallback to previous version on same major version
pstore/ram: Add check for kstrdup
pwm: ab8500: Fix error code in probe()
pwm: Add a stub for devm_pwmchip_add()
pwm: imx-tpm: force 'real_period' to be zero in suspend
pwm: meson: fix handling of period/duty if greater than UINT_MAX
pwm: meson: Simplify duplicated per-channel tracking
pwm: mtk_disp: Fix the disable flow of disp_pwm
pwm: sysfs: Do not apply state to already disabled PWMs
qed: Fix kernel-doc warnings
qed: Fix scheduling in a tasklet while getting stats
quota: fix warning in dqgrab()
quota: Properly disable quotas when add_dquot_ref() fails
radeon: avoid double free in ci_dpm_init()
rbd: harden get_lock_owner_info() a bit
rbd: make get_lock_owner_info() return a single locker or NULL
rbd: prevent busy loop when requesting exclusive lock
rbd: retrieve and check lock owner twice before blocklisting
rcu/kvfree: Avoid freeing new kfree_rcu() memory after old grace period
rcu/rcuscale: Move rcu_scale_*() after kfree_scale_cleanup()
rcu/rcuscale: Stop kfree_scale_thread thread(s) after unloading rcuscale
rcuscale: Always log error message
rcuscale: Move shutdown from wait_event() to wait_event_idle()
rcutorture: Correct name of use_softirq module parameter
RDMA/bnxt_re: Avoid calling wake_up threads from spin_lock context
RDMA/bnxt_re: Disable/kill tasklet only if it is enabled
RDMA/bnxt_re: Fix to remove an unnecessary log
RDMA/bnxt_re: Fix to remove unnecessary return labels
RDMA/bnxt_re: Prevent handling any completions after qp destroy
RDMA/bnxt_re: Remove a redundant check inside bnxt_re_update_gid
RDMA/bnxt_re: Use unique names while registering interrupts
RDMA/bnxt_re: wraparound mbox producer index
RDMA/cma: Always set static rate to 0 for RoCE
RDMA/hns: Fix hns_roce_table_get return value
RDMA/irdma: Add missing read barriers
RDMA/irdma: avoid fortify-string warning in irdma_clr_wqes
RDMA/irdma: Fix data race on CQP completion stats
RDMA/irdma: Fix data race on CQP request done
RDMA/irdma: Report correct WC error
RDMA/mlx4: Make check for invalid flags stricter
RDMA/mlx5: Initiate dropless RQ for RAW Ethernet functions
RDMA/mthca: Fix crash when polling CQ for shared QPs
RDMA/rtrs: Fix rxe_dealloc_pd warning
RDMA/rtrs: Fix the last iu->buf leak in err path
RDMA/rxe: Fix packet length checks
RDMA/rxe: Fix the use-before-initialization error of resp_pkts
RDMA/rxe: Removed unused name from rxe_task struct
RDMA/rxe: Remove the unused variable obj
RDMA/uverbs: Restrict usage of privileged QKEYs
regmap: Account for register length in SMBus I/O limits
regmap: Drop initial version of maximum transfer length fixes
regmap: spi-avmm: Fix regmap_bus max_raw_write
regulator: core: Fix more error checking for debugfs_create_dir()
regulator: core: Streamline debugfs operations
regulator: Fix error checking for debugfs_create_dir
regulator: pca9450: Fix LDO3OUT and LDO4OUT MASK
Remove DECnet support from kernel
Revert "8250: add support for ASIX devices with a FIFO bug"
Revert "drm/amd/display: edp do not add non-edid timings"
Revert "f2fs: fix potential corruption when moving a directory"
Revert "net: phy: dp83867: perform soft reset and retain established link"
Revert "PCI: hv: Fix a timing issue which causes kdump to fail occasionally"
Revert "tcp: avoid the lookup process failing to get sk in ehash table"
Revert "thermal/drivers/mediatek: Use devm_of_iomap to avoid resource leak in mtk_thermal_probe"
Revert "tracing: Add "(fault)" name injection to kernel probes"
Revert "usb: common: usb-conn-gpio: Set last role to unknown before initial detection"
Revert "usb: dwc3: core: Enable AutoRetry feature in the controller"
Revert "usb: gadget: tegra-xudc: Fix error check in tegra_xudc_powerdomain_init()"
Revert "usb: xhci: tegra: Fix error check"
Revert "xhci: add quirk for host controllers that don't update endpoint DCS"
ring-buffer: Fix deadloop issue on reading trace_pipe
ring-buffer: Fix wrong stat of cpu_buffer->read
riscv, bpf: Fix inconsistent JIT image generation
riscv: mm: fix truncation warning on RV32
riscv: move memblock_allow_resize() after linear mapping is ready
riscv: uprobes: Restore thread.bad_cause
rtc: st-lpc: Release some resources in st_rtc_probe() in case of error
rtnetlink: extend RTEXT_FILTER_SKIP_STATS to IFLA_VF_INFO
rtnetlink: let rtnl_bridge_setlink checks IFLA_BRIDGE_MODE length
s390/cio: unregister device when the only path is gone
s390/dasd: fix hanging device after quiesce/resume
s390/decompressor: fix misaligned symbol build error
s390/purgatory: disable branch profiling
s390/qeth: Don't call dev_close/dev_open (DOWN/UP)
s390/qeth: Fix vipa deletion
samples/bpf: Fix buffer overflow in tcp_basertt
samples: ftrace: Save required argument registers in sample trampolines
sch_netem: acquire qdisc lock in netem_change()
scripts/tags.sh: Resolve gtags empty index generation
scsi: 3w-xxxx: Add error handling for initialization failure in tw_probe()
scsi: qedf: Fix NULL dereference in error handling
scsi: qla2xxx: Add debug prints in the device remove path
scsi: qla2xxx: Array index may go out of bound
scsi: qla2xxx: Avoid fcport pointer dereference
scsi: qla2xxx: Check valid rport returned by fc_bsg_to_rport()
scsi: qla2xxx: Correct the index of array
scsi: qla2xxx: Fix buffer overrun
scsi: qla2xxx: Fix error code in qla2x00_start_sp()
scsi: qla2xxx: Fix hang in task management
scsi: qla2xxx: Fix potential NULL pointer dereference
scsi: qla2xxx: Fix task management cmd fail due to unavailable resource
scsi: qla2xxx: Fix task management cmd failure
scsi: qla2xxx: Multi-que support for TMF
scsi: qla2xxx: Pointer may be dereferenced
scsi: qla2xxx: Remove unused declarations for qla2xxx
scsi: qla2xxx: Remove unused nvme_ls_waitq wait queue
scsi: qla2xxx: Wait for io return on terminate rport
scsi: storvsc: Limit max_sectors for virtual Fibre Channel devices
scsi: target: iscsi: Prevent login threads from racing between each other
scsi: zfcp: Defer fc_rport blocking until after ADISC response
sctp: add bpf_bypass_getsockopt proto callback
sctp: fix an error code in sctp_sf_eat_auth()
sctp: fix potential deadlock on &net->sctp.addr_wq_lock
security: keys: Modify mismatched function name
selftests/bpf: Fix check_mtu using wrong variable type
selftests: forwarding: Fix race condition in mirror installation
selftests/mount_setattr: fix redefine struct mount_attr build error
selftests: mptcp: depend on SYN_COOKIES
selftests: mptcp: join: only check for ip6tables if needed
selftests: mptcp: join: skip check if MIB counter not supported
selftests: mptcp: join: use 'iptables-legacy' if available
selftests: mptcp: lib: skip if missing symbol
selftests: mptcp: lib: skip if not below kernel version
selftests: mptcp: pm nl: remove hardcoded default limits
selftests: mptcp: sockopt: return error if wrong mark
selftests: mptcp: sockopt: use 'iptables-legacy' if available
selftests: net: fcnal-test: check if FIPS mode is enabled
selftests/ptp: Fix timestamp printf format for PTP_SYS_OFFSET
selftests/rseq: check if libc rseq support is registered
selftests/rseq: Play nice with binaries statically linked against glibc 2.35+
selftests: rtnetlink: remove netdevsim device after ipsec offload test
selftests: tc: add ConnTrack procfs kconfig
selftests: tc: add 'ct' action kconfig dep
selftests: tc: set timeout to 15 minutes
serial: 8250_dw: Preserve original value of DLF register
serial: 8250: lock port for stop_rx() in omap8250_irq()
serial: 8250: lock port for UART_IER access in omap8250_irq()
serial: 8250: omap: Fix freeing of resources on failed register
serial: 8250_omap: Use force_suspend and resume for system suspend
serial: atmel: don't enable IRQs prematurely
serial: lantiq: add missing interrupt ack
serial: qcom-geni: drop bogus runtime pm state update
serial: sifive: Fix sifive_serial_console_setup() section
sfc: fix crash when reading stats while NIC is resetting
sh/cpu: Switch to arch_cpu_finalize_init()
sh: dma: Fix DMA channel offset calculation
sh: j2: Use ioremap() to translate device tree address into kernel memory
shmem: use ramfs_kill_sb() for kill_sb method of ramfs-based tmpfs
SMB3: Do not send lease break acknowledgment if all file handles have been closed
soc/fsl/qe: fix usb.c build errors
soundwire: bus: pm_runtime_request_resume on peripheral attachment
soundwire: dmi-quirks: add new mapping for HP Spectre x360
soundwire: fix enumeration completion
soundwire: qcom: fix storing port config out-of-bounds
soundwire: qcom: update status correctly with mask
sparc/cpu: Switch to arch_cpu_finalize_init()
spi: bcm63xx: fix max prepend length
spi: bcm-qspi: return error if neither hif_mspi nor mspi is available
spi: dw: Round of n_bytes to power of 2
spi: fsl-dspi: avoid SCK glitches with continuous transfers
spi: lpspi: disable lpspi module irq in DMA mode
spi: spi-geni-qcom: Correct CS_TOGGLE bit in SPI_TRANS_CFG
staging: ks7010: potential buffer overflow in ks_wlan_set_encode_ext()
staging: r8712: Fix memory leak in _r8712_init_xmit_priv()
SUNRPC: Fix UAF in svc_tcp_listen_data_ready()
svcrdma: Prevent page release when nothing was received
tcp: annotate data-races around fastopenq.max_qlen
tcp: annotate data-races around icsk->icsk_syn_retries
tcp: annotate data-races around icsk->icsk_user_timeout
tcp: annotate data-races around rskq_defer_accept
tcp: annotate data-races around tcp_rsk(req)->ts_recent
tcp: annotate data-races around tp->keepalive_intvl
tcp: annotate data-races around tp->keepalive_probes
tcp: annotate data-races around tp->keepalive_time
tcp: annotate data-races around tp->linger2
tcp: annotate data-races around tp->notsent_lowat
tcp: annotate data-races around tp->tcp_tx_delay
tcp: annotate data races in __tcp_oow_rate_limited()
tcp_metrics: annotate data-races around tm->tcpm_lock
tcp_metrics: annotate data-races around tm->tcpm_net
tcp_metrics: annotate data-races around tm->tcpm_stamp
tcp_metrics: annotate data-races around tm->tcpm_vals[]
tcp_metrics: fix addr_same() helper
tcp_metrics: fix data-race in tcpm_suck_dst() vs fastopen
tcp: Reduce chance of collisions in inet6_hashfn().
team: reset team's flags when down link is P2P device
test_firmware: fix a memory leak with reqs buffer
test_firmware: prevent race conditions by a correct implementation of locking
test_firmware: return ENOMEM instead of ENOSPC on failed memory allocation
test_firmware: Use kstrtobool() instead of strtobool()
thermal/drivers/sun8i: Fix some error handling paths in sun8i_ths_probe()
thunderbolt: dma_test: Use correct value for absent rings when creating paths
thunderbolt: Mask ring interrupt on Intel hardware as well
tick/common: Align tick period during sched_timer setup
tipc: check return value of pskb_trim()
tipc: stop tipc crypto on failure in tipc_node_create
tools: gpio: fix debounce_period_us output of lsgpio
tpm_tis: Explicitly check for error code
tpm, tpm_tis: Claim locality in interrupt handler
tpm: tpm_vtpm_proxy: fix a race condition in /dev/vtpmx creation
tracing: Add tracing_reset_all_online_cpus_unlocked() function
tracing: Allow synthetic events to pass around stacktraces
tracing: Fix memory leak of iter->temp when reading trace_pipe
tracing: Fix null pointer dereference in tracing_err_log_open()
tracing: Fix trace_event_raw_event_synth() if else statement
tracing: Fix warning in trace_buffered_event_disable()
tracing/histograms: Add histograms to hist_vars if they have referenced variables
tracing/histograms: Return an error if we fail to add histogram to hist_vars list
tracing/probes: Add symstr type for dynamic events
tracing/probes: Fix not to count error code to total length
tracing/probes: Fix to avoid double count of the string length on the array
tracing/probes: Fix to record 0-length data_loc in fetch_store_string*() if fails
tracing/probes: Fix to update dynamic data counter if fetcharg uses it
tracing/timer: Add missing hrtimer modes to decode_hrtimer_mode().
tty: fix hang on tty device with no_room set
tty: n_gsm: fix UAF in gsm_cleanup_mux
tty: serial: fsl_lpuart: add earlycon for imx8ulp platform
tty: serial: imx: fix rs485 rx after tx
tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() in case of error
tty: serial: samsung_tty: Fix a memory leak in s3c24xx_serial_getclk() when iterating clk
udf: Fix uninitialized array access for some pathnames
udp6: fix udp6_ehashfn() typo
um/cpu: Switch to arch_cpu_finalize_init()
um: Use HOST_DIR for mrproper
usb: cdns3: fix incorrect calculation of ep_buf_size when more than one config
usb: common: usb-conn-gpio: Set last role to unknown before initial detection
usb: dwc2: Fix some error handling paths
usb: dwc2: platform: Improve error reporting for problems during .remove()
usb: dwc3: don't reset device side if dwc3 was configured as host-only
usb: dwc3: gadget: Propagate core init errors to UDC during pullup
usb: dwc3: gadget: Reset num TRBs before giving back the request
usb: dwc3-meson-g12a: Fix an error handling path in dwc3_meson_g12a_probe()
usb: dwc3: pci: skip BYT GPIO lookup table for hardwired phy
usb: dwc3: qcom: Fix an error handling path in dwc3_qcom_probe()
usb: dwc3: qcom: Fix potential memory leak
usb: dwc3: qcom: Release the correct resources in dwc3_qcom_remove()
usb: gadget: call usb_gadget_check_config() to verify UDC capability
USB: gadget: Fix the memory leak in raw_gadget driver
usb: gadget: udc: fix NULL dereference in remove()
usb: gadget: u_serial: Add null pointer check in gserial_suspend
usb: hide unused usbfs_notify_suspend/resume functions
usb: ohci-at91: Fix the unhandle interrupt when resume
usb: phy: phy-tahvo: fix memory leak in tahvo_usb_probe()
USB: quirks: add quirk for Focusrite Scarlett
USB: serial: option: add LARA-R6 01B PIDs
USB: serial: option: add Quectel EC200A module support
USB: serial: option: add Quectel EM061KGL series
USB: serial: option: support Quectel EM060K_128
USB: serial: simple: add Kaufmann RKS+CAN VCP
USB: serial: simple: sort driver entries
usb: xhci-mtk: set the dma max_seg_size
USB: zaurus: Add ID for A-300/B-500/C-700
vhost_net: revert upend_idx only on retriable error
virtio-net: fix race between set queues and probe
vxlan: calculate correct header length for GPE
vxlan: Fix nexthop hash size
vxlan: move to its own directory
w1: fix loop in w1_fini()
w1: w1_therm: fix locking behavior in convert_t
watchdog/perf: define dummy watchdog_update_hrtimer_threshold() on correct config
watchdog/perf: more properly prevent false positives with turbo modes
wifi: airo: avoid uninitialized warning in airo_get_rate()
wifi: ath9k: avoid referencing uninit memory in ath9k_wmi_ctrl_rx
wifi: ath9k: convert msecs to jiffies where needed
wifi: ath9k: don't allow to overwrite ENDPOINT0 attributes
wifi: ath9k: fix AR9003 mac hardware hang check register offset calculation
wifi: ath9k: Fix possible stall on ath9k_txq_list_has_key()
wifi: atmel: Fix an error handling path in atmel_probe()
wifi: cfg80211: fix double lock bug in reg_wdev_chan_valid()
wifi: cfg80211: fix locking in regulatory disconnect
wifi: cfg80211: Fix return value in scan logic
wifi: cfg80211: rewrite merging of inherited elements
wifi: iwlwifi: mvm: indicate HW decrypt for beacon protection
wifi: iwlwifi: pcie: fix NULL pointer dereference in iwl_pcie_irq_rx_msix_handler()
wifi: iwlwifi: pull from TXQs with softirqs disabled
wifi: mt76: mt7615: do not advertise 5 GHz on first phy of MT7615D (DBDC)
wifi: mwifiex: Fix the size of a memory allocation in mwifiex_ret_802_11_scan()
wifi: orinoco: Fix an error handling path in orinoco_cs_probe()
wifi: orinoco: Fix an error handling path in spectrum_cs_probe()
wifi: ray_cs: Drop useless status variable in parse_addr()
wifi: ray_cs: Fix an error handling path in ray_probe()
wifi: ray_cs: Utilize strnlen() in parse_addr()
wifi: rsi: Do not configure WoWlan in shutdown hook if not enabled
wifi: rsi: Do not set MMC_PM_KEEP_POWER in shutdown
wifi: wilc1000: fix for absent RSN capabilities WFA testcase
wifi: wl3501_cs: Fix an error handling path in wl3501_probe()
wireguard: netlink: send staged packets when setting initial private key
wireguard: queueing: use saner cpu selection wrapping
wl3501_cs: use eth_hw_addr_set()
word-at-a-time: use the same return type for has_zero regardless of endianness
workqueue: clean up WORK_* constant types, clarify masking
writeback: fix dereferencing NULL mapping->host on writeback_page_template
x86/apic: Fix kernel panic when booting with intremap=off and x2apic_phys
x86/bugs: Increase the x86 bugs vector size to two u32s
x86/cpu/amd: Add a Zenbleed fix
x86/CPU/AMD: Do not leak quotient data after a division by 0
x86/cpu/amd: Move the errata checking functionality up
x86/cpu, kvm: Add support for CPUID_80000021_EAX
x86/cpu: Switch to arch_cpu_finalize_init()
x86: fix backwards merge of GDS/SRSO bit
x86/fpu: Mark init functions __init
x86/fpu: Move FPU initialization into arch_cpu_finalize_init()
x86/fpu: Remove cpuinfo argument from init functions
x86/init: Initialize signal frame size late
x86/microcode/AMD: Load late on both threads too
x86/mm: Avoid using set_pgd() outside of real PGD pages
x86/mm: fix poking_init() for Xen PV guests
x86/mm: Fix __swp_entry_to_pte() for Xen PV guests
x86/mm: Initialize text poking earlier
x86/mm: Use mm_alloc() in poking_init()
x86/purgatory: remove PGO flags
x86/resctrl: Only show tasks' pid in current pid namespace
x86/smp: Use dedicated cache-line for mwait_play_dead()
x86/speculation: Add force option to GDS mitigation
x86/speculation: Add Gather Data Sampling mitigation
x86/speculation: Add Kconfig option for GDS
x86/srso: Add a Speculative RAS Overflow mitigation
x86/srso: Add IBPB
x86/srso: Add IBPB_BRTYPE support
x86/srso: Add IBPB on VMEXIT
x86/srso: Add SRSO_NO support
x86/srso: Fix return thunks in generated code
x86/srso: Tie SBPB bit setting to microcode patch detection
x86/xen: Fix secondary processors' FPU initialization
xen/blkfront: Only check REQ_FUA for writes
xen/netback: Fix buffer overrun triggered by unusual packet
xfrm: Ensure policies always checked on XFRM-I input path
xfrm: fix inbound ipv4/udp/esp packets to UDPv6 dualstack sockets
xfrm: interface: rename xfrm_interface.c to xfrm_interface_core.c
xfrm: Linearize the skb after offloading if needed.
xfrm: Treat already-verified secpath entries as optional
xhci: Fix resume issue of some ZHAOXIN hosts
xhci: Fix TRB prefetch issue of ZHAOXIN hosts
xhci: Show ZHAOXIN xHCI root hub speed correctly
xsk: Honor SO_BINDTODEVICE on bind
xtensa: ISS: fix call to split_if_spec

Updated by kernel-updater-bot (https://abf.io/mikhailnov/kernel-updater-bot)
2023-08-11 22:20:39 +03:00

2015 lines
73 KiB
RPMSpec

# _get_email() in %%build contains bashisms for regexping
%define _buildshell /bin/bash
# brp-python-bytecompile uses /usr/bin/python,
# but it is a different python version in different ROSA
# releases; there is no good way to tell brp-python-bytecompile
# which iterpreter to use; so just disable it to avoid problems
%define _python_bytecompile_build 0
# Probably dwz bug, on i686 only file is not packaged:
# /usr/lib/debug/usr/bin/trace-5.4.40-3.i386.debug.#dwz#.b5xuKG
# dwz compresses only debuginfo from perf, cpupower, uml,
# not the kernel itself (because it is stripped not by RPM),
# so we do not loose much by disabling it.
%global _find_debuginfo_dwz_opts %{nil}
# Put everything into one non-standard debuginfo subpackage
# TODO: make multiple debuginfo packages coinstallable as installonlypkg,
# to achive this, there must be no conflicting files.
# Probably signing and compressing of kernel modules
# has to be moved to %%_spec_install_post.
%global _debuginfo_subpackages %{nil}
%global _debuginfo_template %{nil}
%undefine _debugsource_packages
# Avoid rediffing patches like AUFS when possible
%define _default_patch_fuzz 10
# Hack: flavour and major version are variable, make %%_build_pkgcheck_* always detect and use this config
%global _build_pkgcheck_set %(echo "%{_build_pkgcheck_set}" | sed -e 's,/%{name}.rpmlintrc,/kernel.rpmlintrc,')
%global _build_pkgcheck_srpm %(echo "%{_build_pkgcheck_srpm}" | sed -e 's,/%{name}.rpmlintrc,/kernel.rpmlintrc,')
%define kernelversion 5
%define patchlevel 15
%define sublevel 126
# Release number. Increase this before a rebuild.
%define rpmrel 1
%define fullrpmrel %{rpmrel}
%define rpmtag %{disttag}
# Version defines
%define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
%define kverrel %{kversion}-%{fullrpmrel}
%define tar_ver %{kernelversion}.%{patchlevel}
%ifarch %{ix86}
%define arch_suffix i686
%endif
%ifarch %{x86_64}
%define arch_suffix x86_64
%endif
%ifarch aarch64
%define arch_suffix arm64
%endif
%define buildrpmrel %{fullrpmrel}%{rpmtag}-%{arch_suffix}
%define buildrel %{kversion}-%{buildrpmrel}
# Add not only the build time generated key to the trusted keyring,
# but also add public keys of private ROSA's keys
%bcond_without additional_keys
# Fail the build after "make oldconfig" to edit kernel configs
%bcond_with fail
# User Mode Linux, https://habr.com/ru/company/itsumma/blog/459558/
# Not buildable on aarch64, rarely needed in general
%bcond_with uml
# "Nickel" is a special brand for certified distros
%if %{mdvver} == 201905
%bcond_without nickel
# Require kernel modules to be signed
%bcond_without oblig_signed_modules
%else
%bcond_with nickel
%bcond_with oblig_signed_modules
%endif
%if %{mdvver} >= 201905
# Build binary out-of-tree kernel modules (experimental)
%bcond_without binary_extra_modules
# Sign kernel modules with GOST key (experimental)
%bcond_without gost_sign
%else
%bcond_with binary_extra_modules
%bcond_with gost_sign
%endif
%bcond_with ccache
%bcond_without flow_abi
%bcond_without aufs
# 1. VirtualBox is for x86_32 and x86_64 only
# 2. I do not know how to solve the problem that userspace part of VirtualBox
# will be updated ahead of these binary modules. So just off building them.
%bcond_with binary_virtualbox_host
# Shredder-kernel works only on x86_64, makes manipulations with syscalls tables,
# loading/unloading of the module failed sometimes on kernel 5.4
# and it has not been adapted for kernel 5.10 (is not buildable)
%bcond_with binary_shredder
# Compress modules with zstd (zstd is good compression and fast decompression)
%bcond_without compress_modules
# Spend more resources on compression, but make resulting size less;
# decompression speed will not be affected, but more memory will be required
# which should not a problem here (performance penalty from allocating more
# memory should not be big, I think, but I did not benchmark).
%define zstd_cmd zstd -q --format=zstd --ultra -22
# Optionally keep using xz as compressor
#bcond_without modxz
# Kernel flavour
%if %{with nickel}
%define flavour nickel
%else
%define flavour generic
%endif
# The full kernel version
%define kver_full %{kversion}-%{flavour}-%{buildrpmrel}
############################################################################
%define top_dir_name kernel-%{_arch}
%define build_dir ${RPM_BUILD_DIR}/%{top_dir_name}
%define src_dir %{build_dir}/linux-%{tar_ver}
# Common target directories
%define _bootdir /boot
%define _modulesdir /lib/modules
%define devel_root /usr/src/linux-%{kver_full}
%define initrd_path %{_bootdir}/initrd-%{kver_full}.img
# Directories needed for building
%define temp_root %{build_dir}/temp-root
%define temp_boot %{temp_root}%{_bootdir}
%define temp_modules %{temp_root}%{_modulesdir}
%define temp_devel_root %{temp_root}%{devel_root}
# Directories definition needed for installing
%define target_boot %{buildroot}%{_bootdir}
%define target_modules %{buildroot}%{_modulesdir}
# Manual control of creating and deleting keys
# "rnd" is "random" and means that a key pair is generated at build time
# and is not saved anywhere.
%define certs_dir_rnd certs
%define certs_signing_key_priv_rnd %{certs_dir_rnd}/signing_key_priv.key
%define certs_signing_der %{certs_dir_rnd}/signing_key.x509
%define certs_key_config_rnd %{certs_dir_rnd}/x509.genkey
%define certs_public_keys %{certs_dir_rnd}/public.pem
%define certs_verify_tmp %{certs_dir_rnd}/verify.tmp
%define kernel_files %{_builddir}/kernel_files.list
%define debuginfo_files %{_builddir}/debuginfo_files.list
# Append list of files generate by find-debuginfo.sh to our custom list
%global __debug_install_post \
%{__debug_install_post} \
cat %{_builddir}/debugfiles.list >> %{debuginfo_files}
############################################################################
%if %{with binary_extra_modules}
# global instead of define to speed up things
%global nvidia_340_j %{kroko_j -p kernel-source-nvidia340 -r 340}
%global nvidia_340_n %{kroko_n -p kernel-source-nvidia340 -r 340}
%global nvidia_390_j %{kroko_j -p kernel-source-nvidia390 -r 390}
%global nvidia_390_n %{kroko_n -p kernel-source-nvidia390 -r 390}
%global nvidia_470_j %{kroko_j -p kernel-source-nvidia470 -r 470}
%global nvidia_470_n %{kroko_n -p kernel-source-nvidia470 -r 470}
%global nvidia_510_j %{kroko_j -p kernel-source-nvidia510 -r 510}
%global nvidia_510_n %{kroko_n -p kernel-source-nvidia510 -r 510}
%global nvidia_515_j %{kroko_j -p kernel-source-nvidia515 -r 515}
%global nvidia_515_n %{kroko_n -p kernel-source-nvidia515 -r 515}
%global nvidia_520_j %{kroko_j -p kernel-source-nvidia520 -r 520}
%global nvidia_520_n %{kroko_n -p kernel-source-nvidia520 -r 520}
%global nvidia_525_j %{kroko_j -p kernel-source-nvidia525 -r 525}
%global nvidia_525_n %{kroko_n -p kernel-source-nvidia525 -r 525}
# For SRPM stage when auto-krokodil-rpm-macros is not installed
%{?!kroko_mk_release:%global kroko_mk_release(n:) %{nil}}
%{?!kroko_req_modules_in_kernel:%global kroko_req_modules_in_kernel(j:n:p:) %{nil}}
# global, not define, must be expanded only once
%global kroko_release %kroko_mk_release -n kernel-%{kernelversion}.%{patchlevel}-%{flavour}
%endif #/binary_extra_modules
############################################################################
# Buildtime flags
%{?_without_doc: %global build_doc 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}
%{?_with_doc: %global build_doc 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_modxz: %global build_modxz 0}
# Build defines
%define build_doc 1
%define build_devel 1
%define build_debug 1
# Build kernel-headers package
%define build_headers 1
# Build perf and cpupower tools
%define build_perf 0
%define build_cpupower 0
%if %{with compress_modules}
%if %{with modxz}
%define kmod_suffix .xz
%else
%define kmod_suffix .zst
%endif
%else
%define kmod_suffix %{nil}
%endif
%if !%{build_debug}
# Disable debug rpms.
%define _enable_debug_packages %{nil}
%define debug_package %{nil}
%endif
# End of user definitions
# http://nickdesaulniers.github.io/blog/2018/06/02/speeding-up-linux-kernel-builds-with-ccache/
%if %{with ccache}
%define kmake KBUILD_BUILD_TIMESTAMP='' %make CC='ccache gcc' ARCH="%{arch_type}"
%else
%define kmake %make CC='gcc' ARCH="%{arch_type}"
%endif
# There are places where parallel make don't work
%define smake make
%ifarch %{ix86} %{x86_64}
%define arch_type x86
%endif
%ifarch aarch64
%define arch_type arm64
%endif
# 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")
#
# SRC RPM description
#
Summary: The Linux kernel
Name: kernel-%{kernelversion}.%{patchlevel}-%{flavour}
Version: %{kversion}
Release: %{fullrpmrel}
License: GPLv2
Group: System/Kernel and hardware
Url: https://www.kernel.org
####################################################################
#
# Sources
#
Source0: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz
# This is for disabling *config, mrproper, prepare, scripts on -devel rpms
# Needed, because otherwise the -devel won't build correctly.
Source2: 0001-disable-mrproper-prepare-scripts-configs-in-devel-rp.patch
# TODO: Make a separate package "ksobirator" and BR it
# after testing these macros properly
Source3: macros.ksobirator
%{load:%{SOURCE3}}
# Kernel configuration files.
Source111: kernel-x86_64.config
Source112: kernel-i686.config
Source113: kernel-arm64.config
# Cpupower: the service, the config, etc.
Source50: cpupower.service
Source51: cpupower.config
Source52: cpupower-start.sh
Source53: cpupower.path
Source80: kernel.rpmlintrc
# Additional keys that can be used to sign kernel modules
# Generated by https://abf.io/soft/kernel-keys
# Source201..206: public_key_GOST_*.pem
%{expand:%(for i in `seq 1 6`; do echo "Source$((200+${i})): public_key_GOST_${i}.pem"; done)}
# Source207..212: public_key_RSA_*.pem
%{expand:%(for i in `seq 7 12`; do echo "Source$((200+${i})): public_key_RSA_${i}.pem"; done)}
####################################################################
# Patches
# The patch to make kernel x.y.z from x.y.0.
Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kversion}.xz
# Patches from mainline
# none
Patch2: kernel-5.10.93-fix-perf-build.patch
# ROSA-specific patches
# Perf docs are built after all the kernels. To validate the xml files
# generated during that process, xmlto tries to get DTD files from the Net.
# If it fails, the whole build fails, which is unfortunate. Let us avoid
# this.
Patch101: 0001-perf-skip-xmlto-validation.patch
# http://bugs.rosalinux.ru/show_bug.cgi?id=6235
# http://bugs.rosalinux.ru/show_bug.cgi?id=6459
Patch102: 0001-audit-make-it-less-verbose.patch
%if %{with aufs}
# AUFS 5 from http://aufs.sourceforge.net/
Patch109: 0001-Apply-AUFS-5.patch
%endif
# For kmod() generator of RPM Provides
# Changes version of aacraid.ko
Patch111: 0001-Remove-RPM-illegal-chars-from-module-version.patch
# AltHa LSM Module
# https://www.altlinux.org/AltHa
# http://git.altlinux.org/gears/k/kernel-image-un-def.git
# TODO: known problem: https://bugzilla.altlinux.org/show_bug.cgi?id=38225
Patch201: 0001-altha.patch
# sent to upstream, https://patchwork.kernel.org/patch/11446123/
Patch302: 0001-sign-file-full-functionality-with-modern-LibreSSL.patch
# Support loading GOST-signed modules
Patch305: 0001-crypto-support-loading-GOST-signed-kernel-modules.patch
# Allow to off modules signature check dynamically
Patch306: 0001-ROSA-ima-allow-to-off-modules-signature-check-dynami.patch
# Experimental patch to reduce freezes in low memory conditions
# Config values are the following:
# CONFIG_UNEVICTABLE_ACTIVEFILE=y
# CONFIG_UNEVICTABLE_ACTIVEFILE_KBYTES_LOW=102400 (100 MB)
# CONFIG_UNEVICTABLE_ACTIVEFILE_KBYTES_MIN=51200 (50 MB)
# + zswap is enabled by default
# 50 MB is default value of min_filelist_kbytes in Chromium OS
# https://chromium.googlesource.com/chromiumos/third_party/kernel-next/+/545e2917dbd863760a51379de8c26631e667c563%5E!/
# 256 and 512 MB values are too big as a distro default because many systems have 512MB-2GB RAM
# TODO: tune 50 and 100 MB to some not random and mathemetically explainable values
# https://www.linux.org.ru/news/kernel/16052362?cid=16075323
Patch307: le9pf.diff
Patch308: 0001-Revert-kallsyms-unexport-kallsyms_lookup_name-and-ka.patch
# Support sound on notebook Aquarius NS685U R11 (https://linux-hardware.org/?probe=339dc3db60)
# First 2 patches are from Aquarius.
# The next ones are cherry-picked commits from v5.16+, all commits except 19aed2d6cd from:
# https://github.com/torvalds/linux/commits/0066f1b0e/sound/soc/intel/boards/sof_es8336.c
# Also needed to make sound work:
# 1) alsa-ucm-conf (SRPM alsa-lib) (ucm2/Intel/sof-essx8336/HiFi.conf) also has to be patched
# https://abf.io/import/alsa-lib/commit/0cc7a15f10ef20dbedba94c14ef614a8c64c1882
# 2) firmware sof-cml-es8336.tplg is added into alsa-sof-firmware
# https://abf.io/import/alsa-sof-firmware/commit/6fa57e82492d3ddede7af7b78aeeb5a0c230db4b
Patch0400: 0400-ASoC-es8316-Add-power-management.patch
Patch0401: 0401-ASoC-es8316-Use-increased-GPIO-debounce-time.patch
Patch0402: 0402-ASoC-Intel-add-machine-driver-for-SOF-ES8336.patch
Patch0403: 0403-ASoC-Intel-sof_es8336-add-quirk-for-Huawei-D15-2021.patch
Patch0404: 0404-ASoC-Intel-sof_es8336-make-gpio-optional.patch
Patch0405: 0405-ASoC-Intel-sof_es8336-get-codec-device-with-ACPI-ins.patch
Patch0406: 0406-ASoC-Intel-Revert-ASoC-Intel-sof_es8336-add-quirk-fo.patch
Patch0407: 0407-ASoC-Intel-sof_es8336-use-NHLT-information-to-set-dm.patch
Patch0408: 0408-ASoC-Intel-sof_es8336-log-all-quirks.patch
Patch0409: 0409-ASoC-Intel-sof_es8336-move-comment-to-the-right-plac.patch
Patch0410: 0410-ASoC-Intel-sof_es8336-add-support-for-JD-inverted-qu.patch
Patch0411: 0411-ASoC-Intel-sof_es8336-extend-machine-driver-to-suppo.patch
Patch0412: 0412-ASoC-Intel-sof_es8336-add-cfg-dmics-component-for-UC.patch
Patch0413: 0413-ASoC-Intel-sof_es8336-simplify-speaker-gpio-naming.patch
Patch0414: 0414-ASoC-Intel-sof_es8336-support-a-separate-gpio-to-con.patch
Patch0415: 0415-ASoC-Intel-sof_es8336-add-a-quirk-for-headset-at-mic.patch
Patch0416: 0416-ASoC-Intel-sof_es8336-Add-a-quirk-for-Huawei-Mateboo.patch
Patch0417: 0417-ASoC-Intel-sof_es8336-Fix-GPIO-quirks-set-via-module.patch
Patch0418: 0418-ASoC-Intel-sof_es8336-ignore-GpioInt-when-looking-fo.patch
Patch0419: 0419-ASoC-Intel-sof_es8336-add-support-for-HDMI_In-captur.patch
Patch0420: 0420-ASoC-Intel-sof_es8336-reset-the-num_links-during-pro.patch
Patch0421: 0421-ASoC-Intel-sof_es8336-remove-hard-coded-SSP-selectio.patch
Patch0422: 0422-ASoC-Intel-fix-sof_es8336-probe.patch
Patch0423: 0423-sound-backport-firmware-matches.patch
# TODO: upstreamize quirks and fixes in alsa ucm2
Patch0424: 0424-ASoC-Intel-sof_es8336-Add-more-quirks-for-Russian-ha.patch
Patch0425: 0425-ASoC-Intel-sof_es8336-Add-a-quirk-for-Aquarius-NS685.patch
# Additional backports to make previous patches work/compile
Patch0426: 0426-ASoC-SOF-Intel-hda-report-SSP-link-mask-to-machine-d.patch
Patch0427: 0427-ASoC-Intel-soc-acpi-quirk-topology-filename-dynamica.patch
Patch0428: 0428-ASoC-soc-acpi-fix-kernel-doc-descriptor.patch
Patch0429: 0429-ASoC-soc-acpi-add-information-on-I2S-TDM-link-mask.patch
Patch0430: 0430-ALSA-hda-Fill-gaps-in-NHLT-endpoint-interface.patch
Patch0431: 0431-ASoC-SOF-avoid-casting-const-attribute-away.patch
Patch0432: 0432-ALSA-intel-dsp-config-add-more-ACPI-HIDs-for-ES83x6-.patch
Patch0433: 0433-ASoC-soc-acpi-add-comp_ids-field-for-machine-driver-.patch
Patch0434: 0434-ALSA-hda-intel-dsp-config-update-AlderLake-PCI-IDs.patch
Patch0435: 0435-ASoC-Intel-soc-acpi-Add-entry-for-sof_es8336-in-ADL-.patch
Patch0436: 0436-ALSA-intel-nhlt-add-helper-to-detect-SSP-link-mask.patch
# Support SoC with Baikal-M (ARMv8) CPU
# http://git.altlinux.org/gears/k/kernel-image-std-def.git
# https://github.com/asheplyakov/linux/commits/baikalm-5.15.y-next (many thanks!)
Patch0600: 0600-drm-panfrost-initial-dual-core-group-GPUs-support.patch
Patch0601: 0601-net-stmmac-inital-support-of-Baikal-T1-M-SoCs-GMAC.patch
Patch0602: 0602-dt-bindings-dwmac-Add-bindings-for-Baikal-T1-M-SoCs.patch
Patch0603: 0603-net-stmmac-custom-mdio-reset-for-some-Baikal-M-board.patch
Patch0604: 0604-net-dwmac-baikal-added-compatible-strings.patch
Patch0605: 0605-hwmon-bt1-pvt-access-registers-via-pvt_-readl-writel.patch
Patch0606: 0606-hwmon-bt1-pvt-define-pvt_readl-pvt_writel-for-Baikal.patch
Patch0607: 0607-hwmon-bt1-pvt-adjusted-probing-for-Baikal-M-SoC.patch
Patch0608: 0608-hwmon-bt1-pvt-added-compatible-baikal-pvt.patch
Patch0609: 0609-clk-added-Baikal-M-clock-management-unit-driver.patch
Patch0610: 0610-cpufreq-dt-don-t-load-on-Baikal-M-SoC.patch
Patch0611: 0611-usb-dwc3-of-simple-added-compatible-string-for-Baika.patch
Patch0612: 0612-arm64-Enable-armv8-based-Baikal-M-SoC-support.patch
Patch0613: 0613-drm-bridge-New-bridge-driver-stdp4028.patch
Patch0614: 0614-drm-added-Baikal-M-SoC-video-display-unit-driver.patch
Patch0615: 0615-baikal_vdu-et101-display-port-support.patch
Patch0616: 0616-dw-hdmi-ahb-audio-support-Baikal-M-SoC.patch
Patch0617: 0617-ALSA-hda-Baikal-M-SoC-support.patch
Patch0618: 0618-Added-TF307-TF306-board-management-controller-driver.patch
Patch0619: 0619-rejected-serial-8250_dw-verify-clock-rate-in-dw8250_.patch
Patch0620: 0620-drm-panfrost-forcibly-set-dma-coherent-on-Baikal-M.patch
Patch0621: 0621-drm-panfrost-disable-devfreq-on-Baikal-M.patch
Patch0622: 0622-pm-disable-all-sleep-states-on-Baikal-M-based-boards.patch
Patch0623: 0623-arm64-stub-fixed-secondary-cores-boot-on-Baikal-M-So.patch
Patch0624: 0624-efi-rtc-avoid-calling-efi.get_time-on-Baikal-M-SoC.patch
Patch0625: 0625-net-fwnode_get_phy_id-consider-all-compatible-string.patch
Patch0626: 0626-BROKEN-dwc-i2s-support-Baikal-M-SoC.patch
Patch0627: 0627-input-added-TF307-serio-PS-2-emulator-driver.patch
Patch0628: 0628-arm64-added-Baikal-M-SoC-and-TF307-board-device-tree.patch
Patch0629: 0629-arm64-device-tree-baikal-mark-GPU-as-dma-coherent.patch
Patch0630: 0630-arm64-device-tree-Baikal-M-fixed-PHY-binding-descrip.patch
Patch0631: 0631-arm64-device-tree-Baikal-M-fixed-gpio-alias.patch
Patch0632: 0632-arm64-device-tree-Baikal-M-fixed-GPU-opp_table.patch
Patch0633: 0633-arm64-device-tree-Baikal-M-fixed-CPUs-opp_table.patch
Patch0634: 0634-arm64-defconfig-for-Baikal-M-support-testing.patch
# Disable AutoReq
AutoReq: 0
# but keep autoprov for kmod(xxx)
AutoProv: 1
BuildRequires: bash
BuildRequires: bc
BuildRequires: binutils
BuildRequires: bison
BuildRequires: bzip2
%if %{with ccache}
BuildRequires: ccache
%endif
BuildRequires: flex
BuildRequires: elfutils-devel
BuildRequires: gcc
# ./scripts/mkcompile_h
BuildRequires: hostname
BuildRequires: kmod-compat
BuildRequires: rsync
%if %{with compress_modules}
%if %{with modxz}
BuildRequires: xz
%else
BuildRequires: zstd
%endif
%endif
%ifarch aarch64
BuildRequires: uboot-tools
%endif
BuildRequires: kmod-devel
%ifarch x86_64 aarch64
BuildRequires: numa-devel
%endif
%if %{with uml}
BuildRequires: vde-devel
%endif
# For power tools
BuildRequires: pkgconfig(ncurses)
# For perf, cpufreq and all other tools
# For cpupower
%if %{build_cpupower}
BuildRequires: pciutils-devel
%endif
# For perf
%if %{build_perf}
BuildRequires: asciidoc
BuildRequires: perl-ExtUtils-Embed
BuildRequires: python3
BuildRequires: xmlto
BuildRequires: audit-devel
BuildRequires: binutils-devel
BuildRequires: java-1.8.0-openjdk-devel
BuildRequires: libunwind-devel
BuildRequires: newt-devel
BuildRequires: perl-devel
BuildRequires: pkgconfig(babeltrace)
BuildRequires: pkgconfig(libcap)
BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(python3)
BuildRequires: pkgconfig(slang)
BuildRequires: pkgconfig(zlib)
%endif
# (To generate keys)
# LibreSSL has GOST support without editing openssl.cnf
# or dlopen()-ing external library
BuildRequires: libressl
BuildRequires: libressl-devel
# To verify signatures (find, xargs, hexdump)
BuildRequires: findutils
BuildRequires: util-linux
%if %{with binary_extra_modules}
BuildRequires: auto-krokodil-rpm-macros
BuildRequires: kernel-source-rtl8821ce
BuildRequires: kernel-source-rtl8821cu
BuildRequires: kernel-source-rtl88x2bu
BuildRequires: kernel-source-rtl8812au
BuildRequires: kernel-source-rtl8821au
BuildRequires: kernel-source-rtl8814au
BuildRequires: kernel-source-rtk_btusb
BuildRequires: kernel-source-rtl8723au
BuildRequires: kernel-source-rtl8188gu
BuildRequires: kernel-source-rtl8723bu
BuildRequires: kernel-source-rtl8723ds
BuildRequires: kernel-source-rtl8723du
BuildRequires: kernel-source-rtl8852au
BuildRequires: kernel-source-rtl8192du
BuildRequires: kernel-source-rtw89
BuildRequires: kernel-source-rtw88
# Broadcom-wl and nvidia contain a proprietary blob which is only for x86
%ifarch %{ix86} %{x86_64}
BuildRequires: kernel-source-broadcom-wl
BuildRequires: kernel-source-nvidia340
BuildRequires: kernel-source-nvidia390
%endif
# Nvidia470+ are x86_64 only (maybe aarch64 will be also packaged later)
%ifarch %{x86_64}
BuildRequires: kernel-source-nvidia470
BuildRequires: kernel-source-nvidia510
BuildRequires: kernel-source-nvidia515
BuildRequires: kernel-source-nvidia520
BuildRequires: kernel-source-nvidia525
%endif
BuildRequires: kernel-source-tripso
BuildRequires: kernel-source-ipt-so
%if %{with binary_virtualbox_host}
BuildRequires: kernel-source-virtualbox
%endif
BuildRequires: kernel-source-v4l2loopback
%if %{with binary_shredder}
BuildRequires: kernel-source-shredder-kernel
%endif
# Rosa-test-suite is maintained in certified branches only nlkm, memfreetest, pcietest
%if %{with nickel}
BuildRequires: kernel-source-rosa-test-suite
%endif
%endif
# End of with binary_extra_modules
Provides: kernel = %{EVRD}
Provides: kernel-%{flavour} = %{EVRD}
Provides: kernel-abi(%{kver_full}) = %{EVRD}
# Dnf config-manager --dump | grep installonly
Provides: installonlypkg(kernel) = %{EVRD}.image
Provides: installonlypkg(kernel) = %{EVRD}.modules
# >= because of added support of zstd-compressed modules
Requires(posttrans): dracut >= 053-0.git5eb736.5
Requires(posttrans): kmod >= 28-3
# Need for rebuild dkms drivers
Recommends: (%{name}-devel%{_isa} = %{EVRD} if dkms)
# Usually necessary, but sometimes user may want to not install them
Recommends: crda
Recommends: linux-firmware
Recommends: microcode
# Set BFQ as default scheduler for HDDs
# https://www.phoronix.com/scan.php?page=article&item=linux-50hdd-io
Recommends: udev-rules-ioschedulers
Recommends: wireless-regdb
%if %{with flow_abi}
Requires: kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
%endif
%ifarch %{ix86}
Conflicts: arch(x86_64)
%endif
# XXX temporary hack to upgrade from kernel-headers 1:5.4
%if %{build_headers}
Recommends: kernel-headers = %{EVRD}
%endif
%if %{with binary_extra_modules}
%ifarch %{ix86} %{x86_64}
%kroko_req_modules_in_kernel -j %{nvidia_340_j} -n %{nvidia_340_n} -p %{kver_full}
%kroko_req_modules_in_kernel -j %{nvidia_390_j} -n %{nvidia_390_n} -p %{kver_full}
%endif
%ifarch %{x86_64}
%kroko_req_modules_in_kernel -j %{nvidia_470_j} -n %{nvidia_470_n} -p %{kver_full}
%kroko_req_modules_in_kernel -j %{nvidia_510_j} -n %{nvidia_510_n} -p %{kver_full}
%kroko_req_modules_in_kernel -j %{nvidia_515_j} -n %{nvidia_515_n} -p %{kver_full}
%kroko_req_modules_in_kernel -j %{nvidia_520_j} -n %{nvidia_520_n} -p %{kver_full}
%kroko_req_modules_in_kernel -j %{nvidia_525_j} -n %{nvidia_525_n} -p %{kver_full}
%endif
%endif
%description
The kernel package contains the Linux kernel (vmlinuz), the core of your
operating system. The kernel handles the basic functions
of the operating system: memory allocation, process allocation, device
input and output, etc. This is a general-purpose kernel.
%posttrans
# update information about modules, useful if kernel-module* packages were
# installed in one transaction with this kernel (%%transfiletrigger* will run later)
depmod -a %{kver_full}
# We always regenerate initrd here, even if it already exists. This may
# happen if kernel-<...>-devel is installed first, triggers rebuild of
# DKMS modules and some of these request remaking of initrd. The initrd
# that is created then will be non-functional. But when the user installs
# kernel-<...> package, that defunct initrd will be replaced with a working
# one here.
dracut -f %{initrd_path} %{kver_full}
# File triggers from grub packages will handle this.
#/usr/sbin/update-grub2
%transfiletriggerin -- %{_modulesdir}/%{kver_full}
# Detect all modules, including ones inside kernel-module* packages
if grep -qE '/.*\.ko(|\..*)' ; then
depmod -a %{kver_full}
fi
%transfiletriggerpostun -- %{_modulesdir}/%{kver_full}
# Handle e.g. removal of kernel-module* packages
# List of files is not available here (?)
depmod -a %{kver_full}
%files -f %{kernel_files}
%{_bootdir}/System.map-%{kver_full}
%{_bootdir}/symvers-%{kver_full}.*
%{_bootdir}/config-%{kver_full}
%{_bootdir}/vmlinuz-%{kver_full}
%ghost %{initrd_path}
%ifarch %{armx}
%{_bootdir}/dtb-%{kver_full}
%endif
%{_modulesdir}/%{kver_full}/modules.*
%if %{with flow_abi}
%{_modulesdir}/%{kver_full}/kernel/zzz-%{kernelversion}.%{patchlevel}-rosa-flow-abi
%endif
%if %{with binary_extra_modules}
# 8821ce.ko.debug will not be excluded and will be in the main debug subpackage
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8821ce.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8821cu.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/88x2bu.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8812au.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8821au.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8814au.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/drivers/bluetooth/rtk_btusb.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8723au.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8188gu.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8723bu.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8723ds.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8723du.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8852au.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8192du.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/realtek/rtw89p
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/realtek/rtw88p
%ifarch %{ix86} %{x86_64}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/wl.ko%{kmod_suffix}
%endif
%if %{with binary_shredder}
%exclude %{_modulesdir}/%{kver_full}/kernel/extra/shredder-kernel.ko%{kmod_suffix}
%endif
%exclude %{_modulesdir}/%{kver_full}/kernel/drivers/media/v4l2loopback.ko%{kmod_suffix}
%if %{with binary_virtualbox_host}
# vbox host modules may be built here (vboxnetflt vboxnetadp vboxdrv vboxpci)
# vbox guest modules are in the mainline kernel now (vboxvideo vboxguest vboxsf)
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/vbox*.ko%{kmod_suffix}
%endif
%exclude %{_modulesdir}/%{kver_full}/kernel/net/xt_TRIPSO.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/net/xt_so.ko%{kmod_suffix}
%if %{with nickel}
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/nlkm.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/memfreetest.ko%{kmod_suffix}
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/pcietest.ko%{kmod_suffix}
%endif
%endif
# End of with binary_extra_modules
############################################################################
%if %{build_devel}
%package devel
Summary: Development files for %{name}
Group: Development/Kernel
Requires: glibc-devel
Requires: ncurses-devel
Requires: gcc
Requires: make
Requires: perl
Requires: %{name} = %{EVRD}
Provides: kernel-devel = %{kverrel}
Provides: kernel-%{flavour}-devel = %{kverrel}
Provides: installonlypkg(kernel) = %{EVRD}.devel
# Have dkms updated/installed before the kernel, scriptlet here checks if dkms exists
OrderWithRequires(post): dkms
# Try to remove the main kernel package after removing this devel package
# because there may be dkms-built kernel modules inside directories owned
# by the main package, try to get rid of such files before RPM starts to
# deal with directories owned in the main package
# (note that the devel package does not explicitly require the main package,
# there is no need to do so, a kernel module may be built using just the devel part).
OrderWithRequires(postun): %{name} = %{EVRD}
%ifarch %{ix86}
Conflicts: arch(x86_64)
%endif
%description devel
This package contains the kernel files (headers and build tools) that should
be enough to build additional drivers for use with %{name}.
%post devel
if command -v dkms_autoinstaller >/dev/null 2>&1; then
dkms_autoinstaller start %{kver_full}
fi
%preun devel
# If any DKMS modules with REMAKE_INITRD=yes in their configs have been
# uninstalled, initrd has been regenerated for the given kernel. However,
# the kernel itself might have been uninstalled before, so that (defunct)
# initrd image files would be left behind. Remove them if the kernel itself
# is no longer installed. Should work if they are uninstalled in parallel
# too.
if ! test -f /boot/vmlinuz-%{kver_full}; then
rm -f /boot/initrd-%{kver_full}.img
rm -f /boot/initrd-%{kver_full}_old.img
fi
if ! command -v dkms >/dev/null 2>&1; then exit 0; fi
for ii in $(/usr/sbin/dkms status -k %{kver_full} | awk '{ print $1 $2; }'); do
mod=$(echo $ii | awk -v FS=',' '{ print $1; }')
ver=$(echo $ii | awk -v FS=',' '{ print $2; }')
/usr/sbin/dkms --rpm_safe_upgrade uninstall -m $mod -v $ver -k %{kver_full} || :
done
%files devel
%{devel_root}/Documentation
%dir %{devel_root}
%dir %{devel_root}/arch
%dir %{devel_root}/include
%{devel_root}/arch/um
%{devel_root}/arch/x86
%{devel_root}/arch/arm
%{devel_root}/arch/arm64
%{devel_root}/block
%{devel_root}/certs
%{devel_root}/crypto
%{devel_root}/drivers
%{devel_root}/fs
%{devel_root}/include/soc
%{devel_root}/include/acpi
%{devel_root}/include/asm-generic
%{devel_root}/include/clocksource
%{devel_root}/include/config
%{devel_root}/include/crypto
%{devel_root}/include/drm
%{devel_root}/include/dt-bindings
%{devel_root}/include/generated
%{devel_root}/include/keys
%{devel_root}/include/kvm
%{devel_root}/include/kunit
%{devel_root}/include/linux
%{devel_root}/include/math-emu
%{devel_root}/include/media
%{devel_root}/include/memory
%{devel_root}/include/misc
%{devel_root}/include/net
%{devel_root}/include/pcmcia
%{devel_root}/include/ras
%{devel_root}/include/rdma
%{devel_root}/include/scsi
%{devel_root}/include/sound
%{devel_root}/include/target
%{devel_root}/include/trace
%{devel_root}/include/uapi
%{devel_root}/include/vdso
%{devel_root}/include/video
%{devel_root}/include/xen
%{devel_root}/init
%{devel_root}/ipc
%{devel_root}/io_uring
%{devel_root}/kernel
%{devel_root}/lib
%{devel_root}/mm
%{devel_root}/net
%{devel_root}/samples
%{devel_root}/scripts
%{devel_root}/security
%{devel_root}/sound
%{devel_root}/tools
%{devel_root}/usr
%{devel_root}/virt
%{devel_root}/.config
%{devel_root}/Kbuild
%{devel_root}/Kconfig
%{devel_root}/Makefile
%{devel_root}/Module.symvers
%{devel_root}/arch/Kconfig
%{_modulesdir}/%{kver_full}/build
%{_modulesdir}/%{kver_full}/source
%endif
# End of build_devel
############################################################################
%if %{build_debug}
%package debuginfo
Summary: Debuginfo for %{name}
Group: Development/Debug
Provides: kernel-debug = %{kverrel}
AutoReq: 0
AutoProv: 0
%description debuginfo
This package contains the files with debuginfo for %{name}.
%files debuginfo -f %{debuginfo_files}
%{_bootdir}/vmlinux-%{kver_full}
%endif
# End of build_debug
############################################################################
%if %{build_doc}
%package doc
Summary: Various documentation bits found in the kernel source
Group: Documentation
BuildArch: noarch
%description doc
This package contains documentation files from the kernel source.
%files doc
%doc linux-%{tar_ver}/Documentation/*
%endif
############################################################################
%if %{build_perf}
%package -n perf
Summary: perf tool and the supporting documentation
Group: System/Kernel and hardware
%description -n perf
The package contains perf tool and the supporting documentation.
%files -n perf
%{_bindir}/perf
%ifarch x86_64
%{_bindir}/perf-read-vdso32
%endif
%{_bindir}/trace
%{_includedir}/perf/perf_dlfilter.h
%dir %{_prefix}/libexec/perf-core
%dir %{_libdir}/traceevent
%dir %{_libdir}/traceevent/plugins
%{_libdir}/libperf-jvmti.so
%{_libdir}/traceevent/plugins/*
%{_prefix}/libexec/perf-core/*
%{_mandir}/man[1-8]/perf*
%{_sysconfdir}/bash_completion.d/perf
%{_datadir}/perf-core/strace/groups/*
%{_datadir}/doc/perf-tip/*.txt
/usr/lib/perf/examples/bpf/*
/usr/lib/perf/include/bpf/*
%endif
############################################################################
%if %{build_cpupower}
%package -n cpupower
Summary: The cpupower tools
Group: System/Kernel and hardware
%description -n cpupower
The cpupower tools.
%post -n cpupower
if [ $1 -ge 0 ]; then
# Do not enable/disable cpupower.service directly, because it should start
# when cpupower.path triggers it.
/bin/systemctl enable cpupower.path >/dev/null 2>&1 || :
/bin/systemctl start cpupower.path >/dev/null 2>&1 || :
fi
%preun -n cpupower
if [ $1 -eq 0 ]; then
/bin/systemctl --no-reload disable cpupower.path > /dev/null 2>&1 || :
/bin/systemctl stop cpupower.path > /dev/null 2>&1 || :
fi
%files -n cpupower -f cpupower.lang
%config(noreplace) %{_sysconfdir}/sysconfig/cpupower
%{_bindir}/cpupower
%{_bindir}/cpupower-start.sh
%{_libdir}/libcpupower.so.0
%{_libdir}/libcpupower.so.0.0.1
%{_unitdir}/cpupower.service
%{_unitdir}/cpupower.path
%{_datadir}/bash-completion/completions/cpupower
%{_mandir}/man[1-8]/cpupower*
############################################################################
%package -n cpupower-devel
Summary: Development files for cpupower
Group: Development/Kernel
Requires: cpupower = %{EVRD}
Conflicts: %{_lib}cpufreq-devel
%description -n cpupower-devel
This package contains the development files for cpupower.
%files -n cpupower-devel
%{_libdir}/libcpupower.so
%{_includedir}/cpufreq.h
%{_includedir}/cpuidle.h
%endif
############################################################################
%if %{build_headers}
%package -n kernel-headers
Summary: Linux kernel header files mostly used by your C library
Group: System/Kernel and hardware
Provides: linux-userspace-headers = %{EVRD}
Provides: kernel-release-headers = %{EVRD}
%description -n kernel-headers
C header files from the Linux kernel. The header files define
structures and constants that are needed for building most
standard programs, notably the C library.
This package is not suitable for building kernel modules, you
should use the 'kernel-devel' package instead.
%files -n kernel-headers
%{_includedir}/*
# Don't conflict with cpupower-devel
%if %{build_cpupower}
%exclude %{_includedir}/cpufreq.h
%exclude %{_includedir}/cpuidle.h
%endif
%if %{build_perf}
%exclude %{_includedir}/perf/perf_dlfilter.h
%endif
%endif
############################################################################
%if %{with uml}
%package uml
Summary: User Mode Linux binary
Group: System/Kernel and hardware
Provides: kernel-uml = %{kverrel}
Provides: kernel-uml-%{flavour} = %{kverrel}
Provides: installonlypkg(kernel) = %{EVRD}.uml
%description uml
User Mode Linux binary.
Stripped, debug is in %{name}-debuginfo.
%files uml
%{_bindir}/linux-uml-%{kver_full}
#-----------------------------------------------------------------------------
%package uml-modules
Summary: User Mode Linux (UML) kernel modules
Group: System/Kernel and hardware
Provides: kernel-uml-modules = %{kverrel}
Provides: kernel-uml-modules-%{flavour} = %{kverrel}
Provides: installonlypkg(kernel-module) = %{EVRD}.uml
%description uml-modules
User Mode Linux (UML) kernel modules:
- not compressed;
- not stripped;
- signed.
%files uml-modules
/lib/modules-uml/%{kver_full}
%endif
# End of uml
#-----------------------------------------------------------------------------
###############################
# Extra modules package definitions
%if %{with binary_extra_modules}
%ksob_mk_module_pkg -n 8821ce -s net/wireless -r rtl8821ce-blacklist
%ksob_mk_module_pkg -n 8821cu -s net/wireless
# add "-r rtl88x2bu-blacklist" in 5.18+!!!
%ksob_mk_module_pkg -n 88x2bu -s net/wireless
# "-r xxx-blacklist" was not added for modules bellow because
# blacklisted modules have not appeared in upstream yet
%ksob_mk_module_pkg -n 8812au -s net/wireless
# for RTL8811AU and RTL8821AU
%ksob_mk_module_pkg -n 8821au -s net/wireless
%ksob_mk_module_pkg -n 8814au -s net/wireless
%ksob_mk_module_pkg -n rtk_btusb -s drivers/bluetooth -r rtk_btusb-firmware
%ksob_mk_module_pkg -n 8723au -s net/wireless
%ksob_mk_module_pkg -n 8188gu -s net/wireless
%ksob_mk_module_pkg -n 8723bu -s net/wireless
%ksob_mk_module_pkg -n 8723ds -s net/wireless
%ksob_mk_module_pkg -n 8723du -s net/wireless
%ksob_mk_module_pkg -n 8852au -s net/wireless
%ksob_mk_module_pkg -n 8192du -s net/wireless
%ksob_mk_modules_pkg -n rtw89 -s net/wireless/realtek/rtw89p
%ksob_mk_modules_pkg -n rtw88 -s net/wireless/realtek/rtw88p -r rtw88-firmware
%ifarch %{ix86} %{x86_64}
%ksob_mk_module_pkg -n wl -s net/wireless -r broadcom-wl-aliases
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_340_j} -n %{nvidia_340_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_390_j} -n %{nvidia_390_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%endif
%ifarch %{x86_64}
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_470_j} -n %{nvidia_470_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_510_j} -n %{nvidia_510_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_515_j} -n %{nvidia_515_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_520_j} -n %{nvidia_520_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%kroko_kmod_pkg -r %{kroko_release} -j %{nvidia_525_j} -n %{nvidia_525_n} -f %{flavour} -k %{kernelversion}.%{patchlevel} -m %{sublevel} -p %{kver_full} -s %{NAME} -c %{kmod_suffix}
%endif
%ksob_mk_module_pkg -n xt_TRIPSO -s net -r tripso
%ksob_mk_module_pkg -n xt_so -s net -r ipt-so
%ksob_mk_module_pkg -n v4l2loopback -s drivers/media -r v4l2loopback
%if %{with binary_shredder}
%ksob_mk_module_pkg -n shredder-kernel -s extra -r rosa-shredder-user
%endif
#-----------------------------------------------------------------------------
###############
# Virtualbox host
%if %{with binary_virtualbox_host}
%ksob_mk_module_pkg -n vboxnetflt -s misc
%ksob_mk_module_pkg -n vboxnetadp -s misc
%ksob_mk_module_pkg -n vboxdrv -s misc
%ksob_mk_module_pkg -n vboxpci -s misc
# A package which will pull all those modules
%package -n kernel-modules-virtualbox-host-%{ksob_kernel}
Summary: Meta package to pull VirtualBox host kernel modules for kernel-%{flavour}-%{kernelversion}.%{patchlevel}
Group: System/Kernel and hardware
Requires: kernel-module-vboxnetflt-%{ksob_kernel}
Requires: kernel-module-vboxnetadp-%{ksob_kernel}
Requires: kernel-module-vboxdrv-%{ksob_kernel}
Requires: kernel-module-vboxpci-%{ksob_kernel}
%description -n kernel-modules-virtualbox-host-%{ksob_kernel}
Meta package to pull VirtualBox host kernel modules for %{name}.
%files -n kernel-modules-virtualbox-host-%{ksob_kernel}
# empty
%endif
#End of ifarch x86
#-----------------------------------------------------------------------------
%if %{with nickel}
%ksob_mk_module_pkg -n nlkm -s misc
%ksob_mk_module_pkg -n memfreetest -s misc
%ksob_mk_module_pkg -n pcietest -s misc
%endif
%endif
# End of binary_extra_modules
#################################################################
%if %{with flow_abi}
%package -n kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
Summary: Directory to install third-party binary kernel modules for kernels %{kernelversion}.%{patchlevel}.x
Group: System/Kernel and hardware
%description -n kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
This package contains a directory to install third-party binary kernel modules for kernels %{kernelversion}.%{patchlevel}.x.
Some vendors provide binary-only kernel modules. They can put them into /lib/modules/%{kernelversion}.%{patchlevel}-rosa-flow-abi.
kmod tools will find them for kernels 5.4.x of "generic" and "nickel" flavours
but there is no guarantee that these modules will load and work correctly on
newer or older kernels then the ones they were build against.
We call this "flow ABI" because most ABIs are not changed between %{kernelversion}.%{patchlevel}.x releases,
but there are no specific guarantees. ABI may evolve and change.
We highly recommend to use DKMS and build third-party kernel modules from source for every kernel!
This package does nothing, just owns a directory for third-party binary kernel modules.
%files -n kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
/lib/modules/%{kernelversion}.%{patchlevel}-rosa-flow-abi
%endif
# End of flow_abi
################################################
%prep
# Avoid accidental merge
%if 0%{?rpm5}
%{error:Package structure is for dnf, not for urpmi!}
%endif
%setup -q -n %{top_dir_name} -c
%if %{with uml}
cp -r %{src_dir} %{src_dir}.uml
%endif
cd %{src_dir}
%autopatch -p1
#
# Setup Begin
#
##################################
# Kernel configuration
echo "Creating the kernel configuration file."
# Configs
cp %{SOURCE111} .
cp %{SOURCE112} .
cp %{SOURCE113} .
cp kernel-%{arch_suffix}.config .config
touch %{build_dir}/.config.append
# Get rid of unwanted files
find . -name '*~' -o -name '*.orig' -o -name '*.append' -delete
# Wipe all .gitignore/.get_maintainer.ignore files
find . -name "*.g*ignore" -delete
# Disable debug info if requested (enabled by default)
%if ! %build_debug
sed -i -e '/CONFIG_DEBUG_INFO/d' -e '/CONFIG_GDB_SCRIPTS/d' .config
echo '# CONFIG_DEBUG_INFO is not set' >> %{build_dir}/.config.append
echo '# CONFIG_GDB_SCRIPTS is not set' >> %{build_dir}/.config.append
%endif
sed -i '/CONFIG_MODULE_SIG_FORCE/d' .config
%if %{with oblig_signed_modules}
# Disallow loading not signed modules
# But 0001-ROSA-ima-allow-to-off-modules-signature-check-dynami.patch allows to override this in cmdline
echo CONFIG_MODULE_SIG_FORCE=y >> %{build_dir}/.config.append
%else
echo CONFIG_MODULE_SIG_FORCE=n >> %{build_dir}/.config.append
%endif
sed -i '/CONFIG_MODULE_SIG_KEY/d' .config
# Set path to the key that will be generated later by openssl/libressl
echo CONFIG_MODULE_SIG_KEY=\"%{certs_signing_key_priv_rnd}\" >> %{build_dir}/.config.append
# Set path to one PEM file with all keys that the kernel must trust
sed -i '/CONFIG_SYSTEM_TRUSTED_KEYS/d' .config
echo CONFIG_SYSTEM_TRUSTED_KEYS=\"%{certs_public_keys}\" >> %{build_dir}/.config.append
# Memory wiping
# Introduced in kernel 5.3 by commit 6471384af2a6530696fc0203bafe4de41a23c9ef
# Estimated performance impact is described in the commit
# "Fill newly allocated pages and heap objects with zeroes."
# To enable, add to cmdline: init_on_alloc=1
sed -i '/CONFIG_INIT_ON_ALLOC_DEFAULT_ON/d' .config
echo CONFIG_INIT_ON_ALLOC_DEFAULT_ON=n >> %{build_dir}/.config.append
# "Fill freed pages and heap objects with zeroes"
# To disable, add to cmdline: init_on_free=0
sed -i '/CONFIG_INIT_ON_FREE_DEFAULT_ON/d' .config
%if %{with nickel}
echo CONFIG_INIT_ON_FREE_DEFAULT_ON=y >> %{build_dir}/.config.append
%else
echo CONFIG_INIT_ON_FREE_DEFAULT_ON=n >> %{build_dir}/.config.append
%endif
# Here enabling only either only init_on_free or only init_on_alloc
# makes sense; init_on_alloc is not about protecting information.
# To load kernel keyring in UML
for i in STREEBOG SHA1 SHA256 SHA512 ECRDSA RSA ; do
if ! grep -q "^CONFIG_CRYPTO_${i}=y$" .config; then
sed -i "/CONFIG_CRYPTO_${i}/d" .config
echo "CONFIG_CRYPTO_${i}=y" >> %{build_dir}/.config.append
fi
done
cat %{build_dir}/.config.append >> .config
##################
# End of kernel config
# Store the config file in the appropriate directory.
CONFIG_DIR=arch/%{arch_type}/configs
mkdir -p "${CONFIG_DIR}"
cfg_file=arch/%{arch_type}/configs/%{arch_suffix}_defconfig-%{flavour}
make ARCH=%{arch_type} oldconfig
# When it is needed to edit kernel configs, run:
# abf fetch
# rpmbuild --define "_sourcedir $PWD" --with=fail -bb kernel.spec
# and then work with the config in the buildroot with applied patches etc.
%{?_with_fail:exit 1}
mv .config ${cfg_file}
echo "Created ${cfg_file}."
# Make sure the kernel has the sublevel we know it has...
LC_ALL=C sed -ri "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile
# Get rid of unwanted files
find . -name '*~' -o -name '*.orig' -o -name '*.append' | %kxargs rm -f
find . -name '.get_maintainer.ignore' | %kxargs rm -f
# Versionize python shebang (#!/usr/bin/env python -> #!/usr/bin/python3) in scripts
sed -i '1 s,^#!/usr/bin/env python$,#!%{__python3},' \
scripts/bloat-o-meter \
scripts/checkkconfigsymbols.py \
scripts/diffconfig \
scripts/jobserver-exec \
scripts/show_delta \
scripts/spdxcheck.py \
scripts/clang-tools/gen_compile_commands.py \
scripts/clang-tools/run-clang-tools.py \
scripts/tracing/draw_functrace.py \
tools/hv/vmbus_testing \
tools/kvm/kvm_stat/kvm_stat \
tools/perf/python/tracepoint.py \
tools/perf/python/twatch.py \
tools/power/pm-graph/bootgraph.py \
tools/power/pm-graph/sleepgraph.py \
tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py \
tools/testing/kunit/kunit.py \
tools/testing/kunit/kunit_tool_test.py \
tools/testing/selftests/bpf/test_offload.py \
tools/testing/selftests/drivers/net/mlxsw/sharedbuffer_configuration.py \
tools/testing/selftests/exec/binfmt_script \
tools/testing/selftests/net/devlink_port_split.py \
tools/testing/selftests/tc-testing/tdc.py \
tools/testing/selftests/tc-testing/tdc_batch.py \
tools/testing/selftests/tc-testing/tdc_multibatch.py \
Documentation/sphinx/kernel_include.py \
Documentation/sphinx/maintainers_include.py \
Documentation/sphinx/rstFlatTable.py \
Documentation/target/tcm_mod_builder.py
# Drop env from bash scripts
sed -i '1 s,^#!.*env .*,#!%{_bindir}/bash,' scripts/config
# Drop env from perl scripts
sed -i '1 s,^#!.*env .*,#!%{_bindir}/perl,' \
scripts/bootgraph.pl \
scripts/checkincludes.pl \
scripts/checkkconfigsymbols.py \
scripts/checkpatch.pl \
scripts/checkstack.pl \
scripts/checkversion.pl \
scripts/cleanfile \
scripts/cleanpatch \
scripts/documentation-file-ref-check \
scripts/export_report.pl \
scripts/extract-module-sig.pl \
scripts/extract-sys-certs.pl \
scripts/extract_xc3028.pl \
scripts/get_abi.pl \
scripts/get_dvb_firmware \
scripts/get_maintainer.pl \
scripts/headerdep.pl \
scripts/headers_check.pl \
scripts/kernel-doc \
scripts/leaking_addresses.pl \
scripts/markup_oops.pl \
scripts/profile2linkerlist.pl \
scripts/recordmcount.pl \
scripts/split-man.pl \
scripts/stackdelta \
scripts/dtc/dt_to_config \
scripts/kconfig/streamline_config.pl \
tools/testing/ktest/compare-ktest-sample.pl \
tools/testing/selftests/kselftest/prefix.pl \
Documentation/sphinx/parse-headers.pl
############################################################################
%build
# Ensure that build time generated private keys don't get published
# as e.g. "RPM build root" on ABF!
# Note that ABF sends SIGKILL to rpm-build.sh when the build is terminated;
# in this case trap will not work, but RPM build root also will not be
# saved because rpm-build.sh saves it, but it is SIGKILLed.
# For best security we could store private keys in RAM (not reachable from
# filesystem, so not in /tmp!) and override sth like fopen() by LD_PRELOAD
# to give the content of keys from RAM when a virtual address of a key file
# is accessed, but currently I don't know how to implement this (TODO: ).
_cleanup(){
# Show resulting kernel public keys for debugging
cat "%{src_dir}/%{certs_dir_rnd}/x509_certificate_list" | base64 -d || :
rm -fvr "%{src_dir}/%{certs_dir_rnd}"
%if %{with uml}
cat "%{src_dir}.uml/%{certs_dir_rnd}/x509_certificate_list" | base64 -d || :
rm -fvr "%{src_dir}.uml/%{certs_dir_rnd}"
%endif
}
# Make a trap to delete keys even if %%build fails in the middle
trap "_cleanup" EXIT
rm -rf %{temp_root}
install -d %{temp_root}
cd %{src_dir}
### Keys for signing kernel modules
# Keys can be generated both manually and automatically,
# let's generate them by ourselves to take full control of the process
# https://www.ibm.com/support/knowledgecenter/en/SSB23S_1.1.0.13/gtps7/cfgcert.html
# See also certs/Makefile in kernel source
mkdir -p "%{certs_dir_rnd}"
# On ABF, %%packager == $username <$email>
# Try to extract email from %%packager if it is set
_get_email(){
# Check that macro %%packager was set and is not empty
if echo '%{packager}' | grep -q 'packager}$' || [ -z "%{packager}" ]
# If was not set or is empty, use default email
then echo 'rpmbuild@rosa.unknown' && return
# Otherwise try to extract email from 'name <email>' or sth else
else temp="$(echo '%{packager}' | tr '[:upper:]' '[:lower:]' | tr ' ' '\n' | tr -d '<>' | grep -E '@.*\..*' | head -n 1)"
fi
# Validate that what we have now is a valid email
# https://stackoverflow.com/a/2138832, https://stackoverflow.com/a/41192733
# Note that we set %%_buildshell to /bin/bash to guarantee the work of this bashism
regex_email="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$"
if [[ "$temp" =~ ${regex_email} ]]
# If it is, use it
then echo "$temp" && return
# Otherwise use default email
else echo 'rpmbuild@rosa.unknown' && return
fi
# If script above has not return'ed for any reason,
# e.g. because of non-bash shell being not able to
# process regexp, use default email
echo 'rpmbuild@rosa.unknown'
}
email="$(_get_email)"
cat <<EOF > "%{certs_key_config_rnd}"
[ req ]
prompt = no
string_mask = utf8only
#default_keyfile = %%{certs_signing_key_priv_rnd}
distinguished_name = req_distinguished_name
x509_extensions = myexts
[ req_distinguished_name ]
organizationName = %{vendor} rpmbuild
commonName = Build time autogenerated @ALGO@ kernel key
emailAddress = ${email}
[ myexts ]
basicConstraints=critical,CA:FALSE
keyUsage=digitalSignature
subjectKeyIdentifier=hash
authorityKeyIdentifier=keyid
EOF
cat "%{certs_key_config_rnd}"
sed -e 's,@ALGO@,RSA,g' "%{certs_key_config_rnd}" > "%{certs_key_config_rnd}.RSA"
sed -e 's,@ALGO@,GOST R 34.10-2012,g' "%{certs_key_config_rnd}" > "%{certs_key_config_rnd}.GOST"
# Avoid using the template
rm -f "%{certs_key_config_rnd}"
_libressl_gen_key(){
if [ "$GOST_KEY" = 1 ]
then
lssl_req_gost_args="\
-newkey gost2001 \
-pkeyopt dgst:streebog512 -pkeyopt paramset:A \
-streebog512"
OUT="%{certs_signing_key_priv_rnd}.GOST"
CONFIG="%{certs_key_config_rnd}.GOST"
else
lssl_req_gost_args=""
OUT="%{certs_signing_key_priv_rnd}.RSA"
CONFIG="%{certs_key_config_rnd}.RSA"
fi
libressl req -new -nodes -utf8 -batch \
$lssl_req_gost_args \
-days 109500 \
-x509 -config "$CONFIG" \
-out "$OUT" \
-keyout "$OUT"
# Verify
if [ "$GOST_KEY" = 1 ]; then
libressl x509 -in "%{certs_signing_key_priv_rnd}.GOST" -text -noout \
| grep -E 'Signature Algorithm:.*GOST R 34.10-2012'
libressl x509 -in "%{certs_signing_key_priv_rnd}.GOST" -text -noout \
| grep -E 'Digest Algorithm:.*GOST R 34-11-2012'
libressl x509 -in "%{certs_signing_key_priv_rnd}.GOST" -text -noout \
| grep -E 'Public Key Algorithm:.*GOST R 34.10-2012'
fi
}
GOST_KEY=0 _libressl_gen_key
GOST_KEY=1 _libressl_gen_key
# Fake CONFIG_MODULE_SIG_KEY to make build scripts happy
cp -v "%{certs_signing_key_priv_rnd}.RSA" "%{certs_signing_key_priv_rnd}"
# Strip public parts from the generated PEMs
sed -n \
'/^-----BEGIN CERTIFICATE-----$/,/^-----END CERTIFICATE-----$/p' \
"%{certs_signing_key_priv_rnd}.GOST" \
"%{certs_signing_key_priv_rnd}.RSA" \
> "%{certs_public_keys}"
# Link sign-file and extract-cert with LibreSSL instead of OpenSSL
if [ $? != 0 ] ; then exit $? ; fi
sed -i %{src_dir}/scripts/Makefile \
%if %{with uml}
%{src_dir}.uml/scripts/Makefile \
%endif
-e "s, libcrypto , libressl-libcrypto ,g"
%if %{with additional_keys}
# Add additional public RSA keys to the list of trusted keys for kernel modules
# Build kernel --without additional_keys if you do not want to trust them
cat %{expand:%(for i in `seq 1 12`; do echo "%%SOURCE$((200+${i}))" | tr "\n" " "; done)} \
>> "%{certs_public_keys}"
%endif
# End of additional_keys
cat %{certs_public_keys}
# .config
%smake -s mrproper
cp arch/%{arch_type}/configs/%{arch_suffix}_defconfig-%{flavour} .config
# Make sure EXTRAVERSION says what we want it to say
LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{flavour}-%{buildrpmrel}/" Makefile
# Build the kernel
echo "Building kernel %{kver_full}"
TARGETS="all"
# need to install dtbs to proper boot arm64 devices
%ifarch %{armx}
TARGETS="$TARGETS dtbs"
%endif
%kmake V=1 -s $TARGETS
# Install modules
mkdir -p %{temp_modules}/%{kver_full}
%smake INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=%{kver_full} modules_install
%if %{with binary_extra_modules}
# Build and install procedure is specific to each Makefile from kernmel-source-* packages
# See also: https://www.kernel.org/doc/html/latest/kbuild/modules.html
# Copy directory because write permissions are required
# `make modules_install` must be done before this, otherwise these copied files will be deleted
# $1: name of kernel module
# $2: directory (e.g.: kernel/net/wireless)
_build_rtl(){
cp -r "$(rpm -q --qf "/usr/src/rtl${1}-%%{VERSION}-%%{RELEASE}" kernel-source-rtl${1})" kernel-source-rtl${1}
pushd kernel-source-rtl${1}
%kmake KSRC=%{src_dir} M="$PWD"
mkdir -p %{temp_modules}/%{kver_full}/${2}
cp ${1}.ko %{temp_modules}/%{kver_full}/${2}
popd
rm -fr kernel-source-rtl${1}
}
_build_rtl 8821ce kernel/net/wireless
_build_rtl 8821cu kernel/net/wireless
_build_rtl 88x2bu kernel/net/wireless
_build_rtl 8812au kernel/net/wireless
_build_rtl 8821au kernel/net/wireless
_build_rtl 8821au kernel/net/wireless
_build_rtl 8814au kernel/net/wireless
_build_rtl 8723au kernel/net/wireless
_build_rtl 8188gu kernel/net/wireless
_build_rtl 8723bu kernel/net/wireless
_build_rtl 8723ds kernel/net/wireless
_build_rtl 8723du kernel/net/wireless
_build_rtl 8852au kernel/net/wireless
_build_rtl 8192du kernel/net/wireless
cp -r "$(rpm -q --qf '/usr/src/rtk_btusb-%%{VERSION}-%%{RELEASE}' kernel-source-rtk_btusb)" kernel-source-rtk_btusb
pushd kernel-source-rtk_btusb
%kmake KDIR=%{src_dir}
mkdir -p %{temp_modules}/%{kver_full}/kernel/drivers/bluetooth/
cp rtk_btusb.ko %{temp_modules}/%{kver_full}/kernel/drivers/bluetooth/rtk_btusb.ko
popd
rm -fr kernel-source-rtk_btusb
cp -r "$(rpm -q --qf '/usr/src/rtw89-%%{VERSION}-%%{RELEASE}' kernel-source-rtw89)" kernel-source-rtw89
pushd kernel-source-rtw89
%kmake KSRC=%{src_dir}
mkdir -p %{temp_modules}/%{kver_full}/kernel/net/wireless/realtek/rtw89p
cp *.ko %{temp_modules}/%{kver_full}/kernel/net/wireless/realtek/rtw89p
popd
rm -fr kernel-source-rtw89
cp -r "$(rpm -q --qf '/usr/src/rtw88-%%{VERSION}-%%{RELEASE}' kernel-source-rtw88)" kernel-source-rtw88
pushd kernel-source-rtw88
%kmake KSRC=%{src_dir}
mkdir -p %{temp_modules}/%{kver_full}/kernel/net/wireless/realtek/rtw88p
cp *.ko %{temp_modules}/%{kver_full}/kernel/net/wireless/realtek/rtw88p
popd
rm -fr kernel-source-rtw88
_build_nvidia(){
cp -r "$(rpm -q --qf "/usr/src/nvidia${1}-%%{VERSION}-%%{RELEASE}" kernel-source-nvidia${1})" kernel-source-nvidia${1}
pushd kernel-source-nvidia${1}
%make SYSSRC=%{src_dir}
mkdir -p %{temp_modules}/%{kver_full}/kernel/drivers/video/nvidia${1}.%{kroko_release}
for i in *.ko
do
# put them here to extract debug and compress, will be moved later
install -m0644 "$i" %{temp_modules}/%{kver_full}/kernel/drivers/video/nvidia${1}.%{kroko_release}/"$i"
done
popd
rm -fr kernel-source-nvidia${1}
# for rosa-kernel-tools
mkdir -p %{temp_root}/var/spool/initramfs-regen
touch %{temp_root}/var/spool/initramfs-regen/nvidia${1}.%{kroko_release}
}
%ifarch %{ix86} %{x86_64}
cp -r "$(rpm -q --qf '/usr/src/broadcom-wl-%%{VERSION}-%%{RELEASE}' kernel-source-broadcom-wl)" kernel-source-broadcom-wl
pushd kernel-source-broadcom-wl
%kmake -C %{src_dir} M="$PWD"
mkdir -p %{temp_modules}/%{kver_full}/kernel/net/wireless/
cp wl.ko %{temp_modules}/%{kver_full}/kernel/net/wireless/wl.ko
popd
rm -fr kernel-source-broadcom-wl
_build_nvidia 340
_build_nvidia 390
%endif
%ifarch %{x86_64}
_build_nvidia 470
_build_nvidia 510
_build_nvidia 515
_build_nvidia 520
_build_nvidia 525
%endif
cp -r "$(rpm -q --qf '/usr/src/tripso-%%{VERSION}-%%{RELEASE}' kernel-source-tripso)" kernel-source-tripso
pushd kernel-source-tripso
%kmake KDIR=%{src_dir}
mkdir -p %{temp_modules}/%{kver_full}/kernel/net
cp xt_TRIPSO.ko %{temp_modules}/%{kver_full}/kernel/net/
popd
rm -fr kernel-source-tripso
cp -r "$(rpm -q --qf '/usr/src/ipt-so-%%{VERSION}-%%{RELEASE}' kernel-source-ipt-so)" kernel-source-ipt-so
pushd kernel-source-ipt-so
%kmake KDIR=%{src_dir}
mkdir -p %{temp_modules}/%{kver_full}/kernel/net
cp xt_so.ko %{temp_modules}/%{kver_full}/kernel/net/
popd
rm -fr kernel-source-ipt-so
%if %{with binary_shredder}
cp -r "$(rpm -q --qf '/usr/src/shredder-kernel-%%{VERSION}-%%{RELEASE}' kernel-source-shredder-kernel)" kernel-source-shredder-kernel
pushd kernel-source-shredder-kernel
%kmake KERNEL_PATH=%{src_dir}
mkdir -p %{temp_modules}/%{kver_full}/kernel/extra/
cp shredder-kernel.ko %{temp_modules}/%{kver_full}/kernel/extra/
popd
rm -fr kernel-source-shredder-kernel
%endif
%if %{with binary_virtualbox_host}
# build commands for virtualbox are based on the ones from the virtualbox package
cp -r "$(rpm -q --qf '/usr/src/virtualbox-%%{VERSION}-%%{RELEASE}' kernel-source-virtualbox)" kernel-source-virtualbox
mkdir -p %{temp_modules}/%{kver_full}/kernel/misc/
pushd kernel-source-virtualbox
make -C vboxdrv KERN_DIR=%{src_dir} KERN_VER=%{kver_full}
cp -fv vboxdrv/Module.symvers vboxnetflt
cp -fv vboxdrv/Module.symvers vboxnetadp
make -C vboxnetflt KERN_DIR=%{src_dir} KERN_VER=%{kver_full}
make -C vboxnetadp KERN_DIR=%{src_dir} KERN_VER=%{kver_full}
cp -fv vboxnetadp/Module.symvers vboxpci/
make -C vboxpci KERN_DIR=%{src_dir} KERN_VER=%{kver_full}
for i in vboxnetflt vboxnetadp vboxdrv vboxpci
do
cp -v "${i}/${i}.ko" %{temp_modules}/%{kver_full}/kernel/misc/
done
popd
%endif
cp -r "$(rpm -q --qf '/usr/src/v4l2loopback-%%{VERSION}-%%{RELEASE}' kernel-source-v4l2loopback)" kernel-source-v4l2loopback
pushd kernel-source-v4l2loopback
cat Kbuild > Makefile
mkdir -p %{temp_modules}/%{kver_full}/kernel/drivers/media
make -C %{src_dir} M="$PWD" modules
cp v4l2loopback.ko %{temp_modules}/%{kver_full}/kernel/drivers/media
pushd
rm -fr kernel-source-v4l2loopback
%if %{with nickel}
# rosa-test-suite uses /sr/src/xxx-version, not /usr/src/xxx-version-release
cp -r "$(rpm -q --qf '/usr/src/rosa-test-suite-%%{VERSION}' kernel-source-rosa-test-suite)" kernel-source-rosa-test-suite
pushd kernel-source-rosa-test-suite
mkdir -p %{temp_modules}/%{kver_full}/kernel/misc/
for i in nlkm memfreetest pcietest
do
cat << EOF > Makefile
obj-m := ${i}.o
all:
make -C %{src_dir} M=\$(PWD) modules
EOF
%kmake
cp -fv ${i}.ko %{temp_modules}/%{kver_full}/kernel/misc/
done
popd
%endif
# End with nickel <- with binary_extra_modules
%endif
# End with binary_extra_modules
%if %{with uml}
cp -rv %{certs_dir_rnd} %{src_dir}.uml/
pushd %{src_dir}.uml
%kmake ARCH=um defconfig
%kmake ARCH=um linux
install -Dm0755 linux %{temp_root}%{_bindir}/linux-uml-%{kver_full}
#rm -fv linux
%kmake V=1 ARCH=um modules
mkdir -p %{temp_root}/lib/modules-uml/%{kver_full}/
%kmake ARCH=um INSTALL_MOD_PATH=%{temp_root}/lib/modules-uml/%{kver_full}/ modules_install
popd
%endif
install -d %{temp_boot}
install -m 644 System.map %{temp_boot}/System.map-%{kver_full}
install -m 644 .config %{temp_boot}/config-%{kver_full}
%if %{with modxz}
xz -c Module.symvers > %{temp_boot}/symvers-%{kver_full}.xz
%else
%{zstd_cmd} Module.symvers
install -m 644 Module.symvers.zst %{temp_boot}/symvers-%{kver_full}.zst
%endif
%ifarch %{armx}
%make_build ARCH=%{arch_type} V=1 INSTALL_DTBS_PATH=%{temp_boot}/dtb-%{kver_full} dtbs_install
%endif
%ifarch aarch64
cp -f arch/arm64/boot/Image.gz %{temp_boot}/vmlinuz-%{kver_full}
%else
cp -f arch/%{arch_type}/boot/bzImage %{temp_boot}/vmlinuz-%{kver_full}
%endif
# Headers
%if %{build_headers}
%make INSTALL_HDR_PATH=%{temp_root}%{_prefix} KERNELRELEASE=%{kver_full} headers_install
find %{temp_root}%{_prefix} -name .install -or -name ..install.cmd | %kxargs rm -f
%endif
# Remove /lib/firmware, we use a separate linux-firmware package
rm -rf %{temp_root}/lib/firmware
# Prepare the files for kernel*-devel
%if %{build_devel}
mkdir -p %{temp_devel_root}
for i in $(find . -name 'Makefile*'); do cp -R --parents $i %{temp_devel_root}; done
for i in $(find . -name 'Kconfig*' -o -name 'Kbuild*'); do cp -R --parents $i %{temp_devel_root}; done
cp -fR include %{temp_devel_root}
cp -fR scripts %{temp_devel_root}
cp -fR kernel/bounds.c %{temp_devel_root}/kernel
cp -fR kernel/time/timeconst.bc %{temp_devel_root}/kernel/time
cp -fR tools %{temp_devel_root}/
cp -fR arch/%{arch_type}/kernel/asm-offsets.{c,s} %{temp_devel_root}/arch/%{arch_type}/kernel/
%ifarch %{ix86} %{x86_64}
cp -fR arch/%{arch_type}/kernel/asm-offsets_{32,64}.c %{temp_devel_root}/arch/%{arch_type}/kernel/
cp -fR arch/%{arch_type}/purgatory/* %{temp_devel_root}/arch/%{arch_type}/purgatory/
# Needed for arch/x86/purgatory
cp -fR lib/*.h lib/*.c %{temp_devel_root}/lib/
cp -fR arch/%{arch_type}/entry/syscalls/syscall* %{temp_devel_root}/arch/%{arch_type}/entry/syscalls/
cp -fR arch/%{arch_type}/tools %{temp_devel_root}/arch/%{arch_type}/
# needed for kexec
cp -fR arch/%{arch_type}/boot/*.h %{temp_devel_root}/arch/%{arch_type}/boot/
cp -fR arch/%{arch_type}/boot/*.c %{temp_devel_root}/arch/%{arch_type}/boot/
%endif
cp -fR arch/%{arch_type}/include %{temp_devel_root}/arch/%{arch_type}/
cp -fR .config Module.symvers %{temp_devel_root}
# Needed for truecrypt build (Danny)
cp -fR drivers/md/dm.h %{temp_devel_root}/drivers/md/
# Needed for lirc_gpio (#39004)
cp -fR drivers/media/pci/bt8xx/bttv{,p}.h %{temp_devel_root}/drivers/media/pci/bt8xx/
cp -fR drivers/media/pci/bt8xx/bt848.h %{temp_devel_root}/drivers/media/pci/bt8xx/
cp -fR drivers/media/common/btcx-risc.h %{temp_devel_root}/drivers/media/common/
# Add acpica header files, needed for fglrx build
cp -fR drivers/acpi/acpica/*.h %{temp_devel_root}/drivers/acpi/acpica/
%if %{with aufs}
# aufs2 has a special file needed
cp -fR fs/aufs/magic.mk %{temp_devel_root}/fs/aufs
%endif
# SELinux needs security/selinux/include
cp -fR security/selinux/include %{temp_devel_root}/security/selinux
for i in alpha arc avr32 blackfin c6x cris csky frv h8300 hexagon ia64 m32r m68k m68knommu metag microblaze \
mips mn10300 nds32 nios2 openrisc parisc powerpc riscv s390 score sh sparc tile unicore32 xtensa; do
rm -rf %{temp_devel_root}/arch/$i
done
# Clean the scripts tree, and make sure everything is ok (sanity check)
# running prepare+scripts (tree was already "prepared" in build)
pushd %{temp_devel_root}
%smake V=1 -s clean ARCH=%{arch_type}
popd
rm -f %{temp_devel_root}/.config.old
# Fix permissions
chmod -R a+rX %{temp_devel_root}
# Disable mrproper in -devel rpms
patch -p1 --fuzz=0 -d %{temp_devel_root} -i %{SOURCE2}
%endif
# End of build_devel
# TODO: maybe move to /usr/lib/debug?
%if %{build_debug}
find %{temp_modules}/%{kver_full}/kernel \
-name "*.ko" | \
%kxargs -I '{}' objcopy --only-keep-debug '{}' '{}'.debug
find %{temp_modules}/%{kver_full}/kernel \
-name "*.ko" | %kxargs -I '{}' \
sh -c 'cd `dirname {}`; \
objcopy --add-gnu-debuglink=`basename {}`.debug \
--strip-debug `basename {}`'
%endif
# End of build_debug
# https://patchwork.kernel.org/patch/11446123/
_libressl_sign(){
if [ ! -f "$1" ]; then
echo "No file $1"
return 0
fi
f="$1"
%if %{with gost_sign}
%{src_dir}/scripts/sign-file streebog512 \
"%{certs_signing_key_priv_rnd}.GOST" "%{certs_signing_key_priv_rnd}.GOST" "$f"
%else
%{src_dir}/scripts/sign-file sha512 \
"%{certs_signing_key_priv_rnd}.RSA" "%{certs_signing_key_priv_rnd}.RSA" "$f"
%endif
unset f
}
export -f _libressl_sign
find %{temp_modules}/%{kver_full}/kernel \
%if %{with uml}
%{temp_root}/lib/modules-uml/%{kver_full} \
%endif
-name '*.ko' -print0 | sort -u | \
xargs --null -P "$(nproc)" -I {} "$SHELL" -e -x -c 'if ! _libressl_sign "{}"; \
then echo Failed _libressl_sign on "{}" && exit 1; fi'
# Set extraversion to match srpm to get nice version reported by the tools
LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{fullrpmrel}/" Makefile
%if %{build_perf}
%smake -C tools/perf -s PYTHON=%{__python3} HAVE_CPLUS_DEMANGLE=1 WERROR=0 prefix=%{_prefix} lib=%{_lib} NO_GTK2=1 all
%smake -C tools/perf -s prefix=%{_prefix} lib=%{_lib} NO_GTK2=1 man
%endif
%if %{build_cpupower}
# Make sure version-gen.sh is executable.
chmod +x tools/power/cpupower/utils/version-gen.sh
%make -C tools/power/cpupower CPUFREQ_BENCH=false
%endif
_cleanup
############################################################################
%install
cd %{src_dir}
# TODO: get rid of temporary directory, install to buildroot directly?
# We want to be able to test several times the install part
rm -rf %{buildroot}
cp -a %{temp_root} %{buildroot}
#if %%{with oblig_signed_modules}
# Multithreaded verification that every kernel module has a signature attached to it
mkdir -p "%{certs_dir_rnd}"
touch %{certs_verify_tmp}
_verify_signature(){
if [ -z "$1" ] || [ ! -f "$1" ]; then return; fi
if hexdump -C "$1" | rev | cut -f 2 -d '|' | rev | tr -d '\n' | grep -q '~Module signature appended~'; then
if [ -f %{certs_verify_tmp} ]; then
rm -f %{certs_verify_tmp}
fi
else
echo "ERROR: Module $1 has no signature attached to it!"
exit 1
fi
}
export -f _verify_signature
find %{target_modules} \
%if %{with uml}
%{buildroot}/lib/modules-uml/%{kver_full} \
%endif
-name '*.ko' -print0 | sort -u | \
xargs --null -P "$(nproc)" -I {} "$SHELL" -c '_verify_signature "{}"'
if [ -f %{certs_verify_tmp} ]; then
echo "ERROR: seems that signatures of none modules were verified!"
exit 1
fi
rm -f %{certs_verify_tmp}
#endif
# Compressing modules
%if %{with compress_modules}
# Tested on /lib/modules/5.10.34-generic-2rosa2019.1-x86_64, the results are the following:
# * decompressed: 266.3 MiB
# * xz -9 --extreme: 67.8 MiB
# * zstd --ultra -22 without training: 73.5 MiB
# * zstd -6 without training: 79.6 MiB
# * zstd --ultra -22 with training: 66.3 MiB (the winner!)
# Training takes only a few minutes, make it here in place with current zstd and kernel modules.
# But! Decompressing also requires a dictionary for zstd, that will be too complex, so not using training :(
# We already use zstd in dracut to compress initrds quickly and with good compression ration.
# Testing speed of loading modules:
# `time modinfo bcache.ko.xz` took 0,048s, `time modinfo bcache.ko.zstd` took 0,014s (for multiple times)
# find /lib/modules/5.10.34-generic-2rosa2019.1-x86_64 -type f -name '*.ko.zst' > /tmp/zst.list
# time { for i in `cat /tmp/zst.list`; do modinfo $i >/dev/null 2>&1; done ;}
# took ~31-40s, with disk cache (2+ runs) ~33s
# find /lib/modules/5.10.34-generic-1rosa2019.1-x86_64 -type f -name '*.ko.xz' > /tmp/xz.list
# time { for i in `cat /tmp/xz.list`; do modinfo $i >/dev/null 2>&1; done ;}
# took 43-47s, with disk cache (2+ runs) ~42s, +21%%
# zstd-compressed initramfs image initrd-5.10.34-generic-1rosa2019.1-x86_64.img with *.ko.xz is 56,3 MiB
# zstd-compressed initramfs image initrd-5.10.34-generic-2rosa2019.1-x86_64.img with *.ko.zst is 58,4 MiB (+3.6%%)
# /lib/modules/5.10.34-generic-1rosa2019.1-x86_64 (*.ko.xz) is 78,1 MiB
# /lib/modules/5.10.34-generic-2rosa2019.1-x86_64 (*.ko.zst) is 83,9 MiB (+7%%)
# When zstd is compressing cpio (initrd image) with zstd-compressed kernel modules inside it, does it recompress data?
# It is not easy to make a choice between zstd and xz for kernel modules... Disk space (and so speed of installing
# RPM packages) is not much bigger, we do not try to support super low end devices, operation speed is a bit better.
# I have not seen measurable difference in startup time according to systemd-analyze.
# Note that decompression after zstd --ultra -22 will consume more memory than after zstd -6, see commit message in
# https://github.com/torvalds/linux/commit/73f3d1b48f5069d46b. I did not benchmark -6 vs -22 in runtime.
# Let's use zstd for now.
# zstd may also be used to compress linux-firmware to save a lot of space on disk,
# but upstream kernels still cannot decompress it.
#{zstd_cmd} -T0 --train $(find . -type f -name '*.ko')
#[ -f dictionary ]
# -T1 (one thread) because we run multiple zstd processes by xargs
%if %{with modxz}
find %{target_modules} -name "*.ko" | %kxargs xz -6e
%else
find %{target_modules} -name "*.ko" | %kxargs %{zstd_cmd} --rm -T1 #-D dictionary
rm -f dictionary
%endif
%endif
%if %{with binary_extra_modules}
# Move nvidia modules to manage them via alternatives(8), leave *.debug
# TODO: better handle debug here and in the package in general
find %{target_modules}/%{kver_full}/kernel/drivers/video -name 'nvidia???.*' -type d -maxdepth 1 |
while read -r line
do
nv="$(basename "$line")"
mkdir -p %{buildroot}%{kroko_kmods_dir}/"$nv"-%{kver_full}
mv -v "$line"/*.ko%{kmod_suffix} %{buildroot}%{kroko_kmods_dir}/"$nv"-%{kver_full}
dir_no_buildroot="$(echo "$line" | sed -e 's,^%{buildroot},,')"
echo "%exclude $dir_no_buildroot" >> %{kernel_files}
%if %{build_debug}
echo "%dir $dir_no_buildroot" >> %{debuginfo_files}
%endif
done
%endif #/with binary_extra_modules
find %{buildroot}%{_modulesdir}/%{kver_full} -type f -name '*.ko%{kmod_suffix}' | sed -e 's,^%{buildroot},,' | sort -u >> %{kernel_files}
find %{buildroot}%{_modulesdir}/%{kver_full} -type d | sed -e 's,^%{buildroot},%dir ,' | sort -u >> %{kernel_files}
# We estimate the size of the initramfs because rpm needs to take this size
# into consideration when performing disk space calculations (See rhbz#530778)
# 65 MiB is a bit more than needed, but let's be more sure that there is enought space.
# On my PC, zstd-compressed initrds take 58,5 MiB.
# Real size of the RPM package should not increase because RPM compresses the payload.
# This file is %%ghost, so the real initrd will be deleted when uninstalling this package.
dd if=/dev/zero of=%{buildroot}%{initrd_path} bs=1M count=65
%if %{build_debug}
install -m 644 vmlinux %{buildroot}%{_bootdir}/vmlinux-%{kver_full}
find %{buildroot}%{_modulesdir} -type f -name '*.debug' | sed -e 's,^%{buildroot},,' | sort -u >> %{debuginfo_files}
%endif
# End of build_debug
pushd %{target_modules}
for i in *; do
rm -f $i/build $i/source
ln -sf /usr/src/linux-$i $i/build
ln -sf /usr/src/linux-$i $i/source
done
# Sniff, if we compressed all the modules, we change the stamp :(
# we really need the depmod -ae here
for i in *; do
/sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i
echo $?
done
# We used to create modules.description files which contained the
# description strings for the modules as shown by modinfo. These files
# are unlikely to be used right now, so create them (in case some old tool
# checks for their existence) but keep them empty.
for i in *; do
touch $i/modules.description
done
popd
# Need to set extraversion to match srpm again to avoid rebuild
LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{fullrpmrel}/" Makefile
%if %{build_perf}
# Perf tool binary and supporting scripts/binaries
make -C tools/perf -s V=1 DESTDIR=%{buildroot} WERROR=0 HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} lib=%{_lib} install
# Versionize shebang (#!/usr/bin/env python -> #!/usr/bin/python3)
sed -i '1 s,^#!/usr/bin/env python$,#!%{__python3},' \
%{buildroot}%{_prefix}/libexec/perf-core/scripts/python/exported-sql-viewer.py \
%{buildroot}%{_prefix}/libexec/perf-core/scripts/python/libxed.py
# Perf man pages (note: implicit rpm magic compresses them later)
make -C tools/perf -s V=1 DESTDIR=%{buildroot} WERROR=0 HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} install-man
%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 %{SOURCE53} %{buildroot}%{_unitdir}/cpupower.path
install -m644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/cpupower
install -m755 %{SOURCE52} %{buildroot}%{_bindir}/cpupower-start.sh
%endif
# Delete junk
rm -fr %{buildroot}%{_usr}/src/*/kernel-source-*
%if %{with flow_abi}
# Prefix with "zzz" to put this directory into the end of search list
# and avoid tricks with depmod configs
mkdir -p %{buildroot}/lib/modules/%{kernelversion}.%{patchlevel}-rosa-flow-abi
ln -s /lib/modules/%{kernelversion}.%{patchlevel}-rosa-flow-abi %{buildroot}%{_modulesdir}/%{kver_full}/kernel/zzz-%{kernelversion}.%{patchlevel}-rosa-flow-abi
%endif
# Drop hidden files
rm -f %{buildroot}%{_docdir}/kernel-5.10-generic-doc/devicetree/bindings/.yamllint
# Fix perms
%if %{build_perf}
chmod -x %{buildroot}%{_sysconfdir}/bash_completion.d/perf
chmod -x %{buildroot}%{_prefix}/lib/perf/examples/bpf/*.c
chmod -x %{buildroot}%{_prefix}/lib/perf/include/bpf/*.h
chmod -x %{buildroot}%{_prefix}/lib/perf/include/bpf/linux/*.h
chmod -x %{buildroot}%{_datadir}/doc/perf-tip/*.txt
%endif