kernel-6.6/kernel.spec
Mikhail Novosyolov 687ff66a18 [bot] upd: 6.1.29 -> 6.1.34
Changelog:

3c589_cs: Fix an error handling path in tc589_probe()
ACPICA: ACPICA: check null return of ACPI_ALLOCATE_ZEROED in acpi_db_display_objects
ACPICA: Avoid undefined behavior: applying zero offset to null pointer
ACPI: EC: Fix oops when removing custom query handlers
ACPI: processor: Check for null return of devm_kzalloc() in fch_misc_setup()
ACPI: resource: Add IRQ override quirk for LG UltraPC 17U70P
ACPI: video: Remove desktops without backlight DMI quirks
af_key: Reject optional tunnel/BEET mode templates in outbound policies
af_packet: do not use READ_ONCE() in packet_bind()
af_packet: Fix data-races of pkt_sk(sk)->num.
afs: Fix setting of mtime when creating a file/dir/symlink
af_unix: Fix a data race of sk->sk_receive_queue->qlen.
af_unix: Fix data races around sk->sk_shutdown.
ALSA: cmipci: Fix kctl->id initialization
ALSA: firewire-digi00x: prevent potential use after free
ALSA: gus: Fix kctl->id initialization
ALSA: hda: Add NVIDIA codec IDs a3 through a7 to patch table
ALSA: hda/ca0132: add quirk for EVGA X299 DARK
ALSA: hda: Fix kctl->id initialization
ALSA: hda: Fix Oops by 9.1 surround channel names
ALSA: hda: Fix unhandled register update during auto-suspend period
ALSA: hda: Glenfly: add HD Audio PCI IDs and HDMI Codec Vendor IDs.
ALSA: hda: LNL: add HD Audio PCI ID
ALSA: hda/realtek: Add a quirk for HP EliteDesk 805
ALSA: hda/realtek: Add a quirk for HP Slim Desktop S01
ALSA: hda/realtek: Add Lenovo P3 Tower platform
ALSA: hda/realtek: Add quirk for 2nd ASUS GU603
ALSA: hda/realtek: Add quirk for Clevo L140AU
ALSA: hda/realtek: Add quirk for Clevo NS50AU
ALSA: hda/realtek: Add quirk for HP EliteBook G10 laptops
ALSA: hda/realtek: Add quirks for ASUS GU604V and GU603V
ALSA: hda/realtek: Add quirks for Asus ROG 2024 laptops using CS35L41
ALSA: hda/realtek: Apply HP B&O top speaker profile to Pavilion 15
ALSA: hda/realtek: Enable headset onLenovo M70/M90
ALSA: hda/realtek: Fix mute and micmute LEDs for yet another HP laptop
ALSA: ice1712,ice1724: fix the kcontrol->id initialization
ALSA: oss: avoid missing-prototype warnings
ALSA: usb-audio: Add a sample rate workaround for Line6 Pod Go
ALSA: ymfpci: Fix kctl->id initialization
amd-xgbe: fix the false linkup in xgbe_phy_status
arm64: Also reset KASAN tag if page is not PG_mte_tagged
arm64: dts: imx8mn-beacon: Fix SPI CS pinmux
arm64: dts: imx8mn-var-som: fix PHY detection bug by adding deassert delay
arm64: dts: imx8mq-librem5: Remove dis_u3_susphy_quirk from usb_dwc3_0
arm64: dts: imx8qm-mek: correct GPIOs for USDHC2 CD and WP signals
arm64: dts: imx8-ss-dma: assign default clock rate for lpuarts
arm64: dts: qcom: msm8996: Add missing DWC3 quirks
arm64: dts: qcom: sc7180-lite: Fix SDRAM freq for misidentified sc7180-lite boards
arm64: dts: qcom: sc8280xp: Flush RSC sleep & wake votes
arm64: dts: qcom: sdm845-polaris: Drop inexistent properties
arm64: efi: Use SMBIOS processor version to key off Ampere quirk
arm64/mm: mark private VM_FAULT_X defines as vm_fault_t
arm64: mte: Do not set PG_mte_tagged if tags were not initialized
arm64: vdso: Pass (void *) to virt_to_page()
ARM: 9295/1: unwind:fix unwind abort for uleb128 case
ARM: 9296/1: HP Jornada 7XX: fix kernel-doc warnings
ARM: at91: pm: fix imbalanced reference counter for ethernet devices
ARM: dts: at91: sama7g5ek: fix debounce delay property for shdwc
ARM: dts: imx6qdl-mba6: Add missing pvcie-supply regulator
ARM: dts: stm32: add pin map for CAN controller on stm32f7
ASoC: amd: Add Dell G15 5525 to quirks list
ASoC: amd: yc: Add DMI entries to support HP OMEN 16-n0xxx (8A42)
ASoC: amd: yc: Add DMI entry to support System76 Pangolin 12
ASoC: amd: yc: Add ThinkBook 14 G5+ ARP to quirks list for acp6x
ASoC: codecs: wsa881x: do not set can_multi_write flag
ASoC: codecs: wsa883x: do not set can_multi_write flag
ASoC: dt-bindings: Adjust #sound-dai-cells on TI's single-DAI codecs
ASoC: dwc: limit the number of overrun messages
ASoC: fsl_micfil: Fix error handler with pm_runtime_enable
ASoC: Intel: avs: Access path components under lock
ASoC: Intel: avs: Fix declaration of enum avs_channel_config
ASoC: Intel: Skylake: Fix declaration of enum skl_ch_cfg
ASoC: Intel: soc-acpi-cht: Add quirk for Nextbook Ares 8A tablet
ASoC: lpass: Fix for KASAN use_after_free out of bounds
ASoC: mediatek: mt8186: Fix use-after-free in driver remove path
ASoC: mediatek: mt8195-afe-pcm: Convert to platform remove callback returning void
ASoC: mediatek: mt8195: fix use-after-free in driver remove path
ASoC: rt5682: Disable jack detection interrupt during suspend
ASoC: simple-card-utils: fix PCM constraint error check
ASoC: SOF: debug: conditionally bump runtime_pm counter on exceptions
ASoC: SOF: pcm: fix pm_runtime imbalance in error handling
ASoC: SOF: pm: save io region state in case of errors in resume
ASoC: SOF: sof-client-probes: fix pm_runtime imbalance in error handling
ASoC: SOF: topology: Fix logic for copying tuples
ASoC: ssm2602: Add workaround for playback distortions
ata: libata-scsi: Use correct device no in ata_find_dev()
atm: hide unused procfs functions
batman-adv: Broken sync while rescheduling delayed work
binder: add lockless binder_alloc_(set|get)_vma()
binder: fix UAF caused by faulty buffer cleanup
binder: fix UAF of alloc->vma in race with munmap()
blk-mq: fix blk_mq_hw_ctx active request accounting
blk-mq: fix race condition in active queue accounting
block, bfq: Fix division by zero error on zero wsum
block: Deny writable memory mapping if block is read-only
block: fix bio-cache for passthru IO
block: fix revalidate performance regression
block/rnbd: replace REQ_OP_FLUSH with REQ_OP_WRITE
bluetooth: Add cmd validity checks at the start of hci_sock_ioctl()
Bluetooth: Add new quirk for broken local ext features page 2
Bluetooth: Add new quirk for broken set random RPA timeout for ATS2851
Bluetooth: btintel: Add LE States quirk support
Bluetooth: btrtl: add support for the RTL8723CS
Bluetooth: btrtl: Add the support for RTL8851B
Bluetooth: btrtl: check for NULL in btrtl_set_quirks()
Bluetooth: btusb: Add new PID/VID 04ca:3801 for MT7663
Bluetooth: fix debugfs registration
Bluetooth: Fix l2cap_disconnect_req deadlock
Bluetooth: Fix use-after-free in hci_remove_ltk/hci_remove_irk
Bluetooth: hci_bcm: Fall back to getting bdaddr from EFI if not set
Bluetooth: hci_qca: fix debugfs registration
Bluetooth: hci_sync: add lock to protect HCI_UNREGISTER
Bluetooth: Improve support for Actions Semi ATS2851 based devices
Bluetooth: ISO: don't try to remove CIG if there are bound CIS left
Bluetooth: L2CAP: Add missing checks for invalid DCID
Bluetooth: L2CAP: fix "bad unlock balance" in l2cap_disconnect_rsp
bnxt: avoid overflow in bnxt_get_nvram_directory()
bnxt_en: Don't issue AP reset during ethtool's reset operation
bnxt_en: Implement .set_port / .unset_port UDP tunnel callbacks
bnxt_en: Prevent kernel panic when receiving unexpected PHC_UPDATE event
bnxt_en: Query default VLAN before VNIC setup on a VF
bnxt_en: Skip firmware fatal error recovery if chip is not accessible
bonding: fix send_peer_notif overflow
bpf: Add extra path pointer check to d_path helper
bpf: Add preempt_count_{sub,add} into btf id deny list
bpf: Annotate data races in bpf_local_storage
bpf: fix a memory leak in the LRU and LRU_PERCPU hash maps
bpf: Fix elem_size not being set for inner maps
bpf: Fix mask generation for 32-bit narrow loads of 64-bit fields
bpf: Fix UAF in task local storage
bpf, sockmap: Avoid potential NULL dereference in sk_psock_verdict_data_ready()
bpf, sockmap: Convert schedule_work into delayed_work
bpf, sockmap: Handle fin correctly
bpf, sockmap: Improved check for empty queue
bpf, sockmap: Incorrectly handling copied_seq
bpf, sockmap: Pass skb ownership through read_skb
bpf, sockmap: Reschedule is now done through backlog
bpf, sockmap: TCP data stall on recv before accept
bpf, sockmap: Wake up polling after data copy
bridge: always declare tunnel functions
btrfs: abort transaction when sibling keys check fails for leaves
btrfs: fix csum_tree_block page iteration to avoid tripping on -Werror=array-bounds
btrfs: use nofs when cleaning up aborted transactions
can: dev: fix missing CAN XL support in can_put_echo_skb()
can: isotp: recvmsg(): allow MSG_CMSG_COMPAT flag
can: j1939: avoid possible use-after-free when j1939_can_rx_register fails
can: j1939: change j1939_netdev_lock type to mutex
can: j1939: j1939_sk_send_loop_abort(): improved error queue handling in J1939 Socket
can: j1939: recvmsg(): allow MSG_CMSG_COMPAT flag
can: kvaser_pciefd: Call request_irq() before enabling interrupts
can: kvaser_pciefd: Clear listen-only bit if not explicitly requested
can: kvaser_pciefd: Disable interrupts in probe error path
can: kvaser_pciefd: Do not send EFLUSH command on TFD interrupt
can: kvaser_pciefd: Empty SRB buffer in probe
can: kvaser_pciefd: Set CAN_STATE_STOPPED in kvaser_pciefd_stop()
cassini: Fix a memory leak in the error handling path of cas_init_one()
ceph: fix use-after-free bug for inodes when flushing capsnaps
ceph: force updating the msg pointer in non-split case
ceph: silence smatch warning in reconnect_caps_cb()
cifs: mapchars mount option ignored
coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet()
cpufreq: amd-pstate: Add ->fast_switch() callback
cpufreq: amd-pstate: Update policy->cur in amd_pstate_adjust_perf()
cpupower: Make TSC read per CPU for Mperf monitor
crypto: jitter - permanent and intermittent health errors
crypto: testmgr - fix RNG performance in fuzz tests
cxl: Wait Memory_Info_Valid before access memory related info
debugobjects: Don't wake up kswapd from fill_pool()
dmaengine: at_xdmac: fix potential Oops in at_xdmac_prep_interleaved()
dmaengine: pl330: rename _start to prevent build error
drivers: base: cacheinfo: Fix shared_cpu_map changes in event of CPU hotplug
drm/amd/amdgpu: introduce gc_*_mes_2.bin v2
drm/amd/amdgpu: limit one queue per gang
drm/amd/amdgpu: update mes11 api def
drm/amd/display: Correct DML calculation to align HW formula
drm/amd/display: Correct DML calculation to follow HW SPEC
drm/amd/display: Enable HostVM based on rIOMMU active
drm/amd/display: fixed dcn30+ underflow issue
drm/amd/display: Have Payload Properly Created After Resume
drm/amd/display: hpd rx irq not working with eDP interface
drm/amd/display: populate subvp cmd info only for the top pipe
drm/amd/display: Reduce sdp bw after urgent to 90%
drm/amd/display: Use DC_LOG_DC in the trasform pixel function
drm/amd: Don't allow s0ix on APUs older than Raven
drm/amd: Fix an out of bounds error in BIOS parser
drm/amdgpu: change reserved vram info print
drm/amdgpu: declare firmware for new MES 11.0.4
drm/amdgpu: drop gfx_v11_0_cp_ecc_error_irq_funcs
drm/amdgpu: enable tmz by default for GC 11.0.1
drm/amdgpu: fix Null pointer dereference error in amdgpu_device_recover_vram
drm/amdgpu: Fix sdma v4 sw fini error
drm/amdgpu: fix xclk freq on CHIP_STONEY
drm/amdgpu/gfx10: Disable gfxoff before disabling powergating.
drm/amdgpu/gfx11: Adjust gfxoff before powergating on gfx11 as well
drm/amdgpu/gfx11: update gpu_clock_counter logic
drm/amdgpu/gmc11: implement get_vbios_fb_size()
drm/amdgpu/mes11: enable reg active poll
drm/amdgpu: refine get gpu clock counter method
drm/amdgpu: release gpu full access after "amdgpu_device_ip_late_init"
drm/amdgpu: reserve the old gc_11_0_*_mes.bin
drm/amdgpu: set gfx9 onwards APU atomics support to be true
drm/amdgpu: skip disabling fence driver src_irqs when device is unplugged
drm/amdgpu: Use the default reset when loading or reloading the driver
drm/amd/pm: add missing NotifyPowerSource message mapping for SMU13.0.7
drm/amd/pm: conditionally disable pcie lane switching for some sienna_cichlid SKUs
drm/amd/pm: Fix output of pp_od_clk_voltage
drm/amd/pm: fix possible power mode mismatch between driver and PMFW
drm/amd/pm: Fix power context allocation in SMU13
drm/amd/pm: resolve reboot exception for si oland
drm/amd/pm: reverse mclk and fclk clocks levels for renoir
drm/amd/pm: reverse mclk and fclk clocks levels for SMU v13.0.4
drm/amd/pm: reverse mclk and fclk clocks levels for vangogh
drm/amd/pm: reverse mclk and fclk clocks levels for yellow carp
drm/amd/pm: reverse mclk clocks levels for SMU v13.0.5
drm/ast: Fix ARM compatibility
drm/displayid: add displayid_get_header() and check bounds better
drm/exynos: fix g2d_open/close helper function definitions
drm/fbdev-generic: prohibit potential out-of-bounds access
drm: fix drmm_mutex_init()
drm/i915/dp: prevent potential div-by-zero
drm/i915: Expand force_probe to block probe of devices as well.
drm/i915: Explain the magic numbers for AUX SYNC/precharge length
drm/i915: Fix NULL ptr deref by checking new_crtc_state
drm/i915/gt: Use the correct error value when kernel_context() fails
drm/i915/guc: Don't capture Gen8 regs on Xe devices
drm/i915/selftests: Add some missing error propagation
drm/i915/selftests: Stop using kthread_stop()
drm/i915: taint kernel when force probing unsupported devices
drm/i915: Use 18 fast wake AUX sync len
drm/mgag200: Fix gamma lut not initialized.
drm/mipi-dsi: Set the fwnode for mipi_dsi_device
drm/msm: Be more shouty if per-process pgtables aren't working
drm/msm/dp: Clean up handling of DP AUX interrupts
drm/msm/dpu: Assign missing writeback log_mask
drm/msm/dpu: Move non-MDP_TOP INTF_INTR offsets out of hwio header
drm/msm/dp: unregister audio driver during unbind
drm/msm/dpu: Remove duplicate register defines from INTF
drm/msm: Fix submit error-path leaks
drm/radeon: reintroduce radeon_dp_work_func content
drm/rockchip: dw_hdmi: cleanup drm encoder during unbind
drm/tegra: Avoid potential 32-bit integer overflow
dt-binding: cdns,usb3: Fix cdns,on-chip-buff-size type
dt-bindings: ata: ahci-ceva: Cover all 4 iommus entries
dt-bindings: display/msm: dsi-controller-main: Document qcom, master-dsi and qcom, sync-dual-dsi
dt-bindings: iio: adc: renesas,rcar-gyroadc: Fix adi,ad7476 compatible value
dt-bindings: usb: snps,dwc3: Fix "snps,hsphy_interface" type
eeprom: at24: also select REGMAP
erspan: get the proto with the md version for collect_md
ext2: Check block size validity during mount
ext4: add EA_INODE checking to ext4_iget()
ext4: add lockdep annotations for i_data_sem for ea_inode's
ext4: allow ext4_get_group_info() to fail
ext4: allow to find by goal if EXT4_MB_HINT_GOAL_ONLY is set
ext4: disallow ea_inodes with extended attributes
ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled
ext4: enable the lazy init thread when remounting read/write
ext4: Fix best extent lstart adjustment logic in ext4_mb_new_inode_pa()
ext4: only check dquot_initialize_needed() when debugging
ext4: reflect error codes from ext4_multi_mount_protect() to its callers
ext4: set goal start correctly in ext4_mb_normalize_request
ext4: set lockdep subclass for the ea_inode in ext4_xattr_inode_cache_find()
f2fs: Fix system crash due to lack of free space in LFS
f2fs: fix to check readonly condition correctly
f2fs: fix to drop all dirty pages during umount() if cp_error is set
fbcon: Fix null-ptr-deref in soft_cursor
fbdev: arcfb: Fix error handling in arcfb_probe()
fbdev: imsttfb: Fix use after free bug in imsttfb_probe
fbdev: modedb: Add 1920x1080 at 60 Hz video mode
fbdev: stifb: Fix info entry in sti_struct on error path
fbdev: udlfb: Fix endpoint check
firmware: arm_ffa: Check if ffa_driver remove is present before executing
firmware: arm_ffa: Fix FFA device names for logical partitions
firmware: arm_ffa: Fix usage of partition info get count flag
firmware: arm_ffa: Set handle field to zero in memory descriptor
firmware: arm_ffa: Set reserved/MBZ fields to zero in the memory descriptors
firmware: arm_sdei: Fix sleep from invalid context BUG
forcedeth: Fix an error handling path in nv_probe()
fs: fix undefined behavior in bit shift for SB_NOUSER
fs: hfsplus: remove WARN_ON() from hfsplus_cat_{read,write}_inode()
fs/ntfs3: Validate MFT flags before replaying logs
gfs2: Don't deref jdesc in evict
gfs2: Fix inode height consistency check
gpio-f7188x: fix chip name and pin count on Nuvoton chip
gpio: mockup: Fix mode of debugfs files
gpio: sim: fix memory corruption when adding named lines and unnamed hogs
gve: Remove the code of clearing PBA bit
HID: apple: Set the tilde quirk flag on the Geyser 3
HID: apple: Set the tilde quirk flag on the Geyser 4 and later
HID: google: add jewel USB id
HID: Ignore battery for ELAN touchscreen on ROG Flow X13 GV301RA
HID: logitech-hidpp: Don't use the USB serial for USB devices
HID: logitech-hidpp: Reconcile USB and Unifying serials
HID: wacom: avoid integer overflow in wacom_intuos_inout()
HID: wacom: generic: Set battery quirk only when we see battery data
hwmon: (k10temp) Add PCI ID for family 19, model 78h
i2c: mv64xxx: Fix reading invalid status value in atomic mode
i2c: sprd: Delete i2c adapter in .remove's error path
ice: Fix ice VF reset during iavf initialization
ice: introduce clear_reset_state operation
igb: fix bit_shift to be in [1..8] range
iio: accel: st_accel: Fix invalid mount_matrix on devices without ACPI _ONT method
iio: adc: ad7192: Change "shorted" channels to differential
iio: adc: ad_sigma_delta: Fix IRQ issue by setting IRQ_DISABLE_UNLAZY flag
iio: adc: mxs-lradc: fix the order of two cleanup operations
iio: adc: stm32-adc: skip adc-channels setup if none is present
iio: adc: stm32-adc: skip adc-diff-channels setup if none is present
iio: addac: ad74413: fix resistance input processing
iio: dac: build ad5758 driver when AD5758 is selected
iio: dac: mcp4725: Fix i2c_master_send() return value handling
iio: imu: inv_icm42600: fix timestamp reset
iio: light: vcnl4035: fixed chip ID check
inet: Add IP_LOCAL_PORT_RANGE socket option
Input: fix open count when closing inhibited device
Input: psmouse - fix OOB access in Elantech protocol
Input: xpad - delete a Razer DeathAdder mouse VID/PID entry
iommu/amd: Don't block updates to GATag if guest mode is on
iommu/amd: Fix domain flush size when syncing iotlb
iommu/amd: Fix up merge conflict resolution
iommu/amd: Handle GALog overflows
iommu/amd/pgtbl_v2: Fix domain max address
iommu/mediatek: Flush IOTLB completely only if domain has been attached
iommu/rockchip: Fix unwind goto issue
io_uring: undeprecate epoll_ctl support
ipv{4,6}/raw: fix output xfrm lookup wrt protocol
ipv6: Fix out-of-bounds access in ipv6_find_tlv()
ipv6: rpl: Fix Route of Death.
ipvlan:Fix out-of-bounds caused by unclear skb->cb
ipvs: Update width of source for ip_vs_sync_conn_options
irqchip/gicv3: Workaround for NVIDIA erratum T241-FABRIC-4
irqchip/mips-gic: Don't touch vl_map if a local interrupt is not routable
irqchip/mips-gic: Use raw spinlock for gic_lock
KEYS: asymmetric: Copy sig and digest in public_key_verify_signature()
ksmbd: allocate one more byte for implied bcc[0]
ksmbd: check the validation of pdu_size in ksmbd_conn_handler_loop
ksmbd: fix credit count leakage
ksmbd: fix global-out-of-bounds in smb2_find_context_vals
ksmbd: fix incorrect AllocationSize set in smb2_get_info
ksmbd: fix multiple out-of-bounds read during context decoding
ksmbd: fix out-of-bound read in deassemble_neg_contexts()
ksmbd: fix out-of-bound read in parse_lease_state()
ksmbd: fix slab-out-of-bounds read in smb2_handle_negotiate
ksmbd: fix UAF issue from opinfo->conn
ksmbd: fix wrong UserName check in session_user
ksmbd: smb2: Allow messages padded to 8byte boundary
KVM: arm64: Populate fault info for watchpoint
KVM: arm64: vgic: Fix a circular locking issue
KVM: arm64: vgic: Fix locking comment
KVM: arm64: vgic: Wrap vgic_its_create() with config_lock
KVM: Fix vcpu_array[0] races
KVM: x86: Account fastpath-only VM-Exits in vCPU stats
lan966x: Fix unloading/loading of the driver
lib: cpu_rmap: Avoid use after free on rmap->obj array entries
lib: cpu_rmap: Fix potential use-after-free in irq_cpu_rmap_release()
linux/dim: Do nothing if no time delta between samples
lkdtm/stackleak: Fix noinstr violation
m68k: Move signal frame following exception on 68020/030
mailbox: mailbox-test: fix a locking issue in mbox_test_message_write()
mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write()
maple_tree: make maple state reusable after mas_empty_area()
mcb-pci: Reallocate memory region to avoid memory overlapping
md: fix soft lockup in status_resync
md/raid5: fix miscalculation of 'end_sector' in raid5_read_one_chunk()
media: cx23885: Fix a null-ptr-deref bug in buffer_prepare() and buffer_finish()
media: dvb_ca_en50221: fix a size write bug
media: dvb-core: Fix kernel WARNING for blocking operation in wait_event*()
media: dvb-core: Fix use-after-free due on race condition at dvb_net
media: dvb-core: Fix use-after-free due to race at dvb_register_device()
media: dvb-core: Fix use-after-free due to race condition at dvb_ca_en50221
media: dvb_demux: fix a bug for the continuity counter
media: dvb-usb: az6027: fix three null-ptr-deref in az6027_i2c_xfer()
media: dvb-usb: digitv: fix null-ptr-deref in digitv_i2c_xfer()
media: dvb-usb: dw2102: fix uninit-value in su3000_read_mac_address
media: dvb-usb-v2: ce6230: fix null-ptr-deref in ce6230_i2c_master_xfer()
media: dvb-usb-v2: ec168: fix null-ptr-deref in ec168_i2c_xfer()
media: dvb-usb-v2: rtl28xxu: fix null-ptr-deref in rtl28xxu_i2c_xfer
media: mediatek: vcodec: Fix potential array out-of-bounds in decoder queue_setup
media: mediatek: vcodec: Only apply 4K frame sizes on decoder formats
media: mn88443x: fix !CONFIG_OF error by drop of_match_ptr from ID table
media: netup_unidvb: fix irq init by register it at the end of probe
media: netup_unidvb: fix use-after-free at del_timer()
media: pci: tw68: Fix null-ptr-deref bug in buf prepare and finish
media: Prefer designated initializers over memset for subdev pad ops
media: pvrusb2: VIDEO_PVRUSB2 depends on DVB_CORE to use dvb_* symbols
media: radio-shark: Add endpoint checks
media: rcar-vin: Select correct interrupt mode for V4L2_FIELD_ALTERNATE
media: ttusb-dec: fix memory leak in ttusb_dec_exit_dvb()
media: uvcvideo: Don't expose unsupported formats to userspace
memstick: r592: Fix UAF bug in r592_remove due to race condition
mfd: dln2: Fix memory leak in dln2_probe()
mfd: intel-lpss: Add Intel Meteor Lake PCH-S LPSS PCI IDs
mfd: intel_soc_pmic_chtwc: Add Lenovo Yoga Book X90F to intel_cht_wc_models
misc: fastrpc: reject new invocations during device removal
misc: fastrpc: return -EPIPE to invocations on device removal
mmc: block: ensure error propagation for non-blk
mmc: pwrseq: sd8787: Fix WILC CHIP_EN and RESETN toggling order
mmc: sdhci-esdhc-imx: make "no-mmc-hs400" works
mmc: vub300: fix invalid response handling
mm: fix zswap writeback race condition
mm: page_table_check: Ensure user pages are not slab pages
mm: page_table_check: Make it dependent on EXCLUSIVE_SYSTEM_RAM
mptcp: add address into userspace pm list
mptcp: add annotations around msk->subflow accesses
mptcp: add annotations around sk->sk_shutdown accesses
mptcp: avoid unneeded address copy
mptcp: avoid unneeded __mptcp_nmpc_socket() usage
mptcp: consolidate passive msk socket initialization
mptcp: fix active subflow finalization
mptcp: fix connect timeout handling
mptcp: fix data race around msk->first access
mptcp: only send RM_ADDR in nl_cmd_remove
mptcp: simplify subflow_syn_recv_sock()
mptcp: update userspace pm infos
mtdchar: mark bits of ioctl handler noinline
mtd: rawnand: ingenic: fix empty stub helper definitions
mtd: rawnand: marvell: don't set the NAND frequency select
mtd: rawnand: marvell: ensure timing values are written
nbd: Fix debugfs_create_dir error checking
nbd: fix incomplete validation of ioctl arg
neighbour: fix unaligned access to pneigh_entry
net: add vlan_get_protocol_and_depth() helper
net: annotate sk->sk_err write from do_recvmmsg()
net: bcmgenet: Fix EEE implementation
net: bcmgenet: Remove phy_stop() from bcmgenet_netif_stop()
net: bcmgenet: Restore phy_stop() depending upon suspend/close
net: Catch invalid index in XPS mapping
net: cdc_ncm: Deal with too low values of dwNtbOutMaxSize
net: datagram: fix data-races in datagram_poll()
net: deal with most data-races in sk_wait_event()
netdev: Enforce index cap in netdev_get_tx_queue
net: dsa: lan9303: allow vid != 0 in port_fdb_{add|del} methods
net: dsa: mv88e6xxx: Add RGMII delay to 88E6320
net: dsa: mv88e6xxx: Fix mv88e6393x EPC write command offset
net: dsa: mv88e6xxx: Increase wait after reset deactivation
net: dsa: rzn1-a5psw: disable learning for standalone ports
net: dsa: rzn1-a5psw: enable management frames for CPU port
net: dsa: rzn1-a5psw: fix STP states handling
net: enetc: correct rx_bytes statistics of XDP
net: enetc: correct the statistics of rx bytes
net: fec: Better handle pm_runtime_get() failing in .remove()
netfilter: conntrack: define variables exp_nat_nla_policy and any_addr with CONFIG_NF_NAT
netfilter: conntrack: fix NULL pointer dereference in nf_confirm_cthelper
netfilter: conntrack: fix possible bug_on with enable_hooks=1
netfilter: ctnetlink: Support offloaded conntrack entry deletion
netfilter: ipset: Add schedule point in call_ad().
netfilter: nf_tables: always release netdev hooks from notifier
netfilter: nf_tables: fix nft_trans type confusion
netfilter: nf_tables: out-of-bound check in chain blob
netfilter: nft_bitwise: fix register tracking
netfilter: nft_set_rbtree: fix null deref on element insertion
net: Fix load-tearing on sk->sk_stamp in sock_recv_cmsgs().
net: fix skb leak in __skb_tstamp_tx()
net: fix stack overflow when LRO is disabled for virtual interfaces
net: hns3: fix output information incomplete for dumping tx queue info with debugfs
net: hns3: fix reset delay time to avoid configuration timeout
net: hns3: fix reset timeout when enable full VF
net: hns3: fix sending pfc frames after reset issue
net/ipv4: ping_group_range: allow GID from 2147483648 to 4294967294
net/ipv6: fix bool/int mismatch for skip_notify_on_dev_down
netlink: annotate accesses to nlk->cb_running
net: mdio: mvusb: Fix an error handling path in mvusb_mdio_probe()
net: mellanox: mlxbf_gige: Fix skb_panic splat under memory pressure
net/mlx5: Collect command failures data only for known commands
net/mlx5: Devcom, fix error flow in mlx5_devcom_register_device
net/mlx5: Devcom, serialize devcom registration
net/mlx5: Drain health before unregistering devlink
net/mlx5: DR, Check force-loopback RC QP capability independently from RoCE
net/mlx5: DR, Fix crc32 calculation to work on big-endian (BE) CPUs
net/mlx5e: do as little as possible in napi poll when budget is 0
net/mlx5e: Don't attach netdev profile while handling internal error
net/mlx5e: Fix deadlock in tc route query code
net/mlx5e: Fix error handling in mlx5e_refresh_tirs
net/mlx5e: Fix SQ wake logic in ptp napi_poll context
net/mlx5: E-switch, Devcom, sync devcom events and devcom comp register
net/mlx5e: Use correct encap attribute during invalidation
net/mlx5: Fix error message when failing to allocate device memory
net/mlx5: fw_tracer, Fix event handling
net/mlx5: Handle pairing of E-switch via uplink un/load APIs
net/mlx5: Read embedded cpu after init bit cleared
net/mlx5: SF, Drain health before removing device
net: mscc: ocelot: fix stat counter register values
net/netlink: fix NETLINK_LIST_MEMBERSHIPS length report
net: nsh: Use correct mac_offset to unwind gso skb in nsh_gso_segment()
net: page_pool: use in_softirq() instead
net: pasemi: Fix return type of pasemi_mac_start_tx()
net: pcs: xpcs: fix C73 AN not getting enabled
net: phy: bcm7xx: Correct read from expansion register
net: phy: dp83867: add w/a for packet errors seen with short cables
net: phy: mscc: add VSC8502 to MODULE_DEVICE_TABLE
net: phy: mscc: enable VSC8501/2 RGMII RX clock
netrom: fix info-leak in nr_write_internal()
net: sched: act_police: fix sparse errors in tcf_police_dump()
net: sched: add rcu annotations around qdisc->qdisc_sleeping
net: sched: fix NULL pointer dereference in mq_attach
net: sched: fix possible refcount leak in tc_chain_tmplt_add()
net/sched: flower: fix possible OOB write in fl_set_geneve_opt()
net/sched: fq_pie: ensure reasonable TCA_FQ_PIE_QUANTUM values
net: sched: move rtm_tca_policy declaration to include file
net/sched: Prohibit regrafting ingress or clsact Qdiscs
net/sched: Reserve TC_H_INGRESS (TC_H_CLSACT) for ingress (clsact) Qdiscs
net/sched: sch_clsact: Only create under TC_H_CLSACT
net/sched: sch_ingress: Only create under TC_H_INGRESS
net: selftests: Fix optstring
net: sfp: fix state loss when updating state_hw_mask
net: skb_partial_csum_set() fix against transport header magic value
net/smc: Avoid to access invalid RMBs' MRs in SMCRv1 ADD LINK CONT
net/smc: Don't use RMBs not mapped to new link in SMCRv2 ADD LINK
net/smc: Reset connection when trying to use SMCRv2 fails.
net/smc: Scan from current RMB list when no position specified
net: stmmac: Initialize MAC_ONEUS_TIC_COUNTER register
net: tun: rebuild error handling in tun_get_user
net: usb: qmi_wwan: Set DTR quirk for BroadMobi BM818
net: wwan: iosm: fix NULL pointer dereference when removing device
net: wwan: t7xx: Ensure init is completed before system sleep
nfsd: fix double fget() bug in __write_ports_addfd()
nfsd: make a copy of struct iattr before calling notify_change
nilfs2: fix use-after-free bug of nilfs_root in nilfs_evict_inode()
null_blk: Always check queue mode setting from configfs
nvme: do not let the user delete a ctrl before a complete initialization
nvme: fix the name of Zone Append for verbose logging
nvme-multipath: don't call blk_mark_disk_dead in nvme_mpath_remove_disk
nvme-pci: add NVME_QUIRK_BOGUS_NID for HS-SSD-FUTURE 2048G
nvme-pci: add quirk for missing secondary temperature thresholds
nvme-pci: Add quirk for Teamgroup MP33 SSD
ocfs2: Switch to security_inode_init_security()
octeontx2-af: Add validation for lmac type
octeontx2-pf: Fix TSOv6 offload
open: return EINVAL for O_DIRECTORY | O_CREAT
optee: fix uninited async notif value
page_pool: fix inconsistency for page_pool_ring_[un]lock()
parisc: Allow to reboot machine after system halt
parisc: Enable LOCKDEP support
parisc: Fix flush_dcache_page() for usage from irq context
parisc: Handle kgdb breakpoints only in kernel context
parisc: Handle kprobes breakpoints only in kernel context
parisc: Replace regular spinlock with spin_trylock on panic path
parisc: Use num_present_cpus() in alternative patching code
perf ftrace latency: Remove unnecessary "--" from --use-nsec option
perf/x86/uncore: Correct the number of CHAs on SPR
phy: amlogic: phy-meson-g12a-mipi-dphy-analog: fix CNTL2_DIF_TX_CTL0 value
phy: qcom-qmp-combo: fix init-count imbalance
phy: qcom-qmp-pcie-msm8996: fix init-count imbalance
phy: st: miphy28lp: use _poll_timeout functions for waits
pinctrl: meson-axg: add missing GPIOA_18 gpio group
platform/mellanox: fix potential race in mlxbf-tmfifo driver
platform/mellanox: mlxbf-pmc: fix sscanf() error checking
platform: Provide a remove callback that returns no value
platform/surface: aggregator: Allow completion work-items to be executed in parallel
platform/surface: aggregator_tabletsw: Add support for book mode in KIP subsystem
platform/x86/amd/pmf: Fix CnQF and auto-mode after resume
platform/x86: hp-wmi: add micmute to hp_wmi_keymap struct
platform/x86: hp-wmi: Fix cast to smaller integer type warning
platform/x86/intel/ifs: Annotate work queue on stack so object debug does not complain
platform/x86: intel_scu_pcidrv: Add back PCI ID for Medfield
platform/x86: ISST: Remove 8 socket limit
platform/x86: Move existing HP drivers to a new hp subdir
platform/x86: x86-android-tablets: Add Acer Iconia One 7 B1-750 data
powerpc/64s/radix: Fix soft dirty tracking
powerpc/iommu: DMA address offset is incorrectly calculated with 2MB TCEs
powerpc/iommu: Incorrect DDW Table is referenced for SR-IOV device
powerpc/iommu: Limit number of TCEs to 512 for H_STUFF_TCE hcall
powerpc/xmon: Use KSYM_NAME_LEN in array size
power: supply: axp288_fuel_gauge: Fix external_power_changed race
power: supply: bq24190: Call power_supply_changed() after updating input current
power: supply: bq25890: Call power_supply_changed() after updating input current or voltage
power: supply: bq25890: Fix external_power_changed race
power: supply: bq27xxx: Add cache parameter to bq27xxx_battery_current_and_status()
power: supply: bq27xxx: After charger plug in/out wait 0.5s for things to stabilize
power: supply: bq27xxx: Ensure power_supply_changed() is called on current sign changes
power: supply: bq27xxx: Fix bq27xxx_battery_update() race condition
power: supply: bq27xxx: Fix I2C IRQ race on remove
power: supply: bq27xxx: Fix poll_interval handling and races on remove
power: supply: bq27xxx: Move bq27xxx_battery_update() down
power: supply: leds: Fix blink to LED on transition
power: supply: mt6360: add a check of devm_work_autocancel in mt6360_charger_probe
power: supply: sbs-charger: Fix INHIBITED bit for Status reg
qed/qede: Fix scheduling while atomic
rbd: get snapshot context after exclusive lock is ensured to be held
rbd: move RBD_OBJ_FLAG_COPYUP_ENABLED flag setting
rcu: Protect rcu_print_task_exp_stall() ->exp_tasks access
RDMA/bnxt_re: Fix a possible memory leak
RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx
RDMA/bnxt_re: Fix the page_size used during the MR creation
RDMA/efa: Fix unsupported page sizes in device
RDMA/hns: Fix base address table allocation
RDMA/hns: Fix timeout attr in query qp for HIP08
RDMA/hns: Modify the value of long message loopback slice
RDMA/irdma: Fix Local Invalidate fencing
RDMA/irdma: Prevent QP use after free
RDMA/rxe: Fix the error "trying to register non-static key in rxe_cleanup_task"
recordmcount: Fix memory leaks in the uwrite function
refscale: Move shutdown from wait_event() to wait_event_idle()
regmap: Account for register length when chunking
regmap: cache: Return error in cache sync operations for REGCACHE_NONE
regulator: mt6359: add read check for PMIC MT6359
regulator: pca9450: Fix BUCK2 enable_mask
remoteproc: imx_dsp_rproc: Add custom memory copy implementation for i.MX DSP Cores
remoteproc: imx_dsp_rproc: Fix kernel test robot sparse warning
remoteproc: stm32_rproc: Add mutex protection for workqueue
rethook, fprobe: do not trace rethook related functions
rethook: use preempt_{disable, enable}_notrace in rethook_trampoline_handler
Revert "android: binder: stop saving a pointer to the VMA"
Revert "binder_alloc: add missing mmap_lock calls when using the VMA"
Revert "ext4: don't clear SB_RDONLY when remounting r/w until quota is re-enabled"
Revert "Fix XFRM-I support for nested ESP tunnels"
Revert "staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE"
Revert "thermal/drivers/mellanox: Use generic thermal_zone_get_trip() function"
Revert "usb: gadget: udc: core: Invoke usb_gadget_connect only when started"
Revert "usb: gadget: udc: core: Prevent redundant calls to pullup"
rfs: annotate lockless accesses to RFS sock flow table
rfs: annotate lockless accesses to sk->sk_rxhash
riscv: fix kprobe __user string arg print fault issue
riscv: Fix unused variable warning when BUILTIN_DTB is set
riscv: mm: Ensure prot of VM_WRITE and VM_EXEC must be readable
riscv: perf: Fix callchain parse error with kernel tracepoint events
rtnetlink: call validate_linkmsg in rtnl_create_link
s390/cio: include subchannels without devices also for evaluation
s390/crypto: use vector instructions only if available for ChaCha20
s390/dasd: fix command reject error on ESE devices
s390/dasd: Use correct lock while counting channel queue length
s390/pkey: zeroize key blobs
s390/qdio: fix do_sqbs() inline assembly constraint
s390/topology: honour nr_cpu_ids when adding CPUs
samples/bpf: Fix fout leak in hbm's run_bpf_prog
sched: Fix KCSAN noinstr violation
scsi: core: Decrease scsi_device's iorequest_cnt if dispatch failed
scsi: lpfc: Correct used_rpi count when devloss tmo fires with no recovery
scsi: lpfc: Prevent lpfc_debugfs_lockstat_write() buffer overflow
scsi: megaraid_sas: Add flexible array member for SGLs
scsi: message: mptlan: Fix use after free bug in mptlan_remove() due to race condition
scsi: stex: Fix gcc 13 warnings
scsi: storvsc: Don't pass unused PFNs to Hyper-V host
scsi: target: iscsit: Free cmds before session free
scsi: ufs: core: Fix I/O hang that occurs when BKOPS fails in W-LUN suspend
scsi: ufs: ufs-pci: Add support for Intel Lunar Lake
sctp: fix an issue that plpmtu can never go to complete state
selftests/bpf: Fix pkg-config call building sign-file
selftests/bpf: Fix sockopt_sk selftest
selftests/bpf: Verify optval=NULL case
selftests: cgroup: Add 'malloc' failures checks in test_memcontrol
selftests: fib_tests: mute cleanup error message
selftests/memfd: Fix unknown type name build failure
selftests: mptcp: connect: skip if MPTCP is not supported
selftests: mptcp: diag: skip if MPTCP is not supported
selftests: mptcp: join: avoid using 'cmp --bytes'
selftests: mptcp: join: skip if MPTCP is not supported
selftests: mptcp: pm nl: skip if MPTCP is not supported
selftests: mptcp: simult flows: skip if MPTCP is not supported
selftests: mptcp: sockopt: skip if MPTCP is not supported
selftests: mptcp: update userspace pm addr tests
selftests: mptcp: update userspace pm subflow tests
selftests: mptcp: userspace pm: skip if MPTCP is not supported
selftests: seg6: disable DAD on IPv6 router cfg for srv6_end_dt4_l3vpn_test
selftets: seg6: disable rp_filter by default in srv6_end_dt4_l3vpn_test
selinux: don't use make's grouped targets feature yet
serial: 8250_bcm7271: balance clk_enable calls
serial: 8250_bcm7271: fix leak in `brcmuart_probe`
serial: 8250_exar: Add support for USR298x PCI Modems
serial: 8250: Reinit port->pm on port specific driver unbind
serial: 8250_tegra: Fix an error handling path in tegra_uart_probe()
serial: Add support for Advantech PCI-1611U card
serial: arc_uart: fix of_iomap leak in `arc_serial_probe`
serial: cpm_uart: Fix a COMPILE_TEST dependency
serial: qcom-geni: fix enabling deactivated interrupt
sfc: disable RXFCS and RXALL features by default
skbuff: Proactively round up to kmalloc bucket size
SMB3: Close all deferred handles of inode in case of handle lease break
SMB3: drop reference to cfile before sending oplock break
soc: qcom: icc-bwmon: fix incorrect error code passed to dev_err_probe()
soundwire: bus: Fix unbalanced pm_runtime_put() causing usage count underflow
soundwire: dmi-quirks: add remapping for Intel 'Rooks County' NUC M15
soundwire: qcom: gracefully handle too many ports in DT
soundwire: stream: Add missing clear of alloc_slave_rt
spi: mt65xx: make sure operations completed before unloading
spi: qup: Request DMA before enabling clocks
spi: spi-imx: fix MX51_ECSPI_* macros when cs > 3
staging: axis-fifo: initialize timeouts in init only
staging: rtl8192e: Replace macro RTL_PCI_DEVICE with PCI_DEVICE
statfs: enforce statfs[64] structure initialization
SUNRPC: always free ctxt when freeing deferred request
SUNRPC: Don't change task->tk_status after the call to rpc_exit_task
SUNRPC: double free xprt_ctxt while still in use
SUNRPC: Fix trace_svc_register() call site
tcp: add annotations around sk->sk_shutdown accesses
tcp: deny tcp_disconnect() when threads are waiting
tcp: fix mishandling when the sack compression is deferred.
tcp: fix possible sk_priority leak in tcp_v4_send_reset()
tcp: gso: really support BIG TCP
tcp: Return user_mss for TCP_MAXSEG in CLOSE/LISTEN state if user_mss set
tee: amdtee: Add return_origin to 'struct tee_cmd_load_ta'
test_firmware: fix a memory leak with reqs buffer
test_firmware: fix the memory leak of the allocated firmware buffer
thunderbolt: Clear registers properly when auto clear isn't in use
tick/broadcast: Make broadcast device replacement work correctly
tipc: add tipc_bearer_min_mtu to calculate min mtu
tipc: check the bearer min mtu properly when setting it by netlink
tipc: do not update mtu if msg_max is too small in mtu negotiation
tls: improve lockless access safety of tls_err_abort()
tls: rx: device: fix checking decryption status
tls: rx: strp: don't use GFP_KERNEL in softirq context
tls: rx: strp: factor out copying skb data
tls: rx: strp: fix determining record length in copy mode
tls: rx: strp: force mixed decrypted records into copy mode
tls: rx: strp: preserve decryption status of skbs when needed
tls: rx: strp: set the skb->len of detached / CoW'ed skbs
tools headers UAPI: Sync the linux/in.h with the kernel sources
tpm: Prevent hwrng from activating during resume
tpm: Re-enable TPM chip boostrapping non-tpm_tis TPM drivers
tpm_tis: Use tpm_chip_{start,stop} decoration inside tpm_tis_resume
tpm, tpm_tis: Avoid cache incoherency in test for interrupts
tpm, tpm_tis: correct tpm_tis_flags enumeration values
tpm/tpm_tis: Disable interrupts for more Lenovo devices
tpm, tpm_tis: Only handle supported interrupts
tpm, tpm_tis: Request threaded interrupt handler
tpm, tpm_tis: startup chip before testing for interrupts
tracing/histograms: Allow variables to have some modifiers
tracing/probe: trace_probe_primary_from_call(): checked list_first_entry
tracing/timerlat: Always wakeup the timerlat thread
tty: serial: fsl_lpuart: use UARTCTRL_TXINV to send break instead of UARTCTRL_SBK
tun: Fix memory leak for detached NAPI queue.
ublk: fix AB-BA lockdep warning
udp6: Fix race condition in udp6_sendmsg & connect
udplite: Fix NULL pointer dereference in __sk_mem_raise_allocated().
um: harddog: fix modular build
usb: cdns3: fix NCM gadget RX speed 20x slow than expection at iMX8QM
USB: core: Add routines for endpoint checks in old drivers
usb: dwc3: debugfs: Resume dwc3 before accessing registers
usb: dwc3: fix gadget mode suspend interrupt handler issue
usb: dwc3: gadget: Improve dwc3_gadget_suspend() and dwc3_gadget_resume()
usb: gadget: f_fs: Add unbind event before functionfs_unbind
usb: gadget: u_ether: Fix host MAC address case
USB: sisusbvga: Add endpoint checks
usb-storage: fix deadlock when a scsi command timeouts more than once
usb: typec: altmodes/displayport: fix pin_assignment_show
usb: typec: tcpm: fix multiple times discover svids error
usb: typec: ucsi: acpi: add quirk for ASUS Zenbook UM325
USB: UHCI: adjust zhaoxin UHCI controllers OverCurrent bit value
usb: usbfs: Enforce page requirements for mmap
usb: usbfs: Use consistent mmap functions
USB: usbtmc: Fix direction for 0-length ioctl control messages
vc_screen: reload load of struct vc_data pointer in vcs_write() to avoid UAF
vduse: avoid empty string for dev name
vfio/type1: check pfn valid before converting to struct page
vhost: support PACKED when setting-getting vring_base
vhost_vdpa: support PACKED when setting-getting vring_base
virtio_net: Fix error unwinding of XDP initialization
virtio-net: Maintain reverse cleanup order
virtio_net: use control_buf for coalesce params
vlan: fix a potential uninit-value in vlan_dev_hard_start_xmit()
vsock: avoid to close connected socket after the timeout
watchdog: menz069_wdt: fix watchdog initialisation
watchdog: sp5100_tco: Immediately trigger upon starting.
wifi: ath11k: Fix SKB corruption in REO destination ring
wifi: ath11k: Ignore frags from uninitialized peer in dp.
wifi: ath: Silence memcpy run-time false positive warning
wifi: b43: fix incorrect __packed annotation
wifi: brcmfmac: cfg80211: Pass the PMK in binary instead of hex
wifi: brcmfmac: pcie: Provide a buffer of random bytes to the device
wifi: cfg80211: Drop entries with invalid BSSIDs in RNR
wifi: cfg80211: fix locking in sched scan stop work
wifi: cfg80211: reject bad AP MLD address
wifi: iwlwifi: add a new PCI device ID for BZ device
wifi: iwlwifi: dvm: Fix memcpy: detected field-spanning write backtrace
wifi: iwlwifi: fix iwl_mvm_max_amsdu_size() for MLO
wifi: iwlwifi: fix OEM's name in the ppag approved list
wifi: iwlwifi: fw: fix DBGI dump
wifi: iwlwifi: mvm: Add locking to the rate read flow
wifi: iwlwifi: mvm: don't trust firmware n_channels
wifi: iwlwifi: mvm: fix cancel_delayed_work_sync() deadlock
wifi: iwlwifi: mvm: fix OEM's name in the tas approved list
wifi: iwlwifi: mvm: fix potential memory leak
wifi: iwlwifi: mvm: fix ptk_pn memory leak
wifi: iwlwifi: mvm: Fix -Warray-bounds bug in iwl_mvm_wait_d3_notif()
wifi: iwlwifi: mvm: support wowlan info notification version 2
wifi: iwlwifi: pcie: Fix integer overflow in iwl_write_to_user_buf
wifi: iwlwifi: pcie: fix possible NULL pointer dereference
wifi: mac80211: Abort running color change when stopping the AP
wifi: mac80211: consider reserved chanctx for mindef
wifi: mac80211: don't translate beacon/presp addrs
wifi: mac80211: fix min center freq offset tracing
wifi: mac80211: fortify the spinlock against deadlock by interrupt
wifi: mac80211: mlme: fix non-inheritence element
wifi: mac80211: recalc chanctx mindef before assigning
wifi: mac80211: simplify chanctx allocation
wifi: mac80211: use correct iftype HE cap
wifi: mt76: connac: fix stats->tx_bytes calculation
wifi: mt76: mt7615: fix possible race in mt7615_mac_sta_poll
wifi: rtl8xxxu: fix authentication timeout due to incorrect RCR value
wifi: rtw88: correct PS calculation for SUPPORTS_DYNAMIC_PS
wifi: rtw88: use work to update rate to avoid RCU warning
wifi: rtw89: correct 5 MHz mask setting
wifi: rtw89: correct PS calculation for SUPPORTS_DYNAMIC_PS
x86/mm: Avoid incomplete Global INVLPG flushes
x86/mtrr: Revert 90b926e68f50 ("x86/pat: Fix pat_x_mtrr_type() for MTRR disabled case")
x86/pci/xen: populate MSI sysfs entries
x86/show_trace_log_lvl: Ensure stack pointer is aligned, again
x86/topology: Fix erroneous smp_num_siblings on Intel Hybrid platforms
xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()
xfrm: Check if_id in inbound policy/secpath match
xfrm: don't check the default policy if the policy allows the packet
xfrm: Reject optional tunnel/BEET mode templates in outbound policies
xfs: verify buffer contents when we skip log replay
xhci: Fix incorrect tracking of free space on transfer rings
xhci-pci: Only run d3cold avoidance quirk for s2idle
xtensa: add __bswap{si,di}2 helpers
xtensa: fix signal delivery to FDPIC process

Updated by kernel-updater-bot (https://abf.io/mikhailnov/kernel-updater-bot)
2023-06-14 20:00:20 +03:00

1815 lines
65 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 6
%define patchlevel 1
%define sublevel 34
# 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
# Build binary out-of-tree kernel modules (experimental)
%bcond_without binary_extra_modules
# Sign kernel modules with GOST key (experimental)
%bcond_without gost_sign
%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
# 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 0
# Build perf and cpupower tools
%define build_perf 1
%define build_cpupower 1
%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
ExclusiveArch: %{x86_64} %{ix86} aarch64
####################################################################
#
# Sources
#
#Source0: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz
Source0: https://github.com/torvalds/linux/archive/refs/tags/v6.1.tar.gz?/linux-6.1.tar.gz
# 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
# ROSA-specific patches
Patch2: kernel-5.10.93-fix-perf-build.patch
# Keep in sync with patch in r8168
Patch3: 0001-r8169-remove-devices-supported-by-r8168.patch
# 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}
# https://github.com/sfjro/aufs-linux/compare/830b3c68c1fb1e9176028d02ef86f3cf76aa2476..834d19786ccd95485e397fc0f36ef7d6c3b04c95.diff
Patch103: aufs-6.1.diff
%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
# Allow to off modules signature check dynamically
Patch306: 0001-ROSA-ima-allow-to-off-modules-signature-check-dynami.patch
# Support sound on notebook Aquarius NS685U R11 (https://linux-hardware.org/?probe=339dc3db60)
Patch0401: 0401-ASoC-es8316-Use-increased-GPIO-debounce-time.patch
Patch0402: 0402-ASoC-Intel-sof_es8336-Add-more-quirks-for-Russian-ha.patch
Patch0403: 0403-ASoC-Intel-sof_es8336-Add-a-quirk-for-Aquarius-NS685.patch
# Support Baikal-M (aarch64)
# From https://github.com/asheplyakov/linux/commits/baikalm-6.1.y
Patch0600: 0600-clk-added-Baikal-M-clock-management-unit-driver.patch
Patch0601: 0601-cpufreq-dt-don-t-load-on-Baikal-M-SoC.patch
Patch0602: 0602-serial-8250_dw-verify-clock-rate-in-dw8250_set_termi.patch
Patch0603: 0603-usb-dwc3-of-simple-added-compatible-string-for-Baika.patch
Patch0604: 0604-dw-pcie-refuse-to-load-on-Baikal-M-with-recent-firmw.patch
Patch0605: 0605-arm64-Enable-armv8-based-Baikal-M-SoC-support.patch
Patch0606: 0606-efi-rtc-avoid-calling-efi.get_time-on-Baikal-M-SoC.patch
Patch0607: 0607-arm64-stub-fixed-secondary-cores-boot-on-Baikal-M-So.patch
Patch0608: 0608-pm-disable-all-sleep-states-on-Baikal-M-based-boards.patch
Patch0609: 0609-net-fwnode_get_phy_id-consider-all-compatible-string.patch
Patch0610: 0610-net-stmmac-inital-support-of-Baikal-T1-M-SoCs-GMAC.patch
Patch0611: 0611-dt-bindings-dwmac-Add-bindings-for-Baikal-T1-M-SoCs.patch
Patch0612: 0612-net-dwmac-baikal-added-compatible-strings.patch
Patch0613: 0613-Added-TF307-TF306-board-management-controller-driver.patch
Patch0614: 0614-hwmon-bt1-pvt-access-registers-via-pvt_-readl-writel.patch
Patch0615: 0615-hwmon-bt1-pvt-define-pvt_readl-pvt_writel-for-Baikal.patch
Patch0616: 0616-hwmon-bt1-pvt-adjusted-probing-for-Baikal-M-SoC.patch
Patch0617: 0617-hwmon-bt1-pvt-added-compatible-baikal-pvt.patch
Patch0618: 0618-drm-new-bridge-driver-stdp4028.patch
Patch0619: 0619-drm-added-Baikal-M-SoC-video-display-unit-driver.patch
Patch0620: 0620-drm-bridge-dw-hdmi-support-ahb-audio-hw-revision-0x2.patch
Patch0621: 0621-dt-bindings-dw-hdmi-added-ahb-audio-regshift.patch
Patch0622: 0622-drm-bridge-dw-hdmi-force-ahb-audio-register-offset-f.patch
Patch0623: 0623-drm-panfrost-forcibly-set-dma-coherent-on-Baikal-M.patch
Patch0624: 0624-drm-panfrost-disable-devfreq-on-Baikal-M.patch
Patch0625: 0625-ALSA-hda-Baikal-M-support.patch
Patch0626: 0626-PCI-pcie-baikal-driver-for-Baikal-M-with-new-firmwar.patch
Patch0627: 0627-BROKEN-dwc-i2s-support-Baikal-M-SoC.patch
Patch0628: 0628-input-added-TF307-serio-PS-2-emulator-driver.patch
Patch0629: 0629-input-new-driver-serdev-serio.patch
Patch0630: 0630-phy-realtek-leds-configuration-for-RTL8211f.patch
Patch0631: 0631-arm64-defconfig-for-Baikal-M-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: 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
BuildRequires: pkgconfig(libelf)
%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: elfutils-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)
BuildRequires: python3-setuptools
%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-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-rtl8188gu
BuildRequires: kernel-source-rtl8723du
BuildRequires: kernel-source-rtl8852au
BuildRequires: kernel-source-rtl8192du
BuildRequires: kernel-source-rtw89
BuildRequires: kernel-source-r8168
# 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)
# not blob, support of devices supported by r8168 is removed from r8169
Recommends: %{ksob_module_pkg_name r8168} = %{EVRD}
# 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}
%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/8188gu.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/drivers/net/ethernet/realtek/r8168.ko%{kmod_suffix}
%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}
%{_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 %{_libexecdir}/perf-core
%dir %{_libdir}/traceevent
%dir %{_libdir}/traceevent/plugins
%{_libdir}/libperf-jvmti.so
%{_libdir}/traceevent/plugins/*
%{_libexecdir}/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 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 8188gu -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_module_pkg -n r8168 -s drivers/net/ethernet/realtek
%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: %ksob_module_pkg_name vboxnetflt
Requires: %ksob_module_pkg_name vboxnetadp
Requires: %ksob_module_pkg_name vboxdrv
Requires: %ksob_module_pkg_name vboxpci
%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
grep -Irl '^#!/usr/bin/env python' | xargs sed -i '1 s,^#!/usr/bin/env python$,#!%{__python3},'
# Drop env from bash scripts
sed -i '1 s,^#!.*env .*,#!%{_bindir}/bash,' scripts/config
# Drop env from perl scripts
grep -IrlE '^#!.*env perl' | xargs sed -i -e '1 s,^#!/usr/bin/env perl$,#!{_bindir}/perl,'
############################################################################
%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 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 8188gu 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/r8168-%%{VERSION}-%%{RELEASE}" kernel-source-r8168)" kernel-source-r8168
pushd kernel-source-r8168
%kmake -C %{src_dir} KERNELRELEASE=%{kver_full} KERNELDIR=%{src_dir} M="$PWD" modules
mkdir -p %{temp_modules}/%{kver_full}/kernel/drivers/net/ethernet/realtek
cp r8168.ko %{temp_modules}/%{kver_full}/kernel/drivers/net/ethernet/realtek
popd
rm -fr kernel-source-r8168
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
_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* %{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}%{_libexecdir}/perf-core/scripts/python/exported-sql-viewer.py \
%{buildroot}%{_libexecdir}/perf-core/scripts/python/libxed.py
sed -i -e '1s,^#!/usr/bin/python$,#!%{__python3},' \
%{buildroot}%{_libexecdir}/perf-core/tests/shell/lib/perf_json_output_lint.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