2019-11-12 02:06:06 +03:00
|
|
|
# _get_email() in %%build contains bashisms for regexping
|
|
|
|
%define _buildshell /bin/bash
|
|
|
|
|
2019-11-13 17:35:59 +03:00
|
|
|
# Prevent RPM scripts from stripping signatures,
|
|
|
|
# we strip binaries manually in %%build
|
|
|
|
%define __strip %(which true)
|
|
|
|
|
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
|
|
|
|
%define _python_bytecompile_build 0
|
|
|
|
|
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.
|
|
|
|
%global _find_debuginfo_dwz_opts %{nil}
|
|
|
|
|
2019-04-09 17:26:40 +03:00
|
|
|
%define kernelversion 5
|
2019-12-11 21:21:05 +03:00
|
|
|
%define patchlevel 4
|
2019-07-16 18:30:53 +03:00
|
|
|
# sublevel is used for stable-based kernels
|
upd: 5.4.79 -> 5.4.80
```
$ wget -qO- https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.80 | grep Date: -A2 | grep -v Date: | sort -u
--
ACPI: button: Add DMI quirk for Medion Akoya E2228T
ah6: fix error return code in ah6_input()
ALSA: ctl: fix error path at adding user-defined element set
ALSA: firewire: Clean up a locking issue in copy_resp_to_buf()
ALSA: hda/realtek: Add some Clove SSID in the ALC293(ALC1220)
ALSA: hda/realtek - Add supported for Lenovo ThinkPad Headset Button
ALSA: mixart: Fix mutex deadlock
ALSA: usb-audio: Add delay quirk for all Logitech USB devices
arm64: dts: allwinner: a64: bananapi-m64: Enable RGMII RX/TX delay on PHY
arm64: dts: allwinner: a64: OrangePi Win: Fix ethernet node
arm64: dts: allwinner: a64: Pine64 Plus: Fix ethernet node
arm64: dts: allwinner: beelink-gs1: Enable both RGMII RX/TX delay
arm64: dts: allwinner: h5: OrangePi PC2: Fix ethernet node
arm64: dts: allwinner: h5: OrangePi Prime: Fix ethernet node
arm64: dts: allwinner: Pine H64: Enable both RGMII RX/TX delay
arm64: dts: imx8mm: fix voltage for 1.6GHz CPU operating point
arm64: dts imx8mn: Remove non-existent USB OTG2
arm64: errata: Fix handling of 1418040 with late CPU onlining
arm64: psci: Avoid printing in cpu_psci_cpu_die()
arm64: smp: Tell RCU about CPUs that fail to come online
ARM: dts: imx50-evk: Fix the chip select 1 IOMUX
arm: dts: imx6qdl-udoo: fix rgmii phy-mode for ksz9031 phy
ARM: dts: sun6i: a31-hummingbird: Enable RGMII RX/TX delay on Ethernet PHY
ARM: dts: sun7i: bananapi-m1-plus: Enable RGMII RX/TX delay on Ethernet PHY
ARM: dts: sun7i: cubietruck: Enable RGMII RX/TX delay on Ethernet PHY
ARM: dts: sun8i: a83t: Enable both RGMII RX/TX delay on Ethernet PHY
ARM: dts: sun8i: h3: orangepi-plus2e: Enable RGMII RX/TX delay on Ethernet PHY
ARM: dts: sun8i: r40: bananapi-m2-ultra: Fix ethernet node
ARM: dts: sun9i: Enable both RGMII RX/TX delay on Ethernet PHY
ARM: dts: sunxi: bananapi-m2-plus: Enable RGMII RX/TX delay on Ethernet PHY
ASoC: qcom: lpass-platform: Fix memory leak
atm: nicstar: Unmap DMA on send error
bnxt_en: read EEPROM A2h address using page 0
bpf, sockmap: Avoid returning unneeded EAGAIN when redirecting to self
bpf, sockmap: Ensure SO_RCVBUF memory is observed on ingress redirect
bpf, sockmap: Fix partial copy_page_to_iter so progress can still be made
bpf, sockmap: On receive programs try to fast track SK_PASS ingress
bpf, sockmap: Skb verdict SK_PASS to self already checked rmem limits
bpf, sockmap: Use truesize with sk_rmem_schedule()
can: af_can: prevent potential access of uninitialized member in canfd_rcv()
can: af_can: prevent potential access of uninitialized member in can_rcv()
can: dev: can_restart(): post buffer from the right context
can: flexcan: fix failure handling of pm_runtime_get_sync()
can: flexcan: flexcan_chip_start(): fix erroneous flexcan_transceiver_enable() during bus-off recovery
can: kvaser_pciefd: Fix KCAN bittiming limits
can: kvaser_usb: kvaser_usb_hydra: Fix KCAN bittiming limits
can: m_can: m_can_class_free_dev(): introduce new function
can: m_can: m_can_handle_state_change(): fix state change
can: m_can: m_can_stop(): set device to software init mode before closing
can: m_can: process interrupt only when not runtime suspended
can: mcba_usb: mcba_usb_start_xmit(): first fill skb, then pass to can_put_echo_skb()
can: peak_usb: fix potential integer overflow on shift of a int
can: tcan4x5x: replace depends on REGMAP_SPI with depends on SPI
can: tcan4x5x: tcan4x5x_can_probe(): add missing error checking for devm_regmap_init()
can: tcan4x5x: tcan4x5x_can_remove(): fix order of deregistration
can: ti_hecc: Fix memleak in ti_hecc_probe
devlink: Add missing genlmsg_cancel() in devlink_nl_sb_port_pool_fill()
Drivers: hv: vmbus: Allow cleanup of VMBUS_CONNECT_CPU if disconnected
drm/amd/display: Add missing pflip irq for dcn2.0
drm/i915: Handle max_bpc==16
drm/sun4i: dw-hdmi: fix error return code in sun8i_dw_hdmi_bind()
efivarfs: fix memory leak in efivarfs_create()
efi/x86: Free efi_pgd with free_pages()
Exempt multicast addresses from five-second neighbor lifetime
ext4: fix bogus warning in ext4_update_dx_flag()
fail_function: Remove a redundant mutex unlock
gfs2: fix possible reference leak in gfs2_check_blk_type
HID: logitech-dj: Fix an error in mse_bluetooth_descriptor
HID: logitech-dj: Fix Dinovo Mini when paired with a MX5x00 receiver
HID: logitech-dj: Handle quad/bluetooth keyboards with a builtin trackpad
HID: logitech-hidpp: Add PID for MX Anywhere 2
hwmon: (pwm-fan) Fix RPM calculation
iio: accel: kxcjk1013: Add support for KIOX010A ACPI DSM for setting tablet-mode
iio: accel: kxcjk1013: Replace is_smo8500_device with an acpi_type enum
iio: adc: mediatek: fix unset field
iio: light: fix kconfig dependency bug for VCNL4035
inet_diag: Fix error path to cancel the meseage in inet_req_diag_fill()
Input: adxl34x - clean up a data type in adxl34x_probe()
Input: resistive-adc-touch - fix kconfig dependency on IIO_BUFFER
iommu/vt-d: Avoid panic if iommu init fails in tboot system
iommu/vt-d: Move intel_iommu_gfx_mapped to Intel IOMMU header
ip_tunnels: Set tunnel option flag when tunnel metadata is present
ipv6: Fix error path to cancel the meseage
lan743x: fix issue causing intermittent kernel log warnings
lan743x: prevent entire kernel HANG on open, for some platforms
libfs: fix error cast of negative value in simple_attr_write()
Linux 5.4.80
mac80211: free sta in sta_info_insert_finish() on errors
mac80211: minstrel: fix tx status processing corner case
mac80211: minstrel: remove deferred sampling code
MIPS: Alchemy: Fix memleak in alchemy_clk_setup_cpu
MIPS: export has_transparent_hugepage() for modules
mlxsw: core: Use variable timeout for EMAD retries
mmc: sdhci-pci: Prefer SDR25 timing for High Speed mode for BYT-based Intel controllers
mm: memcg/slab: fix root memcg vmstats
mm, page_alloc: skip ->waternark_boost for atomic order-0 allocations
mm/userfaultfd: do not access vma->vm_mm after calling handle_userfault()
net: b44: fix error return code in b44_init_one()
net: bridge: add missing counters to ndo_get_stats64 callback
net: dsa: mv88e6xxx: Avoid VTU corruption on 6097
net: ethernet: ti: cpsw: fix error return code in cpsw_probe()
net: ftgmac100: Fix crash when removing driver
net: Have netpoll bring-up DSA management interface
netlabel: fix an uninitialized warning in netlbl_unlabel_staticlist()
netlabel: fix our progress tracking in netlbl_unlabel_staticlist()
net: lantiq: Wait for the GPHY firmware to be ready
net/mlx4_core: Fix init_hca fields offset
net/mlx5: Add handling of port type in rule deletion
net/mlx5: Disable QoS when min_rates on all VFs are zero
net/mlx5: E-Switch, Fail mlx5_esw_modify_vport_rate if qos disabled
net/ncsi: Fix netlink registration
net: qualcomm: rmnet: Fix incorrect receive packet handling during cleanup
net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid()
net/tls: fix corrupted data in recvmsg
net: usb: qmi_wwan: Set DTR quirk for MR400
net: x25: Increase refcnt of "struct x25_neigh" in x25_rx_call_request
page_frag: Recover from memory pressure
perf lock: Don't free "lock_seq_stat" if read_count isn't zero
pinctrl: rockchip: enable gpio pclk for rockchip_gpio_to_irq
ptrace: Set PF_SUPERPRIV when checking capability
qed: fix error return code in qed_iwarp_ll2_start()
qlcnic: fix error return code in qlcnic_83xx_restart_hw()
RDMA/pvrdma: Fix missing kfree() in pvrdma_register_device()
regulator: avoid resolve_supply() infinite recursion
regulator: fix memory leak with repeated set_machine_constraints()
regulator: pfuze100: limit pfuze-support-disable-sw to pfuze{100,200}
regulator: ti-abb: Fix array out of bound read access on the first transition
regulator: workaround self-referent regulators
Revert "arm: sun8i: orangepi-pc-plus: Set EMAC activity LEDs to active high"
rfkill: Fix use-after-free in rfkill_resume()
RMDA/sw: Don't allow drivers using dma_virt_ops on highmem configs
s390/cpum_sf.c: fix file permission for cpum_sfb_size
s390/dasd: fix null pointer dereference for ERP requests
sched/fair: Fix overutilized update in enqueue_task_fair()
scsi: ufs: Fix unbalanced scsi_block_reqs_cnt caused by ufshcd_hold()
sctp: change to hold/put transport for proto_unreach_timer
seccomp: Set PF_SUPERPRIV when checking capability
selftests/bpf: Fix error return code in run_getsockopt_test()
selftests: kvm: Fix the segment descriptor layout to match the actual layout
speakup: Do not let the line discipline be used several times
spi: bcm2835aux: Fix use-after-free on unbind
spi: Introduce device-managed SPI controller allocation
spi: lpspi: Fix use-after-free on unbind
spi: npcm-fiu: Don't leak SPI master in probe error path
staging: rtl8723bs: Add 024c:0627 to the list of SDIO device-ids
swiotlb: using SIZE_MAX needs limits.h included
tcp: only postpone PROBE_RTT if RTT is < current min_rtt estimate
tools, bpftool: Add missing close before bpftool net attach exit
tty: serial: imx: fix potential deadlock
tty: serial: imx: keep console clocks always on
vfs: remove lockdep bogosity in __sb_start_write
x86/microcode/intel: Check patch signature before saving microcode for early loading
xfs: fix the minrecs logic when dealing with inode root child blocks
xfs: return corresponding errcode if xfs_initialize_perag() fail
xfs: revert "xfs: fix rmap key and record comparison functions"
xfs: strengthen rmap record flags checking
xtensa: disable preemption around cache alias management calls
xtensa: fix TLBTEMP area placement
```
2020-11-25 14:10:31 +03:00
|
|
|
%define sublevel 80
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2016-07-22 22:05:03 +03:00
|
|
|
# Release number. Increase this before a rebuild.
|
upd: 5.4.72 -> 5.4.77, changelog:
$ for i in `seq 73 77`; do wget https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.4.$i ; done
$ cat * | grep ^Date: -A2 | grep -v ^Date: | sort -u | sed -e 's,^ ,,g'
9P: Cast to loff_t before multiplying
ACPI: Add out of bounds and numa_off protections to pxm_to_node()
ACPI: button: fix handling lid state changes when input device closed
acpi-cpufreq: Honor _PSD table setting on new AMD CPUs
ACPI: debug: don't allow debugging when ACPI is disabled
ACPI: EC: PM: Drop ec_no_wakeup check from acpi_ec_dispatch_gpe()
ACPI: EC: PM: Flush EC work unconditionally after wakeup
ACPI / extlog: Check for RDMSR failure
ACPI: HMAT: Fix handling of changes from ACPI 6.2 to ACPI 6.3
ACPI: NFIT: Fix comparison to '-ENXIO'
ACPI: video: use ACPI backlight for HP 635 Notebook
ALSA: bebob: potential info leak in hwdep_read()
ALSA: hda/ca0132 - Add AE-7 microphone selection commands.
ALSA: hda/ca0132 - Add new quirk ID for SoundBlaster AE-7.
ALSA: hda: fix jack detection with Realtek codecs when in D3
ALSA: hda/hdmi: fix incorrect locking in hdmi_pcm_close
ALSA: hda/realtek - Add mute Led support for HP Elitebook 845 G7
ALSA: hda/realtek: Enable audio jacks of ASUS D700SA with ALC887
ALSA: hda/realtek - Enable headphone for ASUS TM420
ALSA: hda/realtek - Fixed HP headset Mic can't be detected
ALSA: hda/realtek - set mic to auto detect on a HP AIO machine
ALSA: hda/realtek - The front Mic on a HP machine doesn't work
ALSA: seq: oss: Avoid mutex lock for a long-time ioctl
ALSA: usb-audio: Add implicit feedback quirk for MODX
ALSA: usb-audio: Add implicit feedback quirk for Qu-16
ALSA: usb-audio: Add implicit feedback quirk for Zoom UAC-2
ALSA: usb-audio: add usb vendor id as DSD-capable for Khadas devices
ARC: [dts] fix the errors detected by dtbs_check
arch/x86/amd/ibs: Fix re-arming IBS Fetch
ARC: perf: redo the pct irq missing in device-tree handling
arc: plat-hsdk: fix kconfig dependency warning when !RESET_CONTROLLER
ARC: stack unwinding: avoid indefinite looping
arm64: asm: Add new-style position independent function annotations
arm64: berlin: Select DW_APB_TIMER_OF
arm64: Change .weak to SYM_FUNC_START_WEAK_PI for arch/arm64/lib/mem*.S
arm64: dts: actions: limit address range for pinctrl node
arm64: dts: allwinner: h5: remove Mali GPU PMU module
arm64: dts: imx8mq: Add missing interrupts to GPC
arm64: dts: marvell: espressobin: Add ethernet switch aliases
arm64: dts: meson: add missing g12 rng clock
arm64: dts: meson: vim3: correct led polarity
arm64: dts: qcom: msm8916: Fix MDP/DSI interrupts
arm64: dts: qcom: msm8916: Remove one more thermal trip point unit name
arm64: dts: qcom: pm8916: Remove invalid reg size from wcd_codec
arm64: dts: renesas: r8a774c0: Fix MSIOF1 DMA channels
arm64: dts: renesas: r8a77990: Fix MSIOF1 DMA channels
arm64: dts: renesas: ulcb: add full-pwr-cycle-in-suspend into eMMC nodes
arm64: dts: zynqmp: Remove additional compatible string for i2c IPs
arm64: lib: Use modern annotations for assembly functions
arm64: link with -z norelro regardless of CONFIG_RELOCATABLE
arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE
arm64: Run ARCH_WORKAROUND_1 enabling code on all CPUs
arm64: Run ARCH_WORKAROUND_2 enabling code on all CPUs
arm64/smp: Move rcu_cpu_starting() earlier
arm64: topology: Stop using MPIDR for topology information
ARM: 8997/2: hw_breakpoint: Handle inexact watchpoint addresses
ARM: 9007/1: l2c: fix prefetch bits init in L2X0_AUX_CTRL using DT values
ARM: at91: pm: of_node_put() after its usage
ARM: dts: imx6sl: fix rng node
ARM: dts: meson8: remove two invalid interrupt lines from the GPU node
arm: dts: mt7623: add missing pause for switchport
ARM: dts: omap4: Fix sgx clock rate for 4430
ARM: dts: owl-s500: Fix incorrect PPI interrupt specifiers
ARM: dts: s5pv210: move fixed clocks under root node
ARM: dts: s5pv210: move PMU node out of clock controller
ARM: dts: s5pv210: remove dedicated 'audio-subsystem' node
ARM: dts: s5pv210: remove DMA controller bus node name to fix dtschema warnings
ARM: dts: sun4i-a10: fix cpu_alert temperature
ARM: dts: sun8i: r40: bananapi-m2-ultra: Fix dcdc1 regulator
ARM: OMAP2+: Restore MPU power domain if cpu_cluster_pm_enter() fails
ARM: s3c24xx: fix missing system reset
ARM: s3c24xx: fix mmc gpio lookup tables
ARM: samsung: fix PM debug build with DEBUG_LL but !MMU
ASoC: fsl: imx-es8328: add missing put_device() call in imx_es8328_probe()
ASoC: fsl_sai: Instantiate snd_soc_dai_driver
ASoC: Intel: Skylake: Add alternative topology binary name
ASoC: qcom: lpass-cpu: fix concurrency issue
ASoC: qcom: lpass-platform: fix memory leak
ASoC: tlv320aic32x4: Fix bdiv clock rate derivation
ata: ahci: mvebu: Make SATA PHY optional for Armada 3720
ata: sata_nv: Fix retrieving of active qcs
ata: sata_rcar: Fix DMA boundary mask
ath10k: check idx validity in __ath10k_htt_rx_ring_fill_n()
ath10k: Fix the size used in a 'dma_free_coherent()' call in an error handling path
ath10k: fix VHT NSS calculation when STBC is enabled
ath10k: provide survey info as accumulated data
ath10k: start recovery process when payload length exceeds max htc length for sdio
ath6kl: prevent potential array overflow in ath6kl_add_new_sta()
ath6kl: wmi: prevent a shift wrapping bug in ath6kl_wmi_delete_pstream_cmd()
ath9k: Fix potential out of bounds in ath9k_htc_txcompletion_cb()
ath9k: hif_usb: fix race condition between usb_get_urb() and usb_kill_anchored_urbs()
backlight: sky81452-backlight: Fix refcount imbalance on error
binder: fix UAF when releasing todo list
binder: Remove bogus warning on failed same-process transaction
blk-cgroup: Fix memleak on error path
blk-cgroup: Pre-allocate tree node on blkg_conf_prep
blk-mq: move cancel of hctx->run_work to the front of blk_exit_queue
block: ratelimit handle_bad_sector() message
Bluetooth: btusb: Fix memleak in btusb_mtk_submit_wmt_recv_urb
Bluetooth: hci_uart: Cancel init work before unregistering
Bluetooth: Only mark socket zapped after unlocking
bnxt_en: Check abort error state in bnxt_open_nic().
bnxt_en: Fix regression in workqueue cleanup logic in bnxt_remove_one().
bnxt_en: Invoke cancel_delayed_work_sync() for PFs also.
bnxt_en: Log unknown link speed appropriately.
bnxt_en: Re-write PCI BARs after PCI fatal error.
bnxt_en: Send HWRM_FUNC_RESET fw command unconditionally.
bpf: Fix comment for helper bpf_current_task_under_cgroup()
bpf: Limit caller's stack depth 256 for subprogs with tailcalls
bpf: Permit map_ptr arithmetic with opcode add and offset 0
brcm80211: fix possible memleak in brcmf_proto_msgbuf_attach
brcmfmac: check ndev pointer
brcmfmac: Fix warning message after dongle setup failed
brcmsmac: fix memory leak in wlc_phy_attach_lcnphy
btrfs: cleanup cow block on error
btrfs: fix readahead hang and use-after-free after removing a device
btrfs: fix replace of seed device
btrfs: fix use-after-free on readahead extent after failure to create it
btrfs: improve device scanning messages
btrfs: qgroup: fix wrong qgroup metadata reserve for delayed inode
btrfs: reschedule if necessary when logging directory items
btrfs: send, orphanize first all conflicting inodes when processing references
btrfs: send, recompute reference path after orphanization of a directory
btrfs: tree-checker: fix false alert caused by legacy btrfs root item
btrfs: tree-checker: validate number of chunk stripes and parity
btrfs: use kvzalloc() to allocate clone_roots in btrfs_ioctl_send()
bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
cachefiles: Handle readpage error correctly
cadence: force nonlinear buffers to be cloned
can: flexcan: disable clocks during stop mode
can: flexcan: flexcan_chip_stop(): add error handling and propagate error value
can: j1935: j1939_tp_tx_dat_new(): fix missing initialization of skbcnt
can: m_can_platform: don't call m_can_class_suspend in runtime suspend
ceph: promote to unsigned long long before shifting
chelsio/chtls: correct function return and return type
chelsio/chtls: correct netdevice for vlan interface
chelsio/chtls: fix always leaking ctrl_skb
chelsio/chtls: fix deadlock issue
chelsio/chtls: fix memory leaks caused by a race
chelsio/chtls: fix memory leaks in CPL handlers
chelsio/chtls: fix socket lock
chelsio/chtls: fix tls record info to user
cifs: handle -EINTR in cifs_setattr
cifs: remove bogus debug code
cifs: Return the error from crypt_message when enc/dec key not found.
clk: at91: clk-main: update key before writing AT91_CKGR_MOR
clk: bcm2835: add missing release if devm_clk_hw_register fails
clk: imx8mq: Fix usdhc parents order
clk: keystone: sci-clk: fix parsing assigned-clock data during probe
clk: mediatek: add UART0 clock support
clk: meson: g12a: mark fclk_div2 as critical
clk: qcom: gcc-sdm660: Fix wrong parent_map
clk: rockchip: Initialize hw to error to avoid undefined behavior
clk: ti: clockdomain: fix static checker warning
coresight: etm4x: Handle unreachable sink in perf mode
coresight: etm: perf: Fix warning caused by etm_setup_aux failure
coresight: Make sysfs functional on topologies with per core sink
cpufreq: armada-37xx: Add missing MODULE_DEVICE_TABLE
cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_reboot_notifier
cpufreq: sti-cpufreq: add stih418 support
crypto: algif_aead - Do not set MAY_BACKLOG on the async path
crypto: algif_skcipher - EBUSY on aio should be an error
crypto: caam/qi - add fallback for XTS with more than 8B IV
crypto: ccp - fix error handling
crypto: ixp4xx - Fix the size used in a 'dma_free_coherent()' call
crypto: mediatek - Fix wrong return value in mtk_desc_ring_alloc()
crypto: omap-sham - fix digcnt register handling with export/import
crypto: picoxcell - Fix potential race condition bug
crypto: x86/crc32c - fix building with clang ias
cxgb4: handle 4-tuple PEDIT to NAT mode translation
cxgb4: set up filter action after rewrites
cxl: Rework error message for incompatible slots
cypto: mediatek - fix leaks in mtk_desc_ring_alloc
device property: Don't clear secondary pointer for shared primary firmware node
device property: Keep secondary firmware node secondary by type
dmaengine: dma-jz4780: Fix race in jz4780_dma_tx_status
dmaengine: dmatest: Check list for emptiness before access its last entry
dmaengine: dw: Activate FIFO-mode for memory peripherals only
dmaengine: dw: Add DMA-channels mask cell support
drivers/net/wan/hdlc_fr: Correctly handle special skb->protocol values
drivers/perf: thunderx2_pmu: Fix memory resource error handling
drivers/perf: xgene_pmu: Fix uninitialized resource struct
drivers/virt/fsl_hypervisor: Fix error handling path
drivers: watchdog: rdc321x_wdt: Fix race condition bugs
drm/amd/display: Avoid MST manager resource leak.
drm/amd/display: Don't invoke kgdb_breakpoint() unconditionally
drm/amd/display: Fix kernel panic by dal_gpio_open() error
drm/amd/display: Fix wrong return value in dm_update_plane_state()
drm/amd/display: HDMI remote sink need mode validation for Linux
drm/amd/display: Increase timeout for DP Disable
drm/amdgpu: add DID for navi10 blockchain SKU
drm/amdgpu: correct the gpu reset handling for job != NULL case
drm/amdgpu: don't map BO in reserved region
drm/amdgpu: increase the reserved VM size to 2MB
drm/amdkfd: Use same SQ prefetch setting as amdgpu
drm/amd/pm: increase mclk switch threshold to 200 us
drm/bridge/synopsys: dsi: add support for non-continuous HS clock
drm/brige/megachips: Add checking if ge_b850v3_lvds_init() is working correctly
drm/crc-debugfs: Fix memleak in crc_control_write
drm/gma500: fix error check
drm/i915: Break up error capture compression loops with cond_resched()
drm/i915: Drop runtime-pm assert from vgpu io accessors
drm/i915: Force VT'd workarounds when running as a guest OS
drm/i915/gt: Delay execlist processing for tgl
drm/msm/a6xx: fix a potential overflow issue
drm/msm: Avoid div-by-zero in dpu_crtc_atomic_check()
drm: mxsfb: check framebuffer pitch
drm/nouveau/gem: fix "refcount_t: underflow; use-after-free"
drm/nouveau/nouveau: fix the start/end range for migration
drm: panel: Fix bpc for OrtusTech COM43H4M85ULC panel
drm: panel: Fix bus format for OrtusTech COM43H4M85ULC panel
drm/panfrost: add amlogic reset quirk callback
drm/panfrost: Ensure GPU quirks are always initialised
drm/panfrost: Fix a deadlock between the shrinker and madvise path
drm/sun4i: frontend: Fix the scaler phase on A33
drm/sun4i: frontend: Reuse the ch0 phase for RGB formats
drm/sun4i: frontend: Rework a bit the phase data
drm/ttm: fix eviction valuable range check.
drm/vc4: drv: Add error handding for bind
drm/vkms: fix xrgb on compute crc
EDAC/aspeed: Fix handling of platform_get_irq() error
EDAC/i5100: Fix error handling order in i5100_init_one()
EDAC/ti: Fix handling of platform_get_irq() error
eeprom: at25: set minimum read/write access stride to 1
efivarfs: Replace invalid slashes with exclamation marks in dentries.
erofs: avoid duplicated permission check for "trusted." xattrs
evm: Check size of security.evm before using it
ext4: Detect already used quota file early
ext4: fix error handling code in add_new_gdb
ext4: fix invalid inode checksum
ext4: fix leaking sysfs kobject after failed mount
ext4: limit entries returned when counting fsmap records
extcon: ptn5150: Fix usage of atomic GPIO with sleeping GPIO chips
f2fs: add trace exit in exception path
f2fs: fix to check segment boundary during SIT page readahead
f2fs: fix uninit-value in f2fs_lookup
f2fs: handle errors of f2fs_get_meta_page_nofail
f2fs: wait for sysfs kobject removal before freeing f2fs_sb_info
fbmem: add margin check to fb_check_caps()
firmware: arm_scmi: Add missing Rx size re-initialisation
firmware: arm_scmi: Fix ARCH_COLD_RESET
Fix use after free in get_capset_info callback.
Fonts: Replace discarded const qualifier
fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent
fs: dlm: fix configfs memory leak
fs: Don't invalidate page buffers in block_write_full_page()
fs: fix NULL dereference due to data race in prepend_path()
ftrace: Fix recursion check for NMI test
ftrace: Handle tracing when switching between context
fuse: fix page dereference after free
futex: Fix incorrect should_fail_futex() handling
futex: Handle transient "ownerless" rtmutex state correctly
gfs2: add validation checks for size of superblock
gfs2: use-after-free in sysfs deregistration
gfs2: Wake up when sd_glock_disposal becomes zero
gianfar: Account for Tx PTP timestamp in the skb headroom
gianfar: Replace skb_realloc_headroom with skb_cow_head for PTP
gtp: fix an use-before-init in gtp_newlink()
HID: hid-input: fix stylus battery reporting
HID: ite: Add USB id match for Acer One S1003 keyboard dock
HID: roccat: add bounds checking in kone_sysfs_write_settings()
HID: wacom: Avoid entering wacom_wac_pen_report for pad / battery
hil/parisc: Disable HIL driver when it gets stuck
hwmon: (pmbus/max34440) Fix status register reads for MAX344{51,60,61}
i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs
i2c: imx: Fix external abort on interrupt in exit paths
i2c: rcar: Auto select RESET_CONTROLLER
i3c: master add i3c_master_attach_boardinfo to preserve boardinfo
i3c: master: Fix error return in cdns_i3c_master_probe()
i40iw: Add support to make destroy QP synchronous
ia64: fix build error with !COREDUMP
ia64: kprobes: Use generic kretprobe trampoline handler
IB/mlx4: Adjust delayed work when a dup is observed
IB/mlx4: Fix starvation in paravirt mux/demux
ibmveth: Identify ingress large send packets.
ibmveth: Switch order of ibmveth_helper calls.
ibmvnic: fix ibmvnic_set_mac
ibmvnic: save changed mac address to adapter->mac_addr
ibmvnic: set up 200GBPS speed
IB/rdmavt: Fix sizeof mismatch
icmp: randomize the global rate limiter
ida: Free allocated bitmap in error path
iio: adc: gyroadc: fix leak of device node iterator
iio: adc: stm32-adc: fix runtime autosuspend delay when slow polling
iio:adc:ti-adc0832 Fix alignment issue with timestamp
iio:adc:ti-adc12138 Fix alignment issue with timestamp
iio:gyro:itg3200: Fix timestamp alignment and prevent data leak.
iio:light:si1145: Fix timestamp alignment and prevent data leak.
ima: Don't ignore errors from crypto_shash_update()
Input: ep93xx_keypad - fix handling of platform_get_irq() error
Input: imx6ul_tsc - clean up some errors in imx6ul_tsc_resume()
Input: omap4-keypad - fix handling of platform_get_irq() error
Input: stmfts - fix a & vs && typo
Input: sun4i-ps2 - fix handling of platform_get_irq() error
Input: twl4030_keypad - fix handling of platform_get_irq() error
iomap: Clear page error before beginning a write
iomap: fix WARN_ON_ONCE() from unprivileged users
ionic: check port ptr before use
ip_gre: set dev->hard_header_len and dev->needed_headroom properly
ipmi_si: Fix wrong return value in try_smi_init()
ip_tunnel: fix over-mtu packet send fail without TUNNEL_DONT_FRAGMENT flags
ipv4: Restore flowi4_oif update before call to xfrm_lookup_route
ipvs: clear skb->tstamp in forwarding path
ipvs: Fix uninit-value in do_ip_vs_set_ctl()
iwlwifi: mvm: split a print to avoid a WARNING in ROC
kdb: Fix pager search for multi-line strings
kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"
kthread_worker: prevent queuing delayed work from timer_fn when it is being canceled
KVM: arm64: Fix AArch32 handling of DBGD{CCINT,SCRext} and DBGVCR
KVM: nVMX: Reload vmcs01 if getting vmcs12's pages fails
KVM: nVMX: Reset the segment cache when stuffing guest segs
KVM: PPC: Book3S HV: Do not allocate HPT for a nested guest
KVM: SVM: Initialize prev_ga_tag before use
KVM: x86: emulating RDPID failure shall return #UD rather than #GP
KVM: x86/mmu: Commit zap of remaining invalid pages when recovering lpages
leds: bcm6328, bcm6358: use devres LED registering function
libceph: clear con->out_msg on Policy::stateful_server faults
lib/crc32.c: fix trivial typo in preprocessor condition
lib/crc32test: remove extra local_irq_disable/enable
lightnvm: fix out-of-bounds write to array devices->info[]
linkage: Introduce new macros for assembler symbols
Linux 5.4.73
Linux 5.4.74
Linux 5.4.75
Linux 5.4.76
Linux 5.4.77
mac80211: handle lack of sband->bitrates in rates
maiblox: mediatek: Fix handling of platform_get_irq() error
mailbox: avoid timer start from callback
md/bitmap: fix memory leak of temporary bitmap
md/bitmap: md_bitmap_get_counter returns wrong blocks
md/raid5: fix oops during stripe resizing
media: ati_remote: sanity check for both endpoints
media: bdisp: Fix runtime PM imbalance on error
media: camss: Fix a reference count leak.
media: exynos4-is: Fix a reference count leak
media: exynos4-is: Fix a reference count leak due to pm_runtime_get_sync
media: exynos4-is: Fix several reference count leaks due to pm_runtime_get_sync
media: firewire: fix memory leak
media: i2c: ov5640: Enable data pins on poweron for DVP mode
media: i2c: ov5640: Remain in power down for DVP mode unless streaming
media: i2c: ov5640: Separate out mipi configuration from s_power
media: imx274: fix frame interval handling
media: m5mols: Check function pointer in m5mols_sensor_power
media: media/pci: prevent memory leak in bttv_probe
media: mx2_emmaprp: Fix memleak in emmaprp_probe
media: omap3isp: Fix memleak in isp_probe
media: ov5640: Correct Bit Div register in clock tree diagram
media: platform: fcp: Fix a reference count leak.
media: platform: Improve queue set up flow for bug fixing
media: platform: s3c-camif: Fix runtime PM imbalance on error
media: platform: sti: hva: Fix runtime PM imbalance on error
media: rcar-csi2: Allocate v4l2_async_subdev dynamically
media: rcar_drif: Allocate v4l2_async_subdev dynamically
media: rcar_drif: Fix fwnode reference leak when parsing DT
media: rcar-vin: Fix a reference count leak.
media: Revert "media: exynos4-is: Add missed check for pinctrl_lookup_state()"
media: rockchip/rga: Fix a reference count leak.
media: s5p-mfc: Fix a reference count leak
media: saa7134: avoid a shift overflow
media: staging/intel-ipu3: css: Correctly reset some memory
media: st-delta: Fix reference count leak in delta_run_work
media: sti: Fix reference count leaks
media: stm32-dcmi: Fix a reference count leak
media: tc358743: cleanup tc358743_cec_isr
media: tc358743: initialize variable
media: ti-vpe: Fix a missing check and reference count leak
media: tuner-simple: fix regression in simple_set_radio_freq
media: tw5864: check status of tw5864_frameinterval_get
media: uvcvideo: Ensure all probed info is returned to v4l2
media: uvcvideo: Fix dereference of out-of-bound list iterator
media: uvcvideo: Fix uvc_ctrl_fixup_xu_info() not having any effect
media: uvcvideo: Set media controller entity functions
media: uvcvideo: Silence shift-out-of-bounds warning
media: venus: core: Fix runtime PM imbalance in venus_probe
media: venus: fixes for list corruption
media: videodev2.h: RGB BT2020 and HSV are always full range
media: vsp1: Fix runtime PM imbalance on error
memory: emif: Remove bogus debugfs error handling
memory: fsl-corenet-cf: Fix handling of platform_get_irq() error
memory: omap-gpmc: Fix a couple off by ones
memory: omap-gpmc: Fix build error without CONFIG_OF
mfd: sm501: Fix leaks in probe()
mic: vop: copy data to kernel space then write to io memory
MIPS: DEC: Restore bootmem reservation for firmware working memory area
misc: mic: scif: Fix error handling path
misc: rtsx: do not setting OC_POWER_DOWN reg in rtsx_pci_init_ocp()
misc: rtsx: Fix memory leak in rtsx_pci_probe
misc: vop: add round_up(x,4) for vring_size to avoid kernel panic
mlx4: handle non-napi callers to napi_poll
mlxsw: core: Fix memory leak on module removal
mlxsw: core: Fix use-after-free in mlxsw_emad_trans_finish()
mm: always have io_remap_pfn_range() set pgprot_decrypted()
mmc: sdhci-acpi: AMDI0040: Set SDHCI_QUIRK2_PRESET_VALUE_BROKEN
mmc: sdhci: Add LTR support for some Intel BYT based controllers
mmc: sdhci-of-esdhc: set timeout to max before tuning
mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true
mmc: sdio: Check for CISTPL_VERS_1 buffer size
mmc: via-sdmmc: Fix data race bug
mm/error_inject: Fix allow_error_inject function signatures.
mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
mm/memcg: fix device private memcg accounting
mm: mempolicy: fix potential pte_unmap_unlock pte error
mm, oom_adj: don't loop through tasks in __set_oom_adj when not necessary
mm/page_owner: change split_page_owner to take a count
mm/swapfile.c: fix potential memory leak in sys_swapon
module: statically initialize init section freeing data
mtd: lpddr: Fix bad logic in print_drs_error
mtd: lpddr: fix excessive stack usage with clang
mtd: mtdoops: Don't write panic data twice
mtd: rawnand: vf610: disable clk on error handling path in probe
mtd: spinand: gigadevice: Add QE Bit
mtd: spinand: gigadevice: Only one dummy byte in QUADIO
mtd: spi-nor: Don't copy self-pointing struct around
mwifiex: Do not use GFP_KERNEL in atomic context
mwifiex: don't call del_timer_sync() on uninitialized timer
mwifiex: fix double free
nbd: make the config put is called before the notifying the waiter
net: 9p: initialize sun_server.sun_path to have addr's value only when addr is valid
net: dsa: rtl8366: Check validity of passed VLANs
net: dsa: rtl8366rb: Support all 4096 VLANs
net: dsa: rtl8366: Refactor VLAN/PVID init
net: dsa: rtl8366: Skip PVID setting if not requested
netem: fix zero division in tabledist
net: enic: Cure the enic api locking trainwreck
net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()
net: fec: Fix PHY init after phy_reset_after_clk_enable()
netfilter: conntrack: connection timeout after re-register
netfilter: ebtables: Fixes dropping of small packets in bridge nat
netfilter: nf_fwd_netdev: clear timestamp in forwarding path
netfilter: nf_log: missing vlan offload tag and proto
netfilter: nftables_offload: KASAN slab-out-of-bounds Read in nft_flow_rule_create
net: fix pos incrementment in ipv6_route_seq_next
net: ftgmac100: Fix Aspeed ast2600 TX hang issue
net: hdlc: In hdlc_rcv, check to make sure dev is an HDLC device
net: hdlc_raw_eth: Clear the IFF_TX_SKB_SHARING flag after calling ether_setup
net: hns3: Clear the CMDQ registers before unmapping BAR region
net/ipv4: always honour route mtu during forwarding
net: j1939: j1939_session_fresh_new(): fix missing initialization of skbcnt
net: korina: cast KSEG0 address to pointer in kfree
net: korina: fix kfree of rx/tx descriptor array
net/mlx5: Don't call timecounter cyc2time directly from 1PPS flow
net: Properly typecast int values to set sk_max_pacing_rate
net/sched: act_mpls: Add softdep on mpls_gso.ko
net/sched: act_tunnel_key: fix OOB write in case of IPv6 ERSPAN tunnels
net_sched: remove a redundant goto chain check
net/smc: fix valid DMBE buffer sizes
net: stmmac: use netif_tx_start|stop_all_queues() function
net/tls: sendfile fails with ktls offload
net: usb: qmi_wwan: add Cellient MPL200 card
net: usb: qmi_wwan: add Telit LE910Cx 0x1230 composition
net: wilc1000: clean up resource in error path of init mon interface
nexthop: Fix performance regression in nexthop deletion
nfc: Ensure presence of NFC_ATTR_FIRMWARE_NAME attribute in nfc_genl_fw_download()
NFS4: Fix oops when copy_file_range is attempted with NFS4.0 source
NFSD: Add missing NFSv2 .pc_func methods
NFS: fix nfs_path in case of a rename retry
NFSv4.2: support EXCHGID4_FLAG_SUPP_FENCE_OPS 4.2 EXCHANGE_ID flag
NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE
nl80211: fix non-split wiphy information
nl80211: fix OBSS PD min and max offset validation
NTB: hw: amd: fix an issue about leak system resources
ntfs: add check for mft record size in superblock
nvmem: core: fix possibly memleak when use nvmem_cell_info_to_nvmem_cell()
nvme-pci: disable the write zeros command for Intel 600P/P3100
nvme-rdma: fix crash when connect rejected
nvme-rdma: handle unexpected nvme completion data length
nvmet: fix a NULL pointer dereference when tracing the flush command
nvmet: fix uninitialized work for zero kato
objtool: Support Clang non-section symbols in ORC generation
of: Fix reserved-memory overlap detection
openrisc: Fix issue with get_user for 64-bit values
opp: Prevent memory leak in dev_pm_opp_attach_genpd()
overflow: Include header file with SIZE_MAX declaration
p54: avoid accessing the data mapped to streaming DMA
PCI: aardvark: Check for errors from pci_bridge_emul_init() call
PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI
PCI/IOV: Mark VFs as not implementing PCI_COMMAND_MEMORY
PCI: iproc: Set affinity mask on MSI interrupts
perf/core: Fix a memory leak in perf_event_parse_addr_filter()
perf: correct SNOOPX field offset
perf intel-pt: Fix "context_switch event has no tid" error
perf python scripting: Fix printable strings in python3 scripts
perf stat: Skip duration_time in setup_system_wide
perf/x86/amd/ibs: Don't include randomized bits in get_ibs_op_count()
perf/x86/amd/ibs: Fix raw sample data accumulation
perf/x86/intel/ds: Fix x86_pmu_stop warning for large PEBS
perf/x86/intel: Fix Ice Lake event constraint table
perf/x86/intel/uncore: Reduce the number of CBOX counters
perf/x86/intel/uncore: Update Ice Lake uncore units
phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
pinctrl: bcm: fix kconfig dependency warning when !GPIOLIB
pinctrl: mcp23s08: Fix mcp23x17 precious range
pinctrl: mcp23s08: Fix mcp23x17_regmap initialiser
platform/x86: mlx-platform: Remove PSU EEPROM configuration
PM: hibernate: remove the bogus call to get_gendisk() in software_resume()
PM: runtime: Drop pm_runtime_clean_up_links()
PM: runtime: Drop runtime PM references to supplier on link removal
PM: runtime: Fix timer_expires data type on 32-bit arches
PM: runtime: Remove link state checks in rpm_get/put_supplier()
PM: runtime: Resume the device earlier in __device_release_driver()
powercap: restrict energy meter to root access
powerpc/64s/radix: Fix mm_cpumask trimming race vs kthread_use_mm
powerpc/book3s64/hash/4k: Support large linear mapping range with 4K
powerpc/drmem: Make lmb_size 64 bit
powerpc: Fix undetected data corruption with P9N DD2.1 VSX CI load emulation
powerpc/icp-hv: Fix missing of_node_put() in success path
powerpc/memhotplug: Make lmb size 64bit
powerpc/perf: Exclude pmc5/6 from the irrelevant PMU group constraints
powerpc/perf/hv-gpci: Fix starting index value
powerpc/powermac: Fix low_sleep_handler with KUAP and KUEP
powerpc/powernv/dump: Fix race while processing OPAL dump
powerpc/powernv/elog: Fix race while processing OPAL error log event.
powerpc/powernv/smp: Fix spurious DBG() warning
powerpc/pseries: Avoid using addr_to_pfn in real mode
powerpc/pseries: explicitly reschedule during drmem_lmb list traversal
powerpc/pseries: Fix missing of_node_put() in rng_init()
powerpc/rtas: Restrict RTAS requests from userspace
powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
powerpc/tau: Check processor type before enabling TAU interrupt
powerpc/tau: Convert from timer to workqueue
powerpc/tau: Disable TAU between measurements
powerpc/tau: Remove duplicated set_thresholds() call
powerpc/tau: Use appropriate temperature sample interval
powerpc/vnic: Extend "failover pending" window
powerpc: Warn about use of smt_snooze_delay
power: supply: bq27xxx: report "not charging" on all types
power: supply: test_power: add missing newlines when printing parameters by sysfs
printk: reduce LOG_BUF_SHIFT range for H8300
pseries/drmem: don't cache node id in drmem_lmb struct
ptrace: fix task_join_group_stop() for the case when current is traced
pty: do tty_flip_buffer_push without port->lock in pty_write
pwm: img: Fix null pointer access in probe
pwm: lpss: Add range limit check for the base_unit register value
pwm: lpss: Fix off by one error in base_unit math in pwm_lpss_prepare()
qtnfmac: fix resource leaks on unsupported iftype error return path
quota: clear padding in v2r1_mem2diskdqb()
r8169: fix data corruption issue on RTL8402
r8169: fix issue with forced threading in combination with shared interrupts
r8169: fix operation under forced interrupt threading
ramfs: fix nommu mmap with gaps in the page cache
rapidio: fix error handling path
rapidio: fix the missed put_device() for rio_mport_add_riodev
ravb: Fix bit fields checking in ravb_hwtstamp_get()
RDMA/addr: Fix race with netevent_callback()/rdma_addr_cancel()
RDMA/cma: Consolidate the destruction of a cma_multicast in one place
RDMA/cma: Remove dead code for kernel rdmacm multicast
RDMA/hns: Add a check for current state before modifying QP
RDMA/hns: Fix missing sq_sig_type when querying QP
RDMA/hns: Fix the wrong value of rnr_retry when querying qp
RDMA/hns: Set the unsupported wr opcode
RDMA/ipoib: Set rtnl_link_ops for ipoib interfaces
RDMA/mlx5: Disable IB_DEVICE_MEM_MGT_EXTENSIONS if IB_WR_REG_MR can't work
RDMA/mlx5: Fix potential race between destroy and CQE poll
RDMA/qedr: Fix inline size returned for iWARP
RDMA/qedr: Fix memory leak in iWARP CM
RDMA/qedr: Fix qp structure memory leak
RDMA/qedr: Fix return code if accept is called on a destroyed qp
RDMA/qedr: Fix use of uninitialized field
RDMA/rxe: Fix skb lifetime in rxe_rcv_mcast_pkt()
RDMA/rxe: Handle skb_clone() failure in rxe_recv.c
RDMA/ucma: Add missing locking around rdma_leave_multicast()
RDMA/ucma: Fix locking for ctx->events_reported
RDMA/umem: Fix ib_umem_find_best_pgsz() for mappings that cross a page boundary
RDMA/umem: Fix signature of stub ib_umem_find_best_pgsz()
RDMA/umem: Prevent small pages from being returned by ib_umem_find_best_pgsz()
regulator: defer probe when trying to get voltage from unresolved supply
regulator: resolve supply after creating regulator
reiserfs: Fix memory leak in reiserfs_parse_options()
reiserfs: only call unlock_new_inode() if I_NEW
Revert "coresight: Make sysfs functional on topologies with per core sink"
ring-buffer: Fix recursion protection transitions between interrupt context
ring-buffer: Return 0 on success from ring_buffer_resize()
riscv: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
rpmsg: glink: Use complete_all for open states
rpmsg: smd: Fix a kobj leak in in qcom_smd_parse_edge()
rtc: rx8010: don't modify the global rtc ops
rtl8xxxu: prevent potential memory leak
rtw88: increse the size of rx buffer size
s390/pkey: fix paes selftest failure with paes and pkey static build
s390/qeth: don't let HW override the configured port role
s390/startup: avoid save_area_sync overflow
s390/stp: add locking to sysfs functions
samples/bpf: Fix possible deadlock in xdpsock
sched/fair: Fix wrong cpu selecting from isolated domain
sched/features: Fix !CONFIG_JUMP_LABEL case
scripts/setlocalversion: make git describe output more reliable
scsi: be2iscsi: Fix a theoretical leak in beiscsi_create_eqs()
scsi: bfa: Fix error return in bfad_pci_init()
scsi: core: Don't start concurrent async scan on same host
scsi: csiostor: Fix wrong return value in csio_hw_prep_fw()
scsi: ibmvfc: Fix error return in ibmvfc_probe()
scsi: ibmvscsi: Fix potential race after loss of transport
scsi: mpt3sas: Fix sync irqs
scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove()
scsi: mvumi: Fix error return in mvumi_io_attach()
scsi: qedf: Return SUCCESS if stale rport is encountered
scsi: qedi: Fix list_del corruption while removing active I/O
scsi: qedi: Protect active command list to avoid list corruption
scsi: qla2xxx: Fix crash on session cleanup with unload
scsi: qla2xxx: Fix wrong return value in qla_nvme_register_hba()
scsi: qla2xxx: Fix wrong return value in qlt_chk_unresolv_exchg()
scsi: qla2xxx: Warn if done() or free() are called on an already freed srb
scsi: qla4xxx: Fix an error handling path in 'qla4xxx_get_host_stats()'
scsi: smartpqi: Avoid crashing kernel for controller issues
scsi: target: core: Add CONTROL field for trace events
scsi: target: tcmu: Fix warning: 'page' may be used uninitialized
scsi: ufs: ufs-qcom: Fix race conditions caused by ufs_qcom_testbus_config()
sctp: Fix COMM_LOST/CANT_STR_ASSOC err reporting on big-endian platforms
seccomp: Make duplicate listener detection non-racy
selftests/bpf: Define string const as global for test_sysctl_prog.c
selftests/bpf: Fix test_sysctl_loop{1, 2} failure due to clang change
selftests: forwarding: Add missing 'rp_filter' configuration
selftests/ftrace: Change synthetic event name for inter-event-combined test
selftests/powerpc: Fix eeh-basic.sh exit codes
selftests: rtnetlink: load fou module for kci_test_encap_fou() test
selftests/x86/fsgsbase: Reap a forgotten child
selftests/x86/fsgsbase: Test PTRACE_PEEKUSER for GSBASE with invalid LDT GS
serial: 8250_mtk: Fix uart_get_baud_rate warning
serial: pl011: Fix lockdep splat when handling magic-sysrq interrupt
serial: qcom_geni_serial: To correct QUP Version detection logic
serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init
sfp: Fix error handing in sfp_probe()
sgl_alloc_order: fix memory leak
slimbus: core: check get_addr before removing laddr ida
slimbus: core: do not enter to clock pause mode in core
slimbus: qcom-ngd-ctrl: disable ngd in qmi server down callback
SMB3: Resolve data corruption of TCP server info fields
soc: fsl: qbman: Fix return value on success
socket: don't clear SOCK_TSTAMP_NEW when SO_TIMESTAMPNS is disabled
socket: fix option SO_TIMESTAMPING_NEW
sparc64: remove mm_cpumask clearing to fix kthread_use_mm race
spi: bcm2835: fix gpio cs level inversion
spi: omap2-mcspi: Improve performance waiting for CHSTAT
spi: spi-s3c64xx: Check return values
spi: spi-s3c64xx: swap s3c64xx_spi_set_cs() and s3c64xx_enable_datapath()
spi: sprd: Release DMA channel also on probe deferral
staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice
staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()
staging: fieldbus: anybuss: jump to correct label in an error path
staging: octeon: Drop on uncorrectable alignment or FCS error
staging: octeon: repair "fixed-link" support
staging: rtl8192u: Do not use GFP_KERNEL in atomic context
SUNRPC: fix copying of multiple pages in gss_read_proxy_verf()
SUNRPC: Mitigate cond_resched() in xprt_transmit()
svcrdma: fix bounce buffers for unaligned offsets and multiple pages
tcp: fix to update snd_wl1 in bulk receiver fast path
tcp: Prevent low rmem stalls with SO_RCVLOWAT.
tipc: fix memory leak caused by tipc_buf_append()
tipc: fix the skb_unshare() in tipc_buf_append()
tipc: fix use-after-free in tipc_bcast_get_mode
tracing: Fix out of bounds write in get_trace_buf
tty: hvcs: Don't NULL tty->driver_data until hvcs_cleanup()
tty: ipwireless: fix error handling
tty: make FONTX ioctl use the tty pointer they were actually passed
tty: serial: earlycon dependency
tty: serial: fsl_lpuart: add LS1028A support
tty: serial: fsl_lpuart: fix lpuart32_poll_get_char
tty: serial: fsl_lpuart: LS1021A has a FIFO size of 16 words, like LS1028A
tty: serial: lpuart: fix lpuart32_write usage
ubi: check kthread_should_stop() after the setting of task state
ubifs: dent: Fix some potential memory leaks while iterating entries
ubifs: Don't parse authentication mount options in remount process
ubifs: Fix a memleak after dumping authentication mount options
ubifs: journal: Make sure to not dirty twice for auth nodes
ubifs: mount_ubifs: Release authentication resource in error handling path
ubifs: xattr: Fix some potential memory leaks while iterating entries
udf: Avoid accessing uninitialized data on failed inode read
udf: Fix memory leak when mounting
udf: Limit sparing table size
uio: free uio id after uio file node is freed
um: change sigio_spinlock to a mutex
USB: Add NO_LPM quirk for Kingston flash drive
USB: adutux: fix debugging
usb: cdc-acm: add quirk to blacklist ETAS ES58X devices
usb: cdc-acm: fix cooldown mechanism
USB: cdc-acm: handle broken union descriptors
USB: cdc-wdm: Make wdm_flush() interruptible and add wdm_fsync().
usb: cdns3: gadget: free interrupt after gadget has deleted
usb: cdns3: gadget: suspicious implicit sign extension
usb: core: Solve race condition in anchor cleanup functions
usb: dwc2: Fix INTR OUT transfers in DDMA mode.
usb: dwc2: Fix parameter type in function pointer prototype
usb: dwc3: Add splitdisable quirk for Hisilicon Kirin Soc
usb: dwc3: core: add phy cleanup for probe error handling
usb: dwc3: core: don't trigger runtime pm when remove driver
usb: dwc3: ep0: Fix delay status handling
usb: dwc3: ep0: Fix ZLP for OUT ep0 requests
usb: dwc3: gadget: Check MPS of the request length
usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command
usb: dwc3: gadget: Resume pending requests after CLEAR_STALL
usb: dwc3: pci: Allow Elkhart Lake to utilize DSM method for PM functionality
usb: dwc3: simple: add support for Hikey 970
usb: gadget: f_ncm: allow using NCM in SuperSpeed Plus gadgets.
usb: gadget: f_ncm: fix ncm_bitrate for SuperSpeed and above.
usb: gadget: function: printer: fix use-after-free in __lock_acquire
usb: gadget: u_ether: enable qmult on SuperSpeed Plus as well
usb: host: fsl-mph-dr-of: check return of dma_set_mask()
usb: mtu3: fix panic in mtu3_gadget_stop()
usb: ohci: Default to per-port over-current protection
USB: serial: cyberjack: fix write-URB completion race
USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231
USB: serial: option: add Quectel EC200T module support
USB: serial: option: add Telit FN980 composition 0x1055
usb: typec: tcpm: During PR_SWAP, source caps should be sent only after tSwapSourceStart
usb: typec: tcpm: reset hard_reset_count for any disconnect
usb: xhci: omit duplicate actions when suspending a runtime suspended host.
usb: xhci: Workaround for S3 issue on AMD SNPS 3.0 xHC
vfio iommu type1: Fix memory leak in vfio_iommu_type1_pin_pages
vfio/pci: Clear token on bypass registration failure
vfio/pci: Decouple PCI_COMMAND_MEMORY bit checks from is_virtfn
video: fbdev: pvr2fb: initialize variables
video: fbdev: radeon: Fix memleak in radeonfb_pci_register
video: fbdev: sis: fix null ptr dereference
video: fbdev: vga16fb: fix setting of pixclock because a pass-by-value error
VMCI: check return value of get_user_pages_fast() for errors
vringh: fix __vringh_iov() when riov and wiov are different
vsock: use ns_capable_noaudit() on socket create
vt: Disable KD_FONT_OP_COPY
vt: keyboard, extend func_buf_lock to readers
vt: keyboard, simplify vt_kdgkbsent
w1: mxc_w1: Fix timeout resolution problem leading to bus error
watchdog: Fix memleak in watchdog_cdev_register
watchdog: sp5100: Fix definition of EFCH_PM_DECODEEN3
watchdog: Use put_device on error
wcn36xx: Fix reported 802.11n rx_highest rate wcn3660/wcn3680
x86/asm: Replace __force_order with a memory clobber
x86/events/amd/iommu: Fix sizeof mismatch
x86/fpu: Allow multiple bits in clearcpuid= parameter
x86/kexec: Use up-to-dated screen_info copy to fill boot params
x86/mce: Add Skylake quirk for patrol scrub reported errors
x86/mce: Make mce_rdmsrl() panic on an inaccessible MSR
x86/nmi: Fix nmi_handle() duration miscalculation
x86/PCI: Fix intel_mid_pci.c build error when ACPI is not enabled
x86/unwind/orc: Fix inactive tasks with stack pointer in %sp on GCC 10 compiled kernels
x86/xen: disable Firmware First mode for correctable memory errors
xen/blkback: use lateeoi irq binding
xen/events: add a new "late EOI" evtchn framework
xen/events: add a proper barrier to 2-level uevent unmasking
xen/events: avoid removing an event channel while handling it
xen/events: block rogue events for some time
xen/events: defer eoi in case of excessive number of events
xen/events: fix race in evtchn_fifo_unmask()
xen/events: switch user event channels to lateeoi model
xen/events: use a common cpu hotplug hook for event channels
xen/gntdev.c: Mark pages as dirty
xen/netback: use lateeoi irq binding
xen/pciback: use lateeoi irq binding
xen/pvcallsback: use lateeoi irq binding
xen/scsiback: use lateeoi irq binding
xfs: don't free rt blocks when we're doing a REMAP bunmapi call
xfs: fix deadlock and streamline xfs_getfsmap performance
xfs: fix high key handling in the rt allocator's query_range function
xfs: fix realtime bitmap/summary file truncation when growing rt volume
xfs: flush for older, xfs specific ioctls
xfs: limit entries returned when counting fsmap records
xfs: make sure the rt allocator doesn't run off the end
xhci: don't create endpoint debugfs entry before ring buffer is set.
2020-11-13 03:15:56 +03:00
|
|
|
%define rpmrel 1
|
2019-07-16 18:30:53 +03:00
|
|
|
%define fullrpmrel %{rpmrel}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%define rpmtag %{disttag}
|
|
|
|
|
|
|
|
# fakerel and fakever never change, they are used to fool
|
2015-07-01 16:47:47 +03:00
|
|
|
# rpm/urpmi/smart and ensure the kernels are installed,
|
|
|
|
# not upgraded so old kernel is not overwritten or removed
|
2013-11-16 00:27:01 +04:00
|
|
|
%define fakever 1
|
|
|
|
%define fakerel %mkrel 1
|
|
|
|
|
|
|
|
# version defines
|
|
|
|
%define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
|
2019-07-16 18:30:53 +03:00
|
|
|
%define kverrel %{kversion}-%{fullrpmrel}
|
2013-11-16 00:27:01 +04:00
|
|
|
%define tar_ver %{kernelversion}.%{patchlevel}
|
|
|
|
|
2020-11-26 21:09:27 +00:00
|
|
|
# i586
|
2015-03-16 18:42:29 +03:00
|
|
|
%ifarch %{ix86}
|
2020-11-26 21:09:27 +00:00
|
|
|
%define arch_suffix i686
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%ifarch %{x86_64}
|
2015-03-16 18:42:29 +03:00
|
|
|
%define arch_suffix %{_arch}
|
|
|
|
%endif
|
|
|
|
|
2020-11-26 21:09:27 +00:00
|
|
|
%ifarch aarch64
|
|
|
|
%define arch_suffix arm64
|
|
|
|
%endif
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
%define buildrpmrel %{fullrpmrel}%{rpmtag}-%{arch_suffix}
|
2013-11-16 00:27:01 +04:00
|
|
|
%define buildrel %{kversion}-%{buildrpmrel}
|
|
|
|
|
2019-11-11 21:28:45 +03:00
|
|
|
# %%build_selinux may be defined in branding-configs
|
2020-03-18 22:20:03 +03:00
|
|
|
#%%{?build_selinux}%{?!build_selinux:%bcond_with selinux}
|
|
|
|
#%%if %{with selinux}
|
2019-11-11 21:28:45 +03:00
|
|
|
%global enhanced_security 1
|
2020-03-18 22:20:03 +03:00
|
|
|
#%%else
|
|
|
|
#%%global enhanced_security 0
|
|
|
|
#%%endif
|
|
|
|
# Allow "rpmbuild --without enhanced_security <...>"
|
|
|
|
%{?_without_enhanced_security:%global enhanced_security 0}
|
2019-11-11 21:28:45 +03:00
|
|
|
|
2019-11-17 16:56:39 +03:00
|
|
|
%if %{enhanced_security}
|
|
|
|
%bcond_without additional_keys
|
|
|
|
%endif
|
2020-03-13 20:35:12 +03:00
|
|
|
# User Mode Linux, https://habr.com/ru/company/itsumma/blog/459558/
|
2020-11-26 21:09:27 +00:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
2020-03-13 20:35:12 +03:00
|
|
|
%bcond_without uml
|
2020-11-26 21:09:27 +00:00
|
|
|
%else
|
|
|
|
%bcond_with uml
|
|
|
|
%endif
|
2019-11-17 16:56:39 +03:00
|
|
|
|
2020-03-18 22:20:03 +03:00
|
|
|
# "Nickel" is a special brand for certified distros
|
2020-03-29 01:07:43 +03:00
|
|
|
# gost_sign will probably be enabled outside of Nickel later,
|
|
|
|
# but for now let's better do not make such experiments in stable platforms
|
2020-03-18 22:20:03 +03:00
|
|
|
%if %{mdvver} == 201900 || %{mdvver} == 201905
|
|
|
|
%bcond_without nickel
|
2020-03-29 01:07:43 +03:00
|
|
|
%bcond_without gost_sign
|
2020-08-06 14:44:29 +03:00
|
|
|
%bcond_without oblig_signed_modules
|
2020-03-18 22:20:03 +03:00
|
|
|
%else
|
|
|
|
%bcond_with nickel
|
2020-03-29 01:07:43 +03:00
|
|
|
%bcond_with gost_sign
|
2020-08-06 14:44:29 +03:00
|
|
|
%bcond_with oblig_signed_modules
|
2020-03-18 22:20:03 +03:00
|
|
|
%endif
|
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
# Build binary out-of-tree kernel modules (experimental)
|
|
|
|
%if %{mdvver} >= 201905
|
|
|
|
%bcond_without binary_extra_modules
|
|
|
|
%else
|
|
|
|
%bcond_with binary_extra_modules
|
|
|
|
%endif
|
|
|
|
|
2020-07-27 16:53:12 +03:00
|
|
|
%bcond_with ccache
|
2020-08-19 20:02:58 +03:00
|
|
|
%bcond_without flow_abi
|
2020-07-27 16:53:12 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Kernel flavour
|
2020-03-18 22:20:03 +03:00
|
|
|
%if %{with nickel}
|
2019-11-11 21:28:45 +03:00
|
|
|
%define flavour nickel
|
|
|
|
%else
|
2020-03-18 22:20:03 +03: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
|
|
|
|
%define kver_full %{kversion}-%{flavour}-%{buildrpmrel}
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
%define top_dir_name kernel-%{_arch}
|
2013-11-16 00:27:01 +04:00
|
|
|
%define build_dir ${RPM_BUILD_DIR}/%{top_dir_name}
|
2019-07-21 21:43:25 +03:00
|
|
|
%define src_dir %{build_dir}/linux-%{tar_ver}
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
# Common target directories
|
|
|
|
%define _bootdir /boot
|
|
|
|
%define _modulesdir /lib/modules
|
|
|
|
|
|
|
|
%define devel_root /usr/src/linux-%{kver_full}
|
|
|
|
|
|
|
|
# Directories needed for building
|
|
|
|
%define temp_root %{build_dir}/temp-root
|
|
|
|
%define temp_boot %{temp_root}%{_bootdir}
|
|
|
|
%define temp_modules %{temp_root}%{_modulesdir}
|
|
|
|
%define temp_devel_root %{temp_root}%{devel_root}
|
|
|
|
|
|
|
|
# Directories definition needed for installing
|
|
|
|
%define target_boot %{buildroot}%{_bootdir}
|
|
|
|
%define target_modules %{buildroot}%{_modulesdir}
|
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.
|
2019-11-19 16:37:20 +03:00
|
|
|
%define certs_dir_rnd certs
|
2019-12-07 21:57:55 +03:00
|
|
|
%define certs_signing_key_priv_rnd %{certs_dir_rnd}/signing_key_priv.key
|
|
|
|
%define certs_signing_der %{certs_dir_rnd}/signing_key.x509
|
2019-11-11 17:47:53 +03:00
|
|
|
%define certs_key_config_rnd %{certs_dir_rnd}/x509.genkey
|
2019-11-18 18:48:33 +03:00
|
|
|
%define certs_public_keys %{certs_dir_rnd}/public.pem
|
2019-11-11 21:16:01 +03:00
|
|
|
%define certs_verify_tmp %{certs_dir_rnd}/verify.tmp
|
2016-07-29 13:39:16 +03:00
|
|
|
############################################################################
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
# Build defines
|
2019-07-16 17:21:32 +03:00
|
|
|
%define build_doc 0
|
2013-11-16 00:27:01 +04:00
|
|
|
%define build_devel 1
|
2019-11-12 16:07:05 +03:00
|
|
|
%define build_debug 1
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2018-09-04 11:17:26 +03:00
|
|
|
# Build kernel-headers package
|
2020-03-21 03:02:08 +03:00
|
|
|
# Make headers of this kernel not default for rosa2016.1
|
|
|
|
%if %{mdvver} <= 201610
|
|
|
|
%define build_headers 0
|
|
|
|
%else
|
|
|
|
%define build_headers 1
|
2020-03-21 03:17:06 +03:00
|
|
|
%endif
|
2018-09-04 11:17:26 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# build perf and cpupower tools
|
2016-01-06 17:46:38 +03:00
|
|
|
%define build_perf 1
|
2013-11-16 00:27:01 +04:00
|
|
|
%define build_cpupower 1
|
|
|
|
|
|
|
|
# compress modules with xz
|
|
|
|
%define build_modxz 1
|
|
|
|
# End of user definitions
|
|
|
|
|
|
|
|
# buildtime flags
|
|
|
|
%{?_without_doc: %global build_doc 0}
|
|
|
|
%{?_without_devel: %global build_devel 0}
|
|
|
|
%{?_without_debug: %global build_debug 0}
|
|
|
|
%{?_without_perf: %global build_perf 0}
|
|
|
|
%{?_without_cpupower: %global build_cpupower 0}
|
|
|
|
%{?_without_modxz: %global build_modxz 0}
|
|
|
|
|
|
|
|
%{?_with_doc: %global build_doc 1}
|
|
|
|
%{?_with_devel: %global build_devel 1}
|
|
|
|
%{?_with_debug: %global build_debug 1}
|
|
|
|
%{?_with_perf: %global build_perf 1}
|
|
|
|
%{?_with_cpupower: %global build_cpupower 1}
|
|
|
|
%{?_with_modxz: %global build_modxz 1}
|
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
%if %{build_modxz}
|
|
|
|
%define kmod_suffix .xz
|
|
|
|
%else
|
|
|
|
%define kmod_suffix .gz
|
|
|
|
%endif
|
|
|
|
|
2016-07-21 15:59:26 +03:00
|
|
|
%if !%{build_debug}
|
|
|
|
# Disable debug rpms.
|
|
|
|
%define _enable_debug_packages %{nil}
|
|
|
|
%define debug_package %{nil}
|
|
|
|
%endif
|
|
|
|
|
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}
|
2020-11-26 21:09:27 +00:00
|
|
|
%define kmake KBUILD_BUILD_TIMESTAMP='' %make CC='ccache gcc' ARCH="%{arch_suffix}"
|
2013-11-16 00:27:01 +04:00
|
|
|
%else
|
2020-11-26 21:09:27 +00:00
|
|
|
%define kmake %make CC='gcc' ARCH="%{arch_suffix}"
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
2020-07-27 16:53:12 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# there are places where parallel make don't work
|
2014-01-23 11:57:37 +04:00
|
|
|
%define smake make
|
2020-11-26 18:48:55 +00:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
|
|
|
%define arch_type x86
|
|
|
|
%endif
|
|
|
|
%ifarch aarch64
|
|
|
|
%define arch_type arm64
|
|
|
|
%endif
|
|
|
|
|
2014-01-22 18:31:57 +04:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# Parallelize xargs invocations on smp machines
|
|
|
|
%define kxargs xargs %([ -z "$RPM_BUILD_NCPUS" ] \\\
|
|
|
|
&& RPM_BUILD_NCPUS="`/usr/bin/getconf _NPROCESSORS_ONLN`"; \\\
|
|
|
|
[ "$RPM_BUILD_NCPUS" -gt 1 ] && echo "-P $RPM_BUILD_NCPUS")
|
|
|
|
|
|
|
|
#
|
|
|
|
# SRC RPM description
|
|
|
|
#
|
2016-07-26 11:41:00 +03:00
|
|
|
Summary: The Linux kernel
|
2019-07-16 18:30:53 +03:00
|
|
|
Name: kernel
|
2013-11-16 00:27:01 +04:00
|
|
|
Version: %{kversion}
|
2019-07-16 18:30:53 +03:00
|
|
|
Release: %{fullrpmrel}
|
2013-11-16 00:27:01 +04:00
|
|
|
License: GPLv2
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
URL: http://www.kernel.org
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
#
|
|
|
|
# Sources
|
|
|
|
#
|
2018-01-10 22:20:13 +03:00
|
|
|
Source0: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz
|
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.
|
2013-11-16 00:27:01 +04:00
|
|
|
Source2: disable-mrproper-prepare-scripts-configs-in-devel-rpms.patch
|
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
# TODO: make a separate package "ksobirator" and BR it
|
|
|
|
# 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.
|
|
|
|
Source110: kernel-%{arch_suffix}.config
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2015-03-17 20:53:12 +03:00
|
|
|
# Cpupower: the service, the config, etc.
|
2013-11-16 00:27:01 +04:00
|
|
|
Source50: cpupower.service
|
|
|
|
Source51: cpupower.config
|
2015-03-13 17:29:40 +03:00
|
|
|
Source52: cpupower-start.sh
|
2015-03-17 20:53:12 +03:00
|
|
|
Source53: cpupower.path
|
2013-11-16 00:27:01 +04: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
|
|
|
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.
|
2018-01-10 22:20:13 +03:00
|
|
|
Patch1: https://cdn.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kversion}.xz
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
# Patches from mainline
|
|
|
|
# none
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2016-07-26 11:24:24 +03:00
|
|
|
# ROSA-specific patches
|
|
|
|
|
|
|
|
# Perf docs are built after all the kernels. To validate the xml files
|
|
|
|
# generated during that process, xmlto tries to get DTD files from the Net.
|
|
|
|
# If it fails, the whole build fails, which is unfortunate. Let us avoid
|
|
|
|
# this.
|
|
|
|
Patch101: perf-xmlto-skip-validation.patch
|
|
|
|
|
|
|
|
# http://bugs.rosalinux.ru/show_bug.cgi?id=6235
|
|
|
|
# http://bugs.rosalinux.ru/show_bug.cgi?id=6459
|
2019-07-16 18:30:53 +03:00
|
|
|
Patch102: audit-make-it-less-verbose.patch
|
2016-07-26 11:24:24 +03:00
|
|
|
|
2020-08-18 08:02:38 +03:00
|
|
|
# AUFS 5 from http://aufs.sourceforge.net/
|
2019-12-16 16:12:07 +03:00
|
|
|
Patch109: fs-aufs.patch
|
2020-08-18 08:02:38 +03:00
|
|
|
Patch110: fs-aufs-2.patch
|
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
|
2020-08-18 08:02:38 +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
|
|
|
|
Patch201: 0001-AltHa-LSM-module.patch
|
|
|
|
Patch202: 0002-Documentation-for-AltHa-LSM.patch
|
|
|
|
|
2020-03-07 19:46:37 +03:00
|
|
|
# Other patches
|
2020-03-16 23:19:46 +03:00
|
|
|
Patch301: objtool-sync-check.sh-set-the-exit-code-explicitly.patch
|
2020-03-20 11:27:35 +03:00
|
|
|
# sent to upstream, https://patchwork.kernel.org/patch/11446123/
|
2020-03-19 00:41:40 +03:00
|
|
|
Patch302: 0001-sign-file-full-functionality-with-modern-LibreSSL.patch
|
2020-07-27 22:32:06 +03:00
|
|
|
# Add sysctl to disable disk-based swap
|
|
|
|
Patch304: 0001-mm-add-sysctl-to-disable-disk-based-swap.patch
|
2020-08-06 14:30:23 +03:00
|
|
|
# Support loading GOST-signed modules
|
|
|
|
Patch305: 0001-crypto-support-loading-GOST-signed-kernel-modules.patch
|
2020-08-10 10:44:43 +03:00
|
|
|
# Allow to off modules signature check dynamically
|
|
|
|
Patch306: 0001-ROSA-ima-allow-to-off-modules-signature-check-dynami.patch
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2020-03-09 10:50:38 +03:00
|
|
|
# Disable AutoReq
|
|
|
|
AutoReq: 0
|
|
|
|
# but keep autoprov for kmod(xxx)
|
|
|
|
AutoProv: 1
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2020-03-09 10:46:18 +03:00
|
|
|
BuildRequires: bash
|
2014-07-11 16:00:31 +04:00
|
|
|
BuildRequires: bc
|
|
|
|
BuildRequires: binutils
|
|
|
|
BuildRequires: gcc
|
|
|
|
# For power tools
|
|
|
|
BuildRequires: pkgconfig(ncurses)
|
2013-11-16 00:27:01 +04:00
|
|
|
BuildRequires: kmod-devel kmod-compat
|
2018-02-10 19:33:13 +03:00
|
|
|
BuildRequires: bison
|
|
|
|
BuildRequires: flex
|
2019-07-16 18:30:53 +03:00
|
|
|
BuildRequires: bzip2
|
2019-09-24 11:56:44 +03:00
|
|
|
BuildRequires: rsync
|
|
|
|
|
2014-05-19 18:34:31 +04:00
|
|
|
%ifarch x86_64
|
|
|
|
BuildRequires: numa-devel
|
|
|
|
%endif
|
|
|
|
|
2014-07-11 16:00:31 +04:00
|
|
|
# for perf, cpufreq and all other tools
|
|
|
|
# for cpupower
|
|
|
|
%if %{build_cpupower}
|
|
|
|
BuildRequires: pciutils-devel
|
|
|
|
%endif
|
|
|
|
# for perf
|
|
|
|
%if %{build_perf}
|
|
|
|
BuildRequires: asciidoc
|
|
|
|
BuildRequires: audit-devel
|
2013-11-16 00:27:01 +04:00
|
|
|
BuildRequires: binutils-devel
|
2014-07-11 16:00:31 +04:00
|
|
|
BuildRequires: elfutils-devel
|
|
|
|
BuildRequires: libunwind-devel
|
2013-11-16 00:27:01 +04:00
|
|
|
BuildRequires: newt-devel
|
2014-07-11 16:00:31 +04:00
|
|
|
BuildRequires: perl-devel
|
2020-03-09 10:56:05 +03:00
|
|
|
BuildRequires: pkgconfig(python)
|
2013-11-16 00:27:01 +04:00
|
|
|
BuildRequires: xmlto
|
2014-07-11 16:00:31 +04:00
|
|
|
BuildRequires: zlib-devel
|
2016-07-26 18:18:51 +03:00
|
|
|
BuildRequires: pkgconfig(libcrypto)
|
2014-07-11 16:00:31 +04:00
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-11-11 17:47:53 +03:00
|
|
|
%if %{enhanced_security}
|
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
|
|
|
|
BuildRequires: libressl libressl-devel
|
2019-11-11 21:16:01 +03:00
|
|
|
# To verify signatures (find, xargs, hexdump)
|
|
|
|
BuildRequires: findutils util-linux
|
2019-11-11 17:47:53 +03:00
|
|
|
%endif
|
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
%if %{with binary_extra_modules}
|
|
|
|
BuildRequires: kernel-source-rtl8821ce
|
|
|
|
BuildRequires: kernel-source-tripso
|
2020-11-26 18:58:01 +00:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
2020-11-26 21:09:27 +00:00
|
|
|
BuildRequires: kernel-source-shredder-kernel
|
2020-07-29 10:59:41 +03:00
|
|
|
BuildRequires: kernel-source-virtualbox
|
|
|
|
# TODO: drop it for kernels >= 5.6
|
|
|
|
# because all guest modules have been upstreamized
|
|
|
|
# https://www.phoronix.com/scan.php?page=news_item&px=VirtualBox-Shared-Folder-5.6
|
|
|
|
BuildRequires: kernel-source-virtualbox-vboxadditions
|
2020-11-26 18:58:01 +00:00
|
|
|
%endif
|
2020-08-06 17:26:48 +03:00
|
|
|
# rosa-test-suite is maintained in certified branches only
|
|
|
|
# nlkm, memfreetest, pcietest
|
|
|
|
%if %{with nickel}
|
|
|
|
BuildRequires: kernel-source-rosa-test-suite
|
2020-07-29 10:59:41 +03:00
|
|
|
%endif
|
2020-08-06 17:26:48 +03:00
|
|
|
%endif #with binary_extra_modules
|
2020-07-29 10:59:41 +03:00
|
|
|
|
2020-07-27 16:53:12 +03:00
|
|
|
%if %{with ccache}
|
|
|
|
BuildRequires: ccache
|
|
|
|
%endif
|
|
|
|
|
2014-07-11 16:00:31 +04:00
|
|
|
# might be useful too:
|
2020-03-09 10:46:18 +03:00
|
|
|
Recommends: microcode
|
2014-07-11 16:00:31 +04:00
|
|
|
|
2013-11-16 00:27:01 +04: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.
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
%package -n kernel-%{flavour}-%{buildrel}
|
|
|
|
Version: %{fakever}
|
|
|
|
Release: %{fakerel}
|
|
|
|
|
|
|
|
Provides: kernel = %{kverrel}
|
|
|
|
Provides: kernel = %{kernelversion}.%{patchlevel}
|
2019-11-17 15:12:03 +03:00
|
|
|
Provides: kernel-%{flavour} = %{kverrel}
|
2019-11-17 15:18:28 +03:00
|
|
|
%if %{enhanced_security}
|
|
|
|
Provides: kernel-hardened = %{kverrel}
|
|
|
|
Provides: kernel-hardened = %{kernelversion}.%{patchlevel}
|
|
|
|
Provides: kernel-hardened-%{flavour} = %{kverrel}
|
|
|
|
%endif
|
2019-07-16 18:30:53 +03:00
|
|
|
Provides: alsa = 1.0.27
|
|
|
|
Provides: should-restart = system
|
|
|
|
|
|
|
|
Requires(pre): grub2
|
|
|
|
Requires(pre): dracut >= 046
|
|
|
|
Requires(pre): kmod >= 20-1
|
|
|
|
Requires(pre): sysfsutils >= 2.1.0-12
|
|
|
|
Requires: dracut >= 046
|
|
|
|
Requires: linux-firmware >= 20181026
|
|
|
|
Requires: wireless-regdb
|
|
|
|
|
2020-08-19 20:02:58 +03:00
|
|
|
%if %{with flow_abi}
|
|
|
|
Requires: kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
|
|
|
|
%endif
|
|
|
|
|
2020-03-09 10:46:18 +03:00
|
|
|
Recommends: crda
|
2019-07-16 18:30:53 +03:00
|
|
|
|
2020-08-03 20:51:43 +03:00
|
|
|
# Keep these deps on old platforms
|
|
|
|
# but get rid of puling gcc etc. by the kernel on newer platforms
|
|
|
|
%if %{build_devel} && %{mdvver} < 201900
|
2019-07-16 18:30:53 +03:00
|
|
|
Requires: kernel-%{flavour}-devel-%{buildrel}
|
|
|
|
Requires(post): kernel-%{flavour}-devel-%{buildrel}
|
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
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
Summary: A general-purpose Linux Kernel
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
|
|
|
|
%description -n kernel-%{flavour}-%{buildrel}
|
|
|
|
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.
|
|
|
|
|
|
|
|
%post -n kernel-%{flavour}-%{buildrel}
|
|
|
|
# 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.
|
2013-11-16 00:27:01 +04:00
|
|
|
#
|
2019-07-16 18:30:53 +03:00
|
|
|
# depmod is also needed, because some DKMS-modules might have been installed
|
|
|
|
# when the devel package was installed but that was before the main modules
|
|
|
|
# were installed.
|
|
|
|
# This is also the reason the devel package is in Requires(post) for this
|
|
|
|
# package now: it must be installed completely before we call depmod here.
|
|
|
|
/sbin/depmod -a %{kver_full}
|
|
|
|
/sbin/dracut -f /boot/initrd-%{kver_full}.img %{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
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
pushd /boot > /dev/null
|
|
|
|
if [ -L vmlinuz-%{flavour} ]; then
|
|
|
|
rm -f vmlinuz-%{flavour}
|
|
|
|
fi
|
|
|
|
if [ -L initrd-%{flavour}.img ]; then
|
|
|
|
rm -f initrd-%{flavour}.img
|
|
|
|
fi
|
|
|
|
popd > /dev/null
|
|
|
|
exit 0
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
%preun -n kernel-%{flavour}-%{buildrel}
|
|
|
|
pushd /boot > /dev/null
|
|
|
|
if [ -L vmlinuz-%{flavour} ]; then
|
|
|
|
if [ "$(readlink vmlinuz-%{flavour})" = "vmlinuz-%{kver_full}" ]; then
|
|
|
|
rm -f vmlinuz-%{flavour}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -L initrd-%{flavour}.img ]; then
|
|
|
|
if [ "$(readlink initrd-%{flavour}.img)" = "initrd-%{kver_full}.img" ]; then
|
|
|
|
rm -f initrd-%{flavour}.img
|
|
|
|
fi
|
|
|
|
fi
|
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
|
|
|
|
|
|
|
|
popd > /dev/null
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%postun -n kernel-%{flavour}-%{buildrel}
|
|
|
|
rm -f /boot/initrd-%{kver_full}.img
|
|
|
|
rm -f /boot/initrd-%{kver_full}_old.img
|
|
|
|
rm -f /boot/initrd-%{kver_full}kdump.img
|
|
|
|
rm -f /boot/initramfs-%{kver_full}kdump.img
|
|
|
|
|
|
|
|
# Third-party modules might have left something in /lib/modules/.../kernel/.
|
|
|
|
rm -rf /lib/modules/%{kver_full}/kernel/
|
|
|
|
rm -rf /lib/modules/%{kver_full}/modules*
|
|
|
|
# Remove /lib/modules/<...>/ if it is empty (-devel uses it too).
|
|
|
|
find /lib/modules/%{kver_full} -maxdepth 0 -empty -exec rm -rf {} \; || true
|
|
|
|
|
|
|
|
|
2019-07-21 23:50:25 +03:00
|
|
|
%files -n kernel-%{flavour}-%{buildrel} -f kernel_files.%{flavour}
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
%if %build_devel
|
|
|
|
%package -n kernel-%{flavour}-devel-%{buildrel}
|
|
|
|
Version: %{fakever}
|
|
|
|
Release: %{fakerel}
|
|
|
|
Summary: Development files for kernel-%{flavour}-%{buildrel}
|
|
|
|
Group: Development/Kernel
|
|
|
|
Requires: glibc-devel
|
|
|
|
Requires: ncurses-devel
|
|
|
|
Requires: make
|
|
|
|
Requires: gcc
|
|
|
|
Requires: perl
|
|
|
|
Provides: kernel-devel = %{kverrel}
|
2019-11-17 15:12:03 +03:00
|
|
|
Provides: kernel-%{flavour}-devel = %{kverrel}
|
2019-11-17 15:18:28 +03:00
|
|
|
%if %{enhanced_security}
|
|
|
|
Provides: kernel-hardened-devel = %{kverrel}
|
|
|
|
Provides: kernel-hardened-%{flavour}-devel = %{kverrel}
|
|
|
|
%endif
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
%ifarch %{ix86}
|
|
|
|
Conflicts: arch(x86_64)
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
%description -n kernel-%{flavour}-devel-%{buildrel}
|
|
|
|
This package contains the kernel files (headers and build tools)
|
|
|
|
that should be enough to build additional drivers for
|
|
|
|
use with kernel-%{flavour}-%{buildrel}.
|
|
|
|
|
|
|
|
%post -n kernel-%{flavour}-devel-%{buildrel}
|
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
|
|
|
|
|
|
|
%preun -n kernel-%{flavour}-devel-%{buildrel}
|
2019-11-12 16:16:27 +03:00
|
|
|
|
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
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
%postun -n kernel-%{flavour}-devel-%{buildrel}
|
|
|
|
rm -rf /usr/src/linux-%{kver_full} >/dev/null
|
|
|
|
# depmod (called when removing DKMS modules) might have created files in
|
|
|
|
# /lib/modules/.../. Remove these first.
|
|
|
|
rm -rf /lib/modules/%{kver_full}/modules*
|
|
|
|
# Remove the dir if it is already empty.
|
|
|
|
find /lib/modules/%{kver_full} -maxdepth 0 -empty -exec rm -rf {} \; || true
|
|
|
|
|
|
|
|
|
|
|
|
%files -n kernel-%{flavour}-devel-%{buildrel}
|
|
|
|
%dir %{devel_root}
|
|
|
|
%dir %{devel_root}/arch
|
|
|
|
%dir %{devel_root}/include
|
|
|
|
%{devel_root}/Documentation
|
|
|
|
%{devel_root}/arch/um
|
2020-11-26 18:48:55 +00:00
|
|
|
%{devel_root}/arch/%{arch_type}
|
2019-07-16 18:30:53 +03:00
|
|
|
%{devel_root}/block
|
|
|
|
%{devel_root}/certs
|
|
|
|
%{devel_root}/crypto
|
|
|
|
%{devel_root}/drivers
|
|
|
|
%{devel_root}/fs
|
|
|
|
%{devel_root}/include/acpi
|
|
|
|
%{devel_root}/include/asm-generic
|
|
|
|
%{devel_root}/include/clocksource
|
|
|
|
%{devel_root}/include/config
|
|
|
|
%{devel_root}/include/crypto
|
|
|
|
%{devel_root}/include/drm
|
|
|
|
%{devel_root}/include/dt-bindings
|
|
|
|
%{devel_root}/include/generated
|
|
|
|
%{devel_root}/include/keys
|
|
|
|
%{devel_root}/include/kvm
|
|
|
|
%{devel_root}/include/linux
|
|
|
|
%{devel_root}/include/math-emu
|
|
|
|
%{devel_root}/include/media
|
|
|
|
%{devel_root}/include/misc
|
|
|
|
%{devel_root}/include/net
|
|
|
|
%{devel_root}/include/pcmcia
|
|
|
|
%{devel_root}/include/ras
|
|
|
|
%{devel_root}/include/rdma
|
|
|
|
%{devel_root}/include/scsi
|
|
|
|
%{devel_root}/include/sound
|
|
|
|
%{devel_root}/include/target
|
|
|
|
%{devel_root}/include/trace
|
|
|
|
%{devel_root}/include/uapi
|
2019-09-24 18:37:26 +03:00
|
|
|
%{devel_root}/include/vdso
|
2019-07-16 18:30:53 +03:00
|
|
|
%{devel_root}/include/video
|
|
|
|
%{devel_root}/include/xen
|
|
|
|
%{devel_root}/init
|
|
|
|
%{devel_root}/ipc
|
|
|
|
%{devel_root}/kernel
|
|
|
|
%{devel_root}/lib
|
|
|
|
%{devel_root}/mm
|
|
|
|
%{devel_root}/net
|
|
|
|
%{devel_root}/samples
|
|
|
|
%{devel_root}/scripts
|
|
|
|
%{devel_root}/security
|
|
|
|
%{devel_root}/sound
|
|
|
|
%{devel_root}/tools
|
|
|
|
%{devel_root}/usr
|
|
|
|
%{devel_root}/virt
|
|
|
|
%{devel_root}/.config
|
|
|
|
%{devel_root}/Kbuild
|
|
|
|
%{devel_root}/Kconfig
|
|
|
|
%{devel_root}/Makefile
|
|
|
|
%{devel_root}/Module.symvers
|
|
|
|
%{devel_root}/arch/Kconfig
|
|
|
|
%{_modulesdir}/%{kver_full}/build
|
|
|
|
%{_modulesdir}/%{kver_full}/source
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
%if %build_debug
|
|
|
|
%package -n kernel-%{flavour}-%{buildrel}-debuginfo
|
|
|
|
Version: %{fakever}
|
|
|
|
Release: %{fakerel}
|
|
|
|
Summary: Debuginfo for kernel-%{flavour}-%{buildrel}
|
|
|
|
Group: Development/Debug
|
|
|
|
Provides: kernel-debug = %{kverrel}
|
2019-11-17 15:18:28 +03:00
|
|
|
%if %{enhanced_security}
|
|
|
|
Provides: kernel-hardened-debug = %{kverrel}
|
|
|
|
%endif
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
%ifarch %{ix86}
|
|
|
|
Conflicts: arch(x86_64)
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description -n kernel-%{flavour}-%{buildrel}-debuginfo
|
|
|
|
This package contains the files with debuginfo for kernel-%{flavour}-%{buildrel}.
|
|
|
|
|
2019-11-14 00:20:41 +03:00
|
|
|
%files -n kernel-%{flavour}-%{buildrel}-debuginfo -f kernel_debug_files.%{flavour}
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
%package -n kernel-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
Version: %{kversion}
|
|
|
|
Release: %{fullrpmrel}
|
|
|
|
Summary: Meta package for the latest kernel-%{flavour} in %{kernelversion}.%{patchlevel} series
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
Requires: kernel-%{flavour}-%{buildrel}
|
|
|
|
|
|
|
|
%ifarch %{ix86}
|
|
|
|
Conflicts: arch(x86_64)
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description -n kernel-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
This meta package aims to make sure you always have the
|
|
|
|
latest kernel-%{flavour} %{kernelversion}.%{patchlevel}.x installed.
|
|
|
|
|
|
|
|
%files -n kernel-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
# no files
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
|
|
|
%if %build_devel
|
|
|
|
|
|
|
|
%package -n kernel-%{flavour}-%{kernelversion}.%{patchlevel}-devel-latest
|
|
|
|
Version: %{kversion}
|
|
|
|
Release: %{fullrpmrel}
|
|
|
|
Summary: Meta package for the latest kernel-%{flavour}-devel in %{kernelversion}.%{patchlevel} series
|
|
|
|
Group: Development/Kernel
|
|
|
|
Requires: kernel-%{flavour}-devel-%{buildrel}
|
|
|
|
|
|
|
|
%ifarch %{ix86}
|
|
|
|
Conflicts: arch(x86_64)
|
|
|
|
%endif
|
|
|
|
|
|
|
|
Provides: kernel-devel-latest
|
2019-11-17 15:18:28 +03:00
|
|
|
%if %{enhanced_security}
|
|
|
|
Provides: kernel-hardened-devel-latest
|
|
|
|
%endif
|
2019-07-16 18:30:53 +03:00
|
|
|
|
|
|
|
%description -n kernel-%{flavour}-%{kernelversion}.%{patchlevel}-devel-latest
|
|
|
|
This meta package aims to make sure you always have the
|
|
|
|
latest kernel-%{flavour}-devel %{kernelversion}.%{patchlevel}.x installed.
|
|
|
|
|
|
|
|
%files -n kernel-%{flavour}-%{kernelversion}.%{patchlevel}-devel-latest
|
|
|
|
# no files
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%if %build_doc
|
2019-07-16 18:30:53 +03:00
|
|
|
%package -n kernel-doc
|
2013-11-16 00:27:01 +04:00
|
|
|
Version: %{kversion}
|
2019-07-16 18:30:53 +03:00
|
|
|
Release: %{fullrpmrel}
|
|
|
|
Summary: Various documentation bits found in the kernel source
|
2013-11-16 00:27:01 +04:00
|
|
|
Group: Documentation
|
|
|
|
Buildarch: noarch
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
%description -n kernel-doc
|
|
|
|
This package contains documentation files from the kernel source.
|
|
|
|
|
|
|
|
%files -n kernel-doc
|
2019-07-21 21:43:25 +03:00
|
|
|
%doc linux-%{tar_ver}/Documentation/*
|
2019-07-16 18:30:53 +03:00
|
|
|
|
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
|
|
|
|
Version: %{kversion}
|
2019-07-16 18:30:53 +03:00
|
|
|
Release: %{fullrpmrel}
|
2013-11-16 00:27:01 +04:00
|
|
|
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
|
|
|
|
%dir %{_prefix}/libexec/perf-core
|
|
|
|
%dir %{_libdir}/traceevent
|
|
|
|
%dir %{_libdir}/traceevent/plugins
|
|
|
|
%{_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
|
|
|
|
Version: %{kversion}
|
2019-07-16 18:30:53 +03:00
|
|
|
Release: %{fullrpmrel}
|
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
|
|
|
|
Requires(post): rpm-helper >= 0.24.0-3
|
|
|
|
Requires(preun): rpm-helper >= 0.24.0-3
|
2017-01-21 22:28:16 +03:00
|
|
|
Obsoletes: cpufreq < 3.0
|
|
|
|
Obsoletes: cpufrequtils < 10.0
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%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-10-14 13:22:01 +04:00
|
|
|
|
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
|
2015-03-17 20:53:12 +03: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
|
|
|
|
%{_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*
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/cpupower
|
|
|
|
|
|
|
|
############################################################################
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%package -n cpupower-devel
|
|
|
|
Version: %{kversion}
|
2019-07-16 18:30:53 +03:00
|
|
|
Release: %{fullrpmrel}
|
2014-10-14 13:22:01 +04:00
|
|
|
Summary: Development files for cpupower
|
2013-11-16 00:27:01 +04:00
|
|
|
Group: Development/Kernel
|
2019-07-16 18:30:53 +03:00
|
|
|
Requires: cpupower = %{kversion}-%{fullrpmrel}
|
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
|
2019-07-16 18:30:53 +03:00
|
|
|
|
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}
|
2013-11-16 00:27:01 +04:00
|
|
|
%package headers
|
|
|
|
Version: %kversion
|
2019-07-16 18:30:53 +03:00
|
|
|
Release: %fullrpmrel
|
2013-11-16 00:27:01 +04:00
|
|
|
Summary: Linux kernel header files mostly used by your C library
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
Epoch: 1
|
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
|
|
|
|
|
|
|
%description headers
|
|
|
|
C header files from the Linux kernel. The header files define
|
|
|
|
structures and constants that are needed for building most
|
|
|
|
standard programs, notably the C library.
|
|
|
|
|
|
|
|
This package is not suitable for building kernel modules, you
|
|
|
|
should use the 'kernel-devel' package instead.
|
|
|
|
|
|
|
|
%files 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
|
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}
|
2020-03-18 22:20:03 +03:00
|
|
|
|
2020-03-13 20:35:12 +03:00
|
|
|
%package -n kernel-uml-%{flavour}-%{buildrel}
|
|
|
|
Version: %{fakever}
|
|
|
|
Release: %{fakerel}
|
|
|
|
Provides: kernel-uml = %{kverrel}
|
|
|
|
Provides: kernel-uml-%{flavour} = %{kverrel}
|
|
|
|
Summary: User Mode Linux binary
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
|
|
|
|
%description -n kernel-uml-%{flavour}-%{buildrel}
|
2020-03-18 22:20:03 +03:00
|
|
|
User Mode Linux binary.
|
|
|
|
Stripped, debug is in kernel-%{flavour}-%{buildrel}-debuginfo.
|
2020-03-13 20:35:12 +03:00
|
|
|
|
|
|
|
%files -n kernel-uml-%{flavour}-%{buildrel}
|
|
|
|
%{_bindir}/linux-uml-%{kver_full}
|
|
|
|
#------------------------------------------------
|
|
|
|
|
|
|
|
%package -n kernel-uml-modules-%{flavour}-%{buildrel}
|
|
|
|
Version: %{fakever}
|
|
|
|
Release: %{fakerel}
|
|
|
|
Provides: kernel-uml-modules = %{kverrel}
|
|
|
|
Provides: kernel-uml-modules-%{flavour} = %{kverrel}
|
|
|
|
Summary: User Mode Linux (UML) kernel modules
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
|
|
|
|
%description -n kernel-uml-modules-%{flavour}-%{buildrel}
|
|
|
|
User Mode Linux (UML) kernel modules
|
|
|
|
- not compressed
|
|
|
|
- not stripped
|
|
|
|
- signed
|
|
|
|
|
|
|
|
%files -n kernel-uml-modules-%{flavour}-%{buildrel}
|
|
|
|
/lib/modules-uml/%{kver_full}
|
2020-03-18 22:20:03 +03:00
|
|
|
#------------------------------------------------
|
|
|
|
|
|
|
|
%package -n kernel-uml-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
Version: %{kversion}
|
|
|
|
Release: %{fullrpmrel}
|
|
|
|
Summary: Meta package for the latest kernel-uml-%{flavour} in %{kernelversion}.%{patchlevel} series
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
Requires: kernel-uml-%{flavour}-%{buildrel}
|
|
|
|
|
|
|
|
%ifarch %{ix86}
|
|
|
|
Conflicts: arch(x86_64)
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description -n kernel-uml-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
This meta package aims to make sure you always have the
|
|
|
|
latest kernel-uml-%{flavour} %{kernelversion}.%{patchlevel}.x
|
|
|
|
(User Mode Linux binary) installed.
|
|
|
|
|
|
|
|
%files -n kernel-uml-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
# no files
|
|
|
|
#------------------------------------------------
|
|
|
|
|
|
|
|
%package -n kernel-uml-modules-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
Version: %{kversion}
|
|
|
|
Release: %{fullrpmrel}
|
|
|
|
Summary: Meta package for the latest kernel-uml-modules-%{flavour} in %{kernelversion}.%{patchlevel} series
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
Requires: kernel-uml-modules-%{flavour}-%{buildrel}
|
|
|
|
|
|
|
|
%ifarch %{ix86}
|
|
|
|
Conflicts: arch(x86_64)
|
2020-03-13 20:35:12 +03:00
|
|
|
%endif
|
|
|
|
|
2020-03-18 22:20:03 +03:00
|
|
|
%description -n kernel-uml-modules-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
This meta package aims to make sure you always have the
|
|
|
|
latest kernel-uml-modules-%{flavour} %{kernelversion}.%{patchlevel}.x
|
|
|
|
(User Mode Linux kernel modules) installed.
|
|
|
|
|
|
|
|
%files -n kernel-uml-modules-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
# no files
|
|
|
|
#------------------------------------------------
|
|
|
|
|
|
|
|
%endif #endif uml
|
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
#------------------------------------------------
|
|
|
|
|
|
|
|
%if %{with binary_extra_modules}
|
|
|
|
|
|
|
|
%ksob_mk_module_pkg -n 8821ce -s net/wireless
|
|
|
|
%ksob_mk_module_pkg -n xt_TRIPSO -s net -r tripso
|
|
|
|
|
|
|
|
# virtualbox host
|
2020-11-26 18:58:01 +00:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
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
|
2020-11-26 21:09:27 +00:00
|
|
|
# shredder
|
|
|
|
%ksob_mk_module_pkg -n shredder-kernel -s extra -r rosa-shredder-user
|
2020-07-29 10:59:41 +03:00
|
|
|
|
|
|
|
#------------------------------------------------
|
|
|
|
# a package which will pull all those modules
|
|
|
|
%package -n kernel-modules-virtualbox-host-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
Summary: Meta package to pull VirtualBox host kernel modules for kernel-%{flavour}-%{kernelversion}.%{patchlevel}
|
|
|
|
Group: System/Kernel and hardware
|
2020-08-27 18:51:46 +03:00
|
|
|
Version: %{kversion}
|
|
|
|
Release: %{fullrpmrel}
|
2020-07-29 10:59:41 +03:00
|
|
|
Requires: kernel-module-vboxnetflt-%{flavour}-%{buildrel}
|
|
|
|
Requires: kernel-module-vboxnetadp-%{flavour}-%{buildrel}
|
|
|
|
Requires: kernel-module-vboxdrv-%{flavour}-%{buildrel}
|
|
|
|
Requires: kernel-module-vboxpci-%{flavour}-%{buildrel}
|
|
|
|
|
|
|
|
%description -n kernel-modules-virtualbox-host-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
Meta package to pull VirtualBox host kernel modules for kernel-%{flavour}-%{kernelversion}.%{patchlevel}
|
|
|
|
|
|
|
|
%files -n kernel-modules-virtualbox-host-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
# empty
|
|
|
|
#------------------------------------------------
|
|
|
|
|
|
|
|
# virtualbox guest, to be dropped in kernels 5.6+ (upsreamized)
|
|
|
|
%ksob_mk_module_pkg -n vboxvideo -s misc
|
|
|
|
%ksob_mk_module_pkg -n vboxguest -s misc
|
|
|
|
%ksob_mk_module_pkg -n vboxsf -s misc
|
|
|
|
|
|
|
|
#------------------------------------------------
|
|
|
|
# a package which will pull all those modules
|
|
|
|
%package -n kernel-modules-virtualbox-guest-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
Summary: Meta package to pull VirtualBox guest kernel modules for kernel-%{flavour}-%{kernelversion}.%{patchlevel}
|
|
|
|
Group: System/Kernel and hardware
|
2020-08-27 18:51:46 +03:00
|
|
|
Version: %{kversion}
|
|
|
|
Release: %{fullrpmrel}
|
2020-07-29 10:59:41 +03:00
|
|
|
Requires: kernel-module-vboxvideo-%{flavour}-%{buildrel}
|
|
|
|
Requires: kernel-module-vboxguest-%{flavour}-%{buildrel}
|
|
|
|
Requires: kernel-module-vboxsf-%{flavour}-%{buildrel}
|
|
|
|
|
|
|
|
%description -n kernel-modules-virtualbox-guest-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
|
|
|
Meta package to pull VirtualBox guest kernel modules for kernel-%{flavour}-%{kernelversion}.%{patchlevel}
|
|
|
|
|
|
|
|
%files -n kernel-modules-virtualbox-guest-%{flavour}-%{kernelversion}.%{patchlevel}-latest
|
2020-11-26 21:09:27 +00:00
|
|
|
# end ifarch
|
2020-11-26 18:58:01 +00:00
|
|
|
%endif
|
2020-07-29 10:59:41 +03:00
|
|
|
# empty
|
|
|
|
#------------------------------------------------
|
|
|
|
|
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
|
|
|
|
|
2020-07-29 10:59:41 +03:00
|
|
|
%endif #binary_extra_modules
|
|
|
|
|
2020-08-19 20:02:58 +03:00
|
|
|
############################
|
|
|
|
|
|
|
|
%if %{with flow_abi}
|
|
|
|
%package -n kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
|
|
|
|
Summary: Directory to install third-party binary kernel modules for kernels %{kernelversion}.%{patchlevel}.x
|
|
|
|
Group: System/Kernel and hardware
|
|
|
|
|
|
|
|
%description -n kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
|
|
|
|
This package contains a directory to install third-party binary kernel modules for kernels %{kernelversion}.%{patchlevel}.x.
|
|
|
|
Some vendors provide binary-only kernel modules. They can put them into /lib/modules/%{kernelversion}.%{patchlevel}-rosa-flow-abi.
|
|
|
|
kmod tools will find them for kernels 5.4.x of "generic" and "nickel" flavours,
|
|
|
|
but there is no guarantee that these modules will load and work correctly on newer
|
|
|
|
or older kernels then the ones they were build against.
|
|
|
|
|
|
|
|
We call this "flow ABI" because most ABIs are not changed between %{kernelversion}.%{patchlevel}.x releases,
|
|
|
|
but there are no specific guarantees. ABI may evolve and change.
|
|
|
|
We highly recommend to use DKMS and build third-party kernel modules from source for every kernel!
|
|
|
|
|
|
|
|
This package does nothing, just owns a directory for third-party binary kernel modules.
|
|
|
|
|
|
|
|
%files -n kernel-%{kernelversion}.%{patchlevel}-rosa-flow-abi
|
|
|
|
/lib/modules/%{kernelversion}.%{patchlevel}-rosa-flow-abi
|
|
|
|
%endif #with flow_abi
|
|
|
|
|
|
|
|
################################################
|
2020-03-13 20:35:12 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%prep
|
|
|
|
%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
|
2013-11-16 00:27:01 +04:00
|
|
|
cd %src_dir
|
|
|
|
|
2020-11-26 18:48:55 +00:00
|
|
|
%autopatch -p1
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Setup Begin
|
|
|
|
#
|
|
|
|
|
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
|
2019-07-16 18:30:53 +03:00
|
|
|
cp %{SOURCE110} .config
|
2018-07-08 22:54:29 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Disable ASLR for 32-bit systems because it does not play well with
|
|
|
|
# hibernate.
|
|
|
|
%ifarch %{ix86}
|
|
|
|
sed -i 's/CONFIG_RANDOMIZE_BASE=y/# CONFIG_RANDOMIZE_BASE is not set/' .config
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Disable checking for W+X memory mappings for 32-bit systems. The warnings
|
|
|
|
# may confuse the users and noone is eager to fix the underlying problem,
|
|
|
|
# it seems.
|
|
|
|
%ifarch %{ix86}
|
|
|
|
sed -i 's/CONFIG_DEBUG_WX=y/# CONFIG_DEBUG_WX is not set/' .config
|
|
|
|
%endif
|
|
|
|
|
2020-03-13 20:51:12 +03:00
|
|
|
touch %{build_dir}/.config.append
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Enable debug info if requested.
|
2020-03-13 20:51:12 +03:00
|
|
|
sed -i '/CONFIG_DEBUG_INFO/d' .config
|
2013-11-16 00:27:01 +04:00
|
|
|
%if %build_debug
|
2020-03-13 20:51:12 +03:00
|
|
|
echo 'CONFIG_DEBUG_INFO=y' >> %{build_dir}/.config.append
|
|
|
|
echo 'CONFIG_DEBUG_INFO_DWARF4=y' >> %{build_dir}/.config.append
|
|
|
|
echo 'CONFIG_GDB_SCRIPTS=y' >> %{build_dir}/.config.append
|
|
|
|
%else
|
|
|
|
echo 'CONFIG_DEBUG_INFO=n' >> %{build_dir}/.config.append
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2016-07-29 13:39:16 +03:00
|
|
|
%if %{enhanced_security}
|
2019-11-11 17:47:53 +03:00
|
|
|
### SELinux enablement
|
2019-10-07 01:35:53 +03:00
|
|
|
# seems to be needed to boot system in enforcing selinux mode
|
|
|
|
# note: cpio fpormat of initramfs does not support xattrs without patches
|
|
|
|
# see also: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1680315
|
|
|
|
sed -i '/CONFIG_SECURITY_SELINUX_DISABLE/d' .config
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_SECURITY_SELINUX_DISABLE=y >> %{build_dir}/.config.append
|
2019-10-07 01:35:53 +03:00
|
|
|
# enable selinux in kernel by default if not disabled explicitly
|
|
|
|
sed -i '/CONFIG_SECURITY_SELINUX_BOOTPARAM/d' .config
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_SECURITY_SELINUX_BOOTPARAM=y >> %{build_dir}/.config.append
|
2019-11-11 17:47:53 +03:00
|
|
|
|
|
|
|
### Signing kernel modules
|
|
|
|
# https://www.kernel.org/doc/html/v5.3/admin-guide/module-signing.html
|
|
|
|
sed -i '/CONFIG_MODULE_SIG/d' .config
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_MODULE_SIG=y >> %{build_dir}/.config.append
|
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-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
|
2019-12-07 21:57:55 +03:00
|
|
|
# If %%build_debig is true, signatures will be stripped
|
|
|
|
# We sign modules manually in a tricky way bellow
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_MODULE_SIG_ALL=n >> %{build_dir}/.config.append
|
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
|
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
|
2019-11-18 21:25:13 +03:00
|
|
|
# Reserve area for inserting a certificate without recompiling
|
|
|
|
sed -i '/CONFIG_SYSTEM_EXTRA_CERTIFICATE/d' .config
|
2020-03-13 20:35:12 +03:00
|
|
|
echo CONFIG_SYSTEM_EXTRA_CERTIFICATE=y >> %{build_dir}/.config.append
|
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
|
|
|
|
sed -i "/CONFIG_CRYPTO_${i}/d" .config
|
|
|
|
echo "CONFIG_CRYPTO_${i}=y" >> %{build_dir}/.config.append
|
|
|
|
done
|
2020-03-16 23:19:46 +03:00
|
|
|
|
|
|
|
sed -i '/CONFIG_LSM/d' .config
|
|
|
|
echo 'CONFIG_LSM="yama,loadpin,integrity,selinux,apparmor,altha"' >> %{build_dir}/.config.append
|
|
|
|
sed -i '/CONFIG_SECURITY_ALTHA/d' .config
|
|
|
|
echo 'CONFIG_SECURITY_ALTHA=y' >> %{build_dir}/.config.append
|
2016-07-29 13:39:16 +03:00
|
|
|
%endif
|
|
|
|
|
2020-07-27 22:32:06 +03:00
|
|
|
# Disable disk-based swap (swap files and partitions) on certified systems by default
|
|
|
|
# because we cannot guarantee that data stored in swap is erased from disk securely.
|
|
|
|
# Our patch, based on Chromium OS kernel, allows to use only zram if CONFIG_DISK_BASED_SWAP_DEFAULT_ON=y.
|
|
|
|
# sysctl vm.disk_based_swap = 1 to allow disk-based swap, = 0 to disable it.
|
|
|
|
# Note that CONFIG_ZRAM_WRITEBACK is still on.
|
2020-08-06 14:31:51 +03:00
|
|
|
#sed -i '/CONFIG_DISK_BASED_SWAP_DEFAULT_ON/d' .config
|
|
|
|
#%if %{with nickel}
|
|
|
|
#echo 'CONFIG_DISK_BASED_SWAP_DEFAULT_ON=n' >> %{build_dir}/.config.append
|
|
|
|
#%else
|
2020-07-27 22:32:06 +03:00
|
|
|
echo 'CONFIG_DISK_BASED_SWAP_DEFAULT_ON=y' >> %{build_dir}/.config.append
|
2020-08-06 14:31:51 +03:00
|
|
|
#%endif
|
2020-07-27 22:32:06 +03:00
|
|
|
|
2020-03-13 20:35:12 +03:00
|
|
|
cat %{build_dir}/.config.append >> .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}
|
2020-11-26 21:09:27 +00:00
|
|
|
make ARCH=%{arch_suffix} oldconfig && \
|
2019-07-16 18:30:53 +03:00
|
|
|
mv .config ${cfg_file}
|
|
|
|
|
|
|
|
# Looks like 'make oldconfig' removes '# CONFIG_64BIT is not set' for some
|
|
|
|
# reason. For now, let us restore it.
|
2018-07-08 22:54:29 +03:00
|
|
|
%ifarch %{ix86}
|
2019-07-16 18:30:53 +03:00
|
|
|
sed -i 's/CONFIG_64BIT=y//' ${cfg_file}
|
|
|
|
echo '# CONFIG_64BIT is not set' >> ${cfg_file}
|
2018-07-08 22:54:29 +03:00
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
echo "Created ${cfg_file}."
|
2016-07-22 16:37:05 +03:00
|
|
|
|
2013-11-16 00:27:01 +04: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
|
|
|
|
|
|
|
# get rid of unwanted files
|
|
|
|
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
|
|
|
|
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(){
|
2020-03-14 13:49:15 +03: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
|
|
|
|
2019-07-16 18:30:53 +03: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
|
|
|
%if %{enhanced_security}
|
|
|
|
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
|
2020-03-18 23:36:11 +03: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"
|
|
|
|
# avoid using the template
|
|
|
|
rm -f "%{certs_key_config_rnd}"
|
|
|
|
|
|
|
|
_libressl_gen_key(){
|
|
|
|
if [ "$GOST_KEY" = 1 ]
|
|
|
|
then
|
|
|
|
lssl_req_gost_args="\
|
|
|
|
-newkey gost2001 \
|
|
|
|
-pkeyopt dgst:streebog512 -pkeyopt paramset:A \
|
|
|
|
-streebog512"
|
|
|
|
OUT="%{certs_signing_key_priv_rnd}.GOST"
|
|
|
|
CONFIG="%{certs_key_config_rnd}.GOST"
|
|
|
|
else
|
|
|
|
lssl_req_gost_args=""
|
|
|
|
OUT="%{certs_signing_key_priv_rnd}.RSA"
|
|
|
|
CONFIG="%{certs_key_config_rnd}.RSA"
|
|
|
|
fi
|
|
|
|
libressl req -new -nodes -utf8 -batch \
|
|
|
|
$lssl_req_gost_args \
|
|
|
|
-days 109500 \
|
|
|
|
-x509 -config "$CONFIG" \
|
|
|
|
-out "$OUT" \
|
|
|
|
-keyout "$OUT"
|
|
|
|
|
|
|
|
# Verify
|
|
|
|
if [ "$GOST_KEY" = 1 ]; then
|
|
|
|
libressl x509 -in "%{certs_signing_key_priv_rnd}.GOST" -text -noout \
|
|
|
|
| grep -E 'Signature Algorithm:.*GOST R 34.10-2012'
|
|
|
|
libressl x509 -in "%{certs_signing_key_priv_rnd}.GOST" -text -noout \
|
|
|
|
| grep -E 'Digest Algorithm:.*GOST R 34-11-2012'
|
|
|
|
libressl x509 -in "%{certs_signing_key_priv_rnd}.GOST" -text -noout \
|
|
|
|
| grep -E 'Public Key Algorithm:.*GOST R 34.10-2012'
|
|
|
|
fi
|
|
|
|
}
|
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
|
|
|
|
|
|
|
# link sign-file and extract-cert with LibreSSL instead of OpenSSL
|
|
|
|
libressl_cflags="$(pkg-config --cflags --libs libressl-libcrypto)"
|
|
|
|
if [ $? != 0 ] ; then exit $? ; fi
|
|
|
|
sed -i %{src_dir}/scripts/Makefile \
|
2020-03-13 20:35:12 +03:00
|
|
|
%if %{with uml}
|
|
|
|
%{src_dir}.uml/scripts/Makefile \
|
|
|
|
%endif
|
2019-12-07 21:57:55 +03:00
|
|
|
-e "s,-lcrypto,${libressl_cflags},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}"
|
2019-11-17 16:56:39 +03:00
|
|
|
%endif #endif additional_keys
|
2019-11-19 00:24:49 +03:00
|
|
|
cat %{certs_public_keys}
|
2019-11-17 16:56:39 +03:00
|
|
|
%endif #endif enhanced_security
|
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
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# make sure EXTRAVERSION says what we want it to say
|
|
|
|
LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{flavour}-%{buildrpmrel}/" Makefile
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-12-22 02:24:52 +03:00
|
|
|
# Print debug messages when loglevel=7 in cmdline.
|
|
|
|
# Those messages can be caught by debugfs without -DDEBUG.
|
|
|
|
# but sometimes it is required to see them via a serial port when booting the kernel.
|
|
|
|
# '#ifdef DEBUG' is used in different places for different purposes,
|
|
|
|
# so change DEBUG to PRINTK_DEBUG in one specific place.
|
2020-03-21 13:28:01 +03:00
|
|
|
#%if %build_debug
|
|
|
|
#sed -i %{src_dir}/include/linux/printk.h \
|
|
|
|
# -e 's,^#ifdef DEBUG$,#if defined(DEBUG) || defined(PRINTK_DEBUG),g'
|
|
|
|
#export KCPPFLAGS="-DPRINTK_DEBUG"
|
|
|
|
#%endif
|
2019-12-22 02:24:52 +03:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# build the kernel
|
|
|
|
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
|
|
|
|
%ifarch aarch64
|
|
|
|
TARGETS="$TARGETS dtbs"
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%kmake V=1 -s all $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
|
|
|
|
|
|
|
|
cp -r "$(rpm -q --qf '/usr/src/rtl8821ce-%%{VERSION}-%%{RELEASE}' kernel-source-rtl8821ce)" kernel-source-rtl8821ce
|
|
|
|
pushd kernel-source-rtl8821ce
|
|
|
|
%kmake KSRC=%{src_dir} M="$PWD"
|
|
|
|
mkdir -p %{temp_modules}/%{kver_full}/kernel/net/wireless/
|
|
|
|
cp 8821ce.ko %{temp_modules}/%{kver_full}/kernel/net/wireless/8821ce.ko
|
|
|
|
popd
|
|
|
|
rm -fr kernel-source-rtl8821ce
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-11-26 18:58:01 +00:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
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
|
|
|
|
|
|
|
|
# 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/vboxadditions-%%{VERSION}-%%{RELEASE}' kernel-source-virtualbox-vboxadditions)" kernel-source-virtualbox-vboxadditions
|
|
|
|
mkdir -p %{temp_modules}/%{kver_full}/kernel/misc/
|
|
|
|
pushd kernel-source-virtualbox-vboxadditions
|
|
|
|
%kmake KERN_DIR=%{src_dir} KERN_VER=%{kver_full} -C vboxguest
|
|
|
|
cp -fv vboxguest/Module.symvers vboxsf/
|
|
|
|
%kmake KERN_DIR=%{src_dir} KERN_VER=%{kver_full} -C vboxsf
|
|
|
|
# TODO: vboxvideo is also build inside the upstream kernel...
|
|
|
|
# vboxsf is not in kernel 5.4
|
|
|
|
# https://www.phoronix.com/scan.php?page=news_item&px=VirtualBox-Shared-Folder-5.6
|
|
|
|
cp -fv vboxsf/Module.symvers vboxvideo/
|
|
|
|
%kmake KERN_DIR=%{src_dir} KERN_VER=%{kver_full} -C vboxvideo
|
|
|
|
for i in vboxguest vboxsf vboxvideo
|
|
|
|
do
|
|
|
|
cp -v "${i}/${i}.ko" %{temp_modules}/%{kver_full}/kernel/misc/
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
|
|
|
|
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 21:09:27 +00:00
|
|
|
# end ifarch ix86
|
2020-11-26 18:58:01 +00:00
|
|
|
%endif
|
2020-07-29 10:59:41 +03:00
|
|
|
|
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
|
|
|
|
%endif #with nickel <- with binary_extra_modules
|
|
|
|
|
|
|
|
%endif #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
|
|
|
|
%kmake ARCH=um defconfig
|
|
|
|
cp .config .config.default
|
|
|
|
cat %{build_dir}/.config.append >> .config
|
|
|
|
%kmake oldconfig ARCH=um
|
|
|
|
diff -u .config.default .config || :
|
2020-03-16 19:38:59 +03:00
|
|
|
# Looks like 'make oldconfig' removes '# CONFIG_64BIT is not set' for some
|
|
|
|
# reason. For now, let us restore it.
|
|
|
|
%ifarch %{ix86}
|
|
|
|
sed -i 's/CONFIG_64BIT=y//' .config
|
|
|
|
echo '# CONFIG_64BIT is not set' >> .config
|
|
|
|
%endif
|
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}
|
|
|
|
xz -c Module.symvers > %{temp_boot}/symvers-%{kver_full}.xz
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2020-11-26 21:09:27 +00:00
|
|
|
%ifarch aarch64
|
|
|
|
cp -f arch/arm64/boot/Image.gz %{temp_boot}/vmlinuz-%{kver_full}
|
|
|
|
%else
|
|
|
|
cp -f arch/%{arch_type}/boot/bzImage %{temp_boot}/vmlinuz-%{kver_full}
|
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# headers
|
|
|
|
%if %{build_headers}
|
|
|
|
%make INSTALL_HDR_PATH=%{temp_root}%{_prefix} KERNELRELEASE=%{kver_full} headers_install
|
|
|
|
find %{temp_root}%{_prefix} -name .install -or -name ..install.cmd | %kxargs rm -f
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# remove /lib/firmware, we use a separate linux-firmware package
|
|
|
|
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
|
|
|
|
%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/
|
2020-11-26 21:09:27 +00:00
|
|
|
# needed for arch/x86/purgatory
|
|
|
|
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
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# add acpica header files, needed for fglrx build
|
|
|
|
cp -fR drivers/acpi/acpica/*.h %{temp_devel_root}/drivers/acpi/acpica/
|
2013-11-16 00:27:01 +04:00
|
|
|
|
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
|
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
|
|
|
|
2020-11-26 21:09:27 +00:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
2019-07-16 18:30:53 +03:00
|
|
|
rm -rf %{temp_devel_root}/arch/arm*
|
|
|
|
rm -rf %{temp_devel_root}/include/kvm/arm*
|
|
|
|
rm -rf %{temp_devel_root}/include/soc
|
2020-11-26 21:09:27 +00:00
|
|
|
%endif
|
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
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# fix permissions
|
|
|
|
chmod -R a+rX %{temp_devel_root}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# disable mrproper in -devel rpms
|
|
|
|
patch -p1 --fuzz=0 -d %{temp_devel_root} -i %{SOURCE2}
|
|
|
|
|
|
|
|
# endif build_devel
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Manage the files with debug info, provide the debug links in the
|
|
|
|
# kernel modules.
|
|
|
|
%if %build_debug
|
|
|
|
install -m 644 vmlinux %{temp_boot}/vmlinux-%{kver_full}
|
|
|
|
kernel_debug_files=../kernel_debug_files.%{flavour}
|
|
|
|
echo "%{_bootdir}/vmlinux-%{kver_full}" >> $kernel_debug_files
|
|
|
|
|
|
|
|
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 {}`'
|
|
|
|
|
|
|
|
pushd %{temp_modules}
|
|
|
|
find %{kver_full}/kernel -name "*.ko.debug" > debug_module_list
|
|
|
|
popd
|
|
|
|
cat %{temp_modules}/debug_module_list | \
|
|
|
|
sed 's|\(.*\)|%{_modulesdir}/\1|' >> $kernel_debug_files
|
|
|
|
cat %{temp_modules}/debug_module_list | \
|
|
|
|
sed 's|\(.*\)|%exclude %{_modulesdir}/\1|' \
|
|
|
|
>> ../kernel_exclude_debug_files.%{flavour}
|
|
|
|
rm -f %{temp_modules}/debug_module_list
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# endif build_debug
|
|
|
|
%endif
|
|
|
|
|
2019-12-07 21:57:55 +03:00
|
|
|
%if %{enhanced_security}
|
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
|
|
|
|
echo "No file $1"
|
|
|
|
return 0
|
|
|
|
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}
|
|
|
|
%{temp_root}/lib/modules-uml/%{kver_full} \
|
|
|
|
%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
|
|
|
%endif
|
|
|
|
|
2019-07-16 18:30:53 +03:00
|
|
|
# Create the list of files for the kernel.
|
|
|
|
kernel_files=../kernel_files.%{flavour}
|
|
|
|
|
|
|
|
cat > $kernel_files <<EOF
|
|
|
|
%{_bootdir}/System.map-%{kver_full}
|
|
|
|
%{_bootdir}/symvers-%{kver_full}.xz
|
|
|
|
%{_bootdir}/config-%{kver_full}
|
|
|
|
%{_bootdir}/vmlinuz-%{kver_full}
|
|
|
|
%{_modulesdir}/%{kver_full}/kernel
|
2020-07-29 10:59:41 +03:00
|
|
|
%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}
|
2020-11-26 21:09:27 +00:00
|
|
|
%ifarch %{ix86} %{x86_64}
|
2020-07-29 10:59:41 +03:00
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/extra/shredder-kernel.ko%{kmod_suffix}
|
|
|
|
# vbox host: vboxnetflt vboxnetadp vboxdrv vboxpci
|
|
|
|
# vbox guest: vboxvideo vboxguest vboxsf
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/misc/vbox*.ko%{kmod_suffix}
|
2020-11-26 21:09:27 +00:00
|
|
|
%endif
|
|
|
|
%exclude %{_modulesdir}/%{kver_full}/kernel/net/xt_TRIPSO.ko%{kmod_suffix}
|
2020-08-06 17:26:48 +03:00
|
|
|
%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}
|
2020-07-29 10:59:41 +03:00
|
|
|
%endif
|
2020-08-06 17:26:48 +03:00
|
|
|
%endif #with binary_extra_modules
|
2019-07-16 18:30:53 +03:00
|
|
|
%{_modulesdir}/%{kver_full}/modules.*
|
|
|
|
EOF
|
|
|
|
|
|
|
|
%if %build_debug
|
|
|
|
cat ../kernel_exclude_debug_files.%{flavour} >> $kernel_files
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# set extraversion to match srpm to get nice version reported by the tools
|
|
|
|
LC_ALL=C sed -ri "s/^EXTRAVERSION.*/EXTRAVERSION = -%{fullrpmrel}/" Makefile
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%if %{build_perf}
|
2020-11-26 18:28:35 +00:00
|
|
|
%smake -C tools/perf -s HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} NO_GTK2=1 all
|
2018-12-01 18:39:37 +03:00
|
|
|
%smake -C tools/perf -s prefix=%{_prefix} NO_GTK2=1 man
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{build_cpupower}
|
|
|
|
# make sure version-gen.sh is executable.
|
|
|
|
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
|
2019-07-16 18:30:53 +03:00
|
|
|
############################################################################
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%install
|
|
|
|
cd %src_dir
|
|
|
|
|
|
|
|
# We want to be able to test several times the install part
|
|
|
|
rm -rf %{buildroot}
|
|
|
|
cp -a %{temp_root} %{buildroot}
|
|
|
|
|
2019-11-11 21:16:01 +03:00
|
|
|
%if %{enhanced_security}
|
|
|
|
# Multithreaded verification that every kernel module
|
|
|
|
# has a signature attached to it
|
|
|
|
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
|
2019-11-12 01:32:36 +03:00
|
|
|
if hexdump -C "$1" | rev | cut -f 2 -d '|' | rev | tr -d '\n' | \
|
2019-11-11 21:16:01 +03:00
|
|
|
grep -q '~Module signature appended~'
|
|
|
|
then
|
2019-11-14 01:26:18 +03:00
|
|
|
if [ -f %{certs_verify_tmp} ]; then
|
|
|
|
rm -f %{certs_verify_tmp}
|
|
|
|
fi
|
2019-11-11 21:16:01 +03:00
|
|
|
else
|
|
|
|
echo "ERROR: Module $1 has no signature attached to it!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
export -f _verify_signature
|
2020-03-13 20:35:12 +03:00
|
|
|
find %{target_modules} \
|
|
|
|
%if %{with uml}
|
|
|
|
%{buildroot}/lib/modules-uml/%{kver_full} \
|
|
|
|
%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}
|
|
|
|
%endif
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# compressing modules
|
|
|
|
%if %{build_modxz}
|
|
|
|
find %{target_modules} -name "*.ko" | %kxargs xz -6e
|
|
|
|
%else
|
|
|
|
find %{target_modules} -name "*.ko" | %kxargs gzip -9
|
|
|
|
%endif
|
|
|
|
|
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
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# sniff, if we compressed all the modules, we change the stamp :(
|
|
|
|
# we really need the depmod -ae here
|
|
|
|
for i in *; do
|
|
|
|
/sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i
|
|
|
|
echo $?
|
|
|
|
done
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# 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
|
|
|
%if %{build_perf}
|
|
|
|
|
|
|
|
# perf tool binary and supporting scripts/binaries
|
2020-11-26 18:28:35 +00:00
|
|
|
make -C tools/perf -s V=1 DESTDIR=%{buildroot} HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} 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)
|
|
|
|
sed -i -e '1 s,^.*$,#!%{__python3},' %{buildroot}%{_prefix}/libexec/perf-core/scripts/python/exported-sql-viewer.py
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# perf man pages (note: implicit rpm magic compresses them later)
|
2020-11-26 18:28:35 +00:00
|
|
|
make -C tools/perf -s V=1 DESTDIR=%{buildroot} 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}
|
|
|
|
%find_lang cpupower
|
|
|
|
mv cpupower.lang ../
|
|
|
|
chmod 0755 %{buildroot}%{_libdir}/libcpupower.so*
|
|
|
|
mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig
|
|
|
|
install -m644 %{SOURCE50} %{buildroot}%{_unitdir}/cpupower.service
|
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
|
|
|
|
|
|
|
# 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
|