2019-11-12 02:06:06 +03:00
|
|
|
# _get_email() in %%build contains bashisms for regexping
|
2022-03-09 19:02:02 +01:00
|
|
|
%define _buildshell /bin/bash
|
2019-11-12 02:06:06 +03:00
|
|
|
|
2020-05-11 09:35:25 +03:00
|
|
|
# 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
|
2022-03-09 19:02:02 +01:00
|
|
|
%define _python_bytecompile_build 0
|
2020-05-11 09:35:25 +03:00
|
|
|
|
2020-06-19 23:42:50 +03:00
|
|
|
# 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.
|
2022-03-09 19:02:02 +01:00
|
|
|
%global _find_debuginfo_dwz_opts %{nil}
|
2020-06-19 23:42:50 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
# 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.
|
2022-03-09 19:02:02 +01:00
|
|
|
%global _debuginfo_subpackages %{nil}
|
|
|
|
%global _debuginfo_template %{nil}
|
|
|
|
%undefine _debugsource_packages
|
2021-05-03 15:56:13 +03:00
|
|
|
|
2023-02-08 15:54:13 +03:00
|
|
|
# Avoid rediffing patches like AUFS when possible
|
|
|
|
%define _default_patch_fuzz 10
|
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
# Hack: flavour and major version are variable, make %%_build_pkgcheck_* always detect and use this config
|
2022-03-09 19:02:02 +01:00
|
|
|
%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,')
|
2021-05-03 15:56:13 +03:00
|
|
|
|
2022-11-07 03:13:34 +03:00
|
|
|
%define kernelversion 6
|
|
|
|
%define patchlevel 1
|
[bot] upd: 6.1.4 -> 6.1.10
Changelog:
9p/client: fix data race on req->status
ACPI: Fix selecting wrong ACPI fwnode for the iGPU on some Dell laptops
acpi: Fix suspend with Xen PV
ACPI: PRM: Check whether EFI runtime is available
ACPI: resource: Skip IRQ override on Asus Expertbook B2402CBA
ACPI: video: Add backlight=native DMI quirk for Acer Aspire 4810T
ACPI: video: Add backlight=native DMI quirk for Asus U46E
ACPI: video: Add backlight=native DMI quirk for HP EliteBook 8460p
ACPI: video: Add backlight=native DMI quirk for HP Pavilion g6-1d80nr
ACPI: video: Allow GPU drivers to report no panels
ACPI: video: Allow selecting NVidia-WMI-EC or Apple GMUX backlight from the cmdline
ACPI: video: Don't enable fallback path for creating ACPI backlight by default
ACPI: video: Fix apple gmux detection
Add exception protection processing for vd in axi_chan_handle_err function
affs: initialize fsdata in affs_truncate()
af_unix: selftest: Fix the size of the parameter to connect()
ALSA: control-led: use strscpy in set_led_id()
ALSA: hda: cs35l41: Check runtime suspend capability at runtime_idle
ALSA: hda: cs35l41: Don't return -EINVAL from system suspend/resume
ALSA: hda - Enable headset mic on another Dell laptop with ALC3254
ALSA: hda/hdmi: Add a HP device 0x8715 to force connect list
ALSA: hda/realtek: Enable mute/micmute LEDs on HP Spectre x360 13-aw0xxx
ALSA: hda/realtek: fix mute/micmute LEDs don't work for a HP platform
ALSA: hda/realtek - Turn on power early
ALSA: pcm: Move rwsem lock inside snd_ctl_elem_read to prevent UAF
ALSA: usb-audio: Always initialize fixed_rate in snd_usb_find_implicit_fb_sync_format()
ALSA: usb-audio: Fix possible NULL pointer dereference in snd_usb_pcm_has_fixed_rate()
ALSA: usb-audio: Make sure to stop endpoints before closing EPs
ALSA: usb-audio: Relax hw constraints for implicit fb sync
amdgpu: fix build on non-DCN platforms.
amd-xgbe: Delay AN timeout during KR training
amd-xgbe: TX Flow Ctrl Registers are h/w ver dependent
arm64: cmpxchg_double*: hazard against entire exchange variable
arm64: dts: freescale: Fix pca954x i2c-mux node names
arm64: dts: imx8mm-beacon: Fix ecspi2 pinmux
arm64: dts: imx8mm-venice-gw7901: fix USB2 controller OC polarity
arm64: dts: imx8mp: correct usb clocks
arm64: dts: imx8mp-evk: pcie0-refclk cosmetic cleanup
arm64: dts: imx8mp: Fix missing GPC Interrupt
arm64: dts: imx8mp: Fix power-domain typo
arm64: dts: imx8mp-phycore-som: Remove invalid PMIC property
arm64: dts: imx8mq-thor96: fix no-mmc property for SDHCI
arm64: dts: imx93-11x11-evk: correct clock and strobe pad setting
arm64: dts: marvell: AC5/AC5X: Fix address for UART1
arm64: dts: msm8994-angler: fix the memory map
arm64: dts: qcom: msm8992: Don't use sfpb mutex
arm64: dts: qcom: msm8992-libra: Fix the memory map
arm64: dts: qcom: sc8280xp: fix primary USB-DP PHY reset
arm64: dts: verdin-imx8mm: fix dahlia audio playback
arm64: dts: verdin-imx8mm: fix dev board audio playback
arm64: efi: Account for the EFI runtime stack in stack unwinder
arm64: efi: Avoid workqueue to check whether EFI runtime is live
arm64: efi: Execute runtime services from a dedicated stack
arm64: efi: Recover from synchronous exceptions occurring in firmware
arm64/mm: add pud_user_exec() check in pud_user_accessible_page()
arm64/mm: fix incorrect file_map_count for invalid pmd
arm64: mte: Avoid the racy walk of the vma list during core dump
arm64: mte: Fix double-freeing of the temporary tag storage during coredump
arm64: ptrace: Use ARM64_SME to guard the SME register enumerations
arm64/signal: Always accept SVE signal frames on SME only systems
arm64/signal: Always allocate SVE signal frames on SME only systems
ARM: 9280/1: mm: fix warning on phys_addr_t to void pointer assignment
ARM: dts: at91: sam9x60: fix the ddr clock for sam9x60
ARM: dts: imx6qdl-gw560x: Remove incorrect 'uart-has-rtscts'
ARM: dts: imx6ul-pico-dwarf: Use 'clock-frequency'
ARM: dts: imx7d-pico: Use 'clock-frequency'
ARM: dts: imx: Fix pca9547 i2c-mux node name
ARM: dts: qcom: apq8084-ifc6540: fix overriding SDHCI
ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp151a-prtt1l
ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp157c-emstamp-argon
ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp15xx-dhcom-som
ARM: dts: stm32: Fix qspi pinctrl phandle for stm32mp15xx-dhcor-som
ARM: dts: vf610: Fix pca9548 i2c-mux node names
ARM: imx: add missing of_node_put()
ARM: omap1: fix !ARCH_OMAP1_ANY link failures
ARM: omap1: fix building gpio15xx
ARM: renumber bits related to _TIF_WORK_MASK
ASoC: amd: yc: Add ASUS M5402RA into DMI table
ASoC: amd: yc: Add Razer Blade 14 2022 into DMI table
ASoC: fsl-asoc-card: Fix naming of AC'97 CODEC widgets
ASoC: fsl_micfil: Correct the number of steps on SX controls
ASoC: fsl_ssi: Rename AC'97 streams to avoid collisions with AC'97 CODEC
ASoC: Intel: bytcr_rt5640: Add quirk for the Advantech MICA-071 tablet
ASoC: Intel: fix sof-nau8825 link failure
ASoC: Intel: sof-nau8825: fix module alias overflow
ASoC: Intel: sof_nau8825: support rt1015p speaker amplifier
ASoC: mediatek: mt8186: Add machine support for max98357a
ASoC: mediatek: mt8186: support rt5682s_max98360
ASoC: qcom: Fix building APQ8016 machine driver without SOUNDWIRE
ASoC: qcom: lpass-cpu: Fix fallback SD line index handling
ASoC: rt9120: Make dev PM runtime bind AsoC component PM
ASoC: SOF: Add FW state to debugfs
ASoC: SOF: Intel: pci-tgl: unblock S5 entry if DMA stop has failed"
ASoC: SOF: mediatek: initialize panic_info to zero
ASoC: SOF: pm: Always tear down pipelines before DSP suspend
ASoC: SOF: pm: Set target state earlier
ASoC: SOF: Revert: "core: unregister clients and machine drivers in .shutdown"
ASoC: support machine driver with max98360
ASoC: wm8904: fix wrong outputs volume after power reactivation
ata: pata_cs5535: Don't build on UML
blk-cgroup: fix missing pd_online_fn() while activating policy
block: don't allow splitting of a REQ_NOWAIT bio
block: fix hctx checks for batch allocation
block: handle bio_split_to_limits() NULL return
block: mq-deadline: Rename deadline_is_seq_writes()
block/rnbd-clt: fix wrong max ID in ida_alloc_max
block: ublk: move ublk_chr_class destroying after devices are removed
Bluetooth: Fix a buffer overflow in mgmt_mesh_add()
Bluetooth: Fix possible deadlock in rfcomm_sk_state_change
Bluetooth: hci_conn: Fix memory leaks
Bluetooth: hci_event: Fix Invalid wait context
Bluetooth: hci_qca: Fix driver shutdown on closed serdev
Bluetooth: hci_sync: cancel cmd_timer if hci_open failed
Bluetooth: hci_sync: fix memory leak in hci_update_adv_data()
Bluetooth: hci_sync: Fix use HCI_OP_LE_READ_BUFFER_SIZE_V2
Bluetooth: ISO: Avoid circular locking dependency
Bluetooth: ISO: Fix possible circular locking dependency
bnxt: Do not read past the end of test names
bnxt_en: Fix first buffer size calculations for XDP multi-buffer
bnxt_en: Fix HDS and jumbo thresholds for RX packets
bnxt_en: Fix XDP RX path
bnxt_en: Simplify bnxt_xdp_buff_init()
bnxt: make sure we return pages to the pool
bonding: fix lockdep splat in bond_miimon_commit()
bpf: Always use maximal size for copy_array()
bpf: Fix panic due to wrong pageattr of im->image
bpf: Fix pointer-leak due to insufficient speculative store bypass mitigation
bpf: hash map, avoid deadlock with suitable hash mask
bpf: keep a reference to the mm, in case the task is dead.
bpf: pull before calling skb_postpull_rcsum()
bpf: restore the ebpf program ID for BPF_AUDIT_UNLOAD and PERF_BPF_EVENT_PROG_UNLOAD
bpf: Skip task with pid=1 in send_signal_common()
brcmfmac: Prefer DT board type over DMI board type
btrfs: add extra error messages to cover non-ENOMEM errors from device_add_list()
btrfs: add missing setup of log for full commit at add_conflicting_inode()
btrfs: always report error in run_one_delayed_ref()
btrfs: do not abort transaction on failure to update log root
btrfs: do not abort transaction on failure to write log tree when syncing log
btrfs: fix an error handling path in btrfs_defrag_leaves()
btrfs: fix compat_ro checks against remount
btrfs: fix directory logging due to race with concurrent index key deletion
btrfs: fix invalid leaf access due to inline extent during lseek
btrfs: fix missing error handling when logging directory items
btrfs: fix off-by-one in delalloc search during lseek
btrfs: fix race between quota rescan and disable leading to NULL pointer deref
btrfs: fix trace event name typo for FLUSH_DELAYED_REFS
btrfs: handle case when repair happens with dev-replace
btrfs: qgroup: do not warn on record without old_roots populated
btrfs: replace strncpy() with strscpy()
btrfs: zoned: enable metadata over-commit for non-ZNS setup
caif: fix memory leak in cfctrl_linkup_request()
ceph: switch to vfs_inode_has_locks() to fix file lock bug
cifs: do not include page data when checking signature
cifs: do not query ifaces on smb1 mounts
cifs: fix double free on failed kerberos auth
cifs: fix file info setting in cifs_open_file()
cifs: fix file info setting in cifs_query_path_info()
cifs: fix interface count calculation during refresh
cifs: Fix oops due to uncleared server->smbd_conn in reconnect
cifs: fix potential deadlock in cache_refresh_path()
cifs: fix potential memory leaks in session setup
cifs: fix race in assemble_neg_contexts()
cifs: fix return of uninitialized rc in dfs_cache_update_tgthint()
cifs: Fix uninitialized memory read for smb311 posix symlink create
cifs: reduce roundtrips on create/qinfo requests
cifs: refcount only the selected iface during interface update
comedi: adv_pci1760: Fix PWM instruction handling
cpufreq: Add SM6375 to cpufreq-dt-platdev blocklist
cpufreq: Add Tegra234 to cpufreq-dt-platdev blocklist
cpufreq: amd-pstate: fix kernel hang issue while amd-pstate unregistering
cpufreq: armada-37xx: stop using 0 as NULL pointer
cpufreq: CPPC: Add u64 casts to avoid overflowing
device property: fix of node refcount leak in fwnode_graph_get_next_endpoint()
dma-buf: fix dma_buf_export init order v2
dmaengine: Fix double increment of client_count in dma_chan_get()
dmaengine: idxd: Do not call DMX TX callbacks during workqueue disable
dmaengine: idxd: Let probe fail when workqueue cannot be enabled
dmaengine: idxd: Prevent use after free on completion memory
dmaengine: imx-sdma: Fix a possible memory leak in sdma_transfer_init
dmaengine: lgm: Move DT parsing after initialization
dmaengine: qcom: gpi: Set link_rx bit on GO TRE for rx operation
dmaengine: tegra210-adma: fix global intr clear
dmaengine: tegra: Fix memory leak in terminate_all()
dmaengine: ti: k3-udma: Do conditional decrement of UDMA_CHAN_RT_PEER_BCNT_REG
dmaengine: xilinx_dma: call of_node_put() when breaking out of for_each_child_of_node()
docs: Fix path paste-o for /sys/kernel/warn_count
docs: Fix the docs build with Sphinx 6.0
driver core: Fix test_async_probe_init saves device in wrong array
drivers/net/bonding/bond_3ad: return when there's no aggregator
drm: Add orientation quirk for Lenovo ideapad D330-10IGL
drm/amd: Delay removal of the firmware framebuffer
drm/amd/display: Add check for DET fetch latency hiding for dcn32
drm/amd/display: Calculate output_color_space after pixel encoding adjustment
drm/amd/display: disable S/G display on DCN 3.1.4
drm/amd/display: disable S/G display on DCN 3.1.5
drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix
drm/amd/display: fix issues with driver unload
drm/amd/display: Fix set scaling doesn's work
drm/amd/display: move remaining FPU code to dml folder
drm/amd/display: Report to ACPI video if no panels were found
drm/amd/display: Uninitialized variables causing 4k60 UCLK to stay at DPM1 and not DPM0
drm/amdgpu: add gfx support for GC 11.0.4
drm/amdgpu: add gmc v11 support for GC 11.0.4
drm/amdgpu: add smu 13 support for smu 13.0.11
drm/amdgpu: add soc21 common ip block support for GC 11.0.4
drm/amdgpu: add tmz support for GC 11.0.1
drm/amdgpu: add tmz support for GC IP v11.0.4
drm/amdgpu: allow multipipe policy on ASICs with one MEC
drm/amdgpu: complete gfxoff allow signal during suspend without delay
drm/amdgpu: correct MEC number for gfx11 APUs
drm/amdgpu: Correct the power calcultion for Renior/Cezanne.
drm/amdgpu/discovery: add PSP IP v13.0.11 support
drm/amdgpu/discovery: enable gfx v11 for GC 11.0.4
drm/amdgpu/discovery: enable gmc v11 for GC 11.0.4
drm/amdgpu/discovery: enable mes support for GC v11.0.4
drm/amdgpu/discovery: enable nbio support for NBIO v7.7.1
drm/amdgpu/discovery: enable soc21 common for GC 11.0.4
drm/amdgpu/discovery: set the APU flag for GC 11.0.4
drm/amdgpu/display/mst: Fix mst_state->pbn_div and slot count assignments
drm/amdgpu/display/mst: limit payload to be updated one by one
drm/amdgpu/display/mst: update mst_mgr relevant variable when long HPD
drm/amdgpu: enable GFX Clock Gating control for GC IP v11.0.4
drm/amdgpu: enable GFX IP v11.0.4 CG support
drm/amdgpu: enable GFX Power Gating for GC IP v11.0.4
drm/amdgpu: Enable pg/cg flags on GC11_0_4 for VCN
drm/amdgpu: enable PSP IP v13.0.11 support
drm/amdgpu: enable VCN DPG for GC IP v11.0.4
drm/amdgpu: fix amdgpu_job_free_resources v2
drm/amdgpu: Fixed bug on error when unloading amdgpu
drm/amdgpu: Fix potential NULL dereference
drm/amdgpu: Fix size validation for non-exclusive domains (v4)
drm/amdgpu/pm: add GFXOFF control IP version check for SMU IP v13.0.11
drm/amdgpu/pm: enable swsmu for SMU IP v13.0.11
drm/amdgpu/pm: use the specific mailbox registers only for SMU IP v13.0.4
drm/amdgpu: remove unconditional trap enable on add gfx11 queues
drm/amdgpu: set GC 11.0.4 family
drm/amdgpu/soc21: add mode2 asic reset for SMU IP v13.0.11
drm/amdkfd: Add sync after creating vram bo
drm/amdkfd: Fix double release compute pasid
drm/amdkfd: Fix kernel warning during topology setup
drm/amdkfd: Fix kfd_process_device_init_vm error handling
drm/amdkfd: Fix NULL pointer error for GC 11.0.1 on mGPU
drm/amd/pm: add missing AllowIHInterrupt message mapping for SMU13.0.0
drm/amd/pm: add the missing mapping for PPT feature on SMU13.0.0 and 13.0.7
drm/amd/pm: correct the reference clock for fan speed(rpm) calculation
drm/amd/pm: Enable bad memory page/channel recording support for smu v13_0_0
drm/amd/pm: enable GPO dynamic control support for SMU13.0.0
drm/amd/pm: enable GPO dynamic control support for SMU13.0.7
drm/amd/pm: enable mode1 reset on smu_v13_0_10
drm/amd/pm/smu13: BACO is supported when it's in BACO state
drm/display/dp_mst: Correct the kref of port.
drm/drm_vma_manager: Add drm_vma_node_allow_once()
drm/i915: Allow alternate fixed modes always for eDP
drm/i915: Allow panel fixed modes to have differing sync polarities
drm/i915: Allow switching away via vga-switcheroo if uninitialized
drm/i915/display: Check source height is > 0
drm/i915/dsi: add support for ICL+ native MIPI GPIO sequence
drm/i915/dsi: fix MIPI_BKLT_EN_1 native GPIO index
drm/i915: Fix a memory leak with reused mmap_offset
drm/i915: Fix CFI violations in gt_sysfs
drm/i915: Fix potential context UAFs
drm/i915/gt: Cleanup partial engine discovery failures
drm/i915/gt: Reset twice
drm/i915/gvt: fix double free bug in split_2MB_gtt_entry
drm/i915/gvt: fix gvt debugfs destroy
drm/i915/gvt: fix vgpu debugfs clean in remove
drm/i915: re-disable RC6p on Sandy Bridge
drm/i915: Remove unused variable
drm/i915: Reserve enough fence slot for i915_vma_unbind_async
drm/i915/selftest: fix intel_selftest_modify_policy argument types
drm/i915/selftests: Unwind hugepages to drop wakeref on error
drm/i915: unpin on error in intel_vgpu_shadow_mm_pin()
drm/imx: ipuv3-plane: Fix overlay plane width
drm/meson: Reduce the FIFO lines held when AFBC is not used
drm/msm/a6xx: Avoid gx gbit halt during rpm suspend
drm/msm/adreno: Make adreno quirks not overwrite each other
drm/msm: another fix for the headless Adreno GPU
drm/msm/dp: do not complete dp_aux_cmd_fifo_tx() if irq is not for aux transfer
drm/msm/dpu: Fix memory leak in msm_mdss_parse_data_bus_icc_path
drm/msm/dpu: Fix some kernel-doc comments
drm/msm/gpu: Fix potential double-free
drm: Optimize drm buddy top-down allocation method
drm/panfrost: Fix GEM handle creation ref-counting
drm/panfrost: fix GENERIC_ATOMIC64 dependency
drm/plane-helper: Add the missing declaration of drm_atomic_state
drm/vc4: bo: Fix drmm_mutex_init memory hog
drm/vc4: bo: Fix unused variable warning
drm/virtio: Fix GEM handle creation UAF
drm/virtio: Fix memory leak in virtio_gpu_object_create()
drm/vmwgfx: Refactor resource manager's hashtable to use linux/hashtable implementation.
drm/vmwgfx: Refactor resource validation hashtable to use linux/hashtable implementation.
drm/vmwgfx: Refactor ttm reference object hashtable to use linux/hashtable.
drm/vmwgfx: Remove rcu locks from user resources
drm/vmwgfx: Remove ttm object hashtable
drm/vmwgfx: Remove vmwgfx_hashtab
drm/vmwgfx: Write the driver id registers
dt-bindings: i2c: renesas,rzv2m: Fix SoC specific string
dt-bindings: msm: dsi-controller-main: Fix description of core clock
dt-bindings: msm: dsi-controller-main: Fix operating-points-v2 constraint
dt-bindings: msm: dsi-controller-main: Fix power-domain constraint
dt-bindings: msm/dsi: Don't require vcca-supply on 14nm PHY
dt-bindings: msm/dsi: Don't require vdds-supply on 10nm PHY
dt-bindings: msm: dsi-phy-28nm: Add missing qcom, dsi-phy-regulator-ldo-mode
dt-bindings: phy: g12a-usb2-phy: fix compatible string documentation
dt-bindings: phy: g12a-usb3-pcie-phy: fix compatible string documentation
dt-bindings: riscv: fix single letter canonical order
dt-bindings: riscv: fix underscore requirement for multi-letter extensions
EDAC/device: Fix period calculation in edac_device_reset_delay_period()
EDAC/device: Respect any driver-supplied workqueue polling value
EDAC/highbank: Fix memory leak in highbank_mc_probe()
EDAC/qcom: Do not pass llcc_driv_data as edac_device_ctl_info's pvt_info
efi: fix NULL-deref in init error path
efi: fix userspace infinite retry read efivars after EFI runtime services page fault
efi: random: combine bootloader provided RNG seed with RNG protocol output
efi: rt-wrapper: Add missing include
efi: tpm: Avoid READ_ONCE() for accessing the event log
elfcore: Add a cprm parameter to elf_core_extra_{phdrs,data_size}
erofs: clean up parsing of fscache related options
erofs: fix kvcalloc() misuse with __GFP_NOFAIL
erofs/zmap.c: Fix incorrect offset calculation
exit: Allow oops_limit to be disabled
exit: Expose "oops_count" to sysfs
exit: Put an upper limit on how often we can oops
exit: Use READ_ONCE() for all oops/warn limit reads
f2fs: let's avoid panic if extent_tree is not created
fbdev: matroxfb: G200eW: Increase max memory from 1 MB to 16 MB
fbdev: omapfb: avoid stack overflow warning
filelock: new helper: vfs_inode_has_locks
firmware: arm_scmi: Clear stale xfer->hdr.status
firmware: arm_scmi: Fix virtio channels cleanup on shutdown
firmware: arm_scmi: Harden shared memory access in fetch_notification
firmware: arm_scmi: Harden shared memory access in fetch_response
firmware: coreboot: Check size of table entry and use flex-array
firmware/psci: Don't register with debugfs if PSCI isn't available
firmware/psci: Fix MEM_PROTECT_RANGE function numbers
Fix up more non-executable files marked executable
fs/ntfs3: don't hold ni_lock when calling truncate_setsize()
fs/ntfs3: Fix attr_punch_hole() null pointer derenference
ftrace: Export ftrace_free_filter() to modules
ftrace/scripts: Update the instructions for ftrace-bisect.sh
gcc: disable -Warray-bounds for gcc-11 too
gpio: ep93xx: Fix port F hwirq numbers in handler
gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xRU
gpiolib: acpi: Allow ignoring wake capability on pins that aren't in _AEI
gpiolib-acpi: Don't set GPIOs for wakeup in S3 mode
gpio: mxc: Always set GPIOs used as interrupt source to INPUT mode
gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock
gpio: mxc: Unlock on error path in mxc_flip_edge()
gpio: pca953x: avoid to use uninitialized value pinctrl
gpio: sifive: Fix refcount leak in sifive_gpio_probe
gro: avoid checking for a failed search
gro: take care of DODGY packets
gsmi: fix null-deref in gsmi_get_variable
hfs/hfsplus: avoid WARN_ON() for sanity check, use proper error handling
HID: amd_sfh: Fix warning unwind goto
HID: betop: check shape of output reports
HID: check empty report_list in bigben_probe()
HID: check empty report_list in hid_validate_values()
HID: intel_ish-hid: Add check for ishtp_dma_tx_map
HID: playstation: sanity check DualSense calibration data.
HID: revert CHERRY_MOUSE_000C quirk
HID: uclogic: Add support for XP-PEN Deco 01 V2
hugetlb: unshare some PMDs when splitting VMAs
hvc/xen: lock console list traversal
i2c: designware: Fix unbalanced suspended flag
i2c: designware: use casting of u64 in clock multiplication to avoid overflow
iavf: fix temporary deadlock and failure to set MAC address
iavf/iavf_main: actually log ->src mask when talking about it
iavf: schedule watchdog immediately when changing primary MAC
IB/hfi1: Fix expected receive setup error exit issues
IB/hfi1: Immediately remove invalid memory from hardware
IB/hfi1: Reject a zero-length user expected buffer
IB/hfi1: Remove user expected buffer invalidate race
IB/hfi1: Reserve user expected TIDs
ice: Add check for kzalloc
ice: Fix potential memory leak in ice_gnss_tty_write()
ice: xsk: do not use xdp_return_frame() on tx_buf->raw_buf
igc: Fix PPS delta between two synchronized end-points
Input: i8042 - add Clevo PCX0DX to i8042 quirk table
interconnect: qcom: msm8996: Fix regmap max_register values
interconnect: qcom: msm8996: Provide UFS clocks to A2NoC
iommu/arm-smmu: Don't unregister on shutdown
iommu/arm-smmu: Report IOMMU_CAP_CACHE_COHERENCY even betterer
iommu/arm-smmu-v3: Don't unregister on shutdown
iommu/iova: Fix alloc iova overflows issue
iommu/mediatek-v1: Fix an error handling path in mtk_iommu_v1_probe()
io_uring: always prep_async for drain requests
io_uring/cancel: re-grab ctx mutex after finishing wait
io_uring: check for valid register opcode earlier
io_uring/fdinfo: include locked hash table in fdinfo output
io_uring: fix CQ waiting timeout handling
io_uring: hold locks for io_req_complete_failed
io_uring: inline __io_req_complete_post()
io_uring: inline __io_req_complete_put()
io_uring: inline io_req_task_work_add()
io_uring/io-wq: free worker if task_work creation is canceled
io_uring/io-wq: only free worker if it was allocated for creation
io_uring: lock overflowing for IOPOLL
io_uring/msg_ring: fix remote queue to disabled ring
io_uring/net: cache provided buffer group value for multishot receives
io_uring: pin context while queueing deferred tw
io_uring/poll: add hash if ready poll request can't complete inline
io_uring/poll: attempt request issue after racy poll wakeup
io_uring/poll: don't reissue in case of poll race on multishot request
io_uring: remove io_req_tw_post_queue
io_uring: use io_req_task_complete() in timeout
ipv4: prevent potential spectre v1 gadget in fib_metrics_match()
ipv4: prevent potential spectre v1 gadget in ip_metrics_convert()
ipv6: fix reachability confirmation with proxy_ndp
ipv6: raw: Deduct extension header length in rawv6_push_pending_frames
ixgbe: fix pci device refcount leak
kbuild: export top-level LDFLAGS_vmlinux only to scripts/Makefile.vmlinux
kbuild: fix 'make modules' error when CONFIG_DEBUG_INFO_BTF_MODULES=y
kcsan: test: don't put the expect array on the stack
kselftest: Fix error message for unconfigured LLVM builds
ksmbd: add max connections parameter
ksmbd: check nt_len to be at least CIFS_ENCPWD_SIZE in ksmbd_decode_ntlmssp_auth_blob
ksmbd: do not sign response to session request for guest login
ksmbd: downgrade ndr version error message to debug
ksmbd: fix infinite loop in ksmbd_conn_handler_loop()
ksmbd: limit pdu length size according to connection status
ksmbd: send proper error response in smb2_tree_connect()
kunit: alloc_string_stream_fragment error handling bug fix
KVM: arm64: Fix S1PTW handling on RO memslots
KVM: arm64: GICv4.1: Fix race with doorbell on VPE activation/deactivation
KVM: s390: interrupt: use READ_ONCE() before cmpxchg()
kvm/vfio: Fix potential deadlock on vfio group_lock
KVM: x86: Do not return host topology information from KVM_GET_SUPPORTED_CPUID
KVM: x86/vmx: Do not skip segment attributes if unusable bit is set
l2tp: close all race conditions in l2tp_tunnel_register()
l2tp: convert l2tp_tunnel_list to idr
l2tp: prevent lockdep issue in l2tp_tunnel_register()
lockref: stop doing cpu_relax in the cmpxchg loop
LoongArch: Add HWCAP_LOONGARCH_CPUCFG to elf_hwcap
LoongArch: Get frame info in unwind_start() when regs is not available
mac80211: Fix MLO address translation for multiple bss case
mei: bus: fix unlink on bus in error path
mei: me: add meteor lake point M DID
memblock tests: Fix compilation error.
memory: atmel-sdramc: Fix missing clk_disable_unprepare in atmel_ramc_probe()
memory: mvebu-devbus: Fix missing clk_disable_unprepare in mvebu_devbus_probe()
memory: tegra: Remove clients SID override programming
misc: fastrpc: Don't remove map on creater_process and device_release
misc: fastrpc: Fix use-after-free and race in fastrpc_map_find
misc: fastrpc: Fix use-after-free race condition for maps
mm: Always release pages to the buddy allocator in memblock_free_late().
mmc: sdhci-esdhc-imx: correct the tuning start tap and step setting
mmc: sunxi-mmc: Fix clock refcount imbalance during unbind
mm/hugetlb: fix PTE marker handling in hugetlb_change_protection()
mm/hugetlb: fix uffd-wp handling for migration entries in hugetlb_change_protection()
mm/hugetlb: pre-allocate pgtable pages for uffd wr-protects
mm/khugepaged: fix collapse_pte_mapped_thp() to allow anon_vma
mm/MADV_COLLAPSE: don't expand collapse when vm_end is past requested end
mm/shmem: restore SHMEM_HUGE_DENY precedence over MADV_COLLAPSE
mm/userfaultfd: enable writenotify while userfaultfd-wp is enabled for a VMA
module: Don't wait for GOING modules
mptcp: explicitly specify sock family at subflow creation time
mptcp: fix deadlock in fastopen error path
mptcp: fix lockdep false positive
mptcp: netlink: respect v4/v6-only sockets
mtd: cfi: allow building spi-intel standalone
mtd: parsers: scpart: fix __udivdi3 undefined on mips
net: amd-xgbe: add missed tasklet_kill
net: dsa: microchip: fix probe of I2C-connected KSZ8563
net: dsa: microchip: ksz9477: port map correction in ALU table entry register
net: dsa: mv88e6xxx: depend on PTP conditionally
net: dsa: qca8k: fix wrong length value for mgmt eth packet
net: dsa: tag_qca: fix wrong MGMT_DATA2 size
net: ena: Account for the number of processed bytes in XDP
net: ena: Don't register memory info on XDP exchange
net: ena: Fix rx_copybreak value update
net: ena: Fix toeplitz initial hash value
net: ena: Set default value for RX interrupt moderation
net: ena: Update NUMA TPH hint register upon NUMA node update
net: ena: Use bitmask to indicate packet redirection
net: enetc: avoid deadlock in enetc_tx_onestep_tstamp()
net: ethernet: adi: adin1110: Fix multicast offloading
net: ethernet: marvell: octeontx2: Fix uninitialized variable warning
net/ethtool/ioctl: return -EOPNOTSUPP if we have no phy stats
net: fec: Use page_pool_put_full_page when freeing rx buffers
netfilter: conntrack: fix vtag checks for ABORT/SHUTDOWN_COMPLETE
netfilter: conntrack: handle tcp challenge acks during connection reuse
netfilter: conntrack: unify established states for SCTP paths
netfilter: ipset: fix hash:net,port,net hang with /0 subnet
netfilter: ipset: Fix overflow before widen in the bitmap_ip_create() function.
netfilter: ipset: Rework long task execution when adding/deleting entries
netfilter: nf_tables: add function to create set stateful expressions
netfilter: nf_tables: consolidate set description
netfilter: nf_tables: honor set timeout and garbage collection updates
netfilter: nf_tables: perform type checking for existing sets
netfilter: nft_payload: incorrect arithmetics when fetching VLAN header bits
netfilter: nft_set_rbtree: skip elements in transaction from garbage collection
netfilter: nft_set_rbtree: Switch to node list walk for overlap detection
net: fix NULL pointer in skb_segment_list
net: fix UaF in netns ops registration error path
net: hns3: add interrupts re-initialization while doing VF FLR
net: hns3: fix miss L3E checking for rx packet
net: hns3: fix VF promisc mode not update when mac table full
net: hns3: fix wrong use of rss size during VF rss config
net: hns3: refine the handling for VF heartbeat
net: ipa: disable ipa interrupt during suspend
net: lan966x: add missing fwnode_handle_put() for ports node
net: lan966x: check for ptp to be enabled in lan966x_ptp_deinit()
net: lan966x: Fix configuration of the PCS
netlink: annotate data races around dst_portid and dst_group
netlink: annotate data races around nlk->portid
netlink: annotate data races around sk_state
netlink: prevent potential spectre v1 gadgets
net: macb: fix PTP TX timestamp failure due to packet padding
net: mana: Fix IRQ name - add PCI and queue number
net: mctp: add an explicit reference from a mctp_sk_key to sock
net: mctp: hold key reference when looking up a general key
net: mctp: mark socks as dead on unhash, prevent re-add
net: mctp: move expiry timer delete to unhash
net: mctp: purge receive queues on sk destruction
net: mdio-mux-meson-g12a: force internal PHY off on mux switch
net: mdio: validate parameter addr in mdiobus_get_phy()
net/mlx5: Add forgotten cleanup calls into mlx5_init_once() error path
net/mlx5: Avoid recovery in probe flows
net/mlx5: check attr pointer validity before dereferencing it
net/mlx5e: Always clear dest encap in neigh-update-del
net/mlx5e: Avoid false lock dependency warning on tc_ht even more
net/mlx5e: CT: Fix ct debugfs folder name
net/mlx5e: Don't support encap rules with gbp option
net/mlx5e: Fix hw mtu initializing at XDP SQ allocation
net/mlx5e: Fix macsec possible null dereference when updating MAC security entity (SecY)
net/mlx5e: Fix macsec ssci attribute handling in offload path
net/mlx5e: Fix RX reporter for XSK RQs
net/mlx5e: IPoIB, Block PKEY interfaces with less rx queues than parent
net/mlx5e: IPoIB, Block queue count configuration when sub interfaces are present
net/mlx5e: IPoIB, Don't allow CQE compression to be turned on by default
net/mlx5e: IPoIB, Fix child PKEY interface stats on rx path
net: mlx5: eliminate anonymous module_init & module_exit
net/mlx5e: QoS, Fix wrongfully setting parent_element_id on MODIFY_SCHEDULING_ELEMENT
net/mlx5e: Set decap action based on attr for sample
net/mlx5e: Set geneve_tlv_option_0_exist when matching on geneve option
net/mlx5: E-switch, Fix setting of reserved fields on MODIFY_SCHEDULING_ELEMENT
net/mlx5: E-switch, Fix switchdev mode after devlink reload
net/mlx5: E-Switch, properly handle ingress tagged packets on VST
net/mlx5e: TC, Keep mod hdr actions after mod hdr alloc
net/mlx5e: Verify dev is present for fix features ndo
net/mlx5: Fix command stats access after free
net/mlx5: Fix io_eq_size and event_eq_size params validation
net/mlx5: fix missing mutex_unlock in mlx5_fw_fatal_reporter_err_work()
net/mlx5: Fix ptp max frequency adjustment range
net/mlx5: Fix RoCE setting at HCA level
net/mlx5: Lag, fix failure to cancel delayed bond work
net: nfc: Fix use-after-free in local_cleanup()
net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe
net: ravb: Fix lack of register setting after system resumed for Gen3
net: ravb: Fix possible hang if RIS2_QFF1 happen
netrom: Fix use-after-free of a listening socket.
net/sched: act_mpls: Fix warning during failed attribute validation
net: sched: atm: dont intepret cls results when asked to drop
net: sched: cbq: dont intepret cls results when asked to drop
net: sched: disallow noqueue for qdisc classes
net: sched: fix memory leak in tcindex_set_parms
net: sched: gred: prevent races when adding offloads to stats
net/sched: sch_taprio: do not schedule in taprio_reset()
net/sched: sch_taprio: fix possible use-after-free
net: sparx5: Fix reading of the MAC address
net: stmmac: add aux timestamps fifo clearance wait
net: stmmac: enable all safety features by default
net: stmmac: fix invalid call to mdiobus_get_phy()
net: stmmac: Fix queue statistics reading
net/tg3: resolve deadlock in tg3_reset_task() during EEH
net/ulp: prevent ULP without clone op from entering the LISTEN status
net/ulp: use consistent error code when blocking ULP
net: usb: cdc_ether: add support for Thales Cinterion PLS62-W modem
net: usb: sr9700: Handle negative len
net: vrf: determine the dst using the original ifindex for multicast
net: wan: Add checks for NULL for utdm in undo_uhdlc_init and unmap_si_regs
nfc: Fix potential resource leaks
nfc: pn533: Wait for out_urb's completion in pn533_usb_send_frame()
NFSD: Add an nfsd_file_fsync tracepoint
NFSD: Add an NFSD_FILE_GC flag to enable nfsd_file garbage collection
nfsd: don't free files unconditionally in __nfsd_file_cache_purge
nfsd: fix handling of cached open files in nfsd4_open codepath
nfsd: fix handling of readdir in v4root vs. mount upcall timeout
NFSD: fix use-after-free in nfsd4_ssc_setup_dul()
NFSD: Pass the target nfsd_file to nfsd_commit()
nfsd: remove the pages_flushed statistic from filecache
nfsd: reorganize filecache.c
NFSD: Revert "NFSD: NFSv4 CLOSE should release an nfsd_file immediately"
nfsd: rework refcounting in filecache
nfsd: shut down the NFSv4 state objects before the filecache
nilfs2: fix general protection fault in nilfs_btree_insert()
nolibc: fix fd_set type
nommu: fix do_munmap() error path
nommu: fix memory leak in do_mmap() error path
nommu: fix split_vma() map_count error
nvme: also return I/O command effects from nvme_command_effects
nvme-apple: only reset the controller when RTKit is running
nvme: consolidate setting the tagset flags
nvme-fc: fix initialization order
nvme: fix multipath crash caused by flush request when blktrace is enabled
nvme: fix passthrough csi check
nvme-pci: fix timeout request state check
nvme: simplify transport specific device attribute handling
nvmet: use NVME_CMD_EFFECTS_CSUPP instead of open coding it
octeontx2-af: Fix LMAC config in cgx_lmac_rx_tx_enable
octeontx2-pf: Avoid use of GFP_KERNEL in atomic context
octeontx2-pf: Fix lmtst ID used in aura free
octeontx2-pf: Fix resource leakage in VF driver unbind
octeontx2-pf: Fix the use of GFP_KERNEL in atomic context on rt
of: fdt: Honor CONFIG_CMDLINE* even without /chosen node, take 2
of/fdt: run soc memory setup when early_init_dt_scan_memory fails
ovl: fail on invalid uid/gid mapping at copy up
ovl: fix tmpfile leak
panic: Consolidate open-coded panic_on_warn checks
panic: Expose "warn_count" to sysfs
panic: Introduce warn_limit
panic: Separate sysctl logic from CONFIG_SMP
parisc: Align parisc MADV_XXX constants with all other architectures
Partially revert "perf/arm-cmn: Optimise DTC counter accesses"
perf auxtrace: Fix address filter duplicate symbol selection
perf build: Properly guard libbpf includes
perf kmem: Support field "node" in evsel__process_alloc_event() coping with recent tracepoint restructuring
perf kmem: Support legacy tracepoints
perf lock contention: Fix core dump related to not finding the "__sched_text_end" symbol on s/390
perf probe: Fix to get the DW_AT_decl_file and DW_AT_call_file as unsinged data
perf probe: Use dwarf_attr_integrate as generic DWARF attr accessor
perf stat: Fix handling of --for-each-cgroup with --bpf-counters to match non BPF mode
perf stat: Fix handling of unsupported cgroup events when using BPF counters
perf tools: Fix resources leak in perf_data__open_dir()
perf/x86/amd: fix potential integer overflow on shift of a int
perf/x86/cstate: Add Meteor Lake support
perf/x86/intel/uncore: Add Emerald Rapids
perf/x86/msr: Add Emerald Rapids
perf/x86/msr: Add Meteor Lake support
perf/x86/rapl: Add support for Intel Emerald Rapids
perf/x86/rapl: Add support for Intel Meteor Lake
perf/x86/rapl: Treat Tigerlake like Icelake
phy: phy-can-transceiver: Skip warning if no "max-bitrate"
phy: qcom-qmp-combo: fix broken power on
phy: rockchip-inno-usb2: Fix missing clk_disable_unprepare() in rockchip_usb2phy_power_on()
phy: ti: fix Kconfig warning and operator precedence
phy: usb: sunplus: Fix potential null-ptr-deref in sp_usb_phy_probe()
pinctrl: amd: Add dynamic debugging for active GPIOs
pinctrl: rockchip: fix mux route data for rk3568
pinctrl: rockchip: fix reading pull type on rk3568
pktcdvd: check for NULL returna fter calling bio_split_to_limits()
platform/surface: aggregator: Add missing call to ssam_request_sync_free()
platform/surface: aggregator: Ignore command messages not intended for us
platform/x86/amd: Fix refcount leak in amd_pmc_probe
platform/x86: apple-gmux: Add apple_gmux_detect() helper
platform/x86: apple-gmux: Move port defines to apple-gmux.h
platform/x86: asus-nb-wmi: Add alternate mapping for KEY_CAMERA
platform/x86: asus-nb-wmi: Add alternate mapping for KEY_SCREENLOCK
platform/x86: asus-wmi: Add quirk wmi_ignore_fan
platform/x86: asus-wmi: Don't load fan curves without fan
platform/x86: asus-wmi: Fix kbd_dock_devid tablet-switch reporting
platform/x86: asus-wmi: Ignore fan on E410MA
platform/x86: dell-privacy: Fix SW_CAMERA_LENS_COVER reporting
platform/x86: dell-privacy: Only register SW_CAMERA_LENS_COVER if present
platform/x86: ideapad-laptop: Add Legion 5 15ARH05 DMI id to set_fn_lock_led_list[]
platform/x86: int3472/discrete: Ensure the clk/power enable pins are in output mode
platform/x86: simatic-ipc: add another model
platform/x86: simatic-ipc: correct name of a model
platform/x86: sony-laptop: Don't turn off 0x153 keyboard backlight during probe
platform/x86: thinkpad_acpi: Fix profile mode display in AMT mode
platform/x86: thinkpad_acpi: Fix profile modes on Intel platforms
platform/x86: touchscreen_dmi: Add info for the CSL Panther Tab HD
PM: AVS: qcom-cpr: Fix an error handling path in cpr_probe()
pNFS/filelayout: Fix coalescing test for single DS
powerpc/imc-pmu: Fix use of mutex in IRQs disabled section
prlimit: do_prlimit needs to have a speculation check
proc: fix PIE proc-empty-vm, proc-pid-vm tests
ptdma: pt_core_execute_cmd() should use spinlock
qed: allow sleep in qed_mcp_trace_dump()
qlcnic: prevent ->dcb use-after-free on qlcnic_dcb_enable() failure
r8152: add vendor/device ID pair for Microsoft Devkit
r8169: fix dmar pte write access is not set error
r8169: move rtl_wol_enable_rx() and rtl_prepare_power_down()
RDMA/core: Fix ib block iterator counter overflow
RDMA/mlx5: Fix mlx5_ib_get_hw_stats when used for device
RDMA/mlx5: Fix validation of max_rd_atomic caps for DC
RDMA/rxe: Fix inaccurate constants in rxe_type_info
RDMA/rxe: Prevent faulty rkey generation
RDMA/srp: Move large values to a new enum for gcc13
regulator: da9211: Use irq handler when ready
regulator: dt-bindings: samsung,s2mps14: add lost samsung,ext-control-gpios
reset: ti-sci: honor TI_SCI_PROTOCOL setting when not COMPILE_TEST
reset: uniphier-glue: Fix possible null-ptr-deref
Revert "ALSA: usb-audio: Drop superfluous interface setup at parsing"
Revert "drm/amd/display: Enable Freesync Video Mode by default"
Revert "drm/amdgpu: Revert "drm/amdgpu: getting fan speed pwm for vega10 properly""
Revert "Input: synaptics - switch touchpad on HP Laptop 15-da3001TU to RMI mode"
Revert "mm/compaction: fix set skip in fast_find_migrateblock"
Revert "net: dsa: qca8k: cache lo and hi for mdio write"
Revert "r8169: disable detection of chip version 36"
Revert "selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID"
Revert "serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler"
Revert "SUNRPC: Use RMW bitops in single-threaded hot paths"
Revert "usb: ulpi: defer ulpi_register on ulpi_read_id timeout"
Revert "wifi: mac80211: fix memory leak in ieee80211_if_add()"
riscv: dts: sifive: fu740: fix size of pcie 32bit memory
riscv: fix -Wundef warning for CONFIG_RISCV_BOOT_SPINWAIT
riscv/kprobe: Fix instruction simulation of JALR
riscv, kprobes: Stricter c.jr/c.jalr decoding
riscv: Move call to init_cpu_topology() to later initialization stage
riscv: uaccess: fix type of 0 variable on error in get_user()
rust: print: avoid evaluating arguments in `pr_*` macros in `unsafe` blocks
s390/cpum_sf: add READ_ONCE() semantics to compare and swap loops
s390/debug: add _ASM_S390_ prefix to header guard
s390: expicitly align _edata and _end symbols on page boundary
s390/kexec: fix ipl report address for kdump
s390/percpu: add READ_ONCE() to arch_this_cpu_to_op_simple()
s390: workaround invalid gcc-11 out of bounds read warning
sched/core: Fix arch_scale_freq_tick() on tickless systems
sched/core: Fix use-after-free bug in dup_user_cpus_ptr()
sched/fair: Check if prev_cpu has highest spare cap in feec()
sched/uclamp: Fix a uninitialized variable warnings
sch_htb: Avoid grafting on htb_destroy_class_offload when destroying htb
scsi: hisi_sas: Set a port invalid only if there are no devices attached when refreshing port id
scsi: hisi_sas: Use abort task set to reset SAS disks when discovered
scsi: hpsa: Fix allocation size for scsi_host_alloc()
scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace
scsi: mpi3mr: Refer CONFIG_SCSI_MPI3MR in Makefile
scsi: storvsc: Fix swiotlb bounce buffer leak in confidential VM
scsi: ufs: core: Fix devfreq deadlocks
scsi: ufs: core: WLUN suspend SSU/enter hibern8 fail recovery
sctp: fail if no bound addresses can be used for a given scope
selftests/bpf: check null propagation only neither reg is PTR_TO_BTF_ID
selftests: mptcp: userspace: validate v4-v6 subflows mix
selftests: netfilter: fix transaction test script timeout handling
selftests: net: fix cleanup_v6() for arp_ndisc_evict_nocarrier
selftests: net: fix cmsg_so_mark.sh test hang
selftests/net: l2_tos_ttl_inherit.sh: Ensure environment cleanup on failure.
selftests/net: l2_tos_ttl_inherit.sh: Run tests in their own netns.
selftests/net: l2_tos_ttl_inherit.sh: Set IPv6 addresses with "nodad".
selftests: net: return non-zero for failures reported in arp_ndisc_evict_nocarrier
selftests/net: toeplitz: fix race on tpacket_v3 block close
selftests/vm/pkeys: Add a regression test for setting PKRU through ptrace
serial: amba-pl011: fix high priority character transmission in rs486 mode
serial: atmel: fix incorrect baudrate setup
serial: exar: Add support for Sealevel 7xxxC serial cards
serial: pch_uart: Pass correct sg to dma_unmap_sg()
serial: stm32: Merge hard IRQ and threaded IRQ handling into single IRQ handler
soc: imx8m: Fix incorrect check for of_clk_get_by_name()
soc: imx: imx8mp-blk-ctrl: don't set power device name
soc: imx: imx8mp-blk-ctrl: enable global pixclk with HDMI_TX_PHY PD
soc: qcom: apr: Make qcom,protection-domain optional again
spi: cadence: Fix busy cycles calculation
spi: spidev: remove debug messages that access spidev->spi without locking
staging: vchiq_arm: fix enum vchiq_status return types
stmmac: dwmac-mediatek: remove the dwmac_fix_mac_speed
SUNRPC: ensure the matching upcall is in-flight upon downcall
tcp: Add TIME_WAIT sockets in bhash2.
tcp: avoid the lookup process failing to get sk in ehash table
tcp: fix rate_app_limited to default to 1
thermal: core: call put_device() only after device_register() fails
thermal/core: fix error code in __thermal_cooling_device_register()
thermal: int340x: Add missing attribute for data rate base
thermal: intel: int340x: Add locking to int340x_thermal_get_trip_type()
thermal: intel: int340x: Protect trip temperature from concurrent updates
thermal: Validate new state in cur_state_store()
thunderbolt: Disable XDomain lane 1 only in software connection manager
thunderbolt: Do not call PM runtime functions in tb_retimer_scan()
thunderbolt: Do not report errors if on-board retimers are found
thunderbolt: Use correct function to calculate maximum USB3 link rate
tipc: fix unexpected link reset due to discovery messages
tomoyo: fix broken dependency on *.conf.default
tools: gpio: fix -c option of gpio-event-mon
tools/nolibc: fix missing includes causing build issues at -O0
tools/nolibc: Fix S_ISxxx macros
tools/nolibc: fix the O_* fcntl/open macro definitions for riscv
tools/nolibc: prevent gcc from making memset() loop over itself
tools/nolibc: restore mips branch ordering in the _start block
tools/virtio: initialize spinlocks in vring_test.c
tpm: Allow system suspend to continue when TPM suspend fails
trace_events_hist: add check for return value of 'create_hist_field'
tracing: Make sure trace_printk() can output as soon as it can be used
tracing/osnoise: Use built-in RCU list checking
treewide: fix up files incorrectly marked executable
tsnep: Fix TX queue stop/wake for multiple queues
tty: fix possible null-ptr-defer in spk_ttyio_release
tty: serial: qcom-geni-serial: fix slab-out-of-bounds on RX FIFO buffer
ublk: honor IO_URING_F_NONBLOCK for handling control command
udf: Fix extension of the last extent in the file
usb: acpi: add helper to check port lpm capability using acpi _DSM
usb: cdns3: remove fetched trb from cache before dequeuing
usb: core: hub: disable autosuspend for TI TUSB8041
usb: dwc3: fix extcon dependency
usb: dwc3: gadget: Ignore End Transfer delay on teardown
usb: dwc3: xilinx: include linux/gpio/consumer.h
USB: gadget: Add ID numbers to configfs-gadget driver names
usb: gadget: f_fs: Ensure ep0req is dequeued before free_request
usb: gadget: f_fs: Prevent race during ffs_ep0_queue_wait
usb: gadget: f_ncm: fix potential NULL ptr deref in ncm_bitrate()
USB: gadgetfs: Fix race between mounting and unmounting
usb: gadget: g_webcam: Send color matching descriptor per frame
usb: host: ehci-fsl: Fix module alias
USB: misc: iowarrior: fix up header size for USB_DEVICE_ID_CODEMERCS_IOW100
usb: misc: onboard_hub: Invert driver registration order
usb: misc: onboard_hub: Move 'attach' work to the driver
usb: musb: fix error return code in omap2430_probe()
usb: rndis_host: Secure rndis_query check against int overflow
USB: serial: cp210x: add SCALANCE LPE-9000 device id
USB: serial: option: add Quectel EC200U modem
USB: serial: option: add Quectel EM05CN modem
USB: serial: option: add Quectel EM05CN (SG) modem
USB: serial: option: add Quectel EM05-G (CS) modem
USB: serial: option: add Quectel EM05-G (GR) modem
USB: serial: option: add Quectel EM05-G (RS) modem
usb-storage: apply IGNORE_UAS only for HIKSEMI MD202 on RTL9210
usb: typec: altmodes/displayport: Add pin assignment helper
usb: typec: altmodes/displayport: Fix pin assignment calculation
usb: typec: tcpm: Fix altmode re-registration causes sysfs create fail
usb: ucsi: Ensure connector delayed work items are flushed
usb: ulpi: defer ulpi_register on ulpi_read_id timeout
usb: xhci: Check endpoint is valid before dereferencing it
vdpa/mlx5: Avoid overwriting CVQ iotlb
vdpa/mlx5: Avoid using reslock in event_handler
vdpa/mlx5: Fix rule forwarding VLAN to TIR
vdpa/mlx5: Fix wrong mac address deletion
vdpa/mlx5: Return error on vlan ctrl commands if not supported
vdpasim: fix memory leak when freeing IOTLBs
vdpa_sim: fix possible memory leak in vdpasim_net_init() and vdpasim_blk_init()
vdpa_sim: fix vringh initialization in vdpasim_queue_ready()
vdpa_sim_net: should not drop the multicast/broadcast packet
vdpa/vp_vdpa: fix kfree a wrong pointer in vp_vdpa_remove
vduse: Validate vq_num in vduse_validate_config()
veth: Fix race with AF_XDP exposing old or uninitialized descriptors
vfio/type1: Respect IOMMU reserved regions in vfio_test_domain_fgsp()
vhost: fix range used in translate_desc()
vhost-vdpa: fix an iotlb memory leak
vhost_vdpa: fix the crash in unmap a large memory
vhost/vsock: Fix error handling in vhost_vsock_init()
virtio_blk: Fix signedness bug in virtblk_prep_rq()
virtio-blk: use a helper to handle request queuing errors
virtio-crypto: fix memory leak in virtio_crypto_alg_skcipher_close_session()
virtio-net: correctly enable callback during start_xmit
virtio_pci: modify ENOENT to EINVAL
VMCI: Use threaded irqs instead of tasklets
vmxnet3: correctly report csum_level for encapsulated packet
vringh: fix range used in iotlb_translate()
vxlan: Fix memory leaks in error path
w1: fix deadloop in __w1_remove_master_device()
w1: fix WARNING after calling w1_process()
wifi: ath11k: Send PME message during wakeup from D3cold
wifi: ath9k: use proper statements in conditionals
wifi: brcmfmac: fix regression for Broadcom PCIe wifi devices
wifi: iwlwifi: fw: skip PPAG for JF
wifi: mac80211: fix initialization of rx->link and rx->link_sta
wifi: mac80211: Fix iTXQ AMPDU fragmentation handling
wifi: mac80211: fix MLO + AP_VLAN check
wifi: mac80211: Proper mark iTXQs for resumption
wifi: mac80211: reset multiple BSSID options in stop_ap()
wifi: mac80211: sdata can be NULL during AMPDU start
wifi: rndis_wlan: Prevent buffer overflow in rndis_query_oid
x86/asm: Fix an assembler warning with current binutils
x86/boot: Avoid using Intel mnemonics in AT&T syntax asm
x86/bugs: Flush IBP in ib_prctl_set()
x86/fpu: Add a pkru argument to copy_uabi_from_kernel_to_xstate().
x86/fpu: Add a pkru argument to copy_uabi_to_xstate()
x86/fpu: Allow PKRU to be (once again) written by ptrace.
x86/fpu: Emulate XRSTOR's behavior if the xfeatures PKRU bit is not set
x86/fpu: Take task_struct* in copy_sigframe_from_user_to_xstate()
x86/fpu: Use _Alignof to avoid undefined behavior in TYPE_ALIGN
x86/i8259: Mark legacy PIC interrupts with IRQ_LEVEL
x86/kexec: Fix double-free of elf header buffer
x86/pat: Fix pat_x_mtrr_type() for MTRR disabled case
x86/resctrl: Fix event counts regression in reused RMIDs
x86/resctrl: Fix task CLOSID/RMID update race
x86/sev: Add SEV-SNP guest feature negotiation support
xen/pvcalls: free active map buffer on pvcalls_front_free_map
xhci: Add a flag to disable USB3 lpm on a xhci root port level.
xhci: Add update_hub_device override for PCI xHCI hosts
xhci: Detect lpm incapable xHC USB3 roothub ports from ACPI tables
xhci: Fix null pointer dereference when host dies
xhci-pci: set the dma max_seg_size
zonefs: Detect append writes at invalid locations
Updated by kernel-updater-bot (https://abf.io/mikhailnov/kernel-updater-bot)
2023-02-08 10:54:56 +03:00
|
|
|
%define sublevel 10
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2016-07-22 22:05:03 +03:00
|
|
|
# Release number. Increase this before a rebuild.
|
2023-02-08 18:37:50 +03:00
|
|
|
%define rpmrel 2
|
2022-08-21 16:12:54 +03:00
|
|
|
%define fullrpmrel %{rpmrel}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-08-21 16:12:54 +03:00
|
|
|
%define rpmtag %{disttag}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Version defines
|
2022-08-21 16:12:54 +03:00
|
|
|
%define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
|
|
|
|
%define kverrel %{kversion}-%{fullrpmrel}
|
2022-12-14 02:55:50 +00:00
|
|
|
%define tar_ver %{kernelversion}.%{patchlevel}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2015-03-16 18:42:29 +03:00
|
|
|
%ifarch %{ix86}
|
2022-03-30 09:04:46 +03:00
|
|
|
%define arch_suffix i686
|
2020-11-26 21:09:27 +00:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%ifarch %{x86_64}
|
2022-03-09 19:02:02 +01:00
|
|
|
%define arch_suffix x86_64
|
2015-03-16 18:42:29 +03:00
|
|
|
%endif
|
|
|
|
|
2020-11-26 21:09:27 +00:00
|
|
|
%ifarch aarch64
|
2022-03-09 19:02:02 +01:00
|
|
|
%define arch_suffix arm64
|
2020-11-26 21:09:27 +00:00
|
|
|
%endif
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%define buildrpmrel %{fullrpmrel}%{rpmtag}-%{arch_suffix}
|
|
|
|
%define buildrel %{kversion}-%{buildrpmrel}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2020-12-30 19:47:16 +03:00
|
|
|
# Add not only the build time generated key to the trusted keyring,
|
|
|
|
# but also add public keys of private ROSA's keys
|
2022-03-09 19:02:02 +01:00
|
|
|
%bcond_without additional_keys
|
2020-12-30 19:47:16 +03:00
|
|
|
|
2021-05-22 12:08:22 +03:00
|
|
|
# Fail the build after "make oldconfig" to edit kernel configs
|
2022-03-09 19:02:02 +01:00
|
|
|
%bcond_with fail
|
2021-05-22 12:08:22 +03:00
|
|
|
|
2020-03-13 20:35:12 +03:00
|
|
|
# User Mode Linux, https://habr.com/ru/company/itsumma/blog/459558/
|
2022-07-11 15:56:35 +03:00
|
|
|
# Not buildable on aarch64, rarely needed in general
|
2022-03-09 19:02:02 +01:00
|
|
|
%bcond_with uml
|
2019-11-17 16:56:39 +03:00
|
|
|
|
2020-03-18 22:20:03 +03:00
|
|
|
# "Nickel" is a special brand for certified distros
|
2022-03-17 10:23:10 +03:00
|
|
|
%if %{mdvver} == 201905
|
2022-03-09 19:02:02 +01:00
|
|
|
%bcond_without nickel
|
2020-11-27 01:34:07 +03:00
|
|
|
# Require kernel modules to be signed
|
2022-03-09 19:02:02 +01:00
|
|
|
%bcond_without oblig_signed_modules
|
2020-03-18 22:20:03 +03:00
|
|
|
%else
|
|
|
|
%bcond_with nickel
|
2020-08-06 14:44:29 +03:00
|
|
|
%bcond_with oblig_signed_modules
|
2020-03-18 22:20:03 +03:00
|
|
|
%endif
|
|
|
|
|
2020-11-27 01:34:07 +03:00
|
|
|
# Build binary out-of-tree kernel modules (experimental)
|
2022-11-07 03:13:34 +03:00
|
|
|
%bcond_with binary_extra_modules
|
2020-11-27 01:34:07 +03:00
|
|
|
# Sign kernel modules with GOST key (experimental)
|
|
|
|
%bcond_without gost_sign
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2020-07-27 16:53:12 +03:00
|
|
|
%bcond_with ccache
|
2022-03-15 17:03:05 +03:00
|
|
|
%bcond_without flow_abi
|
2022-11-07 03:13:34 +03:00
|
|
|
# https://github.com/sfjro/aufs-standalone/tree/aufs6.1 does not exist yet
|
|
|
|
%bcond_with aufs
|
2020-07-27 16:53:12 +03:00
|
|
|
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
# 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
|
2022-03-15 17:03:05 +03:00
|
|
|
# will be updated ahead of these binary modules. So just off building them.
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
%bcond_with binary_virtualbox_host
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Shredder-kernel works only on x86_64, makes manipulations with syscalls tables,
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
# 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
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Compress modules with zstd (zstd is good compression and fast decompression)
|
2022-03-15 17:03:05 +03:00
|
|
|
%bcond_without compress_modules
|
2021-05-03 18:21:14 +03:00
|
|
|
# Spend more resources on compression, but make resulting size less;
|
2021-05-04 15:17:47 +03:00
|
|
|
# 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).
|
2022-03-15 17:03:05 +03:00
|
|
|
%define zstd_cmd zstd -q --format=zstd --ultra -22
|
2021-05-03 18:21:14 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Kernel flavour
|
2020-03-18 22:20:03 +03:00
|
|
|
%if %{with nickel}
|
2022-03-09 19:02:02 +01:00
|
|
|
%define flavour nickel
|
2019-11-11 21:28:45 +03:00
|
|
|
%else
|
2022-03-09 19:02:02 +01:00
|
|
|
%define flavour generic
|
2019-11-11 21:28:45 +03:00
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# The full kernel version
|
2022-03-09 19:02:02 +01:00
|
|
|
%define kver_full %{kversion}-%{flavour}-%{buildrpmrel}
|
2021-10-10 16:12:22 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
############################################################################
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%define top_dir_name kernel-%{_arch}
|
|
|
|
%define build_dir ${RPM_BUILD_DIR}/%{top_dir_name}
|
|
|
|
%define src_dir %{build_dir}/linux-%{tar_ver}
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
# Common target directories
|
2022-03-09 19:02:02 +01:00
|
|
|
%define _bootdir /boot
|
|
|
|
%define _modulesdir /lib/modules
|
|
|
|
%define devel_root /usr/src/linux-%{kver_full}
|
|
|
|
%define initrd_path %{_bootdir}/initrd-%{kver_full}.img
|
Delete old initrds by RPM
After moving to dnf (installonlypkg(kernel)) schema of packaging the kernel,
the %%postun scriptlet stopped working properly because $1 is the number
of packages left after the transaction, and there are multiple
kernels - packages with the same name but of different version/release - left.
Let's just make initrd be %%ghost as Fedora (but increase its size from Fedora's 20 MiB to 65 MiB),
and drop deleting empty directories etc. Recent commit fixed ownership of directories,
now /lib/modules/kernel_version is owned by RPM (it was not), dkms will remove modules
that it built, and, if anything else was left, then let's just not touch it, why must we delete
what we know nothing about?
Also delete scriptlet in the devel subpackage, that scriptlet would probably cause problems
with reinstalling the devel package.
2021-05-24 21:10:00 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Directories needed for building
|
2022-03-09 19:02:02 +01:00
|
|
|
%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}
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
# Directories definition needed for installing
|
2022-03-09 19:02:02 +01:00
|
|
|
%define target_boot %{buildroot}%{_bootdir}
|
|
|
|
%define target_modules %{buildroot}%{_modulesdir}
|
2019-11-11 17:47:53 +03:00
|
|
|
|
|
|
|
# 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.
|
2022-03-09 19:02:02 +01:00
|
|
|
%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
|
2021-05-03 15:56:13 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%define kernel_files %{_builddir}/kernel_files.list
|
|
|
|
%define debuginfo_files %{_builddir}/debuginfo_files.list
|
2021-05-03 15:56:13 +03:00
|
|
|
|
|
|
|
# Append list of files generate by find-debuginfo.sh to our custom list
|
2022-03-09 19:02:02 +01:00
|
|
|
%global __debug_install_post \
|
2021-05-03 15:56:13 +03:00
|
|
|
%{__debug_install_post} \
|
|
|
|
cat %{_builddir}/debugfiles.list >> %{debuginfo_files}
|
|
|
|
|
2016-07-29 13:39:16 +03:00
|
|
|
############################################################################
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-09-20 14:48:35 +03:00
|
|
|
%if %{with binary_extra_modules}
|
|
|
|
# global instead of define to speed up things
|
2022-10-16 00:19:07 +03:00
|
|
|
%global nvidia_340_j %{kroko_j -p kernel-source-nvidia340 -r 340}
|
|
|
|
%global nvidia_340_n %{kroko_n -p kernel-source-nvidia340 -r 340}
|
2022-09-20 14:48:35 +03:00
|
|
|
%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}
|
2022-10-14 18:16:15 +03:00
|
|
|
%global nvidia_520_j %{kroko_j -p kernel-source-nvidia520 -r 520}
|
|
|
|
%global nvidia_520_n %{kroko_n -p kernel-source-nvidia520 -r 520}
|
2021-10-10 16:12:22 +03:00
|
|
|
|
|
|
|
# For SRPM stage when auto-krokodil-rpm-macros is not installed
|
2022-09-20 14:48:35 +03:00
|
|
|
%{?!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
|
2022-10-05 05:15:50 +03:00
|
|
|
%global kroko_release %kroko_mk_release -n kernel-%{kernelversion}.%{patchlevel}-%{flavour}
|
2022-09-20 14:48:35 +03:00
|
|
|
|
|
|
|
%endif #/binary_extra_modules
|
2021-10-10 16:12:22 +03:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Buildtime flags
|
2013-11-16 00:27:01 +04:00
|
|
|
%{?_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}
|
2022-03-15 17:03:05 +03:00
|
|
|
%{?_with_modxz: %global build_modxz 0}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Build defines
|
2022-03-15 17:03:05 +03:00
|
|
|
%define build_doc 1
|
2022-03-09 19:02:02 +01:00
|
|
|
%define build_devel 1
|
|
|
|
%define build_debug 1
|
|
|
|
|
|
|
|
# Build kernel-headers package
|
2022-11-07 03:13:34 +03:00
|
|
|
%define build_headers 0
|
2022-03-09 19:02:02 +01:00
|
|
|
|
|
|
|
# Build perf and cpupower tools
|
2022-11-07 03:13:34 +03:00
|
|
|
%define build_perf 0
|
|
|
|
%define build_cpupower 0
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2022-03-15 17:03:05 +03:00
|
|
|
%if %{with compress_modules}
|
|
|
|
%if %{with modxz}
|
2022-03-09 19:02:02 +01:00
|
|
|
%define kmod_suffix .xz
|
2022-03-15 17:03:05 +03:00
|
|
|
%else
|
|
|
|
%define kmod_suffix .zst
|
|
|
|
%endif
|
|
|
|
%else
|
|
|
|
%define kmod_suffix %{nil}
|
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
|
2016-07-21 15:59:26 +03:00
|
|
|
%if !%{build_debug}
|
|
|
|
# Disable debug rpms.
|
2022-03-15 17:03:05 +03:00
|
|
|
%define _enable_debug_packages %{nil}
|
2022-03-09 19:02:02 +01:00
|
|
|
%define debug_package %{nil}
|
2016-07-21 15:59:26 +03:00
|
|
|
%endif
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# End of user definitions
|
|
|
|
|
2020-07-27 16:53:12 +03:00
|
|
|
# http://nickdesaulniers.github.io/blog/2018/06/02/speeding-up-linux-kernel-builds-with-ccache/
|
|
|
|
%if %{with ccache}
|
2022-03-09 19:02:02 +01:00
|
|
|
%define kmake KBUILD_BUILD_TIMESTAMP='' %make CC='ccache gcc' ARCH="%{arch_type}"
|
2013-11-16 00:27:01 +04:00
|
|
|
%else
|
2022-03-09 19:02:02 +01:00
|
|
|
%define kmake %make CC='gcc' ARCH="%{arch_type}"
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
2020-07-27 16:53:12 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# There are places where parallel make don't work
|
|
|
|
%define smake make
|
2020-11-26 18:48:55 +00:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
2022-03-09 19:02:02 +01:00
|
|
|
%define arch_type x86
|
2020-11-26 18:48:55 +00:00
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
%ifarch aarch64
|
|
|
|
%define arch_type arm64
|
2020-11-26 18:48:55 +00:00
|
|
|
%endif
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# Parallelize xargs invocations on smp machines
|
2022-03-09 19:02:02 +01:00
|
|
|
%define kxargs xargs %([ -z "$RPM_BUILD_NCPUS" ] \\\
|
2013-11-16 00:27:01 +04:00
|
|
|
&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
|
|
|
|
[ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-P $RPM_BUILD_NCPUS")
|
|
|
|
|
|
|
|
#
|
|
|
|
# SRC RPM description
|
|
|
|
#
|
2022-03-09 19:02:02 +01:00
|
|
|
Summary: The Linux kernel
|
2021-05-03 15:56:13 +03:00
|
|
|
Name: kernel-%{kernelversion}.%{patchlevel}-%{flavour}
|
2022-03-09 19:02:02 +01:00
|
|
|
Version: %{kversion}
|
|
|
|
Release: %{fullrpmrel}
|
|
|
|
License: GPLv2
|
2022-03-15 17:03:05 +03:00
|
|
|
Group: System/Kernel and hardware
|
|
|
|
Url: https://www.kernel.org
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-11-07 21:01:49 +03:00
|
|
|
ExclusiveArch: %{x86_64} %{ix86} aarch64
|
2022-11-07 03:13:34 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
####################################################################
|
|
|
|
#
|
|
|
|
# Sources
|
|
|
|
#
|
2022-11-07 03:13:34 +03:00
|
|
|
#Source0: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz
|
2022-12-14 18:46:00 +03:00
|
|
|
Source0: https://github.com/torvalds/linux/archive/refs/tags/v6.1.tar.gz?/linux-6.1.tar.gz
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# This is for disabling *config, mrproper, prepare, scripts on -devel rpms
|
2019-07-16 18:30:53 +03:00
|
|
|
# Needed, because otherwise the -devel won't build correctly.
|
2022-11-07 03:13:34 +03:00
|
|
|
#Source2: 0001-disable-mrproper-prepare-scripts-configs-in-devel-rp.patch
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# TODO: Make a separate package "ksobirator" and BR it
|
2020-07-29 10:59:41 +03:00
|
|
|
# after testing these macros properly
|
|
|
|
Source3: macros.ksobirator
|
|
|
|
%{load:%{SOURCE3}}
|
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
# Kernel configuration files.
|
2020-12-30 19:47:16 +03:00
|
|
|
Source111: kernel-x86_64.config
|
2022-03-30 09:04:46 +03:00
|
|
|
Source112: kernel-i686.config
|
2020-12-30 19:47:16 +03:00
|
|
|
Source113: kernel-arm64.config
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2015-03-17 20:53:12 +03:00
|
|
|
# Cpupower: the service, the config, etc.
|
2022-03-15 17:03:05 +03:00
|
|
|
Source50: cpupower.service
|
|
|
|
Source51: cpupower.config
|
|
|
|
Source52: cpupower-start.sh
|
|
|
|
Source53: cpupower.path
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-15 17:03:05 +03:00
|
|
|
Source80: kernel.rpmlintrc
|
2019-11-17 16:56:39 +03:00
|
|
|
|
|
|
|
# Additional keys that can be used to sign kernel modules
|
2020-03-20 21:20:38 +03:00
|
|
|
# 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)}
|
2019-11-17 16:56:39 +03:00
|
|
|
|
2016-07-26 11:24:24 +03:00
|
|
|
####################################################################
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# Patches
|
|
|
|
|
2016-07-22 22:05:03 +03:00
|
|
|
# The patch to make kernel x.y.z from x.y.0.
|
2023-01-04 17:13:03 +00:00
|
|
|
Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kversion}.xz
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2016-07-26 11:24:24 +03:00
|
|
|
# ROSA-specific patches
|
2022-11-07 03:13:34 +03:00
|
|
|
Patch2: kernel-5.10.93-fix-perf-build.patch
|
2016-07-26 11:24:24 +03:00
|
|
|
# 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.
|
2022-03-15 17:03:05 +03:00
|
|
|
Patch101: 0001-perf-skip-xmlto-validation.patch
|
2016-07-26 11:24:24 +03:00
|
|
|
|
|
|
|
# http://bugs.rosalinux.ru/show_bug.cgi?id=6235
|
|
|
|
# http://bugs.rosalinux.ru/show_bug.cgi?id=6459
|
2022-03-15 17:03:05 +03:00
|
|
|
Patch102: 0001-audit-make-it-less-verbose.patch
|
2016-07-26 11:24:24 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{with aufs}
|
2020-08-18 08:02:38 +03:00
|
|
|
# AUFS 5 from http://aufs.sourceforge.net/
|
2022-03-15 17:03:05 +03:00
|
|
|
Patch109: 0001-Apply-AUFS-5.patch
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
2019-12-07 21:57:55 +03:00
|
|
|
|
2020-06-18 18:38:30 +03:00
|
|
|
# For kmod() generator of RPM Provides
|
|
|
|
# Changes version of aacraid.ko
|
2022-03-15 17:03:05 +03:00
|
|
|
Patch111: 0001-Remove-RPM-illegal-chars-from-module-version.patch
|
2020-06-18 18:38:30 +03:00
|
|
|
|
2020-03-16 23:19:46 +03:00
|
|
|
# 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
|
2022-03-17 10:23:10 +03:00
|
|
|
Patch201: 0001-altha.patch
|
2020-03-16 23:19:46 +03:00
|
|
|
|
2020-03-20 11:27:35 +03:00
|
|
|
# sent to upstream, https://patchwork.kernel.org/patch/11446123/
|
2022-03-15 17:03:05 +03:00
|
|
|
Patch302: 0001-sign-file-full-functionality-with-modern-LibreSSL.patch
|
2020-08-10 10:44:43 +03:00
|
|
|
# Allow to off modules signature check dynamically
|
2022-03-15 17:03:05 +03:00
|
|
|
Patch306: 0001-ROSA-ima-allow-to-off-modules-signature-check-dynami.patch
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-09-07 12:55:51 +03:00
|
|
|
# Support sound on notebook Aquarius NS685U R11 (https://linux-hardware.org/?probe=339dc3db60)
|
2022-09-07 14:24:27 +03:00
|
|
|
Patch0401: 0401-ASoC-es8316-Use-increased-GPIO-debounce-time.patch
|
2022-11-07 03:13:34 +03:00
|
|
|
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
|
Add support of Baikal-M SoCs
Information about config values was taken from:
From 804820df7bcb3d53a33ecd074b1eac277e938f24 Mon Sep 17 00:00:00 2001
From: Alexey Sheplyakov <asheplyakov@altlinux.org>
Date: Thu, 4 Feb 2021 19:35:14 +0400
Subject: [PATCH] config-aarch64: adjusted for Baikal-M (MBM1.0 board)
* DW_APB_TIMER=y, DW_APB_TIMER_OF=y: SoC clocks
* SERIAL_8250_DW=y: serial console
* I2C_DESIGNWARE_CORE=y, I2C_DESIGNWARE_PLATFORM=y: BMC (board
management controller) and RTC (Real Time Clock) are connected
via I2C.
* GPIO_DWAPB=y: device (PCIe, PHY, etc) reset/configuration
* RTC_DRV_PCF2127=y: RTC compiled in so the kernel automatically
sets the system time from the hardware clock
* TP_BMC=y: amongst other things handles the power button
* DRM_BAIKAL_VDU=m, DRM_BAIKAL_HDMI=m: video unit and HDMI transmitter
* CMA_SIZE_MBYTES=256: video display unit and GPU use system RAM, hence
CMA should reserve enough (contiguous) memory.
Note: CMA reserves memory during very early init, hence the size
has to be hard-coded into CONFIG
* MALI_MIDGARD=m: GPU driver, kernel side of proprietary mali blob.
Note: kernel mode code is GPLv2, so it's fine to distribute it.
* SENSORS_BT1_PVT=m: hardware temperature/voltage sensors
* PCI_BAIKAL=m: PCIe root complex. Compiled as a module since takes
ages (60 seconds or so) to probe the hardware. If compiled in
substantially increases the boot time, and machine is completely
unresponsive during probing PCIe. When built as a module probing
executes concurrently with other boot activities (unless booting
from a PCIe device)
* STMMAC_ETH=m, STMMAC_PLATFORM=m, DWMAC_BAIKAL=m: Ethernet driver
2021-06-22 16:12:03 +03:00
|
|
|
|
2020-03-09 10:50:38 +03:00
|
|
|
# Disable AutoReq
|
2022-03-09 19:02:02 +01:00
|
|
|
AutoReq: 0
|
2020-03-09 10:50:38 +03:00
|
|
|
# but keep autoprov for kmod(xxx)
|
2022-03-09 19:02:02 +01:00
|
|
|
AutoProv: 1
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: bash
|
|
|
|
BuildRequires: bc
|
|
|
|
BuildRequires: binutils
|
|
|
|
BuildRequires: bison
|
|
|
|
BuildRequires: bzip2
|
|
|
|
%if %{with ccache}
|
|
|
|
BuildRequires: ccache
|
|
|
|
%endif
|
|
|
|
BuildRequires: flex
|
|
|
|
BuildRequires: gcc
|
2020-11-27 15:52:01 +03:00
|
|
|
# ./scripts/mkcompile_h
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: hostname
|
|
|
|
BuildRequires: kmod-compat
|
2019-09-24 11:56:44 +03:00
|
|
|
BuildRequires: rsync
|
2022-03-15 17:03:05 +03:00
|
|
|
%if %{with compress_modules}
|
|
|
|
%if %{with modxz}
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: xz
|
2022-03-15 17:03:05 +03:00
|
|
|
%else
|
|
|
|
BuildRequires: zstd
|
|
|
|
%endif
|
|
|
|
%endif
|
2022-03-17 10:23:10 +03:00
|
|
|
%ifarch aarch64
|
|
|
|
BuildRequires: uboot-tools
|
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: kmod-devel
|
2022-11-07 17:52:17 +03:00
|
|
|
BuildRequires: pkgconfig(libelf)
|
2020-11-26 21:21:05 +00:00
|
|
|
%ifarch x86_64 aarch64
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: numa-devel
|
|
|
|
%endif
|
|
|
|
%if %{with uml}
|
|
|
|
BuildRequires: vde-devel
|
2014-05-19 18:34:31 +04:00
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
# For power tools
|
|
|
|
BuildRequires: pkgconfig(ncurses)
|
2014-05-19 18:34:31 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# For perf, cpufreq and all other tools
|
|
|
|
# For cpupower
|
2014-07-11 16:00:31 +04:00
|
|
|
%if %{build_cpupower}
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: pciutils-devel
|
2014-07-11 16:00:31 +04:00
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
# For perf
|
2014-07-11 16:00:31 +04:00
|
|
|
%if %{build_perf}
|
2022-03-09 19:02:02 +01:00
|
|
|
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)
|
2022-10-07 00:26:16 +03:00
|
|
|
BuildRequires: pkgconfig(libcap)
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: pkgconfig(libcrypto)
|
|
|
|
BuildRequires: pkgconfig(python3)
|
|
|
|
BuildRequires: pkgconfig(slang)
|
|
|
|
BuildRequires: pkgconfig(zlib)
|
2020-12-30 21:25:08 +03:00
|
|
|
%endif
|
|
|
|
|
2019-12-01 02:03:15 +03:00
|
|
|
# (To generate keys)
|
2019-12-07 21:57:55 +03:00
|
|
|
# LibreSSL has GOST support without editing openssl.cnf
|
|
|
|
# or dlopen()-ing external library
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: libressl
|
|
|
|
BuildRequires: libressl-devel
|
2019-11-11 21:16:01 +03:00
|
|
|
# To verify signatures (find, xargs, hexdump)
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: findutils
|
|
|
|
BuildRequires: util-linux
|
2019-11-11 17:47:53 +03:00
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
%if %{with binary_extra_modules}
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: auto-krokodil-rpm-macros
|
|
|
|
BuildRequires: kernel-source-rtl8821ce
|
|
|
|
BuildRequires: kernel-source-rtl8821cu
|
2022-10-15 14:00:47 +03:00
|
|
|
BuildRequires: kernel-source-rtl88x2bu
|
2022-10-15 15:03:47 +03:00
|
|
|
BuildRequires: kernel-source-rtl8812au
|
2022-10-15 15:39:08 +03:00
|
|
|
BuildRequires: kernel-source-rtl8821au
|
2022-10-15 15:52:51 +03:00
|
|
|
BuildRequires: kernel-source-rtl8814au
|
2022-10-15 18:02:04 +03:00
|
|
|
BuildRequires: kernel-source-rtk_btusb
|
2022-10-18 18:44:54 +03:00
|
|
|
BuildRequires: kernel-source-rtl8723au
|
|
|
|
BuildRequires: kernel-source-rtl8188gu
|
|
|
|
BuildRequires: kernel-source-rtl8723bu
|
|
|
|
BuildRequires: kernel-source-rtl8723ds
|
|
|
|
BuildRequires: kernel-source-rtl8723du
|
|
|
|
BuildRequires: kernel-source-rtl8852au
|
|
|
|
BuildRequires: kernel-source-rtl8192du
|
|
|
|
BuildRequires: kernel-source-rtw89
|
|
|
|
BuildRequires: kernel-source-rtw88
|
2022-10-16 00:19:07 +03:00
|
|
|
# Broadcom-wl and nvidia contain a proprietary blob which is only for x86
|
2021-10-07 00:45:03 +03:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: kernel-source-broadcom-wl
|
2022-10-16 00:19:07 +03:00
|
|
|
BuildRequires: kernel-source-nvidia340
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: kernel-source-nvidia390
|
2021-10-07 00:45:03 +03:00
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
# Nvidia470+ are x86_64 only (maybe aarch64 will be also packaged later)
|
2021-10-19 21:43:37 +03:00
|
|
|
%ifarch %{x86_64}
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: kernel-source-nvidia470
|
2022-05-04 10:07:56 +03:00
|
|
|
BuildRequires: kernel-source-nvidia510
|
2022-05-28 12:25:23 +03:00
|
|
|
BuildRequires: kernel-source-nvidia515
|
2022-10-14 18:16:15 +03:00
|
|
|
BuildRequires: kernel-source-nvidia520
|
2021-10-19 21:43:37 +03:00
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: kernel-source-tripso
|
|
|
|
BuildRequires: kernel-source-ipt-so
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
%if %{with binary_virtualbox_host}
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: kernel-source-virtualbox
|
2020-11-26 18:58:01 +00:00
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: kernel-source-v4l2loopback
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
%if %{with binary_shredder}
|
2020-11-27 23:00:06 +03:00
|
|
|
BuildRequires: kernel-source-shredder-kernel
|
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
# Rosa-test-suite is maintained in certified branches only nlkm, memfreetest, pcietest
|
2020-08-06 17:26:48 +03:00
|
|
|
%if %{with nickel}
|
2022-03-09 19:02:02 +01:00
|
|
|
BuildRequires: kernel-source-rosa-test-suite
|
2020-07-29 10:59:41 +03:00
|
|
|
%endif
|
2021-05-03 18:21:14 +03:00
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
# End of with binary_extra_modules
|
2021-05-03 18:21:14 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
Provides: kernel = %{EVRD}
|
|
|
|
Provides: kernel-%{flavour} = %{EVRD}
|
2021-10-10 16:12:22 +03:00
|
|
|
Provides: kernel-abi(%{kver_full}) = %{EVRD}
|
2022-03-09 19:02:02 +01:00
|
|
|
# Dnf config-manager --dump | grep installonly
|
2021-05-03 15:56:13 +03:00
|
|
|
Provides: installonlypkg(kernel) = %{EVRD}.image
|
|
|
|
Provides: installonlypkg(kernel) = %{EVRD}.modules
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2021-05-04 14:39:10 +03:00
|
|
|
# >= because of added support of zstd-compressed modules
|
2022-03-15 17:03:05 +03:00
|
|
|
Requires(posttrans): dracut >= 053-0.git5eb736.5
|
|
|
|
Requires(posttrans): kmod >= 28-3
|
2021-05-03 15:56:13 +03:00
|
|
|
|
2022-03-23 12:18:52 +03:00
|
|
|
# Need for rebuild dkms drivers
|
2022-10-27 12:22:05 +03:00
|
|
|
Requires: (%{name}-devel%{_isa} = %{EVRD} if dkms)
|
2022-03-23 12:18:52 +03:00
|
|
|
|
2020-12-27 23:46:32 +03:00
|
|
|
# Usually necessary, but sometimes user may want to not install them
|
|
|
|
Recommends: crda
|
2022-03-09 19:02:02 +01:00
|
|
|
Recommends: linux-firmware
|
2021-05-03 15:56:13 +03:00
|
|
|
Recommends: microcode
|
2020-12-27 16:13:54 +03:00
|
|
|
# Set BFQ as default scheduler for HDDs
|
|
|
|
# https://www.phoronix.com/scan.php?page=article&item=linux-50hdd-io
|
|
|
|
Recommends: udev-rules-ioschedulers
|
2022-03-09 19:02:02 +01:00
|
|
|
Recommends: wireless-regdb
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%if %{with flow_abi}
|
|
|
|
Requires: kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
%ifarch %{ix86}
|
|
|
|
Conflicts: arch(x86_64)
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
2016-07-21 15:58:13 +03:00
|
|
|
|
2021-09-19 00:46:54 +03:00
|
|
|
# XXX temporary hack to upgrade from kernel-headers 1:5.4
|
|
|
|
%if %{build_headers}
|
|
|
|
Recommends: kernel-headers = %{EVRD}
|
|
|
|
%endif
|
|
|
|
|
2021-10-10 16:12:22 +03:00
|
|
|
%if %{with binary_extra_modules}
|
|
|
|
%ifarch %{ix86} %{x86_64}
|
2022-10-16 00:19:07 +03:00
|
|
|
%kroko_req_modules_in_kernel -j %{nvidia_340_j} -n %{nvidia_340_n} -p %{kver_full}
|
2022-09-20 14:48:35 +03:00
|
|
|
%kroko_req_modules_in_kernel -j %{nvidia_390_j} -n %{nvidia_390_n} -p %{kver_full}
|
2021-10-10 16:12:22 +03:00
|
|
|
%endif
|
2021-10-19 21:43:37 +03:00
|
|
|
%ifarch %{x86_64}
|
2022-09-20 14:48:35 +03:00
|
|
|
%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}
|
2022-10-14 18:16:15 +03:00
|
|
|
%kroko_req_modules_in_kernel -j %{nvidia_520_j} -n %{nvidia_520_n} -p %{kver_full}
|
2021-10-19 21:43:37 +03:00
|
|
|
%endif
|
2021-10-10 16:12:22 +03:00
|
|
|
%endif
|
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%description
|
2019-07-16 18:30:53 +03:00
|
|
|
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.
|
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%posttrans
|
2022-10-18 23:20:11 +03:00
|
|
|
# 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}
|
2019-07-16 18:30:53 +03:00
|
|
|
# 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.
|
2021-10-17 00:46:32 +03:00
|
|
|
dracut -f %{initrd_path} %{kver_full}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# File triggers from grub packages will handle this.
|
|
|
|
#/usr/sbin/update-grub2
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-10-10 06:54:03 +03:00
|
|
|
%transfiletriggerin -- %{_modulesdir}/%{kver_full}
|
2021-10-17 00:46:32 +03:00
|
|
|
# Detect all modules, including ones inside kernel-module* packages
|
|
|
|
if grep -qE '/.*\.ko(|\..*)' ; then
|
|
|
|
depmod -a %{kver_full}
|
|
|
|
fi
|
|
|
|
|
2022-10-10 06:54:03 +03:00
|
|
|
%transfiletriggerpostun -- %{_modulesdir}/%{kver_full}
|
2021-10-17 00:46:32 +03:00
|
|
|
# Handle e.g. removal of kernel-module* packages
|
2022-10-10 06:54:03 +03:00
|
|
|
# List of files is not available here (?)
|
|
|
|
depmod -a %{kver_full}
|
2021-10-17 00:46:32 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%files -f %{kernel_files}
|
|
|
|
%{_bootdir}/System.map-%{kver_full}
|
2022-03-15 17:03:05 +03:00
|
|
|
%{_bootdir}/symvers-%{kver_full}.*
|
2021-05-03 15:56:13 +03:00
|
|
|
%{_bootdir}/config-%{kver_full}
|
|
|
|
%{_bootdir}/vmlinuz-%{kver_full}
|
Delete old initrds by RPM
After moving to dnf (installonlypkg(kernel)) schema of packaging the kernel,
the %%postun scriptlet stopped working properly because $1 is the number
of packages left after the transaction, and there are multiple
kernels - packages with the same name but of different version/release - left.
Let's just make initrd be %%ghost as Fedora (but increase its size from Fedora's 20 MiB to 65 MiB),
and drop deleting empty directories etc. Recent commit fixed ownership of directories,
now /lib/modules/kernel_version is owned by RPM (it was not), dkms will remove modules
that it built, and, if anything else was left, then let's just not touch it, why must we delete
what we know nothing about?
Also delete scriptlet in the devel subpackage, that scriptlet would probably cause problems
with reinstalling the devel package.
2021-05-24 21:10:00 +03:00
|
|
|
%ghost %{initrd_path}
|
2021-05-03 15:56:13 +03:00
|
|
|
%ifarch %{armx}
|
|
|
|
%{_bootdir}/dtb-%{kver_full}
|
|
|
|
%endif
|
|
|
|
%{_modulesdir}/%{kver_full}/modules.*
|
|
|
|
%if %{with flow_abi}
|
|
|
|
%{_modulesdir}/%{kver_full}/kernel/zzz-%{kernelversion}.%{patchlevel}-rosa-flow-abi
|
|
|
|
%endif
|
|
|
|
%if %{with binary_extra_modules}
|
|
|
|
# 8821ce.ko.debug will not be excluded and will be in the main debug subpackage
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8821ce.ko%{kmod_suffix}
|
2021-10-03 16:35:09 +03:00
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8821cu.ko%{kmod_suffix}
|
2022-10-15 14:00:47 +03:00
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/88x2bu.ko%{kmod_suffix}
|
2022-10-15 15:03:47 +03:00
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8812au.ko%{kmod_suffix}
|
2022-10-15 15:39:08 +03:00
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8821au.ko%{kmod_suffix}
|
2022-10-15 15:52:51 +03:00
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8814au.ko%{kmod_suffix}
|
2022-10-15 18:02:04 +03:00
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/drivers/bluetooth/rtk_btusb.ko%{kmod_suffix}
|
2022-10-18 18:44:54 +03:00
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8723au.ko%{kmod_suffix}
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8188gu.ko%{kmod_suffix}
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8723bu.ko%{kmod_suffix}
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8723ds.ko%{kmod_suffix}
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8723du.ko%{kmod_suffix}
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8852au.ko%{kmod_suffix}
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/8192du.ko%{kmod_suffix}
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/realtek/rtw89p
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/realtek/rtw88p
|
2021-10-07 00:45:03 +03:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/wireless/wl.ko%{kmod_suffix}
|
2021-10-19 21:43:37 +03:00
|
|
|
%endif
|
2021-05-03 15:56:13 +03:00
|
|
|
%if %{with binary_shredder}
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/extra/shredder-kernel.ko%{kmod_suffix}
|
|
|
|
%endif
|
2021-10-16 20:11:50 +03:00
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/drivers/media/v4l2loopback.ko%{kmod_suffix}
|
2021-05-03 15:56:13 +03:00
|
|
|
%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
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End of with binary_extra_modules
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{build_devel}
|
2021-05-03 15:56:13 +03:00
|
|
|
%package devel
|
|
|
|
Summary: Development files for %{name}
|
2019-07-16 18:30:53 +03:00
|
|
|
Group: Development/Kernel
|
|
|
|
Requires: glibc-devel
|
|
|
|
Requires: ncurses-devel
|
|
|
|
Requires: gcc
|
2022-03-09 19:02:02 +01:00
|
|
|
Requires: make
|
2019-07-16 18:30:53 +03:00
|
|
|
Requires: perl
|
2022-06-09 17:28:02 +03:00
|
|
|
Requires: %{name} = %{EVRD}
|
2019-07-16 18:30:53 +03:00
|
|
|
Provides: kernel-devel = %{kverrel}
|
2019-11-17 15:12:03 +03:00
|
|
|
Provides: kernel-%{flavour}-devel = %{kverrel}
|
2021-05-03 15:56:13 +03:00
|
|
|
Provides: installonlypkg(kernel) = %{EVRD}.devel
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2021-04-22 16:04:36 +03:00
|
|
|
# Have dkms updated/installed before the kernel, scriptlet here checks if dkms exists
|
2022-03-09 19:02:02 +01:00
|
|
|
OrderWithRequires(post): dkms
|
Delete old initrds by RPM
After moving to dnf (installonlypkg(kernel)) schema of packaging the kernel,
the %%postun scriptlet stopped working properly because $1 is the number
of packages left after the transaction, and there are multiple
kernels - packages with the same name but of different version/release - left.
Let's just make initrd be %%ghost as Fedora (but increase its size from Fedora's 20 MiB to 65 MiB),
and drop deleting empty directories etc. Recent commit fixed ownership of directories,
now /lib/modules/kernel_version is owned by RPM (it was not), dkms will remove modules
that it built, and, if anything else was left, then let's just not touch it, why must we delete
what we know nothing about?
Also delete scriptlet in the devel subpackage, that scriptlet would probably cause problems
with reinstalling the devel package.
2021-05-24 21:10:00 +03:00
|
|
|
# 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}
|
2021-04-22 16:04:36 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
%ifarch %{ix86}
|
|
|
|
Conflicts: arch(x86_64)
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%description devel
|
2022-03-09 19:02:02 +01:00
|
|
|
This package contains the kernel files (headers and build tools) that should
|
|
|
|
be enough to build additional drivers for use with %{name}.
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%post devel
|
2020-08-03 21:07:52 +03:00
|
|
|
if command -v dkms_autoinstaller >/dev/null 2>&1; then
|
|
|
|
dkms_autoinstaller start %{kver_full}
|
|
|
|
fi
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2019-11-12 16:16:27 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%preun devel
|
2019-07-16 18:30:53 +03:00
|
|
|
# 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
|
|
|
|
|
2020-03-18 22:20:03 +03:00
|
|
|
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
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%files devel
|
2022-11-07 18:19:22 +03:00
|
|
|
%{devel_root}
|
2019-07-16 18:30:53 +03:00
|
|
|
%{_modulesdir}/%{kver_full}/build
|
|
|
|
%{_modulesdir}/%{kver_full}/source
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End of build_devel
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{build_debug}
|
2021-05-03 15:56:13 +03:00
|
|
|
%package debuginfo
|
|
|
|
Summary: Debuginfo for %{name}
|
2019-07-16 18:30:53 +03:00
|
|
|
Group: Development/Debug
|
|
|
|
Provides: kernel-debug = %{kverrel}
|
2022-03-09 19:02:02 +01:00
|
|
|
AutoReq: 0
|
|
|
|
AutoProv: 0
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%description debuginfo
|
|
|
|
This package contains the files with debuginfo for %{name}.
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%files debuginfo -f %{debuginfo_files}
|
|
|
|
%{_bootdir}/vmlinux-%{kver_full}
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End of build_debug
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{build_doc}
|
2021-05-03 15:56:13 +03:00
|
|
|
%package doc
|
2022-03-09 19:02:02 +01:00
|
|
|
Summary: Various documentation bits found in the kernel source
|
|
|
|
Group: Documentation
|
2022-03-15 17:03:05 +03:00
|
|
|
BuildArch: noarch
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%description doc
|
2019-07-16 18:30:53 +03:00
|
|
|
This package contains documentation files from the kernel source.
|
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%files doc
|
2019-07-21 21:43:25 +03:00
|
|
|
%doc linux-%{tar_ver}/Documentation/*
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
############################################################################
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%if %{build_perf}
|
|
|
|
%package -n perf
|
|
|
|
Summary: perf tool and the supporting documentation
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
|
|
|
|
%description -n perf
|
2019-07-16 18:30:53 +03:00
|
|
|
The package contains perf tool and the supporting documentation.
|
|
|
|
|
|
|
|
%files -n perf
|
|
|
|
%{_bindir}/perf
|
|
|
|
%ifarch x86_64
|
|
|
|
%{_bindir}/perf-read-vdso32
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
2019-07-16 18:30:53 +03:00
|
|
|
%{_bindir}/trace
|
2022-03-23 12:00:37 +03:00
|
|
|
%{_includedir}/perf/perf_dlfilter.h
|
2019-07-16 18:30:53 +03:00
|
|
|
%dir %{_prefix}/libexec/perf-core
|
|
|
|
%dir %{_libdir}/traceevent
|
|
|
|
%dir %{_libdir}/traceevent/plugins
|
2022-03-13 17:36:13 +03:00
|
|
|
%{_libdir}/libperf-jvmti.so
|
2019-07-16 18:30:53 +03:00
|
|
|
%{_libdir}/traceevent/plugins/*
|
|
|
|
%{_prefix}/libexec/perf-core/*
|
|
|
|
%{_mandir}/man[1-8]/perf*
|
|
|
|
%{_sysconfdir}/bash_completion.d/perf
|
|
|
|
%{_datadir}/perf-core/strace/groups/*
|
|
|
|
%{_datadir}/doc/perf-tip/*.txt
|
|
|
|
/usr/lib/perf/examples/bpf/*
|
|
|
|
/usr/lib/perf/include/bpf/*
|
|
|
|
%endif
|
|
|
|
|
|
|
|
############################################################################
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%if %{build_cpupower}
|
|
|
|
%package -n cpupower
|
2021-05-03 15:56:13 +03:00
|
|
|
|
2014-10-14 13:22:01 +04:00
|
|
|
Summary: The cpupower tools
|
2013-11-16 00:27:01 +04:00
|
|
|
Group: System/Kernel and hardware
|
|
|
|
|
|
|
|
%description -n cpupower
|
2014-10-14 13:22:01 +04:00
|
|
|
The cpupower tools.
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%post -n cpupower
|
2014-04-18 15:05:40 +04:00
|
|
|
if [ $1 -ge 0 ]; then
|
2015-03-17 20:53:12 +03:00
|
|
|
# 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 || :
|
2014-04-01 15:25:39 +04:00
|
|
|
fi
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%preun -n cpupower
|
2014-04-01 15:25:39 +04:00
|
|
|
if [ $1 -eq 0 ]; then
|
2022-03-09 19:02:02 +01:00
|
|
|
/bin/systemctl --no-reload disable cpupower.path > /dev/null 2>&1 || :
|
|
|
|
/bin/systemctl stop cpupower.path > /dev/null 2>&1 || :
|
2014-04-01 15:25:39 +04:00
|
|
|
fi
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
%files -n cpupower -f cpupower.lang
|
2022-03-09 19:02:02 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/cpupower
|
2019-07-16 18:30:53 +03:00
|
|
|
%{_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*
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%package -n cpupower-devel
|
2014-10-14 13:22:01 +04:00
|
|
|
Summary: Development files for cpupower
|
2013-11-16 00:27:01 +04:00
|
|
|
Group: Development/Kernel
|
2021-05-03 15:56:13 +03:00
|
|
|
Requires: cpupower = %{EVRD}
|
2013-11-16 00:27:01 +04:00
|
|
|
Conflicts: %{_lib}cpufreq-devel
|
|
|
|
|
|
|
|
%description -n cpupower-devel
|
|
|
|
This package contains the development files for cpupower.
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
%files -n cpupower-devel
|
|
|
|
%{_libdir}/libcpupower.so
|
|
|
|
%{_includedir}/cpufreq.h
|
2020-03-21 12:28:56 +03:00
|
|
|
%{_includedir}/cpuidle.h
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
############################################################################
|
|
|
|
|
2018-09-04 11:17:26 +03:00
|
|
|
%if %{build_headers}
|
2021-05-03 15:56:13 +03:00
|
|
|
%package -n kernel-headers
|
2013-11-16 00:27:01 +04:00
|
|
|
Summary: Linux kernel header files mostly used by your C library
|
|
|
|
Group: System/Kernel and hardware
|
2020-04-14 22:03:16 +03:00
|
|
|
Provides: linux-userspace-headers = %{EVRD}
|
|
|
|
Provides: kernel-release-headers = %{EVRD}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%description -n kernel-headers
|
2013-11-16 00:27:01 +04:00
|
|
|
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.
|
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%files -n kernel-headers
|
2020-03-21 12:28:56 +03:00
|
|
|
%{_includedir}/*
|
2013-11-16 00:27:01 +04:00
|
|
|
# Don't conflict with cpupower-devel
|
|
|
|
%if %{build_cpupower}
|
2020-03-21 12:28:56 +03:00
|
|
|
%exclude %{_includedir}/cpufreq.h
|
|
|
|
%exclude %{_includedir}/cpuidle.h
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
2022-03-23 12:00:37 +03:00
|
|
|
%if %{build_perf}
|
|
|
|
%exclude %{_includedir}/perf/perf_dlfilter.h
|
|
|
|
%endif
|
2018-09-04 11:17:26 +03:00
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
############################################################################
|
|
|
|
|
2020-03-13 20:35:12 +03:00
|
|
|
%if %{with uml}
|
2021-05-03 15:56:13 +03:00
|
|
|
%package uml
|
2020-03-13 20:35:12 +03:00
|
|
|
Summary: User Mode Linux binary
|
|
|
|
Group: System/Kernel and hardware
|
2021-05-03 15:56:13 +03:00
|
|
|
Provides: kernel-uml = %{kverrel}
|
|
|
|
Provides: kernel-uml-%{flavour} = %{kverrel}
|
|
|
|
Provides: installonlypkg(kernel) = %{EVRD}.uml
|
2020-03-13 20:35:12 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%description uml
|
2020-03-18 22:20:03 +03:00
|
|
|
User Mode Linux binary.
|
2021-05-03 15:56:13 +03:00
|
|
|
Stripped, debug is in %{name}-debuginfo.
|
2020-03-13 20:35:12 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%files uml
|
2020-03-13 20:35:12 +03:00
|
|
|
%{_bindir}/linux-uml-%{kver_full}
|
2022-03-09 19:02:02 +01:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
2020-03-13 20:35:12 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%package uml-modules
|
2020-03-13 20:35:12 +03:00
|
|
|
Summary: User Mode Linux (UML) kernel modules
|
|
|
|
Group: System/Kernel and hardware
|
2021-05-03 15:56:13 +03:00
|
|
|
Provides: kernel-uml-modules = %{kverrel}
|
|
|
|
Provides: kernel-uml-modules-%{flavour} = %{kverrel}
|
|
|
|
Provides: installonlypkg(kernel-module) = %{EVRD}.uml
|
2020-03-13 20:35:12 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%description uml-modules
|
2022-03-09 19:02:02 +01:00
|
|
|
User Mode Linux (UML) kernel modules:
|
|
|
|
- not compressed;
|
|
|
|
- not stripped;
|
|
|
|
- signed.
|
2020-03-13 20:35:12 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%files uml-modules
|
2020-03-13 20:35:12 +03:00
|
|
|
/lib/modules-uml/%{kver_full}
|
2020-03-18 22:20:03 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End of uml
|
2020-03-18 22:20:03 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
#-----------------------------------------------------------------------------
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
###############################
|
|
|
|
# Extra modules package definitions
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{with binary_extra_modules}
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
%ksob_mk_module_pkg -n 8821ce -s net/wireless -r rtl8821ce-blacklist
|
2021-10-03 16:35:09 +03:00
|
|
|
%ksob_mk_module_pkg -n 8821cu -s net/wireless
|
2022-10-15 15:58:03 +03:00
|
|
|
# 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
|
2022-10-15 15:39:08 +03:00
|
|
|
# for RTL8811AU and RTL8821AU
|
2022-10-15 15:58:03 +03:00
|
|
|
%ksob_mk_module_pkg -n 8821au -s net/wireless
|
|
|
|
%ksob_mk_module_pkg -n 8814au -s net/wireless
|
2022-10-15 18:02:04 +03:00
|
|
|
%ksob_mk_module_pkg -n rtk_btusb -s drivers/bluetooth -r rtk_btusb-firmware
|
2022-10-18 18:44:54 +03:00
|
|
|
%ksob_mk_module_pkg -n 8723au -s net/wireless
|
|
|
|
%ksob_mk_module_pkg -n 8188gu -s net/wireless
|
|
|
|
%ksob_mk_module_pkg -n 8723bu -s net/wireless
|
|
|
|
%ksob_mk_module_pkg -n 8723ds -s net/wireless
|
|
|
|
%ksob_mk_module_pkg -n 8723du -s net/wireless
|
|
|
|
%ksob_mk_module_pkg -n 8852au -s net/wireless
|
|
|
|
%ksob_mk_module_pkg -n 8192du -s net/wireless
|
|
|
|
%ksob_mk_modules_pkg -n rtw89 -s net/wireless/realtek/rtw89p -r rtw89-firmware
|
|
|
|
%ksob_mk_modules_pkg -n rtw88 -s net/wireless/realtek/rtw88p -r rtw88-firmware
|
|
|
|
|
2021-10-07 00:45:03 +03:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
|
|
|
%ksob_mk_module_pkg -n wl -s net/wireless -r broadcom-wl-aliases
|
2022-10-16 00:19:07 +03:00
|
|
|
%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}
|
2022-09-26 15:32:27 +03:00
|
|
|
%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}
|
2021-10-07 00:45:03 +03:00
|
|
|
%endif
|
2021-10-19 21:43:37 +03:00
|
|
|
%ifarch %{x86_64}
|
2022-09-26 15:32:27 +03:00
|
|
|
%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}
|
2022-10-14 18:16:15 +03:00
|
|
|
%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}
|
2021-10-19 21:43:37 +03:00
|
|
|
%endif
|
2020-07-29 10:59:41 +03:00
|
|
|
%ksob_mk_module_pkg -n xt_TRIPSO -s net -r tripso
|
2021-04-01 14:30:32 +03:00
|
|
|
%ksob_mk_module_pkg -n xt_so -s net -r ipt-so
|
2021-10-16 20:11:50 +03:00
|
|
|
%ksob_mk_module_pkg -n v4l2loopback -s drivers/media -r v4l2loopback
|
2020-07-29 10:59:41 +03:00
|
|
|
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
%if %{with binary_shredder}
|
2020-11-27 23:00:06 +03:00
|
|
|
%ksob_mk_module_pkg -n shredder-kernel -s extra -r rosa-shredder-user
|
|
|
|
%endif
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
###############
|
|
|
|
# Virtualbox host
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
|
|
|
|
%if %{with binary_virtualbox_host}
|
2020-07-29 10:59:41 +03:00
|
|
|
%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
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# A package which will pull all those modules
|
2021-05-03 15:56:13 +03:00
|
|
|
%package -n kernel-modules-virtualbox-host-%{ksob_kernel}
|
2022-03-09 19:02:02 +01:00
|
|
|
Summary: Meta package to pull VirtualBox host kernel modules for kernel-%{flavour}-%{kernelversion}.%{patchlevel}
|
2022-03-15 17:03:05 +03:00
|
|
|
Group: System/Kernel and hardware
|
2022-03-09 19:02:02 +01:00
|
|
|
Requires: kernel-module-vboxnetflt-%{ksob_kernel}
|
|
|
|
Requires: kernel-module-vboxnetadp-%{ksob_kernel}
|
|
|
|
Requires: kernel-module-vboxdrv-%{ksob_kernel}
|
|
|
|
Requires: kernel-module-vboxpci-%{ksob_kernel}
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%description -n kernel-modules-virtualbox-host-%{ksob_kernel}
|
2022-03-09 19:02:02 +01:00
|
|
|
Meta package to pull VirtualBox host kernel modules for %{name}.
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
%files -n kernel-modules-virtualbox-host-%{ksob_kernel}
|
2020-07-29 10:59:41 +03:00
|
|
|
# empty
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
#End of ifarch x86
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2020-08-06 17:26:48 +03:00
|
|
|
%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
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End of binary_extra_modules
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
#################################################################
|
2020-08-19 20:02:58 +03:00
|
|
|
|
|
|
|
%if %{with flow_abi}
|
|
|
|
%package -n kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
|
2022-03-09 19:02:02 +01:00
|
|
|
Summary: Directory to install third-party binary kernel modules for kernels %{kernelversion}.%{patchlevel}.x
|
2022-03-15 17:03:05 +03:00
|
|
|
Group: System/Kernel and hardware
|
2020-08-19 20:02:58 +03:00
|
|
|
|
|
|
|
%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.
|
2022-03-09 19:02:02 +01:00
|
|
|
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.
|
2020-08-19 20:02:58 +03:00
|
|
|
|
|
|
|
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
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End of flow_abi
|
2020-08-19 20:02:58 +03:00
|
|
|
|
|
|
|
################################################
|
2020-03-13 20:35:12 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%prep
|
2022-03-09 19:02:02 +01:00
|
|
|
# Avoid accidental merge
|
2021-05-03 15:56:13 +03:00
|
|
|
%if 0%{?rpm5}
|
|
|
|
%{error:Package structure is for dnf, not for urpmi!}
|
|
|
|
%endif
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%setup -q -n %{top_dir_name} -c
|
2020-03-13 20:35:12 +03:00
|
|
|
%if %{with uml}
|
|
|
|
cp -r %{src_dir} %{src_dir}.uml
|
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
cd %{src_dir}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2020-11-26 18:48:55 +00:00
|
|
|
%autopatch -p1
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Setup Begin
|
|
|
|
#
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
##################################
|
2019-07-16 18:30:53 +03:00
|
|
|
# Kernel configuration
|
|
|
|
|
|
|
|
echo "Creating the kernel configuration file."
|
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
# Configs
|
2020-12-30 19:47:16 +03:00
|
|
|
cp %{SOURCE111} .
|
|
|
|
cp %{SOURCE112} .
|
|
|
|
cp %{SOURCE113} .
|
|
|
|
cp kernel-%{arch_suffix}.config .config
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2020-03-13 20:51:12 +03:00
|
|
|
touch %{build_dir}/.config.append
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Get rid of unwanted files
|
2020-11-26 21:17:21 +00:00
|
|
|
find . -name '*~' -o -name '*.orig' -o -name '*.append' -delete
|
2022-03-09 19:02:02 +01:00
|
|
|
# Wipe all .gitignore/.get_maintainer.ignore files
|
2020-11-26 21:17:21 +00:00
|
|
|
find . -name "*.g*ignore" -delete
|
|
|
|
|
2022-07-11 16:39:46 +03:00
|
|
|
# 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
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2020-12-30 19:47:16 +03:00
|
|
|
sed -i '/CONFIG_MODULE_SIG_FORCE/d' .config
|
2019-11-21 21:17:42 +03:00
|
|
|
%if %{with oblig_signed_modules}
|
2019-11-11 17:47:53 +03:00
|
|
|
# Disallow loading not signed modules
|
2020-12-30 19:47:16 +03:00
|
|
|
# But 0001-ROSA-ima-allow-to-off-modules-signature-check-dynami.patch allows to override this in cmdline
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_MODULE_SIG_FORCE=y >> %{build_dir}/.config.append
|
2019-11-21 21:17:42 +03:00
|
|
|
%else
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_MODULE_SIG_FORCE=n >> %{build_dir}/.config.append
|
2019-11-21 21:17:42 +03:00
|
|
|
%endif
|
2020-12-30 19:47:16 +03:00
|
|
|
|
|
|
|
sed -i '/CONFIG_MODULE_SIG_KEY/d' .config
|
2019-12-01 02:03:15 +03:00
|
|
|
# Set path to the key that will be generated later by openssl/libressl
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_MODULE_SIG_KEY=\"%{certs_signing_key_priv_rnd}\" >> %{build_dir}/.config.append
|
2020-12-30 19:47:16 +03:00
|
|
|
|
2019-11-18 18:48:33 +03:00
|
|
|
# Set path to one PEM file with all keys that the kernel must trust
|
|
|
|
sed -i '/CONFIG_SYSTEM_TRUSTED_KEYS/d' .config
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_SYSTEM_TRUSTED_KEYS=\"%{certs_public_keys}\" >> %{build_dir}/.config.append
|
2020-12-30 19:47:16 +03:00
|
|
|
|
2019-11-14 01:08:33 +03:00
|
|
|
# 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
|
2020-03-18 22:20:03 +03:00
|
|
|
sed -i '/CONFIG_INIT_ON_ALLOC_DEFAULT_ON/d' .config
|
|
|
|
echo CONFIG_INIT_ON_ALLOC_DEFAULT_ON=n >> %{build_dir}/.config.append
|
2019-11-14 01:08:33 +03:00
|
|
|
# "Fill freed pages and heap objects with zeroes"
|
|
|
|
# To disable, add to cmdline: init_on_free=0
|
2020-03-18 22:20:03 +03:00
|
|
|
sed -i '/CONFIG_INIT_ON_FREE_DEFAULT_ON/d' .config
|
|
|
|
%if %{with nickel}
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_INIT_ON_FREE_DEFAULT_ON=y >> %{build_dir}/.config.append
|
2020-03-18 22:20:03 +03:00
|
|
|
%else
|
|
|
|
echo CONFIG_INIT_ON_FREE_DEFAULT_ON=n >> %{build_dir}/.config.append
|
|
|
|
%endif
|
2019-11-14 01:08:33 +03:00
|
|
|
# Here enabling only either only init_on_free or only init_on_alloc
|
|
|
|
# makes sense; init_on_alloc is not about protecting information.
|
2020-03-13 20:35:12 +03:00
|
|
|
|
2020-03-20 21:28:35 +03:00
|
|
|
# To load kernel keyring in UML
|
|
|
|
for i in STREEBOG SHA1 SHA256 SHA512 ECRDSA RSA ; do
|
2020-12-30 19:47:16 +03:00
|
|
|
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
|
2020-03-20 21:28:35 +03:00
|
|
|
done
|
2020-03-16 23:19:46 +03:00
|
|
|
|
2020-03-13 20:35:12 +03:00
|
|
|
cat %{build_dir}/.config.append >> .config
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
##################
|
|
|
|
# End of kernel config
|
|
|
|
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Store the config file in the appropriate directory.
|
2020-11-26 18:48:55 +00:00
|
|
|
CONFIG_DIR=arch/%{arch_type}/configs
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
mkdir -p "${CONFIG_DIR}"
|
|
|
|
|
2020-11-26 18:48:55 +00:00
|
|
|
cfg_file=arch/%{arch_type}/configs/%{arch_suffix}_defconfig-%{flavour}
|
2021-05-22 12:08:22 +03:00
|
|
|
|
|
|
|
make ARCH=%{arch_type} oldconfig
|
|
|
|
# When it is needed to edit kernel configs, run:
|
2021-06-01 07:01:02 +03:00
|
|
|
# abf fetch
|
|
|
|
# rpmbuild --define "_sourcedir $PWD" --with=fail -bb kernel.spec
|
2021-05-22 12:08:22 +03:00
|
|
|
# and then work with the config in the buildroot with applied patches etc.
|
|
|
|
%{?_with_fail:exit 1}
|
2019-07-16 18:30:53 +03:00
|
|
|
mv .config ${cfg_file}
|
|
|
|
echo "Created ${cfg_file}."
|
2016-07-22 16:37:05 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Make sure the kernel has the sublevel we know it has...
|
2019-07-16 18:30:53 +03:00
|
|
|
LC_ALL=C sed -ri "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Get rid of unwanted files
|
2013-11-16 00:27:01 +04:00
|
|
|
find . -name '*~' -o -name '*.orig' -o -name '*.append' | %kxargs rm -f
|
2015-10-13 10:17:01 +03:00
|
|
|
find . -name '.get_maintainer.ignore' | %kxargs rm -f
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Versionize python shebang (#!/usr/bin/env python -> #!/usr/bin/python3) in scripts
|
2022-11-07 03:13:34 +03:00
|
|
|
grep -Irl '^#!/usr/bin/env python' | xargs sed -i '1 s,^#!/usr/bin/env python$,#!%{__python3},'
|
2022-03-09 19:02:02 +01:00
|
|
|
|
|
|
|
# Drop env from bash scripts
|
2022-03-17 10:23:10 +03:00
|
|
|
sed -i '1 s,^#!.*env .*,#!%{_bindir}/bash,' scripts/config
|
2022-03-09 19:02:02 +01:00
|
|
|
|
|
|
|
# Drop env from perl scripts
|
2022-11-07 03:13:34 +03:00
|
|
|
grep -IrlE '^#!.*env perl' | xargs sed -i -e '1 s,^#!/usr/bin/env perl$,#!{_bindir}/perl,'
|
2022-03-09 19:02:02 +01:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
############################################################################
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%build
|
2019-11-11 22:27:50 +03:00
|
|
|
# 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(){
|
2022-03-09 19:02:02 +01:00
|
|
|
# Show resulting kernel public keys for debugging
|
2020-03-14 22:02:48 +03:00
|
|
|
cat "%{src_dir}/%{certs_dir_rnd}/x509_certificate_list" | base64 -d || :
|
2020-03-14 13:49:15 +03:00
|
|
|
rm -fvr "%{src_dir}/%{certs_dir_rnd}"
|
2020-03-13 20:35:12 +03:00
|
|
|
%if %{with uml}
|
2020-03-14 22:02:48 +03:00
|
|
|
cat "%{src_dir}.uml/%{certs_dir_rnd}/x509_certificate_list" | base64 -d || :
|
2020-03-13 20:35:12 +03:00
|
|
|
rm -fvr "%{src_dir}.uml/%{certs_dir_rnd}"
|
|
|
|
%endif
|
2019-11-11 22:27:50 +03:00
|
|
|
}
|
|
|
|
# Make a trap to delete keys even if %%build fails in the middle
|
|
|
|
trap "_cleanup" EXIT
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
rm -rf %{temp_root}
|
|
|
|
install -d %{temp_root}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
cd %{src_dir}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-11-11 17:47:53 +03:00
|
|
|
### 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
|
2019-11-17 16:09:47 +03:00
|
|
|
# See also certs/Makefile in kernel source
|
2019-11-11 17:47:53 +03:00
|
|
|
mkdir -p "%{certs_dir_rnd}"
|
2019-11-12 02:06:06 +03:00
|
|
|
|
|
|
|
# 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)"
|
|
|
|
|
2019-11-11 17:47:53 +03:00
|
|
|
cat <<EOF > "%{certs_key_config_rnd}"
|
|
|
|
[ req ]
|
|
|
|
prompt = no
|
2019-11-17 16:09:47 +03:00
|
|
|
string_mask = utf8only
|
2022-03-09 19:02:02 +01:00
|
|
|
#default_keyfile = %%{certs_signing_key_priv_rnd}
|
2019-11-11 17:47:53 +03:00
|
|
|
distinguished_name = req_distinguished_name
|
2019-11-17 16:09:47 +03:00
|
|
|
x509_extensions = myexts
|
2019-11-11 17:47:53 +03:00
|
|
|
[ req_distinguished_name ]
|
|
|
|
organizationName = %{vendor} rpmbuild
|
2020-03-18 23:36:11 +03:00
|
|
|
commonName = Build time autogenerated @ALGO@ kernel key
|
2019-11-12 02:06:06 +03:00
|
|
|
emailAddress = ${email}
|
2019-11-17 16:09:47 +03:00
|
|
|
[ myexts ]
|
|
|
|
basicConstraints=critical,CA:FALSE
|
|
|
|
keyUsage=digitalSignature
|
|
|
|
subjectKeyIdentifier=hash
|
|
|
|
authorityKeyIdentifier=keyid
|
2019-11-11 17:47:53 +03:00
|
|
|
EOF
|
|
|
|
cat "%{certs_key_config_rnd}"
|
2020-03-18 23:36:11 +03:00
|
|
|
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"
|
2022-03-09 19:02:02 +01:00
|
|
|
# Avoid using the template
|
2020-03-18 23:36:11 +03:00
|
|
|
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
|
|
|
|
}
|
2019-11-11 17:47:53 +03:00
|
|
|
|
2020-03-18 23:36:11 +03:00
|
|
|
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}"
|
2019-11-17 16:56:39 +03:00
|
|
|
|
2020-03-18 23:36:11 +03:00
|
|
|
# Strip public parts from the generated PEMs
|
2019-11-18 18:48:33 +03:00
|
|
|
sed -n \
|
2020-03-18 23:36:11 +03:00
|
|
|
'/^-----BEGIN CERTIFICATE-----$/,/^-----END CERTIFICATE-----$/p' \
|
|
|
|
"%{certs_signing_key_priv_rnd}.GOST" \
|
|
|
|
"%{certs_signing_key_priv_rnd}.RSA" \
|
|
|
|
> "%{certs_public_keys}"
|
2019-12-07 21:57:55 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Link sign-file and extract-cert with LibreSSL instead of OpenSSL
|
2019-12-07 21:57:55 +03:00
|
|
|
if [ $? != 0 ] ; then exit $? ; fi
|
|
|
|
sed -i %{src_dir}/scripts/Makefile \
|
2020-03-13 20:35:12 +03:00
|
|
|
%if %{with uml}
|
2022-03-15 17:03:05 +03:00
|
|
|
%{src_dir}.uml/scripts/Makefile \
|
2020-03-13 20:35:12 +03:00
|
|
|
%endif
|
2021-02-22 13:17:43 +03:00
|
|
|
-e "s, libcrypto , libressl-libcrypto ,g"
|
2019-11-18 18:48:33 +03:00
|
|
|
|
2020-03-18 23:36:11 +03:00
|
|
|
%if %{with additional_keys}
|
2020-03-15 20:26:01 +03:00
|
|
|
# Add additional public RSA keys to the list of trusted keys for kernel modules
|
2019-11-17 16:56:39 +03:00
|
|
|
# Build kernel --without additional_keys if you do not want to trust them
|
2020-03-15 20:26:01 +03:00
|
|
|
cat %{expand:%(for i in `seq 1 12`; do echo "%%SOURCE$((200+${i}))" | tr "\n" " "; done)} \
|
|
|
|
>> "%{certs_public_keys}"
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End of additional_keys
|
2019-11-19 00:24:49 +03:00
|
|
|
cat %{certs_public_keys}
|
2019-11-11 17:47:53 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# .config
|
|
|
|
%smake -s mrproper
|
2020-11-26 18:48:55 +00:00
|
|
|
cp arch/%{arch_type}/configs/%{arch_suffix}_defconfig-%{flavour} .config
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Make sure EXTRAVERSION says what we want it to say
|
2019-07-16 18:30:53 +03:00
|
|
|
LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{flavour}-%{buildrpmrel}/" Makefile
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Build the kernel
|
2019-07-16 18:30:53 +03:00
|
|
|
echo "Building kernel %{kver_full}"
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2020-11-26 21:09:27 +00:00
|
|
|
TARGETS="all"
|
|
|
|
# need to install dtbs to proper boot arm64 devices
|
2021-05-22 11:56:21 +03:00
|
|
|
%ifarch %{armx}
|
2020-11-26 21:09:27 +00:00
|
|
|
TARGETS="$TARGETS dtbs"
|
|
|
|
%endif
|
|
|
|
|
2021-02-23 17:35:52 +03:00
|
|
|
%kmake V=1 -s $TARGETS
|
2015-04-23 12:11:47 +03:00
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
# 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
|
|
|
|
|
2022-10-18 18:44:54 +03:00
|
|
|
# $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}
|
|
|
|
}
|
2022-10-15 15:39:08 +03:00
|
|
|
|
2022-10-18 18:44:54 +03:00
|
|
|
_build_rtl 8821ce kernel/net/wireless
|
|
|
|
_build_rtl 8821cu kernel/net/wireless
|
|
|
|
_build_rtl 88x2bu kernel/net/wireless
|
|
|
|
_build_rtl 8812au kernel/net/wireless
|
|
|
|
_build_rtl 8821au kernel/net/wireless
|
|
|
|
_build_rtl 8821au kernel/net/wireless
|
|
|
|
_build_rtl 8814au kernel/net/wireless
|
|
|
|
_build_rtl 8723au kernel/net/wireless
|
|
|
|
_build_rtl 8188gu kernel/net/wireless
|
|
|
|
_build_rtl 8723bu kernel/net/wireless
|
|
|
|
_build_rtl 8723ds kernel/net/wireless
|
|
|
|
_build_rtl 8723du kernel/net/wireless
|
|
|
|
_build_rtl 8852au kernel/net/wireless
|
|
|
|
_build_rtl 8192du kernel/net/wireless
|
2022-10-15 15:52:51 +03:00
|
|
|
|
2022-10-15 18:02:04 +03:00
|
|
|
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
|
|
|
|
|
2022-10-18 18:44:54 +03:00
|
|
|
cp -r "$(rpm -q --qf '/usr/src/rtw89-%%{VERSION}-%%{RELEASE}' kernel-source-rtw89)" kernel-source-rtw89
|
|
|
|
pushd kernel-source-rtw89
|
|
|
|
%kmake KSRC=%{src_dir}
|
|
|
|
mkdir -p %{temp_modules}/%{kver_full}/kernel/net/wireless/realtek/rtw89p
|
|
|
|
cp *.ko %{temp_modules}/%{kver_full}/kernel/net/wireless/realtek/rtw89p
|
|
|
|
popd
|
|
|
|
rm -fr kernel-source-rtw89
|
|
|
|
|
|
|
|
cp -r "$(rpm -q --qf '/usr/src/rtw88-%%{VERSION}-%%{RELEASE}' kernel-source-rtw88)" kernel-source-rtw88
|
|
|
|
pushd kernel-source-rtw88
|
|
|
|
%kmake KSRC=%{src_dir}
|
|
|
|
mkdir -p %{temp_modules}/%{kver_full}/kernel/net/wireless/realtek/rtw88p
|
|
|
|
cp *.ko %{temp_modules}/%{kver_full}/kernel/net/wireless/realtek/rtw88p
|
|
|
|
popd
|
|
|
|
rm -fr kernel-source-rtw88
|
|
|
|
|
2021-10-19 21:43:37 +03:00
|
|
|
_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}
|
2022-09-26 15:32:27 +03:00
|
|
|
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
|
2021-10-19 21:43:37 +03:00
|
|
|
popd
|
|
|
|
rm -fr kernel-source-nvidia${1}
|
2022-09-26 15:32:27 +03:00
|
|
|
# for rosa-kernel-tools
|
|
|
|
mkdir -p %{temp_root}/var/spool/initramfs-regen
|
|
|
|
touch %{temp_root}/var/spool/initramfs-regen/nvidia${1}.%{kroko_release}
|
2021-10-19 21:43:37 +03:00
|
|
|
}
|
|
|
|
|
2021-10-07 00:45:03 +03:00
|
|
|
%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
|
2021-10-10 16:12:22 +03:00
|
|
|
|
2022-10-16 00:19:07 +03:00
|
|
|
_build_nvidia 340
|
2021-10-19 21:43:37 +03:00
|
|
|
_build_nvidia 390
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%ifarch %{x86_64}
|
|
|
|
_build_nvidia 470
|
2022-05-04 10:07:56 +03:00
|
|
|
_build_nvidia 510
|
2022-05-28 12:25:23 +03:00
|
|
|
_build_nvidia 515
|
2022-10-14 18:16:15 +03:00
|
|
|
_build_nvidia 520
|
2021-10-07 00:45:03 +03:00
|
|
|
%endif
|
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
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
|
|
|
|
|
2021-04-01 14:30:32 +03:00
|
|
|
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
|
|
|
|
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
%if %{with binary_shredder}
|
2020-11-26 21:09:27 +00:00
|
|
|
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
|
2020-11-27 23:00:06 +03:00
|
|
|
%endif
|
2020-11-26 21:09:27 +00:00
|
|
|
|
Update from 5.4 to 5.10.1
- rediffed most of patches, renamed files to easify further rediffs by git format-patch
- thanks to abf.io/kernels_stable for some patches for kernel 5.9
- using unofficial patch for AUFS for kernel 5.10, there may be issues with stability, try to avoid using AUFS (I would have dropped it, but MagOS wants it very much)
- pulled updates of AltHa from http://git.altlinux.org/gears/k/kernel-image-un-def.git?p=kernel-image-un-def.git;a=history;f=security/altha;hb=HEAD
- dropped patch adding sysctl to disable disk-based swap because it has not found any usage
- bpf is now in the list of LSM modules (ability to write LSM modules as BPF programs), enable it, it is potentially useful and does not seem to be harmful
- keeping kernel libc headers in older kernels for now
- dropped building external virtualbox guest modules because they are now included into the mainline kernel
- offed building VirtualBox host modules, I do not know how to keep these binary modules in sync with userspace part of VirtualBox, users can continue using dkms
- offed building kernel-shredder because it is not buildable on kernel 5.10
- updated rtl8821ce and added a dependency from its "blacklist" subpackage here (see https://github.com/tomaspinho/rtl8821ce/commit/14b536f0)
It is not clear if kernel 5.10 will receive an LTS support longer than 5.4 or not. Support until Dec, 2022 is declared right now at https://www.kernel.org/category/releases.html for 5.10 and until Dec, 2025 - for 5.4.
TODO: update kernel configs
TODO: solve problems with version of virtualbox host modules not matching version of the virtualbox package after virtualbox is updated but kernel is not rebuilt
2020-12-20 18:49:24 +03:00
|
|
|
%if %{with binary_virtualbox_host}
|
2020-11-26 21:09:27 +00:00
|
|
|
# build commands for virtualbox are based on the ones from the virtualbox package
|
2020-07-29 10:59:41 +03:00
|
|
|
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
|
2020-11-26 18:58:01 +00:00
|
|
|
%endif
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2021-10-16 20:11:50 +03:00
|
|
|
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
|
|
|
|
|
2020-08-06 17:26:48 +03:00
|
|
|
%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
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End with nickel <- with binary_extra_modules
|
2020-08-06 17:26:48 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End with binary_extra_modules
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2020-03-13 20:35:12 +03:00
|
|
|
%if %{with uml}
|
|
|
|
cp -rv %{certs_dir_rnd} %{src_dir}.uml/
|
|
|
|
pushd %{src_dir}.uml
|
2020-12-31 14:30:14 +03:00
|
|
|
%kmake ARCH=um defconfig
|
2020-03-13 20:35:12 +03:00
|
|
|
%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
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
install -d %{temp_boot}
|
|
|
|
install -m 644 System.map %{temp_boot}/System.map-%{kver_full}
|
|
|
|
install -m 644 .config %{temp_boot}/config-%{kver_full}
|
2022-03-15 17:03:05 +03:00
|
|
|
%if %{with modxz}
|
2022-03-09 19:02:02 +01:00
|
|
|
xz -c Module.symvers > %{temp_boot}/symvers-%{kver_full}.xz
|
2022-03-15 17:03:05 +03:00
|
|
|
%else
|
|
|
|
%{zstd_cmd} Module.symvers
|
|
|
|
install -m 644 Module.symvers.zst %{temp_boot}/symvers-%{kver_full}.zst
|
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2021-04-06 19:36:12 +00:00
|
|
|
%ifarch %{armx}
|
2021-05-22 11:56:21 +03:00
|
|
|
%make_build ARCH=%{arch_type} V=1 INSTALL_DTBS_PATH=%{temp_boot}/dtb-%{kver_full} dtbs_install
|
2021-04-06 19:36:12 +00:00
|
|
|
%endif
|
|
|
|
|
2020-11-26 21:09:27 +00:00
|
|
|
%ifarch aarch64
|
2022-11-07 21:16:34 +03:00
|
|
|
cp -f arch/arm64/boot/Image* %{temp_boot}/vmlinuz-%{kver_full}
|
2020-11-26 21:09:27 +00:00
|
|
|
%else
|
|
|
|
cp -f arch/%{arch_type}/boot/bzImage %{temp_boot}/vmlinuz-%{kver_full}
|
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Headers
|
2019-07-16 18:30:53 +03:00
|
|
|
%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
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Remove /lib/firmware, we use a separate linux-firmware package
|
2019-07-16 18:30:53 +03:00
|
|
|
rm -rf %{temp_root}/lib/firmware
|
2014-12-11 19:36:25 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Prepare the files for kernel*-devel
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{build_devel}
|
2014-12-11 19:36:25 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
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
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
cp -fR include %{temp_devel_root}
|
2014-12-11 19:36:25 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
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}/
|
2020-11-26 18:48:55 +00:00
|
|
|
cp -fR arch/%{arch_type}/kernel/asm-offsets.{c,s} %{temp_devel_root}/arch/%{arch_type}/kernel/
|
2020-11-26 21:09:27 +00:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
2020-11-26 18:48:55 +00:00
|
|
|
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/
|
2022-03-09 19:02:02 +01:00
|
|
|
# Needed for arch/x86/purgatory
|
2020-11-26 21:09:27 +00:00
|
|
|
cp -fR lib/*.h lib/*.c %{temp_devel_root}/lib/
|
2020-11-26 18:48:55 +00:00
|
|
|
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}/
|
2020-11-26 21:09:27 +00:00
|
|
|
# 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}/
|
2019-07-16 18:30:53 +03:00
|
|
|
cp -fR .config Module.symvers %{temp_devel_root}
|
2014-12-11 19:36:25 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Needed for truecrypt build (Danny)
|
|
|
|
cp -fR drivers/md/dm.h %{temp_devel_root}/drivers/md/
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# 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/
|
2017-03-13 18:10:33 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Add acpica header files, needed for fglrx build
|
2019-07-16 18:30:53 +03:00
|
|
|
cp -fR drivers/acpi/acpica/*.h %{temp_devel_root}/drivers/acpi/acpica/
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{with aufs}
|
2019-07-16 18:30:53 +03:00
|
|
|
# aufs2 has a special file needed
|
2019-12-16 16:12:07 +03:00
|
|
|
cp -fR fs/aufs/magic.mk %{temp_devel_root}/fs/aufs
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# SELinux needs security/selinux/include
|
|
|
|
cp -fR security/selinux/include %{temp_devel_root}/security/selinux
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
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
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Clean the scripts tree, and make sure everything is ok (sanity check)
|
|
|
|
# running prepare+scripts (tree was already "prepared" in build)
|
2020-03-14 13:49:15 +03:00
|
|
|
pushd %{temp_devel_root}
|
2020-11-26 21:09:27 +00:00
|
|
|
%smake V=1 -s clean ARCH=%{arch_type}
|
2020-03-14 13:49:15 +03:00
|
|
|
popd
|
2020-11-26 21:09:27 +00:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
rm -f %{temp_devel_root}/.config.old
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Fix permissions
|
2019-07-16 18:30:53 +03:00
|
|
|
chmod -R a+rX %{temp_devel_root}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Disable mrproper in -devel rpms
|
2022-11-07 03:13:34 +03:00
|
|
|
#patch -p1 --fuzz=0 -d %{temp_devel_root} -i %{SOURCE2}
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
2022-03-09 19:02:02 +01:00
|
|
|
# End of build_devel
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2021-05-03 15:56:13 +03:00
|
|
|
# TODO: maybe move to /usr/lib/debug?
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{build_debug}
|
2019-07-16 18:30:53 +03:00
|
|
|
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 {}`'
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End of build_debug
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
# https://patchwork.kernel.org/patch/11446123/
|
2019-12-07 21:57:55 +03:00
|
|
|
_libressl_sign(){
|
|
|
|
if [ ! -f "$1" ]; then
|
2022-03-15 17:03:05 +03:00
|
|
|
echo "No file $1"
|
|
|
|
return 0
|
2019-12-07 21:57:55 +03:00
|
|
|
fi
|
|
|
|
f="$1"
|
2020-03-18 23:36:11 +03:00
|
|
|
%if %{with gost_sign}
|
2020-03-29 01:07:43 +03:00
|
|
|
%{src_dir}/scripts/sign-file streebog512 \
|
|
|
|
"%{certs_signing_key_priv_rnd}.GOST" "%{certs_signing_key_priv_rnd}.GOST" "$f"
|
2020-03-15 20:26:01 +03:00
|
|
|
%else
|
|
|
|
%{src_dir}/scripts/sign-file sha512 \
|
2020-03-20 11:27:35 +03:00
|
|
|
"%{certs_signing_key_priv_rnd}.RSA" "%{certs_signing_key_priv_rnd}.RSA" "$f"
|
2020-03-15 20:26:01 +03:00
|
|
|
%endif
|
2019-12-07 21:57:55 +03:00
|
|
|
unset f
|
|
|
|
}
|
|
|
|
export -f _libressl_sign
|
2020-03-13 20:35:12 +03:00
|
|
|
find %{temp_modules}/%{kver_full}/kernel \
|
|
|
|
%if %{with uml}
|
2022-03-15 17:03:05 +03:00
|
|
|
%{temp_root}/lib/modules-uml/%{kver_full} \
|
2020-03-13 20:35:12 +03:00
|
|
|
%endif
|
|
|
|
-name '*.ko' -print0 | sort -u | \
|
2019-12-07 21:57:55 +03:00
|
|
|
xargs --null -P "$(nproc)" -I {} "$SHELL" -e -x -c 'if ! _libressl_sign "{}"; \
|
|
|
|
then echo Failed _libressl_sign on "{}" && exit 1; fi'
|
2019-11-13 17:35:59 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Set extraversion to match srpm to get nice version reported by the tools
|
2019-07-16 18:30:53 +03:00
|
|
|
LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{fullrpmrel}/" Makefile
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%if %{build_perf}
|
2020-12-27 23:26:55 +03:00
|
|
|
%smake -C tools/perf -s PYTHON=%{__python3} HAVE_CPLUS_DEMANGLE=1 WERROR=0 prefix=%{_prefix} lib=%{_lib} NO_GTK2=1 all
|
2020-11-27 01:21:49 +03:00
|
|
|
%smake -C tools/perf -s prefix=%{_prefix} lib=%{_lib} NO_GTK2=1 man
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{build_cpupower}
|
2022-03-09 19:02:02 +01:00
|
|
|
# Make sure version-gen.sh is executable.
|
2013-11-16 00:27:01 +04:00
|
|
|
chmod +x tools/power/cpupower/utils/version-gen.sh
|
2014-01-23 11:57:37 +04:00
|
|
|
%make -C tools/power/cpupower CPUFREQ_BENCH=false
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2019-11-11 22:27:50 +03:00
|
|
|
_cleanup
|
2022-03-09 19:02:02 +01:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
############################################################################
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%install
|
2022-03-09 19:02:02 +01:00
|
|
|
cd %{src_dir}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-09-26 15:32:27 +03:00
|
|
|
# TODO: get rid of temporary directory, install to buildroot directly?
|
2013-11-16 00:27:01 +04:00
|
|
|
# We want to be able to test several times the install part
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
cp -a %{temp_root} %{buildroot}
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
#if %%{with oblig_signed_modules}
|
|
|
|
# Multithreaded verification that every kernel module has a signature attached to it
|
2019-11-11 21:16:01 +03:00
|
|
|
mkdir -p "%{certs_dir_rnd}"
|
2019-11-14 01:26:18 +03:00
|
|
|
touch %{certs_verify_tmp}
|
2019-11-11 21:16:01 +03:00
|
|
|
_verify_signature(){
|
|
|
|
if [ -z "$1" ] || [ ! -f "$1" ]; then return; fi
|
2022-03-15 17:03:05 +03:00
|
|
|
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
|
2019-11-11 21:16:01 +03:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
export -f _verify_signature
|
2020-03-13 20:35:12 +03:00
|
|
|
find %{target_modules} \
|
|
|
|
%if %{with uml}
|
2022-03-15 17:03:05 +03:00
|
|
|
%{buildroot}/lib/modules-uml/%{kver_full} \
|
2020-03-13 20:35:12 +03:00
|
|
|
%endif
|
|
|
|
-name '*.ko' -print0 | sort -u | \
|
2019-11-11 23:48:27 +03:00
|
|
|
xargs --null -P "$(nproc)" -I {} "$SHELL" -c '_verify_signature "{}"'
|
2019-11-14 01:26:18 +03:00
|
|
|
if [ -f %{certs_verify_tmp} ]; then
|
2019-11-11 21:16:01 +03:00
|
|
|
echo "ERROR: seems that signatures of none modules were verified!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
rm -f %{certs_verify_tmp}
|
2022-03-09 19:02:02 +01:00
|
|
|
#endif
|
2019-11-11 21:16:01 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Compressing modules
|
2022-03-15 17:03:05 +03:00
|
|
|
%if %{with compress_modules}
|
2021-05-04 15:17:47 +03:00
|
|
|
# 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 ;}
|
2022-03-09 19:02:02 +01:00
|
|
|
# took 43-47s, with disk cache (2+ runs) ~42s, +21%%
|
2021-05-04 15:17:47 +03:00
|
|
|
# zstd-compressed initramfs image initrd-5.10.34-generic-1rosa2019.1-x86_64.img with *.ko.xz is 56,3 MiB
|
2022-03-09 19:02:02 +01:00
|
|
|
# zstd-compressed initramfs image initrd-5.10.34-generic-2rosa2019.1-x86_64.img with *.ko.zst is 58,4 MiB (+3.6%%)
|
2021-05-04 15:17:47 +03:00
|
|
|
# /lib/modules/5.10.34-generic-1rosa2019.1-x86_64 (*.ko.xz) is 78,1 MiB
|
2022-03-09 19:02:02 +01:00
|
|
|
# /lib/modules/5.10.34-generic-2rosa2019.1-x86_64 (*.ko.zst) is 83,9 MiB (+7%%)
|
2021-05-04 15:17:47 +03:00
|
|
|
# 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.
|
2022-03-15 17:03:05 +03:00
|
|
|
#{zstd_cmd} -T0 --train $(find . -type f -name '*.ko')
|
2021-05-04 15:17:47 +03:00
|
|
|
#[ -f dictionary ]
|
2021-05-03 18:21:14 +03:00
|
|
|
# -T1 (one thread) because we run multiple zstd processes by xargs
|
2022-03-15 17:03:05 +03:00
|
|
|
%if %{with modxz}
|
2022-03-09 19:02:02 +01:00
|
|
|
find %{target_modules} -name "*.ko" | %kxargs xz -6e
|
2022-03-15 17:03:05 +03:00
|
|
|
%else
|
|
|
|
find %{target_modules} -name "*.ko" | %kxargs %{zstd_cmd} --rm -T1 #-D dictionary
|
|
|
|
rm -f dictionary
|
|
|
|
%endif
|
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-09-26 15:32:27 +03:00
|
|
|
%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}
|
2022-10-07 00:01:12 +03:00
|
|
|
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
|
2022-09-26 15:32:27 +03:00
|
|
|
done
|
|
|
|
%endif #/with binary_extra_modules
|
|
|
|
|
2021-05-23 14:11:15 +03:00
|
|
|
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}
|
2021-05-03 15:56:13 +03:00
|
|
|
|
Delete old initrds by RPM
After moving to dnf (installonlypkg(kernel)) schema of packaging the kernel,
the %%postun scriptlet stopped working properly because $1 is the number
of packages left after the transaction, and there are multiple
kernels - packages with the same name but of different version/release - left.
Let's just make initrd be %%ghost as Fedora (but increase its size from Fedora's 20 MiB to 65 MiB),
and drop deleting empty directories etc. Recent commit fixed ownership of directories,
now /lib/modules/kernel_version is owned by RPM (it was not), dkms will remove modules
that it built, and, if anything else was left, then let's just not touch it, why must we delete
what we know nothing about?
Also delete scriptlet in the devel subpackage, that scriptlet would probably cause problems
with reinstalling the devel package.
2021-05-24 21:10:00 +03:00
|
|
|
# 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
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{build_debug}
|
2021-05-03 15:56:13 +03:00
|
|
|
install -m 644 vmlinux %{buildroot}%{_bootdir}/vmlinux-%{kver_full}
|
|
|
|
find %{buildroot}%{_modulesdir} -type f -name '*.debug' | sed -e 's,^%{buildroot},,' | sort -u >> %{debuginfo_files}
|
2022-03-09 19:02:02 +01:00
|
|
|
%endif
|
|
|
|
# End of build_debug
|
2021-05-03 15:56:13 +03:00
|
|
|
|
2015-04-21 19:03:58 +03:00
|
|
|
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
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Sniff, if we compressed all the modules, we change the stamp :(
|
2013-11-16 00:27:01 +04:00
|
|
|
# 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
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# 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.
|
2013-11-16 00:27:01 +04:00
|
|
|
for i in *; do
|
2019-07-16 18:30:53 +03:00
|
|
|
touch $i/modules.description
|
2013-11-16 00:27:01 +04:00
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Need to set extraversion to match srpm again to avoid rebuild
|
2019-07-16 18:30:53 +03:00
|
|
|
LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{fullrpmrel}/" Makefile
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
%if %{build_perf}
|
|
|
|
# Perf tool binary and supporting scripts/binaries
|
2020-12-11 19:39:08 +00:00
|
|
|
make -C tools/perf -s V=1 DESTDIR=%{buildroot} WERROR=0 HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} lib=%{_lib} install
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2020-05-11 09:33:18 +03:00
|
|
|
# Versionize shebang (#!/usr/bin/env python -> #!/usr/bin/python3)
|
2022-03-17 10:23:10 +03:00
|
|
|
sed -i '1 s,^#!/usr/bin/env python$,#!%{__python3},' \
|
|
|
|
%{buildroot}%{_prefix}/libexec/perf-core/scripts/python/exported-sql-viewer.py \
|
|
|
|
%{buildroot}%{_prefix}/libexec/perf-core/scripts/python/libxed.py
|
2020-05-11 09:33:18 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Perf man pages (note: implicit rpm magic compresses them later)
|
2022-03-15 17:03:05 +03:00
|
|
|
make -C tools/perf -s V=1 DESTDIR=%{buildroot} WERROR=0 HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} install-man
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{build_cpupower}
|
2014-01-23 11:57:37 +04:00
|
|
|
make -C tools/power/cpupower DESTDIR=%{buildroot} libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install
|
2013-11-16 00:27:01 +04:00
|
|
|
rm -f %{buildroot}%{_libdir}/*.{a,la}
|
2022-03-09 19:02:02 +01:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%find_lang cpupower
|
2022-03-09 19:02:02 +01:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
mv cpupower.lang ../
|
|
|
|
chmod 0755 %{buildroot}%{_libdir}/libcpupower.so*
|
|
|
|
mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig
|
|
|
|
install -m644 %{SOURCE50} %{buildroot}%{_unitdir}/cpupower.service
|
2015-03-17 20:53:12 +03:00
|
|
|
install -m644 %{SOURCE53} %{buildroot}%{_unitdir}/cpupower.path
|
2013-11-16 00:27:01 +04:00
|
|
|
install -m644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/cpupower
|
2015-03-13 17:29:40 +03:00
|
|
|
install -m755 %{SOURCE52} %{buildroot}%{_bindir}/cpupower-start.sh
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2022-03-09 19:02:02 +01:00
|
|
|
# Delete junk
|
2020-08-06 17:26:48 +03:00
|
|
|
rm -fr %{buildroot}%{_usr}/src/*/kernel-source-*
|
2020-08-19 20:02:58 +03:00
|
|
|
|
|
|
|
%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
|
2022-03-09 19:02:02 +01:00
|
|
|
|
|
|
|
# Drop hidden files
|
|
|
|
rm -f %{buildroot}%{_docdir}/kernel-5.10-generic-doc/devicetree/bindings/.yamllint
|
|
|
|
|
|
|
|
# Fix perms
|
2022-10-11 09:24:23 +03:00
|
|
|
%if %{build_perf}
|
2022-03-09 19:02:02 +01:00
|
|
|
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
|
2022-10-11 09:24:23 +03:00
|
|
|
%endif
|