kernel/kernel.spec

1978 lines
57 KiB
RPMSpec
Raw Normal View History

Unify the specs for 2014.1 and the future cert. systems; revisit configs The source code of the kernel and the patchset are the same for both 2014.1 and the "current" platform, so are the scripts used during the build. 1. I updated create_configs-withBFQ so that it creates different kernel configuration files depending on its --with-enhanced-security parameter. If --with-enhanced-security is set, * SELinux is used instead of TOMOYO; * Memory sanitization facilities are compiled in (but are disabled by default - should be enabled at boot time with boot options pax_sanitize_slab=1 paxsanitize_pages=1). Similar to other packages, I added a conditional in the spec that enables enhanced security features when building for 'current' (i.e. for the future cert. systems) and leaves everithing as is. Besides, I fixed create_configs-withBFQ: even if --user-cpu=... was given, it still generated the configs for all architectures, a waste of time. Now it creates the config only for the architecture corresponding to --user-cpu=... if it is set and for all otherwise. ---------------- The changes in the configs listed below are for i586 and x86_64 only. 2. Added the following to make lxc-checkconfig happy: * CONFIG_MEMCG=y * CONFIG_MEMCG_SWAP=y * CONFIG_MEMCG_KMEM=y 3. Added the following options that 'make oldconfig' adds anyway during the build: * CONFIG_MM_OWNER=y * CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y * CONFIG_IOSF_MBI=m * CONFIG_LRU_CACHE=m * (x86_64 only) CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y 4. Removed the following options (they are no longer available in 3.14): * CONFIG_CPU_FREQ_TABLE * CONFIG_IP_NF_MATCH_PSD * CONFIG_IP_NF_TARGET_IFWLOG 5. Increased CONFIG_SERIAL_8250_NR_UARTS from 4 to 8: some of our users have unusual boards with more than 4 serial ports. Also added CONFIG_SERIAL_8250_MANY_PORTS=y: needed for these users too. 6. Unset CONFIG_DRM_RADEON_UMS: it has been deprecated for quite some time and was seemingly ignored. 'radeon' driver the kernel provides works via KMS rather than UMS now and its UMS support is obsolete and buggy. 7. Finally dropped support for Mach64 GPUs. If there are enough users with such hardware, we could enable it is some kernel flavour in contrib (project: https://abf.io/import/kernel-other/). 8. Changed CONFIG_FB_TILEBLITTING to "y": 'make oldconfig' already does this during the kernel build because it is needed for Matrox GPUs (CONFIG_FB_MATROX). BTW, some of our users do seem to have Matrox GPUs. Consequently, I had to disable CONFIG_FB_CON_DECOR: it needs CONFIG_FB_TILEBLITTING unset. 9. Changed CONFIG_X86_VERBOSE_BOOTUP=n to # CONFIG_X86_VERBOSE_BOOTUP is not set 10. (x86_64 only) Changed CONFIG_X86_ESPFIX32=y to CONFIG_X86_ESPFIX64=y This is what 'make oldconfig' does with that option anyway.
2015-01-13 19:32:41 +03:00
%{?build_selinux}%{?!build_selinux:%bcond_with selinux}
2013-11-16 00:27:01 +04:00
%define kernelversion 3
%define patchlevel 14
2013-11-16 00:27:01 +04:00
# sublevel is now used for -stable patches
Updated to version 3.14.25 Most significant upstream changes since 3.14.22: acer-wmi: Add acpi_backlight=video quirk for the Acer KAV80 ahci: Add Device IDs for Intel Sunrise Point PCH ahci: disable MSI instead of NCQ on Samsung pci-e SSDs on macbooks ALSA: ALC283 codec - Avoid pop noise on headphones during suspend/resume ALSA: emu10k1: Fix deadlock in synth voice lookup ALSA: hda - add codec ID for Braswell display audio codec ALSA: hda - add PCI IDs for Intel Braswell ALSA: hda - hdmi: Fix missing ELD change event on plug/unplug ALSA: pcm: Zero-clear reserved fields of PCM status ioctl in compat mode ALSA: usb-audio: Add support for Steinberg UR22 USB interface ALSA: usb-audio: Fix device_del() sysfs warnings at disconnect ALSA: usb-audio: Fix memory leak in FTU quirk ata: sata_rcar: Disable DIPM mode for r8a7790 ES1 audit: AUDIT_FEATURE_CHANGE message format missing delimiting space audit: correct AUDIT_GET_FEATURE return message type audit: keep inode pinned ax88179_178a: fix bonding failure be2iscsi: check ip buffer before copying block: fix alignment_offset math that assumes io_min is a power-of-2 block: Fix computation of merged request priority Bluetooth: Fix HCI H5 corrupted ack value Bluetooth: Fix incorrect LE CoC PDU length restriction based on HCI MTU Bluetooth: Fix issue with USB suspend in btusb driver Btrfs: add missing compression property remove in btrfs_ioctl_setflags Btrfs: cleanup error handling in build_backref_tree Btrfs: fix build_backref_tree issue with multiple shared blocks Btrfs: fix kfree on list_head in btrfs_lookup_csums_range error cleanup Btrfs: fix race in WAIT_SYNC ioctl Btrfs: fix up bounds checking in lseek Btrfs: send, fix data corruption due to incorrect hole detection Btrfs: try not to ENOSPC on log replay btrfs: wake up transaction thread from SYNC_FS ioctl callers of iov_copy_from_user_atomic() don't need pagecache_disable() cgroup/kmemleak: add kmemleak_free() for cgroup deallocations. clocksource: Remove "weak" from clocksource_default_clock() declaration cpc925_edac: Report UE events properly cpufreq: expose scaling_cur_freq sysfs file for set_policy() drivers cpufreq: intel_pstate: Add CPU ID for Braswell processor cpufreq: intel_pstate: Fix setting max_perf_pct in performance policy crypto: algif - avoid excessive use of socket buffer in skcipher crypto: caam - fix missing dma unmap on error path crypto: caam - remove duplicated sg copy functions dell-wmi: Fix access out of memory dmaengine: fix xor sources continuation dm btree: fix a recursion depth bug in btree walking code dm bufio: change __GFP_IO to __GFP_FS in shrinker callbacks dm bufio: update last_accessed when relinking a buffer dm bufio: when done scanning return from __scan immediately dm log userspace: fix memory leak in dm_ulog_tfr_init failure path dm raid: ensure superblock's size matches device's logical block size dm thin: grab a virtual cell before looking up the mapping drbd: compute the end before rb_insert_augmented() Drivers: hv: vmbus: Cleanup vmbus_close_internal() Drivers: hv: vmbus: Cleanup vmbus_establish_gpadl() Drivers: hv: vmbus: Cleanup vmbus_post_msg() Drivers: hv: vmbus: Cleanup vmbus_teardown_gpadl() Drivers: hv: vmbus: Fix a bug in vmbus_open() drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets drivers/net: macvtap and tun depend on INET drm/i915: don't warn if backlight unexpectedly enabled drm/nouveau/bios: memset dcb struct to zero before parsing drm/radeon: add missing crtc unlock when setting up the MC drm/radeon/dpm: disable ulv support on SI drm/radeon: make sure mode init is complete in bandwidth_update drm/radeon: remove invalid pci id drm/radeon: set correct CE ram size for CIK drm/tilcdc: Fix the error path in tilcdc_load() drm/vmwgfx: Filter out modes those cannot be supported by the current VRAM size. drm/vmwgfx: Fix drm.h include e7xxx_edac: Report CE events properly ecryptfs: avoid to access NULL pointer when write metadata in xattr evm: check xattr value length and type in evm_inode_setxattr() evm: properly handle INTEGRITY_NOXATTRS EVM status ext3: Don't check quota format when there are no quota files ext4: add ext4_iget_normal() which is to be used for dir tree lookups ext4: check EA value offset when loading ext4: check s_chksum_driver when looking for bg csum presence ext4: don't check quota format when there are no quota files ext4: enable journal checksum when metadata checksum feature enabled ext4: fix mmap data corruption when blocksize < pagesize ext4: fix oops when loading block bitmap failed ext4: fix overflow when updating superblock backups after resize ext4: fix reservation overflow in ext4_da_write_begin ext4: grab missed write_count for EXT4_IOC_SWAP_BOOT ext4: Replace open coded mdata csum feature to helper function fanotify: enable close-on-exec on events' fd when requested in fanotify_init() firewire: cdev: prevent kernel stack leaking into ioctl arguments firmware_class: make sure fw requests contain a name fix misuses of f_count() in ppp and netlink framebuffer: fix border color freezer: Do not freeze tasks killed by OOM killer fs: Add a missing permission check to do_umount fs: allow open(dir, O_TMPFILE|..., 0) with mode 0 fs: Fix theoretical division by 0 in super_cache_scan(). fs: make cont_expand_zero interruptible fs/superblock: avoid locking counting inodes and dentries before reclaiming them fs/superblock: unregister sb shrinker before ->kill_sb() futex: Ensure get_futex_key_refs() always implies a barrier GFS2: Fix address space from page function gre6: Move the setting of dev->iflink into the ndo_init functions. gre: Use inner mac length when computing tunnel length HID: usbhid: add always-poll quirk HID: usbhid: enable always-poll quirk for Elan Touchscreen HID: usbhid: enable always-poll quirk for Elan Touchscreen 009b HID: usbhid: enable always-poll quirk for Elan Touchscreen 016f hwrng: pseries - port to new read API and fix stack corruption i2c: at91: don't account as iowait i3200_edac: Report CE events properly i82860_edac: Report CE events properly IB/core: Clear AH attr variable to prevent garbage data iio: st_sensors: Fix buffer copy ima: provide flag to identify new empty files Input: alps - allow up to 2 invalid packets without resetting device Input: alps - ignore bad data on Dell Latitudes E6440 and E7440 Input: alps - ignore potential bare packets when device is out of sync Input: i8042 - add noloop quirk for Asus X750LN Input: i8042 - quirks for Fujitsu Lifebook A544 and Lifebook AH544 Input: synaptics - add min/max quirk for Lenovo T440s intel_pstate: Add CPU IDs for Broadwell processors intel_pstate: Correct BYT VID values. intel_pstate: Fix BYT frequency reporting ip6_tunnel: Use ip6_tnl_dev_init as the ndo_init function. ipc: always handle a new value of auto_msgmni ipv4: dst_entry leak in ip_send_unicast_reply() ipv4: fix a potential use after free in ip_tunnel_core.c ipv4: fix nexthop attlen check in fib_nh_match iwlwifi: Add missing PCI IDs for the 7260 series iwlwifi: configure the LTR jbd2: free bh when descriptor block checksum fails kill wbuf_queued/wbuf_dwork_lock kvm: don't take vcpu mutex for obviously invalid vcpu ioctls kvm: fix excessive pages un-pinning in kvm_iommu_map error path. kvm: fix potentially corrupt mmio cache kvm: vmx: handle invvpid vm exit gracefully KVM: x86: Check non-canonical addresses upon WRMSR kvm: x86: don't kill guest on unknown exit reason KVM: x86: Don't report guest userspace emulation error to userspace KVM: x86: Emulator fixes for eip canonical checks on near branches kvm: x86: fix stale mmio cache bug KVM: x86: Fix wrong masking on relative jump/call KVM: x86: Improve thread safety in pit KVM: x86: Prevent host from panicking on shared MSR writes. libata-sff: Fix controllers with no ctl port lib/bitmap.c: fix undefined shift in __bitmap_shift_{left|right}() libceph: ceph-msgr workqueue needs a resque worker libceph: do not crash on large auth tickets lib: radix-tree: add radix_tree_delete_item() lockd: Try to reconnect if statd has moved lzo: check for length overrun in variable length encoding. mac80211: fix typo in starting baserate for rts_cts_rate_idx mac80211: fix use-after-free in defragmentation mac80211_hwsim: release driver when ieee80211_register_hw fails mac80211: properly flush delayed scan work on interface removal mac80211: schedule the actual switch of the station before CSA count 0 mac80211: use secondary channel offset IE also beacons during CSA macvtap: Fix csum_start when VLAN tags are present md: Always set RECOVERY_NEEDED when clearing RECOVERY_FROZEN media: ds3000: fix LNB supply voltage on Tevii S480 on initialization media: em28xx: check if a device has audio earlier" media: em28xx-v4l: give back all active video buffers to the vb2 core properly on streaming stop media: m88ts2022: fix 32bit overflow on filter calc media: tda7432: Fix setting TDA7432_MUTE bit for TDA7432_RF register media: ttusb-dec: buffer overflow in ioctl media: usb: uvc: add a quirk for Dell XPS M1330 webcam media: v4l2-common: fix overflow in v4l_bound_align_image() mei: bus: fix possible boundaries violation mfd: rtsx_pcr: Fix MSI enable error handling mfd: ti_am335x_tscadc: Fix TSC operation after ADC continouous mode mfd: ti_am335x_tscadc: Fix TSC resume missing data dependency barrier in prepend_name() mm: clear __GFP_FS when PF_MEMALLOC_NOIO is set mm, compaction: add per-zone migration pfn cache for async compaction mm/compaction: avoid rescanning pageblocks in isolate_freepages mm/compaction: cleanup isolate_freepages() mm/compaction: clean up unused code lines mm/compaction: do not count migratepages when unnecessary mm, compaction: embed migration mode in compact_control mm, compaction: properly signal and act upon lock and need_sched() contention mm, compaction: return failed migration target pages back to freelist mm, compaction: terminate async compaction when rescheduling mmc: rtsx_pci_sdmmc: fix incorrect last byte in R2 response mmc: sdhci-pci: SDIO host controller support for Intel Quark X1000 mm: filemap: move radix tree hole searching here mm: fix direct reclaim writeback regression mm: free compound page with correct order mm + fs: prepare for non-page entries in page cache radix trees mm: madvise: fix MADV_WILLNEED on shmem swapouts mm: memcontrol: do not iterate uninitialized memcgs mm, migration: add destination page freeing callback mm: page_alloc: fix zone allocation fairness on UP mm/page_alloc: prevent MIGRATE_RESERVE pages from being misplaced mm/readahead.c: inline ra_submit mm: Remove false WARN_ON from pagecache_isize_extended() mm: remove read_cache_page_async() mm: shmem: save one radix tree lookup when truncating swapped pages mm: vmscan: use proportional scanning during direct reclaim and full scan at DEF_PRIORITY mnt: Prevent pivot_root from creating a loop in the mount tree modules, lock around setting of MODULE_STATE_UNFORMED mptfusion: enable no_write_same for vmware scsi disks netfilter: ipset: off by one in ip_set_nfnl_get_byindex() netfilter: nf_log: account for size of NLMSG_DONE attribute netfilter: nf_log: release skbuff on nlmsg put failure netfilter: nfnetlink_log: fix maximum packet length logged to userspace netfilter: nft_compat: fix wrong target lookup in nft_target_select_ops() netfilter: xt_bpf: add mising opaque struct sk_filter definition net: sctp: fix memory leak in auth key management net: sctp: fix NULL pointer dereference in af->from_addr_param on malformed packet net: sctp: fix panic on duplicate ASCONF chunks net: sctp: fix remote memory pressure from excessive queueing net: sctp: fix skb_over_panic when receiving malformed ASCONF chunks nfsd4: fix crash on unknown operation number NFS: Don't try to reclaim delegation open state if recovery failed nfs: fix pnfs direct write memory leak nfs: Fix use of uninitialized variable in nfs_getattr() NFSv4.1: Fix an NFSv4.1 state renewal regression NFSv4.1: nfs41_clear_delegation_stateid shouldn't trust NFS_DELEGATED_STATE NFSv4: Ensure that we remove NFSv4.0 delegations when state has expired NFSv4: Fix lock recovery when CREATE_SESSION/SETCLIENTID_CONFIRM fails NFSv4: fix open/lock state recovery error handling NFSv4: Fix races between nfs_remove_bad_delegation() and delegation return of: Fix overflow bug in string property parsing functions OOM, PM: OOM killed task shouldn't escape PM suspend pata_serverworks: disable 64-KB DMA transfers on Broadcom OSB4 IDE Controller PCI: Generate uppercase hex for modalias interface class pci_ids: Add support for Intel Quark ILB PCI: Increase IBM ipr SAS Crocodile BARs to at least system page size PCI: mvebu: Fix uninitialized variable in mvebu_get_tgt_attr() PCI: Rename sysfs 'enabled' file back to 'enable' perf: Handle compat ioctl perf/x86/intel: Use proper dTLB-load-misses event on IvyBridge pinctrl: baytrail: show output gpio state correctly on Intel Baytrail pinctrl: dra: dt-bindings: Fix output pull up/down PM / Sleep: fix recovery during resuming from hibernation posix-timers: Fix stack info leak in timer_create() power: bq2415x_charger: Fix memory leak on DTS parsing error power: bq2415x_charger: Properly handle ENODEV from power_supply_get_by_phandle power: charger-manager: Fix accessing invalidated power supply after charger unbind power: charger-manager: Fix accessing invalidated power supply after fuel gauge unbind power: charger-manager: Fix NULL pointer exception with missing cm-fuel-gauge pstore: Fix duplicate {console,ftrace}-efi entries qla2xxx: Fix shost use-after-free on device removal qla2xxx: Use correct offset to req-q-out for reserve calculation qla_target: don't delete changed nacls quota: Properly return errors from dquot_writeback_dquots() qxl: don't create too large primary surface random: add and use memzero_explicit() for clearing data rbd: Fix error recovery in rbd_obj_read_sync() rcu: Make callers awaken grace-period kthread rcu: Use rcu_gp_kthread_wake() to wake up grace period kthreads regmap: debugfs: fix possbile NULL pointer dereference regmap: fix kernel hang on regmap_bulk_write with zero val_count. regmap: fix NULL pointer dereference in _regmap_write/read regmap: fix possible ZERO_SIZE_PTR pointer dereferencing error. regulator: max77693: Fix use of uninitialized regulator config rt2800: correct BBP1_TX_POWER_CTRL mask rt2x00: support Ralink 5362. sched: Use dl_bw_of() under RCU read lock sched: Use rq->rd in sched_setaffinity() under RCU read lock scsi: Fix error handling in SCSI_IOCTL_SEND_COMMAND scsi: only re-lock door after EH on devices that were reset selinux: fix inode security list corruption serial: Fix divide-by-zero fault in uart_get_divisor() sh: fix sh770x SCIF memory regions sit: Use ipip6_tunnel_init as the ndo_init function. smsc911x: power-up phydev before doing a software reset. spi: dw-mid: check that DMA was inited before exit spi: dw-mid: respect 8 bit mode spi: dw-mid: terminate ongoing transfers at exit spi: fsl-dspi: Fix CTAR selection spi: pl022: Fix incorrect dma_unmap_sg spi: pxa2xx: toggle clocks on suspend if not disabled by runtime PM staging:iio:ad5933: Drop "raw" from channel names staging:iio:ad5933: Fix NULL pointer deref when enabling buffer staging:iio:ade7758: Fix check if channels are enabled in prenable staging:iio:ade7758: Fix NULL pointer deref when enabling buffer staging:iio:ade7758: Remove "raw" from channel name SUNRPC: Add missing support for RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT SUNRPC: Don't wake tasks during connection abort sunvdc: add cdrom and v1.1 protocol support sunvdc: compute vdisk geometry from capacity sunvdc: don't call VD_OP_GET_VTOC sunvdc: limit each sg segment to a page sysfs: driver core: Fix glue dir race condition by gdp_mutex target: Fix APTPL metadata handling for dynamic MappedLUNs target: Fix queue full status NULL pointer for SCF_TRANSPORT_TASK_SENSE tcp: md5: do not use alloc_percpu() tracing/syscalls: Ignore numbers outside NR_syscalls' range tty: Fix high cpu load if tty is unreleaseable tun: Fix csum_start with VLAN acceleration UBI: add missing kmem_cache_free() in process_pool_aeb error path UBIFS: fix a race condition UBIFS: fix free log space calculation UBIFS: remove mst_mutex um: ubd: Fix for processes stuck in D state forever USB: cdc-acm: add device id for GW Instek AFG-2225 USB: cdc-acm: only raise DTR on transitions from B0 USB: core: add device-qualifier quirk usb: Do not allow usb_alloc_streams on unconfigured devices usb: dwc3: gadget: fix set_halt() bug with pending transfers usb: dwc3: gadget: Properly initialize LINK TRB usb: gadget: f_fs: remove redundant ffs_data_get() usb: gadget: function: acm: make f_acm pass USB20CV Chapter9 usb: gadget: udc: core: fix kernel oops with soft-connect USB: kobil_sct: fix non-atomic allocation in write path usb: musb: cppi41: restart hrtimer only if not yet done usb: musb: dsps: start OTG timer on resume again USB: opticon: fix non-atomic allocation in write path USB: option: add Haier CE81B CDMA modem usb: option: add support for Telit LE910 usb: pch_udc: usb gadget device support for Intel Quark X1000 usb: phy: return -ENODEV on failure of try_module_get USB: quirks: enable device-qualifier quirk for another Elan touchscreen USB: quirks: enable device-qualifier quirk for Elan Touchscreen USB: quirks: enable device-qualifier quirk for yet another Elan touchscreen USB: serial: cp210x: add Silicon Labs 358x VID and PID usb: serial: ftdi_sio: add Awinda Station and Dongle products usb: serial: ftdi_sio: add "bricked" FTDI device PID usb-storage: handle a skipped data phase vfs: fix data corruption when blocksize < pagesize for mmaped data vio: fix reuse of vio_dring slot virtio_pci: fix virtio spec compliance on restore vti6: Use vti6_dev_init as the ndo_init function. vxlan: Do not reuse sockets for a different address family vxlan: fix a free after use vxlan: fix a use after free in vxlan_encap_bypass vxlan: using pskb_may_pull as early as possible wireless: rt2x00: add new rt2800usb device wireless: rt2x00: add new rt2800usb devices x86_64, entry: Filter RFLAGS.NT on entry from userspace x86_64, entry: Fix out of bounds read on sysenter x86: Add cpu_detect_cache_sizes to init_intel() add Quark legacy_cache() x86, apic: Handle a bad TSC more gracefully x86, fpu: __restore_xstate_sig()->math_state_restore() needs preempt_disable() x86, fpu: shift drop_init_fpu() from save_xstate_sig() to handle_signal() x86/intel/quark: Switch off CR4.PGE so TLB flush uses CR3 instead x86, iosf: Added Quark MBI identifiers x86, iosf: Add PCI ID macros for better readability x86, iosf: Add Quark X1000 PCI ID x86, iosf: Make IOSF driver modular and usable by more drivers x86, kaslr: Prevent .bss from overlaping initrd x86, microcode, AMD: Fix early ucode loading on 32-bit x86, microcode, AMD: Fix ucode patch stashing on 32-bit x86/mm: In the PTE swapout page reclaim case clear the accessed bit instead of flushing the TLB x86, pageattr: Prevent overflow in slow_virt_to_phys() for X86_PAE x86/platform/intel/iosf: Add Braswell PCI ID x86: Reject x32 executables if x32 ABI not supported x86, x32, audit: Fix x32's AUDIT_ARCH wrt audit xfs: avoid false quotacheck after unclean shutdown xfs: ensure WB_SYNC_ALL writeback handles partial pages correctly zram: avoid kunmap_atomic() of a NULL pointer On top of that, 2 more changes in intel_pstate from 3.17.x have been included into our kernel: * intel_pstate: Don't lose sysfs settings during cpu offline (upstream commit c034871) * cpufreq: intel_pstate: Reflect current no_turbo state correctly (upstream commit 4521e1a0) BFQ has aso been updated to v7r6, the patches are from the set for 3.14.x maintained by Nicolo' Costanza <abitrules@yahoo.it>.
2014-11-24 13:41:44 +03:00
%define sublevel 25
2013-11-16 00:27:01 +04:00
# Package release
2014-01-13 13:48:30 +04:00
%define mibrel 69
2013-11-16 00:27:01 +04:00
# kernel Makefile extraversion is substituted by
# kpatch wich are either 0 (empty), rc (kpatch)
%define kpatch 0
# kernel.org -gitX patch (only the number after "git")
%define kgit 0
# kernel base name (also name of srpm)
%define kname kernel
# Patch tarball tag
%define ktag rosa
# define rpmtag %{disttag}
%define rpmtag %{disttag}
%if %kpatch
%if %kgit
%define rpmrel %mkrel 0.%{kpatch}.%{kgit}.%{mibrel}
%else
%define rpmrel %mkrel 0.%{kpatch}.%{mibrel}
%endif
%else
Unify the specs for 2014.1 and the future cert. systems; revisit configs The source code of the kernel and the patchset are the same for both 2014.1 and the "current" platform, so are the scripts used during the build. 1. I updated create_configs-withBFQ so that it creates different kernel configuration files depending on its --with-enhanced-security parameter. If --with-enhanced-security is set, * SELinux is used instead of TOMOYO; * Memory sanitization facilities are compiled in (but are disabled by default - should be enabled at boot time with boot options pax_sanitize_slab=1 paxsanitize_pages=1). Similar to other packages, I added a conditional in the spec that enables enhanced security features when building for 'current' (i.e. for the future cert. systems) and leaves everithing as is. Besides, I fixed create_configs-withBFQ: even if --user-cpu=... was given, it still generated the configs for all architectures, a waste of time. Now it creates the config only for the architecture corresponding to --user-cpu=... if it is set and for all otherwise. ---------------- The changes in the configs listed below are for i586 and x86_64 only. 2. Added the following to make lxc-checkconfig happy: * CONFIG_MEMCG=y * CONFIG_MEMCG_SWAP=y * CONFIG_MEMCG_KMEM=y 3. Added the following options that 'make oldconfig' adds anyway during the build: * CONFIG_MM_OWNER=y * CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y * CONFIG_IOSF_MBI=m * CONFIG_LRU_CACHE=m * (x86_64 only) CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y 4. Removed the following options (they are no longer available in 3.14): * CONFIG_CPU_FREQ_TABLE * CONFIG_IP_NF_MATCH_PSD * CONFIG_IP_NF_TARGET_IFWLOG 5. Increased CONFIG_SERIAL_8250_NR_UARTS from 4 to 8: some of our users have unusual boards with more than 4 serial ports. Also added CONFIG_SERIAL_8250_MANY_PORTS=y: needed for these users too. 6. Unset CONFIG_DRM_RADEON_UMS: it has been deprecated for quite some time and was seemingly ignored. 'radeon' driver the kernel provides works via KMS rather than UMS now and its UMS support is obsolete and buggy. 7. Finally dropped support for Mach64 GPUs. If there are enough users with such hardware, we could enable it is some kernel flavour in contrib (project: https://abf.io/import/kernel-other/). 8. Changed CONFIG_FB_TILEBLITTING to "y": 'make oldconfig' already does this during the kernel build because it is needed for Matrox GPUs (CONFIG_FB_MATROX). BTW, some of our users do seem to have Matrox GPUs. Consequently, I had to disable CONFIG_FB_CON_DECOR: it needs CONFIG_FB_TILEBLITTING unset. 9. Changed CONFIG_X86_VERBOSE_BOOTUP=n to # CONFIG_X86_VERBOSE_BOOTUP is not set 10. (x86_64 only) Changed CONFIG_X86_ESPFIX32=y to CONFIG_X86_ESPFIX64=y This is what 'make oldconfig' does with that option anyway.
2015-01-13 19:32:41 +03:00
%define rpmrel 3
2013-11-16 00:27:01 +04:00
%endif
# fakerel and fakever never change, they are used to fool
# rpm/urpmi/smart
%define fakever 1
%define fakerel %mkrel 1
# version defines
%define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
%define kverrel %{kversion}-%{rpmrel}
# When we are using a pre/rc patch, the tarball is a sublevel -1
%if %kpatch
%if %sublevel
%define tar_ver %{kernelversion}.%{patchlevel}
%else
%define tar_ver %{kernelversion}.%(expr %{patchlevel} - 1)
%endif
%define patch_ver %{kversion}-%{kpatch}-%{ktag}%{mibrel}
%else
%define tar_ver %{kernelversion}.%{patchlevel}
%define patch_ver %{kversion}-%{ktag}%{mibrel}
%endif
# Used for not making too long names for rpms or search paths
# replaced mibrel with rpmrel / release > we can use only ONE sources folder for nrj & nrjQL
%if %kpatch
%if %kgit
%define buildrpmrel 0.%{kpatch}.%{kgit}.%{rpmrel}%{rpmtag}
%else
%define buildrpmrel 0.%{kpatch}.%{rpmrel}%{rpmtag}
%endif
%else
%define buildrpmrel %{rpmrel}%{rpmtag}
%endif
%define buildrel %{kversion}-%{buildrpmrel}
# Having different top-level names for packages means that you have to remove
# them by hand :(
2013-11-16 00:27:01 +04:00
%define top_dir_name %{kname}-%{_arch}
%define build_dir ${RPM_BUILD_DIR}/%{top_dir_name}
%define src_dir %{build_dir}/linux-%{tar_ver}
# Disable debug rpms...
2013-11-16 00:27:01 +04:00
%define _enable_debug_packages %{nil}
%define debug_package %{nil}
# Build defines
2013-11-16 00:35:08 +04:00
%define build_doc 1
2013-11-16 00:27:01 +04:00
%define build_source 1
%define build_devel 1
%define build_debug 0
#
# Old Mandriva kernel flavours plus new two PAE flavours
#
# Build desktop i586 / 4GB
%ifarch %{ix86}
%define build_desktop586 0
%endif
# Build desktop (i686 / 4GB) / x86_64 / sparc64 sets
%define build_desktop 0
2013-11-16 00:27:01 +04:00
# Build netbook (i686 / 4GB) / x86_64
%define build_netbook 0
# Build server (i686 / 64GB)/x86_64 / sparc64 sets
%define build_server 0
2013-11-16 00:27:01 +04:00
# Build desktop686 pae (i686 / 64GB)
%ifarch %{ix86}
%define build_desktop_pae 0
%endif
# Build netbook686 pae (i686 / 64GB)
%ifarch %{ix86}
%define build_netbook_pae 0
%endif
#
# MIB low latency optimized flavours called "nrj"
#
# Build nrj desktop586 (i586 / 4GB)
%ifarch %{ix86}
2013-11-16 00:35:08 +04:00
%define build_nrj_desktop586 0
2013-11-16 00:27:01 +04:00
%endif
# Build nrj desktop (i686 / 4GB) / x86_64 / sparc64 sets
%define build_nrj_desktop 1
# Build nrj realtime (i686 / 4GB) / x86_64
%define build_nrj_realtime 0
2013-11-16 00:27:01 +04:00
# Build nrj server (i686 / 4GB) / x86_64
%define build_nrj_server 0
2013-11-16 00:27:01 +04:00
# Build nrj laptop (i686 / 4GB) / x86_64
2014-01-13 15:57:59 +04:00
%define build_nrj_laptop 1
2013-11-16 00:27:01 +04:00
# Build nrj netbook (i686 / 4GB) / x86_64
%define build_nrj_netbook 0
2013-11-16 00:27:01 +04:00
# Build nrj desktop pae (i686 / 64GB)
%ifarch %{ix86}
2014-01-13 15:57:59 +04:00
%define build_nrj_desktop_pae 1
2013-11-16 00:27:01 +04:00
%endif
# Build nrj realtime pae (i686 / 64GB)
%ifarch %{ix86}
%define build_nrj_realtime_pae 0
%endif
# Build nrj laptop pae (i686 / 64GB)
%ifarch %{ix86}
2014-01-13 15:57:59 +04:00
%define build_nrj_laptop_pae 1
2013-11-16 00:27:01 +04:00
%endif
# Build nrj netbook686 pae (i686 / 64GB)
%ifarch %{ix86}
%define build_nrj_netbook_pae 0
%endif
#
# experimental "cpu level" optimized "nrj" flavours
#
# Build nrj netbook Intel Atom (matom / 4GB)
%ifarch %{ix86}
%define build_nrj_netbook_atom 0
%endif
# Build nrj netbook Intel Atom pae (matom / 64GB)
%ifarch %{ix86}
%define build_nrj_netbook_atom_pae 0
%endif
# Build nrj desktop Intel Core2 (mcore2 / 4GB)
%ifarch %{ix86}
%define build_nrj_desktop_core2 0
%endif
# Build nrj desktop Intel Core2 pae (mcore2 / 64GB)
%ifarch %{ix86}
%define build_nrj_desktop_core2_pae 0
%endif
#
# end of experimental "cpu level" optimized "nrj" flavours
2013-11-16 00:27:01 +04:00
#
# build perf and cpupower tools
%define build_perf 1
%define build_cpupower 1
# compress modules with xz
%define build_modxz 1
# ARM builds
%ifarch %{arm}
%define build_desktop 0
%define build_netbook 0
%define build_server 0
%define build_iop32x 0
%define build_kirkwood 1
%define build_versatile 1
# no cpupower tools on arm yet
%define build_cpupower 0
# arm is currently not using xz
%define build_modxz 0
%endif
# End of user definitions
# buildtime flags
%{?_without_desktop586: %global build_desktop586 0}
%{?_without_desktop: %global build_desktop 0}
%{?_without_netbook: %global build_netbook 0}
%{?_without_server: %global build_server 0}
%{?_without_desktop_pae: %global build_desktop_pae 0}
%{?_without_netbook_pae: %global build_netbook_pae 0}
%{?_without_nrj_desktop586: %global build_nrj_desktop586 0}
%{?_without_nrj_desktop: %global build_nrj_desktop 0}
%{?_without_nrj_realtime: %global build_nrj_realtime 0}
%{?_without_nrj_server: %global build_nrj_server 0}
2013-11-16 00:27:01 +04:00
%{?_without_nrj_laptop: %global build_nrj_laptop 0}
%{?_without_nrj_netbook: %global build_nrj_netbook 0}
%{?_without_nrj_desktop_pae: %global build_nrj_desktop_pae 0}
%{?_without_nrj_realtime_pae: %global build_nrj_realtime_pae 0}
%{?_without_nrj_laptop_pae: %global build_nrj_laptop_pae 0}
%{?_without_nrj_netbook_pae: %global build_nrj_netbook_pae 0}
%{?_without_nrj_netbook_atom: %global build_nrj_netbook_atom 0}
%{?_without_nrj_netbook_atom_pae: %global build_nrj_netbook_atom_pae 0}
%{?_without_nrj_desktop_core2: %global build_nrj_desktop_core2 0}
%{?_without_nrj_desktop_core2_pae: %global build_nrj_desktop_core2_pae 0}
%{?_without_doc: %global build_doc 0}
%{?_without_source: %global build_source 0}
%{?_without_devel: %global build_devel 0}
%{?_without_debug: %global build_debug 0}
%{?_without_perf: %global build_perf 0}
%{?_without_cpupower: %global build_cpupower 0}
%{?_without_modxz: %global build_modxz 0}
%{?_with_desktop586: %global build_desktop586 1}
%{?_with_desktop: %global build_desktop 1}
%{?_with_netbook: %global build_netbook 1}
%{?_with_server: %global build_server 1}
%{?_with_desktop_pae: %global build_desktop_pae 1}
%{?_with_netbook_pae: %global build_netbook_pae 1}
%{?_with_nrj_desktop586: %global build_nrj_desktop586 1}
%{?_with_nrj_desktop: %global build_nrj_desktop 1}
%{?_with_nrj_realtime: %global build_nrj_realtime 1}
%{?_with_nrj_server: %global build_nrj_server 1}
2013-11-16 00:27:01 +04:00
%{?_with_nrj_laptop: %global build_nrj_laptop 1}
%{?_with_nrj_netbook: %global build_nrj_netbook 1}
%{?_with_nrj_desktop_pae: %global build_nrj_desktop_pae 1}
%{?_with_nrj_realtime_pae: %global build_nrj_realtime_pae 1}
%{?_with_nrj_laptop_pae: %global build_nrj_laptop_pae 1}
%{?_with_nrj_netbook_pae: %global build_nrj_netbook_pae 1}
%{?_with_nrj_netbook_atom: %global build_nrj_netbook_atom 1}
%{?_with_nrj_netbook_atom_pae: %global build_nrj_netbook_atom_pae 1}
%{?_with_nrj_desktop_core2: %global build_nrj_desktop_core2 1}
%{?_with_nrj_desktop_core2_pae: %global build_nrj_desktop_core2_pae 1}
%{?_with_doc: %global build_doc 1}
%{?_with_source: %global build_source 1}
%{?_with_devel: %global build_devel 1}
%{?_with_debug: %global build_debug 1}
%{?_with_perf: %global build_perf 1}
%{?_with_cpupower: %global build_cpupower 1}
%{?_with_modxz: %global build_modxz 1}
# ARM builds
%{?_with_iop32x: %global build_iop32x 1}
%{?_with_kirkwood: %global build_kirkwood 1}
%{?_with_versatile: %global build_versatile 1}
%{?_without_iop32x: %global build_iop32x 0}
%{?_without_kirkwood: %global build_kirkwood 0}
%{?_without_versatile: %global build_versatile 0}
# For the .nosrc.rpm
%define build_nosrc 0
%{?_with_nosrc: %global build_nosrc 1}
############################################################
### Linker start1 > Check point to build for omv or rosa ###
2013-11-16 00:27:01 +04:00
############################################################
%if %(if [ -z "$CC" ] ; then echo 0; else echo 1; fi)
%define kmake %make CC="$CC"
2013-11-16 00:27:01 +04:00
%else
%define kmake %make
2013-11-16 00:27:01 +04:00
%endif
# there are places where parallel make don't work
%define smake make
2014-01-22 18:31:57 +04:00
2013-11-16 00:27:01 +04:00
###########################################################
### Linker end1 > Check point to build for omv or rosa ###
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")
# Sparc arch wants sparc64 kernels
%define target_arch %(echo %{_arch} | sed -e 's/mips.*/mips/' -e 's/arm.*/arm/' -e 's/aarch64/arm64/')
#
# SRC RPM description
#
Summary: Linux kernel built for Mandriva and ROSA
Name: %{kname}
Version: %{kversion}
Release: %{rpmrel}
License: GPLv2
Group: System/Kernel and hardware
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
ExclusiveOS: Linux
URL: http://www.kernel.org
####################################################################
#
# Sources
#
### This is for full SRC RPM
Source0: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.xz
Source1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/linux-%{tar_ver}.tar.sign
### This is for stripped SRC RPM
%if %build_nosrc
NoSource: 0
%endif
# This is for disabling *config, mrproper, prepare, scripts on -devel rpms
Source2: disable-mrproper-prepare-scripts-configs-in-devel-rpms.patch
Source4: README.kernel-sources
Source5: kernel.rpmlintrc
# config and systemd service file from fedora
Source50: cpupower.service
Source51: cpupower.config
# Our patch tarball,
# see https://abf.rosalinux.ru/soft/kernel-patches-and-configs/
Source100: kernel-patches-and-configs-%{kversion}.tar.xz
2013-11-16 00:27:01 +04:00
####################################################################
#
# Patches
#
# Patch0 to Patch100 are for core kernel upgrades.
#
# Pre linus patch: ftp://ftp.kernel.org/pub/linux/kernel/v3.0/testing
%if %kpatch
%if %sublevel
2014-01-13 13:48:30 +04:00
Patch2: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/stable-review/patch-%{kversion}-%{kpatch}.xz
2013-11-16 00:27:01 +04:00
Source11: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/stable-review/patch-%{kversion}-%{kpatch}.sign
%else
2014-01-13 13:48:30 +04:00
Patch1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/testing/patch-%{kernelversion}.%{patchlevel}-%{kpatch}.xz
2013-11-16 00:27:01 +04:00
Source10: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/testing/patch-%{kernelversion}.%{patchlevel}-%{kpatch}.sign
%endif
%endif
%if %kgit
2014-01-13 13:48:30 +04:00
Patch2: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/snapshots/patch-%{kernelversion}.%{patchlevel}-%{kpatch}-git%{kgit}.xz
2013-11-16 00:27:01 +04:00
Source11: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/snapshots/patch-%{kernelversion}.%{patchlevel}-%{kpatch}-git%{kgit}.sign
%endif
%if %sublevel
%if %kpatch
%define prev_sublevel %(expr %{sublevel} - 1)
%if %prev_sublevel
2014-01-13 13:48:30 +04:00
Patch1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{prev_sublevel}.xz
2013-11-16 00:27:01 +04:00
Source10: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kernelversion}.%{patchlevel}.%{prev_sublevel}.sign
%endif
%else
2014-01-13 13:48:30 +04:00
Patch1: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kversion}.xz
2013-11-16 00:27:01 +04:00
Source10: ftp://ftp.kernel.org/pub/linux/kernel/v%{kernelversion}.x/patch-%{kversion}.sign
%endif
%endif
#END
####################################################################
# Defines for the things that are needed for all the kernels
#
%define common_desc_kernel The kernel package contains the Linux kernel (vmlinuz), the core of your \
Mandriva and ROSA operating system. The kernel handles the basic functions \
of the operating system: memory allocation, process allocation, device \
input and output, etc.
%define common_desc_kernel_smp This kernel relies on in-kernel smp alternatives to switch between up & smp \
mode depending on detected hardware. To force the kernel to boot in single \
processor mode, use the "nosmp" boot parameter.
### Global Requires/Provides
%define requires1 grub2
%define requires2 dracut >= 017-16
%define requires3 kmod >= 7-6
2013-11-16 00:27:01 +04:00
%define requires4 sysfsutils >= 2.1.0-12
%define requires5 kernel-firmware >= 20120219-1
%define kprovides1 %{kname} = %{kverrel}
%define kprovides2 kernel = %{tar_ver}
%define kprovides3 alsa = 1.0.27
%define kprovides_server drbd-api = 88
%define kobsoletes1 dkms-r8192se <= 0019.1207.2010-2
%define kobsoletes2 dkms-lzma <= 4.43-32
%define kobsoletes3 dkms-psb <= 4.41.1-7
2014-07-11 16:23:13 +04:00
# conflict dkms packages that dont support kernel-3.14
2013-11-16 00:27:01 +04:00
# all driver versions must be carefully checked to add
%define kconflicts1 dkms-broadcom-wl < 6.30.223.141-6
%define kconflicts2 dkms-fglrx < 14.10.1006.1001-1
%define kconflicts3 dkms-nvidia-current < 331.38-5
%define kconflicts4 dkms-nvidia-long-lived < 304.108-8
%define kconflicts5 dkms-nvidia173 < 173.14.39-3
2013-11-16 00:27:01 +04:00
# nvidia96xx does not support this kernel or x11-server-1.13
Autoreqprov: no
2013-11-16 00:27:01 +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
%ifarch x86_64
BuildRequires: numa-devel
%endif
# 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
BuildRequires: bison
BuildRequires: elfutils-devel
BuildRequires: flex
BuildRequires: libunwind-devel
2013-11-16 00:27:01 +04:00
BuildRequires: newt-devel
BuildRequires: perl-devel
BuildRequires: pkgconfig(gtk+-2.0)
2013-11-16 00:27:01 +04:00
BuildRequires: python-devel
BuildRequires: xmlto
BuildRequires: zlib-devel
%endif
2013-11-16 00:27:01 +04:00
%ifarch %{arm}
BuildRequires: uboot-mkimage
%endif
# might be useful too:
Suggests: microcode
2013-11-16 00:27:01 +04:00
%description
%common_desc_kernel
%ifnarch %{arm}
%common_desc_kernel_smp
%endif
# Define obsolete/provides to help automatic upgrades of old kernel-xen-pvops
%define latest_obsoletes_server kernel-xen-pvops-latest < 3.2.1-1
%define latest_provides_server kernel-xen-pvops-latest = %{kverrel}
%define latest_obsoletes_devel_server kernel-xen-pvops-devel-latest < 3.2.1-1
%define latest_provides_devel_server kernel-xen-pvops-devel-latest = %{kverrel}
# mkflavour() name flavour processor
# name: the flavour name in the package name
# flavour: first parameter of CreateKernel()
%define mkflavour() \
%package -n %{kname}-%{1}-%{buildrel} \
Version: %{fakever} \
Release: %{fakerel} \
Provides: %kprovides1 %kprovides2 %kprovides3 \
%{expand:%%{?kprovides_%{1}:Provides: %{kprovides_%{1}}}} \
Provides: %{kname}-%{1} \
%if %{build_nrj_desktop} \
Provides: kernel-desktop \
%endif \
Requires(pre): %requires1 %requires2 %requires3 %requires4 \
Requires: %requires2 %requires5 \
Obsoletes: %kobsoletes1 %kobsoletes2 %kobsoletes3 \
Conflicts: %kconflicts1 %kconflicts2 %kconflicts3 \
Conflicts: %kconflicts4 %kconflicts5 \
Provides: should-restart = system \
Suggests: crda \
%ifarch %{ix86} \
Conflicts: arch(x86_64) \
%endif \
Summary: %{expand:%{summary_%(echo %{1} | sed -e "s/-/_/")}} \
Group: System/Kernel and hardware \
%description -n %{kname}-%{1}-%{buildrel} \
%common_desc_kernel %{expand:%{info_%(echo %{1} | sed -e "s/-/_/")}} \
%ifnarch %{arm} \
%common_desc_kernel_smp \
%endif \
\
%if %build_devel \
%package -n %{kname}-%{1}-devel-%{buildrel} \
Version: %{fakever} \
Release: %{fakerel} \
Requires: glibc-devel ncurses-devel make gcc perl \
Summary: The kernel-devel files for %{kname}-%{1}-%{buildrel} \
Group: Development/Kernel \
Provides: %{kname}-devel = %{kverrel} \
Provides: %{kname}-%{1}-devel \
%ifarch %{ix86} \
Conflicts: arch(x86_64) \
%endif \
%description -n %{kname}-%{1}-devel-%{buildrel} \
This package contains the kernel files (headers and build tools) \
that should be enough to build additional drivers for \
use with %{kname}-%{1}-%{buildrel}. \
\
If you want to build your own kernel, you need to install the full \
%{kname}-source-%{buildrel} rpm. \
\
%endif \
\
%if %build_debug \
%package -n %{kname}-%{1}-%{buildrel}-debuginfo \
Version: %{fakever} \
Release: %{fakerel} \
Summary: Files with debuginfo for %{kname}-%{1}-%{buildrel} \
Group: Development/Debug \
Provides: kernel-debug = %{kverrel} \
%ifarch %{ix86} \
Conflicts: arch(x86_64) \
%endif \
%description -n %{kname}-%{1}-%{buildrel}-debuginfo \
This package contains the files with debuginfo to aid in debug tasks \
when using %{kname}-%{1}-%{buildrel}. \
\
If you need to look at debug information or use some application that \
needs debugging info from the kernel, this package may help. \
\
%endif \
\
%package -n %{kname}-%{1}-latest \
Version: %{kversion} \
Release: %{rpmrel} \
Summary: Virtual rpm for latest %{kname}-%{1} \
Group: System/Kernel and hardware \
Requires: %{kname}-%{1}-%{buildrel} \
%ifarch %{ix86} \
Conflicts: arch(x86_64) \
%endif \
%{expand:%%{?latest_obsoletes_%{1}:Obsoletes: %{latest_obsoletes_%{1}}}} \
%{expand:%%{?latest_provides_%{1}:Provides: %{latest_provides_%{1}}}} \
%description -n %{kname}-%{1}-latest \
This package is a virtual rpm that aims to make sure you always have the \
latest %{kname}-%{1} installed... \
\
%if %build_devel \
%package -n %{kname}-%{1}-devel-latest \
Version: %{kversion} \
Release: %{rpmrel} \
Summary: Virtual rpm for latest %{kname}-%{1}-devel \
Group: Development/Kernel \
Requires: %{kname}-%{1}-devel-%{buildrel} \
%ifarch %{ix86} \
Conflicts: arch(x86_64) \
%endif \
Provides: %{kname}-devel-latest \
%{expand:%%{?latest_obsoletes_devel_%{1}:Obsoletes: %{latest_obsoletes_devel_%{1}}}} \
%{expand:%%{?latest_provides_devel_%{1}:Provides: %{latest_provides_devel_%{1}}}} \
%description -n %{kname}-%{1}-devel-latest \
This package is a virtual rpm that aims to make sure you always have the \
latest %{kname}-%{1}-devel installed... \
\
%endif \
\
%post -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-post \
%posttrans -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-posttrans \
%preun -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-preun \
%postun -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-postun \
\
%if %build_devel \
%post -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-post \
%preun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-preun \
%postun -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1}-postun \
%endif \
\
%files -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1} \
%files -n %{kname}-%{1}-latest \
\
%if %build_devel \
%files -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1} \
%files -n %{kname}-%{1}-devel-latest \
%endif \
\
%if %build_debug \
%files -n %{kname}-%{1}-%{buildrel}-debuginfo -f kernel_debug_files.%{1} \
%endif
%ifarch %{ix86}
#
# kernel-desktop586: i586, smp-alternatives, 4GB
#
%if %build_desktop586
%define summary_desktop586 Linux kernel for desktop use with i586 & 4GB RAM
%define info_desktop586 This kernel is compiled for desktop use, single or \
multiple i586 processor(s)/core(s) and less than 4GB RAM, using HZ_1000, \
voluntary preempt, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour desktop586
%endif
%endif
#
# kernel-desktop: i686, smp-alternatives, 4 GB / x86_64
#
%if %build_desktop
%ifarch %{ix86}
%define summary_desktop Linux Kernel for desktop use with i686 & 4GB RAM
%define info_desktop This kernel is compiled for desktop use, single or \
multiple i686 processor(s)/core(s) and less than 4GB RAM, using HZ_1000, \
voluntary preempt, CFS cpu scheduler and BFQ i/o scheduler.
%else
%define summary_desktop Linux Kernel for desktop use with %{_arch}
%define info_desktop This kernel is compiled for desktop use, single or \
multiple %{_arch} processor(s)/core(s), using HZ_1000, \
voluntary preempt, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%endif
%mkflavour desktop
%endif
#
# kernel-netbook: i686, smp-alternatives, 4 GB / x86_64
#
%if %build_netbook
%ifarch %{ix86}
%define summary_netbook Linux Kernel for netbook use with i686 & 4GB RAM
%define info_netbook This kernel is compiled for netbook use, single or \
multiple i686 processor(s)/core(s) and less than 4GB RAM, using HZ_250, \
voluntary preempt, CFS cpu scheduler and BFQ i/o scheduler.
%else
%define summary_netbook Linux Kernel for netbook use with %{_arch}
%define info_netbook This kernel is compiled for netbook use, single or \
multiple %{_arch} processor(s)/core(s), using HZ_250, \
voluntary preempt, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%endif
%mkflavour netbook
%endif
#
# kernel-server: i686, smp-alternatives, 64 GB / x86_64
#
%if %build_server
%ifarch %{ix86}
%define summary_server Linux Kernel for server use with i686 & 64GB RAM
%define info_server This kernel is compiled for server use, single or \
multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using \
no preempt, HZ_100, CFS cpu scheduler and CFQ i/o scheduler, ONDEMAND governor.
2013-11-16 00:27:01 +04:00
%else
%define summary_server Linux Kernel for server use with %{_arch}
%define info_server This kernel is compiled for server use, single or \
multiple %{_arch} processor(s)/core(s), using no preempt, HZ_100, \
CFS cpu scheduler and CFQ i/o scheduler, ONDEMAND governor.
2013-11-16 00:27:01 +04:00
%endif
%mkflavour server
%endif
%ifarch %{ix86}
#
# kernel-desktop-pae: i686, smp-alternatives, 64GB
#
%if %build_desktop_pae
%define summary_desktop_pae Linux kernel for desktop use with i686 & upto 64GB RAM
%define info_desktop_pae This kernel is compiled for desktop use, single or \
multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using HZ_1000, \
voluntary preempt, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour desktop-pae
%endif
%endif
%ifarch %{ix86}
#
# kernel-netbook-pae: i686, smp-alternatives, 64 GB
#
%if %build_netbook_pae
%define summary_netbook_pae Linux Kernel for for netbook use with i686 & upto 64GB RAM
%define info_netbook_pae This kernel is compiled for netbook use, single or \
multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using HZ_250, \
voluntary preempt, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour netbook-pae
%endif
%endif
%ifarch %{ix86}
#
# kernel-nrj-desktop586: nrj, i586, smp-alternatives, 4GB
#
%if %build_nrj_desktop586
%define summary_nrj_desktop586 Linux kernel for desktop use with i586 & 4GB RAM
%define info_nrj_desktop586 This kernel is compiled for desktop use, single or \
multiple i586 processor(s)/core(s) and less than 4GB RAM, using HZ_1000, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour nrj-desktop586
%endif
%endif
#
# kernel-nrj-desktop: nrj, i686, smp-alternatives, 4 GB / x86_64
#
%if %build_nrj_desktop
%ifarch %{ix86}
%define summary_nrj_desktop Linux Kernel for desktop use with i686 & 4GB RAM
%define info_nrj_desktop This kernel is compiled for desktop use, single or \
multiple i686 processor(s)/core(s) and less than 4GB RAM, using HZ_1000, \
full preempt, rcu boost, RIFS cpu scheduler and BFQ I/O scheduler, ONDEMAND governor.
%else
%define summary_nrj_desktop Linux Kernel for desktop use with %{_arch}
%define info_nrj_desktop This kernel is compiled for desktop use, single or \
multiple %{_arch} processor(s)/core(s), using HZ_1000, \
full preempt, rcu boost, RIFS cpu scheduler and BFQ I/O scheduler, ONDEMAND governor.
%endif
%mkflavour nrj-desktop
%endif
#
# kernel-nrj-realtime: nrj, i686, smp-alternatives, 4 GB / x86_64
#
%if %build_nrj_realtime
%ifarch %{ix86}
%define summary_nrj_realtime Linux Kernel for low latency use with i686 & 4GB RAM
%define info_nrj_realtime This kernel is compiled for low latency use, single or \
multiple i686 processor(s)/core(s) and less than 4GB RAM, using HZ_1000, \
full preempt, rcu boost, CFS cpu scheduler and new BFQ I/O scheduler, PERFORMANCE governor.
%else
%define summary_nrj_realtime Linux Kernel for low latency use with %{_arch}
%define info_nrj_realtime This kernel is compiled for low latency use, single or \
multiple %{_arch} processor(s)/core(s), using HZ_1000, \
full preempt, rcu boost, CFS cpu scheduler and new BFQ I/O scheduler, PERFORMANCE governor.
%endif
%mkflavour nrj-realtime
%endif
#
# kernel-nrj-server: i686, smp-alternatives, 64 GB / x86_64
#
%if %build_nrj_server
%ifarch %{ix86}
%define summary_nrj_server Linux Kernel for server use with i686 & 64GB RAM
%define info_nrj_server This kernel is compiled for server use, single or \
multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using \
no preempt, HZ_100, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%else
%define summary_nrj_server Linux Kernel for server use with %{_arch}
%define info_nrj_server This kernel is compiled for server use, single or \
multiple %{_arch} processor(s)/core(s), using no preempt, HZ_100, \
CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%endif
%mkflavour nrj-server
%endif
2013-11-16 00:27:01 +04:00
#
# kernel-nrj-laptop: nrj, i686, smp-alternatives, 4 GB / x86_64
#
%if %build_nrj_laptop
%ifarch %{ix86}
%define summary_nrj_laptop Linux Kernel for laptop use with i686 & 4GB RAM
%define info_nrj_laptop This kernel is compiled for laptop use, single or \
multiple i686 processor(s)/core(s) and less than 4GB RAM, using HZ_300, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%else
%define summary_nrj_laptop Linux Kernel for laptop use with %{_arch}
%define info_nrj_laptop This kernel is compiled for laptop use, single or \
multiple %{_arch} processor(s)/core(s), using HZ_300, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%endif
%mkflavour nrj-laptop
%endif
#
# kernel-nrj-netbook: nrj, i686, smp-alternatives, 4 GB / x86_64
#
%if %build_nrj_netbook
%ifarch %{ix86}
%define summary_nrj_netbook Linux Kernel for netbook use with i686 & 4GB RAM
%define info_nrj_netbook This kernel is compiled for netbook use, single or \
multiple i686 processor(s)/core(s) and less than 4GB RAM, using HZ_250, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%else
%define summary_nrj_netbook Linux Kernel for netbook use with %{_arch}
%define info_nrj_netbook This kernel is compiled for netbook use, single or \
multiple %{_arch} processor(s)/core(s), using HZ_250, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%endif
%mkflavour nrj-netbook
%endif
#
%ifarch %{ix86}
#
# kernel-nrj-desktop-pae: nrj, i686, smp-alternatives, 64GB
#
%if %build_nrj_desktop_pae
%define summary_nrj_desktop_pae Linux kernel for desktop use with i686 & upto 64GB RAM
%define info_nrj_desktop_pae This kernel is compiled for desktop use, single or \
multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using HZ_1000, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour nrj-desktop-pae
%endif
%endif
#
%ifarch %{ix86}
#
# kernel-nrj-realtime-pae: nrj, i686, smp-alternatives, 64GB
#
%if %build_nrj_realtime_pae
%define summary_nrj_realtime_pae Linux kernel for low latency use with i686 & upto 64GB RAM
%define info_nrj_realtime_pae This kernel is compiled for low latency use, single or \
multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using HZ_1000, \
full preempt, rcu boost, CFS cpu scheduler and new BFQ I/O scheduler, PERFORMANCE governor.
%mkflavour nrj-realtime-pae
%endif
%endif
#
%ifarch %{ix86}
#
# kernel-nrj-laptop-pae: nrj, i686, smp-alternatives, 64 GB
#
%if %build_nrj_laptop_pae
%define summary_nrj_laptop_pae Linux Kernel for for laptop use with i686 & upto 64GB RAM
%define info_nrj_laptop_pae This kernel is compiled for laptop use, single or \
multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using HZ_300, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour nrj-laptop-pae
%endif
%endif
#
%ifarch %{ix86}
#
# kernel-nrj-netbook-pae: nrj, i686, smp-alternatives, 64 GB
#
%if %build_nrj_netbook_pae
%define summary_nrj_netbook_pae Linux Kernel for for netbook use with i686 & upto 64GB RAM
%define info_nrj_netbook_pae This kernel is compiled for netbook use, single or \
multiple i686 processor(s)/core(s) and up to 64GB RAM using PAE, using HZ_250, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour nrj-netbook-pae
%endif
%endif
#
%ifarch %{ix86}
#
# kernel-nrj-netbook-atom: nrj, for Intel Atom cpu, smp-alternatives, 4 GB
#
%if %build_nrj_netbook_atom
%define summary_nrj_netbook_atom Linux Kernel for netbook use with Intel Atom cpu, less than 4GB RAM
%define info_nrj_netbook_atom This kernel is compiled for netbook use, single or \
multiple Intel Atom cpu processor(s)/core(s) and less than 4GB RAM, using HZ_250, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour nrj-netbook-atom
%endif
%endif
#
%ifarch %{ix86}
#
# kernel-nrj-netbook-atom-pae: nrj, for Intel Atom cpu, smp-alternatives, 64 GB
#
%if %build_nrj_netbook_atom_pae
%define summary_nrj_netbook_atom_pae Linux Kernel for netbook use with Intel Atom cpu & upto 64GB RAM
%define info_nrj_netbook_atom_pae This kernel is compiled for netbook use, single or \
multiple Intel Atom cpu processor(s)/core(s) and up to 64GB RAM using PAE, using HZ_250, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour nrj-netbook-atom-pae
%endif
%endif
#
%ifarch %{ix86}
#
# kernel-nrj-desktop-core2: nrj, Intel Core 2 and newer, smp-alternatives, 4 GB
#
%if %build_nrj_desktop_core2
%define summary_nrj_desktop_core2 Linux Kernel for desktop use with i686 & 4GB RAM
%define info_nrj_desktop_core2 This kernel is compiled for desktop use, single or \
multiple Intel Core 2 and newer processor(s)/core(s) and less than 4GB RAM, using HZ_1000, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour nrj-desktop-core2
%endif
%endif
#
%ifarch %{ix86}
#
# kernel-nrj-desktop-core2-pae: nrj, Intel Core 2 and newer, smp-alternatives, 64 GB
#
%if %build_nrj_desktop_core2_pae
%define summary_nrj_desktop_core2_pae Linux Kernel for desktop use with i686 & upto 64GB RAM
%define info_nrj_desktop_core2_pae This kernel is compiled for desktop use, single or \
multiple Intel Core 2 and newer processor(s)/core(s) and up to 64GB RAM using PAE, using HZ_1000, \
full preempt, rcu boost, CFS cpu scheduler and BFQ i/o scheduler, ONDEMAND governor.
%mkflavour nrj-desktop-core2-pae
%endif
%endif
#
# ARM kernels
#
%ifarch %{arm}
%if %build_iop32x
%define summary_iop32x Linux Kernel for Arm machines based on Xscale IOP32X
%define info_iop32x This kernel is compiled for iop32x boxes. It will run on n2100 \
or ss4000e or sanmina boards.
%mkflavour iop32x
%endif
%if %build_kirkwood
%define summary_kirkwood Linux Kernel for Arm machines based on Kirkwood
%define info_kirkwood This kernel is compiled for kirkwood boxes. It will run on openrd boards.
%mkflavour kirkwood
%endif
%if %build_versatile
%define summary_versatile Linux Kernel for Versatile arm machines
%define info_versatile This kernel is compiled for Versatile boxes. It will run on Qemu for instance.
%mkflavour versatile
%endif
%endif
#
# kernel-source
#
%if %build_source
%package -n %{kname}-source-%{buildrel}
Version: %{fakever}
Release: %{fakerel}
Requires: glibc-devel, ncurses-devel, make, gcc, perl, diffutils
Summary: The Linux source code for %{kname}-%{buildrel}
Group: Development/Kernel
Autoreqprov: no
Provides: kernel-source = %{kverrel}
Buildarch: noarch
%description -n %{kname}-source-%{buildrel}
The %{kname}-source package contains the source code files for the Mandriva and
Unify the specs for 2014.1 and the future cert. systems; revisit configs The source code of the kernel and the patchset are the same for both 2014.1 and the "current" platform, so are the scripts used during the build. 1. I updated create_configs-withBFQ so that it creates different kernel configuration files depending on its --with-enhanced-security parameter. If --with-enhanced-security is set, * SELinux is used instead of TOMOYO; * Memory sanitization facilities are compiled in (but are disabled by default - should be enabled at boot time with boot options pax_sanitize_slab=1 paxsanitize_pages=1). Similar to other packages, I added a conditional in the spec that enables enhanced security features when building for 'current' (i.e. for the future cert. systems) and leaves everithing as is. Besides, I fixed create_configs-withBFQ: even if --user-cpu=... was given, it still generated the configs for all architectures, a waste of time. Now it creates the config only for the architecture corresponding to --user-cpu=... if it is set and for all otherwise. ---------------- The changes in the configs listed below are for i586 and x86_64 only. 2. Added the following to make lxc-checkconfig happy: * CONFIG_MEMCG=y * CONFIG_MEMCG_SWAP=y * CONFIG_MEMCG_KMEM=y 3. Added the following options that 'make oldconfig' adds anyway during the build: * CONFIG_MM_OWNER=y * CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y * CONFIG_IOSF_MBI=m * CONFIG_LRU_CACHE=m * (x86_64 only) CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y 4. Removed the following options (they are no longer available in 3.14): * CONFIG_CPU_FREQ_TABLE * CONFIG_IP_NF_MATCH_PSD * CONFIG_IP_NF_TARGET_IFWLOG 5. Increased CONFIG_SERIAL_8250_NR_UARTS from 4 to 8: some of our users have unusual boards with more than 4 serial ports. Also added CONFIG_SERIAL_8250_MANY_PORTS=y: needed for these users too. 6. Unset CONFIG_DRM_RADEON_UMS: it has been deprecated for quite some time and was seemingly ignored. 'radeon' driver the kernel provides works via KMS rather than UMS now and its UMS support is obsolete and buggy. 7. Finally dropped support for Mach64 GPUs. If there are enough users with such hardware, we could enable it is some kernel flavour in contrib (project: https://abf.io/import/kernel-other/). 8. Changed CONFIG_FB_TILEBLITTING to "y": 'make oldconfig' already does this during the kernel build because it is needed for Matrox GPUs (CONFIG_FB_MATROX). BTW, some of our users do seem to have Matrox GPUs. Consequently, I had to disable CONFIG_FB_CON_DECOR: it needs CONFIG_FB_TILEBLITTING unset. 9. Changed CONFIG_X86_VERBOSE_BOOTUP=n to # CONFIG_X86_VERBOSE_BOOTUP is not set 10. (x86_64 only) Changed CONFIG_X86_ESPFIX32=y to CONFIG_X86_ESPFIX64=y This is what 'make oldconfig' does with that option anyway.
2015-01-13 19:32:41 +03:00
ROSA kernel. These source files are only needed if you want to build your own
2013-11-16 00:27:01 +04:00
custom kernel that is better tuned to your particular hardware.
If you only want the files needed to build 3rdparty (nVidia, Ati, dkms-*,...)
drivers against, install the *-devel-* rpm that is matching your kernel.
#
# kernel-source-latest: virtual rpm
#
%package -n %{kname}-source-latest
Version: %{kversion}
Release: %{rpmrel}
Summary: Virtual rpm for latest %{kname}-source
Group: Development/Kernel
Requires: %{kname}-source-%{buildrel}
Buildarch: noarch
%description -n %{kname}-source-latest
This package is a virtual rpm that aims to make sure you always have the
latest %{kname}-source installed...
%endif
#
# kernel-doc: documentation for the Linux kernel
#
%if %build_doc
%package -n %{kname}-doc
Version: %{kversion}
Release: %{rpmrel}
Summary: Various documentation bits found in the %{kname} source
Group: Documentation
Buildarch: noarch
%description -n %{kname}-doc
This package contains documentation files from the %{kname} source.
Various bits of information about the Linux kernel and the device drivers
shipped with it are documented in these files. You also might want install
this package if you need a reference to the options that can be passed to
Linux kernel modules at load time.
%endif
#
# kernel/tools
#
%if %{build_perf}
%package -n perf
Version: %{kversion}
Release: %{rpmrel}
Summary: perf tool and the supporting documentation
Group: System/Kernel and hardware
%description -n perf
the perf tool and the supporting documentation.
%endif
%if %{build_cpupower}
%package -n cpupower
Version: %{kversion}
Release: %{rpmrel}
Summary: The cpupower tools
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
Obsoletes: cpufreq cpufrequtils
%description -n cpupower
The cpupower tools.
2013-11-16 00:27:01 +04:00
%post -n cpupower
AVAIL_FILE=/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
CFG_FILE=%{_sysconfdir}/sysconfig/cpupower
if ! [ -e "${AVAIL_FILE}" ]; then
echo "Warning: CPU frequency scaling is not supported."
sed -i 's/@GOVERNOR@/<not_supported>/g' "${CFG_FILE}"
exit 0
fi
# Set "ondemand" or "powersave" by default. Do not enable cpupower.service
# if neither are supported.
if grep "ondemand" "${AVAIL_FILE}" >/dev/null 2>&1; then
echo "Info: setting 'ondemand' governor as the default."
sed -i 's/@GOVERNOR@/ondemand/g' "${CFG_FILE}"
elif grep "powersave" "${AVAIL_FILE}" >/dev/null 2>&1; then
echo "Info: setting 'powersave' governor as the default."
sed -i 's/@GOVERNOR@/powersave/g' "${CFG_FILE}"
else
echo -n "Warning: not setting the default governor. Available governors:"
cat "${AVAIL_FILE}"
echo
sed -i 's/@GOVERNOR@/<not_supported>/g' "${CFG_FILE}"
exit 0
fi
if [ $1 -ge 0 ]; then
/bin/systemctl enable cpupower >/dev/null 2>&1 || :
/bin/systemctl start cpupower >/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
/bin/systemctl --no-reload disable cpupower > /dev/null 2>&1 || :
/bin/systemctl stop cpupower > /dev/null 2>&1 || :
fi
2013-11-16 00:27:01 +04:00
%package -n cpupower-devel
Version: %{kversion}
Release: %{rpmrel}
Summary: Development files for cpupower
2013-11-16 00:27:01 +04:00
Group: Development/Kernel
Requires: cpupower = %{kversion}-%{rpmrel}
Conflicts: %{_lib}cpufreq-devel
%description -n cpupower-devel
This package contains the development files for cpupower.
%endif
%package headers
Version: %kversion
Release: %rpmrel
Summary: Linux kernel header files mostly used by your C library
Group: System/Kernel and hardware
Epoch: 1
%rename linux-userspace-headers
%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
%_includedir/*
# Don't conflict with cpupower-devel
%if %{build_cpupower}
%exclude %_includedir/cpufreq.h
%endif
#
# End packages - here begins build stage
#
%prep
%setup -q -n %top_dir_name -c
%setup -q -n %top_dir_name -D -T -a100
%define patches_dir ../kernel-patches-and-configs/
2013-11-16 00:27:01 +04:00
cd %src_dir
%if %sublevel
%if %kpatch
%if %prev_sublevel
%patch1 -p1
%endif
%patch2 -p1
%else
%patch1 -p1
%endif
%else
%if %kpatch
%patch1 -p1
%endif
%endif
%if %kgit
%patch2 -p1
%endif
%{patches_dir}/scripts/apply_patches
%{patches_dir}/scripts/apply_patches-NRJ
%{patches_dir}/scripts/apply_patches-geek
%{patches_dir}/scripts/apply_patches-latest
2013-11-16 00:27:01 +04:00
#
# Setup Begin
#
# Prepare all the variables for calling create_configs
%if %build_debug
%define debug --debug
%else
%define debug --no-debug
%endif
Unify the specs for 2014.1 and the future cert. systems; revisit configs The source code of the kernel and the patchset are the same for both 2014.1 and the "current" platform, so are the scripts used during the build. 1. I updated create_configs-withBFQ so that it creates different kernel configuration files depending on its --with-enhanced-security parameter. If --with-enhanced-security is set, * SELinux is used instead of TOMOYO; * Memory sanitization facilities are compiled in (but are disabled by default - should be enabled at boot time with boot options pax_sanitize_slab=1 paxsanitize_pages=1). Similar to other packages, I added a conditional in the spec that enables enhanced security features when building for 'current' (i.e. for the future cert. systems) and leaves everithing as is. Besides, I fixed create_configs-withBFQ: even if --user-cpu=... was given, it still generated the configs for all architectures, a waste of time. Now it creates the config only for the architecture corresponding to --user-cpu=... if it is set and for all otherwise. ---------------- The changes in the configs listed below are for i586 and x86_64 only. 2. Added the following to make lxc-checkconfig happy: * CONFIG_MEMCG=y * CONFIG_MEMCG_SWAP=y * CONFIG_MEMCG_KMEM=y 3. Added the following options that 'make oldconfig' adds anyway during the build: * CONFIG_MM_OWNER=y * CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y * CONFIG_IOSF_MBI=m * CONFIG_LRU_CACHE=m * (x86_64 only) CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y 4. Removed the following options (they are no longer available in 3.14): * CONFIG_CPU_FREQ_TABLE * CONFIG_IP_NF_MATCH_PSD * CONFIG_IP_NF_TARGET_IFWLOG 5. Increased CONFIG_SERIAL_8250_NR_UARTS from 4 to 8: some of our users have unusual boards with more than 4 serial ports. Also added CONFIG_SERIAL_8250_MANY_PORTS=y: needed for these users too. 6. Unset CONFIG_DRM_RADEON_UMS: it has been deprecated for quite some time and was seemingly ignored. 'radeon' driver the kernel provides works via KMS rather than UMS now and its UMS support is obsolete and buggy. 7. Finally dropped support for Mach64 GPUs. If there are enough users with such hardware, we could enable it is some kernel flavour in contrib (project: https://abf.io/import/kernel-other/). 8. Changed CONFIG_FB_TILEBLITTING to "y": 'make oldconfig' already does this during the kernel build because it is needed for Matrox GPUs (CONFIG_FB_MATROX). BTW, some of our users do seem to have Matrox GPUs. Consequently, I had to disable CONFIG_FB_CON_DECOR: it needs CONFIG_FB_TILEBLITTING unset. 9. Changed CONFIG_X86_VERBOSE_BOOTUP=n to # CONFIG_X86_VERBOSE_BOOTUP is not set 10. (x86_64 only) Changed CONFIG_X86_ESPFIX32=y to CONFIG_X86_ESPFIX64=y This is what 'make oldconfig' does with that option anyway.
2015-01-13 19:32:41 +03:00
%if %{with selinux}
# Enable SELinux, memory sanitization, etc.
%define enhanced_security --with-enhanced-security
%else
%define enhanced_security %{nil}
%endif
2013-11-16 00:27:01 +04:00
Unify the specs for 2014.1 and the future cert. systems; revisit configs The source code of the kernel and the patchset are the same for both 2014.1 and the "current" platform, so are the scripts used during the build. 1. I updated create_configs-withBFQ so that it creates different kernel configuration files depending on its --with-enhanced-security parameter. If --with-enhanced-security is set, * SELinux is used instead of TOMOYO; * Memory sanitization facilities are compiled in (but are disabled by default - should be enabled at boot time with boot options pax_sanitize_slab=1 paxsanitize_pages=1). Similar to other packages, I added a conditional in the spec that enables enhanced security features when building for 'current' (i.e. for the future cert. systems) and leaves everithing as is. Besides, I fixed create_configs-withBFQ: even if --user-cpu=... was given, it still generated the configs for all architectures, a waste of time. Now it creates the config only for the architecture corresponding to --user-cpu=... if it is set and for all otherwise. ---------------- The changes in the configs listed below are for i586 and x86_64 only. 2. Added the following to make lxc-checkconfig happy: * CONFIG_MEMCG=y * CONFIG_MEMCG_SWAP=y * CONFIG_MEMCG_KMEM=y 3. Added the following options that 'make oldconfig' adds anyway during the build: * CONFIG_MM_OWNER=y * CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y * CONFIG_IOSF_MBI=m * CONFIG_LRU_CACHE=m * (x86_64 only) CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y 4. Removed the following options (they are no longer available in 3.14): * CONFIG_CPU_FREQ_TABLE * CONFIG_IP_NF_MATCH_PSD * CONFIG_IP_NF_TARGET_IFWLOG 5. Increased CONFIG_SERIAL_8250_NR_UARTS from 4 to 8: some of our users have unusual boards with more than 4 serial ports. Also added CONFIG_SERIAL_8250_MANY_PORTS=y: needed for these users too. 6. Unset CONFIG_DRM_RADEON_UMS: it has been deprecated for quite some time and was seemingly ignored. 'radeon' driver the kernel provides works via KMS rather than UMS now and its UMS support is obsolete and buggy. 7. Finally dropped support for Mach64 GPUs. If there are enough users with such hardware, we could enable it is some kernel flavour in contrib (project: https://abf.io/import/kernel-other/). 8. Changed CONFIG_FB_TILEBLITTING to "y": 'make oldconfig' already does this during the kernel build because it is needed for Matrox GPUs (CONFIG_FB_MATROX). BTW, some of our users do seem to have Matrox GPUs. Consequently, I had to disable CONFIG_FB_CON_DECOR: it needs CONFIG_FB_TILEBLITTING unset. 9. Changed CONFIG_X86_VERBOSE_BOOTUP=n to # CONFIG_X86_VERBOSE_BOOTUP is not set 10. (x86_64 only) Changed CONFIG_X86_ESPFIX32=y to CONFIG_X86_ESPFIX64=y This is what 'make oldconfig' does with that option anyway.
2015-01-13 19:32:41 +03:00
%{patches_dir}/scripts/create_configs-withBFQ %debug %enhanced_security --user_cpu="%{target_arch}"
2013-11-16 00:27:01 +04:00
# make sure the kernel has the sublevel we know it has...
LC_ALL=C perl -p -i -e "s/^SUBLEVEL.*/SUBLEVEL = %{sublevel}/" Makefile
# get rid of unwanted files
find . -name '*~' -o -name '*.orig' -o -name '*.append' | %kxargs rm -f
%build
# Common target directories
%define _kerneldir /usr/src/linux-%{kversion}-%{buildrpmrel}
%define _bootdir /boot
%define _modulesdir /lib/modules
%define _efidir %{_bootdir}/efi/mandriva
# Directories definition needed for building
%define temp_root %{build_dir}/temp-root
%define temp_source %{temp_root}%{_kerneldir}
%define temp_boot %{temp_root}%{_bootdir}
%define temp_modules %{temp_root}%{_modulesdir}
PrepareKernel() {
name=$1
extension=$2
%ifarch %{ix86} x86_64
config_dir=arch/x86/configs
%endif
%ifarch %arm
config_dir=arch/arm/configs
%endif
%ifarch aarc64
config_dir=arch/arm64/configs
%endif
echo "Make config for kernel $extension"
pushd 3rdparty
perl mkbuild.pl
popd
2013-11-16 00:27:01 +04:00
%smake -s mrproper
if [ "%{target_arch}" == "i386" -o "%{target_arch}" == "x86_64" ]; then
if [ -z "$name" ]; then
cp ${config_dir}/%{target_arch}_defconfig-desktop .config
else
cp ${config_dir}/%{target_arch}_defconfig-$name .config
fi
else
if [ -z "$name" ]; then
cp arch/%{target_arch}/defconfig-desktop .config
else
cp arch/%{target_arch}/defconfig-$name .config
fi
fi
# make sure EXTRAVERSION says what we want it to say
LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -$extension/" Makefile
%smake oldconfig
}
BuildKernel() {
KernelVer=$1
echo "Building kernel $KernelVer"
%kmake -s all
# kirkwood boxes have u-boot
if [ "$KernelVer" = "%{kversion}-kirkwood-%{buildrpmrel}" ]; then
%kmake uImage
fi
# Start installing stuff
install -d %{temp_boot}
install -m 644 System.map %{temp_boot}/System.map-$KernelVer
install -m 644 .config %{temp_boot}/config-$KernelVer
xz -c Module.symvers > %{temp_boot}/symvers-$KernelVer.xz
%ifarch %{arm}
if [ -f arch/arm/boot/uImage ]; then
cp -f arch/arm/boot/uImage %{temp_boot}/uImage-$KernelVer
else
cp -f arch/arm/boot/zImage %{temp_boot}/vmlinuz-$KernelVer
fi
%else
cp -f arch/%{target_arch}/boot/bzImage %{temp_boot}/vmlinuz-$KernelVer
%endif
# modules
install -d %{temp_modules}/$KernelVer
%smake INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=$KernelVer modules_install
# headers
%make INSTALL_HDR_PATH=%{temp_root}%_prefix KERNELRELEASE=$KernelVer headers_install
# remove /lib/firmware, we use a separate kernel-firmware
rm -rf %{temp_root}/lib/firmware
}
SaveDevel() {
devel_flavour=$1
DevelRoot=/usr/src/linux-%{kversion}-$devel_flavour-%{buildrpmrel}
TempDevelRoot=%{temp_root}$DevelRoot
mkdir -p $TempDevelRoot
for i in $(find . -name 'Makefile*'); do cp -R --parents $i $TempDevelRoot;done
for i in $(find . -name 'Kconfig*' -o -name 'Kbuild*'); do cp -R --parents $i $TempDevelRoot;done
cp -fR include $TempDevelRoot
# ln -s ../generated/uapi/linux/version.h $TempDevelRoot/include/linux/version.h
2013-11-16 00:27:01 +04:00
cp -fR scripts $TempDevelRoot
cp -fR kernel/bounds.c $TempDevelRoot/kernel
cp -fR tools/include $TempDevelRoot/tools/
%ifarch %{arm}
cp -fR arch/%{target_arch}/tools $TempDevelRoot/arch/%{target_arch}/
%endif
%ifarch %{ix86} x86_64
cp -fR arch/x86/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/x86/kernel/
cp -fR arch/x86/kernel/asm-offsets_{32,64}.c $TempDevelRoot/arch/x86/kernel/
cp -fR arch/x86/syscalls/syscall* $TempDevelRoot/arch/x86/syscalls/
cp -fR arch/x86/include $TempDevelRoot/arch/x86/
cp -fR arch/x86/tools $TempDevelRoot/arch/x86/
%else
cp -fR arch/%{target_arch}/kernel/asm-offsets.{c,s} $TempDevelRoot/arch/%{target_arch}/kernel/
for f in $(find arch/%{target_arch} -name include); do cp -fR --parents $f $TempDevelRoot; done
%endif
cp -fR .config Module.symvers $TempDevelRoot
cp -fR 3rdparty/mkbuild.pl $TempDevelRoot/3rdparty
# Needed for truecrypt build (Danny)
cp -fR drivers/md/dm.h $TempDevelRoot/drivers/md/
# Needed for lguest
cp -fR drivers/lguest/lg.h $TempDevelRoot/drivers/lguest/
# Needed for lirc_gpio (#39004)
cp -fR drivers/media/pci/bt8xx/bttv{,p}.h $TempDevelRoot/drivers/media/pci/bt8xx/
cp -fR drivers/media/pci/bt8xx/bt848.h $TempDevelRoot/drivers/media/pci/bt8xx/
cp -fR drivers/media/common/btcx-risc.h $TempDevelRoot/drivers/media/common/
# Needed for external dvb tree (#41418)
cp -fR drivers/media/dvb-core/*.h $TempDevelRoot/drivers/media/dvb-core/
cp -fR drivers/media/dvb-frontends/lgdt330x.h $TempDevelRoot/drivers/media/dvb-frontends/
# add acpica header files, needed for fglrx build
cp -fR drivers/acpi/acpica/*.h $TempDevelRoot/drivers/acpi/acpica/
# aufs2 has a special file needed
cp -fR fs/aufs/magic.mk $TempDevelRoot/fs/aufs
Unify the specs for 2014.1 and the future cert. systems; revisit configs The source code of the kernel and the patchset are the same for both 2014.1 and the "current" platform, so are the scripts used during the build. 1. I updated create_configs-withBFQ so that it creates different kernel configuration files depending on its --with-enhanced-security parameter. If --with-enhanced-security is set, * SELinux is used instead of TOMOYO; * Memory sanitization facilities are compiled in (but are disabled by default - should be enabled at boot time with boot options pax_sanitize_slab=1 paxsanitize_pages=1). Similar to other packages, I added a conditional in the spec that enables enhanced security features when building for 'current' (i.e. for the future cert. systems) and leaves everithing as is. Besides, I fixed create_configs-withBFQ: even if --user-cpu=... was given, it still generated the configs for all architectures, a waste of time. Now it creates the config only for the architecture corresponding to --user-cpu=... if it is set and for all otherwise. ---------------- The changes in the configs listed below are for i586 and x86_64 only. 2. Added the following to make lxc-checkconfig happy: * CONFIG_MEMCG=y * CONFIG_MEMCG_SWAP=y * CONFIG_MEMCG_KMEM=y 3. Added the following options that 'make oldconfig' adds anyway during the build: * CONFIG_MM_OWNER=y * CONFIG_ARCH_SUPPORTS_ATOMIC_RMW=y * CONFIG_IOSF_MBI=m * CONFIG_LRU_CACHE=m * (x86_64 only) CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION=y 4. Removed the following options (they are no longer available in 3.14): * CONFIG_CPU_FREQ_TABLE * CONFIG_IP_NF_MATCH_PSD * CONFIG_IP_NF_TARGET_IFWLOG 5. Increased CONFIG_SERIAL_8250_NR_UARTS from 4 to 8: some of our users have unusual boards with more than 4 serial ports. Also added CONFIG_SERIAL_8250_MANY_PORTS=y: needed for these users too. 6. Unset CONFIG_DRM_RADEON_UMS: it has been deprecated for quite some time and was seemingly ignored. 'radeon' driver the kernel provides works via KMS rather than UMS now and its UMS support is obsolete and buggy. 7. Finally dropped support for Mach64 GPUs. If there are enough users with such hardware, we could enable it is some kernel flavour in contrib (project: https://abf.io/import/kernel-other/). 8. Changed CONFIG_FB_TILEBLITTING to "y": 'make oldconfig' already does this during the kernel build because it is needed for Matrox GPUs (CONFIG_FB_MATROX). BTW, some of our users do seem to have Matrox GPUs. Consequently, I had to disable CONFIG_FB_CON_DECOR: it needs CONFIG_FB_TILEBLITTING unset. 9. Changed CONFIG_X86_VERBOSE_BOOTUP=n to # CONFIG_X86_VERBOSE_BOOTUP is not set 10. (x86_64 only) Changed CONFIG_X86_ESPFIX32=y to CONFIG_X86_ESPFIX64=y This is what 'make oldconfig' does with that option anyway.
2015-01-13 19:32:41 +03:00
%if %{with selinux}
# SELinux needs security/selinux/include
cp -fR security/selinux/include $TempDevelRoot/security/selinux
%endif
2013-11-16 00:27:01 +04:00
for i in alpha arc avr32 blackfin c6x cris frv h8300 hexagon ia64 m32r m68k m68knommu metag microblaze \
mips mn10300 openrisc parisc powerpc s390 score sh sparc tile unicore32 xtensa; do
rm -rf $TempDevelRoot/arch/$i
done
%ifnarch %{arm}
rm -rf $TempDevelRoot/arch/arm*
rm -rf $TempDevelRoot/include/kvm/arm*
2013-11-16 00:27:01 +04:00
%endif
%ifnarch %{ix86} x86_64
rm -rf $TempDevelRoot/arch/x86
%endif
# Clean the scripts tree, and make sure everything is ok (sanity check)
# running prepare+scripts (tree was already "prepared" in build)
pushd $TempDevelRoot >/dev/null
%smake -s prepare scripts
%smake -s clean
popd >/dev/null
rm -f $TempDevelRoot/.config.old
# fix permissions
chmod -R a+rX $TempDevelRoot
# disable mrproper in -devel rpms
patch -p1 --fuzz=0 -d $TempDevelRoot -i %{SOURCE2}
kernel_devel_files=../kernel_devel_files.$devel_flavour
### Create the kernel_devel_files.*
cat > $kernel_devel_files <<EOF
%dir $DevelRoot
%dir $DevelRoot/arch
%dir $DevelRoot/include
$DevelRoot/3rdparty
$DevelRoot/Documentation
%ifarch %{arm}
$DevelRoot/arch/arm
$DevelRoot/arch/arm64
%endif
$DevelRoot/arch/um
%ifarch %{ix86} x86_64
$DevelRoot/arch/x86
%endif
$DevelRoot/block
$DevelRoot/crypto
$DevelRoot/drivers
$DevelRoot/firmware
$DevelRoot/fs
$DevelRoot/include/Kbuild
$DevelRoot/include/acpi
$DevelRoot/include/asm-generic
$DevelRoot/include/clocksource
$DevelRoot/include/config
$DevelRoot/include/crypto
$DevelRoot/include/drm
$DevelRoot/include/dt-bindings
$DevelRoot/include/generated
$DevelRoot/include/keys
$DevelRoot/include/linux
$DevelRoot/include/math-emu
$DevelRoot/include/media
$DevelRoot/include/memory
$DevelRoot/include/misc
$DevelRoot/include/net
$DevelRoot/include/pcmcia
$DevelRoot/include/ras
$DevelRoot/include/rdma
$DevelRoot/include/rxrpc
$DevelRoot/include/scsi
$DevelRoot/include/sound
$DevelRoot/include/target
$DevelRoot/include/trace
$DevelRoot/include/uapi
$DevelRoot/include/video
$DevelRoot/include/xen
$DevelRoot/init
$DevelRoot/ipc
$DevelRoot/kernel
$DevelRoot/lib
$DevelRoot/mm
$DevelRoot/net
$DevelRoot/samples
$DevelRoot/scripts
$DevelRoot/security
$DevelRoot/sound
$DevelRoot/tools
$DevelRoot/usr
$DevelRoot/virt
$DevelRoot/.config
$DevelRoot/Kbuild
$DevelRoot/Kconfig
$DevelRoot/Makefile
$DevelRoot/Module.symvers
$DevelRoot/arch/Kconfig
%doc README.kernel-sources
EOF
### Create -devel Post script on the fly
cat > $kernel_devel_files-post <<EOF
if [ -d /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel} ]; then
rm -f /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/{build,source}
ln -sf $DevelRoot /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build
ln -sf $DevelRoot /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/source
fi
EOF
### Create -devel Preun script on the fly
cat > $kernel_devel_files-preun <<EOF
if [ -L /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build ]; then
rm -f /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/build
fi
if [ -L /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/source ]; then
rm -f /lib/modules/%{kversion}-$devel_flavour-%{buildrpmrel}/source
fi
exit 0
EOF
### Create -devel Postun script on the fly
cat > $kernel_devel_files-postun <<EOF
rm -rf /usr/src/linux-%{kversion}-$devel_flavour-%{buildrpmrel} >/dev/null
EOF
}
SaveDebug() {
debug_flavour=$1
install -m 644 vmlinux \
%{temp_boot}/vmlinux-%{kversion}-$debug_flavour-%{buildrpmrel}
kernel_debug_files=../kernel_debug_files.$debug_flavour
echo "%{_bootdir}/vmlinux-%{kversion}-$debug_flavour-%{buildrpmrel}" \
>> $kernel_debug_files
find %{temp_modules}/%{kversion}-$debug_flavour-%{buildrpmrel}/kernel \
-name "*.ko" | \
%kxargs -I '{}' objcopy --only-keep-debug '{}' '{}'.debug
find %{temp_modules}/%{kversion}-$debug_flavour-%{buildrpmrel}/kernel \
-name "*.ko" | %kxargs -I '{}' \
sh -c 'cd `dirname {}`; \
objcopy --add-gnu-debuglink=`basename {}`.debug \
--strip-debug `basename {}`'
pushd %{temp_modules}
find %{kversion}-$debug_flavour-%{buildrpmrel}/kernel \
-name "*.ko.debug" > debug_module_list
popd
cat %{temp_modules}/debug_module_list | \
sed 's|\(.*\)|%{_modulesdir}/\1|' >> $kernel_debug_files
cat %{temp_modules}/debug_module_list | \
sed 's|\(.*\)|%exclude %{_modulesdir}/\1|' \
>> ../kernel_exclude_debug_files.$debug_flavour
rm -f %{temp_modules}/debug_module_list
}
CreateFiles() {
kernel_flavour=$1
kernel_files=../kernel_files.$kernel_flavour
ker="vmlinuz"
if [ "$kernel_flavour" = "kirkwood" ]; then
ker="uImage"
fi
### Create the kernel_files.*
cat > $kernel_files <<EOF
%{_bootdir}/System.map-%{kversion}-$kernel_flavour-%{buildrpmrel}
%{_bootdir}/symvers-%{kversion}-$kernel_flavour-%{buildrpmrel}.xz
%{_bootdir}/config-%{kversion}-$kernel_flavour-%{buildrpmrel}
%{_bootdir}/$ker-%{kversion}-$kernel_flavour-%{buildrpmrel}
%dir %{_modulesdir}/%{kversion}-$kernel_flavour-%{buildrpmrel}/
%{_modulesdir}/%{kversion}-$kernel_flavour-%{buildrpmrel}/kernel
%{_modulesdir}/%{kversion}-$kernel_flavour-%{buildrpmrel}/modules.*
%doc README.kernel-sources
EOF
%if %build_debug
cat ../kernel_exclude_debug_files.$kernel_flavour >> $kernel_files
%endif
### Create kernel Post script
cat > $kernel_files-post <<EOF
KVER=%{kversion}-$kernel_flavour-%{buildrpmrel}
INITRD=/boot/initrd-\${KVER}.img
if [ ! -e \${INITRD} ]; then
/sbin/dracut \${INITRD} \${KVER}
else
printf "WARNING: Initrd image \${INITRD} already exists and will not be replaced.\n"
fi
/usr/sbin/update-grub2
2013-11-16 00:27:01 +04:00
pushd /boot > /dev/null
if [ -L vmlinuz-$kernel_flavour ]; then
rm -f vmlinuz-$kernel_flavour
fi
#ln -sf vmlinuz-\${KVER} vmlinuz-$kernel_flavour
2013-11-16 00:27:01 +04:00
if [ -L initrd-$kernel_flavour.img ]; then
rm -f initrd-$kernel_flavour.img
fi
#ln -sf initrd-\${KVER}.img initrd-$kernel_flavour.img
2013-11-16 00:27:01 +04:00
popd > /dev/null
2013-11-16 00:27:01 +04:00
%if %build_devel
# create kernel-devel symlinks if matching -devel- rpm is installed
if [ -d /usr/src/linux-\${KVER} ]; then
rm -f /lib/modules/\${KVER}/{build,source}
ln -sf /usr/src/linux-\${KVER} /lib/modules/\${KVER}/build
ln -sf /usr/src/linux-\${KVER} /lib/modules/\${KVER}/source
2013-11-16 00:27:01 +04:00
fi
%endif
EOF
### Create kernel Posttrans script
cat > $kernel_files-posttrans <<EOF
if [ -x /usr/sbin/dkms_autoinstaller -a -d /usr/src/linux-%{kversion}-$kernel_flavour-%{buildrpmrel} ]; then
/usr/sbin/dkms_autoinstaller start %{kversion}-$kernel_flavour-%{buildrpmrel}
fi
EOF
### Create kernel Preun script on the fly
cat > $kernel_files-preun <<EOF
KVER=%{kversion}-$kernel_flavour-%{buildrpmrel}
2013-11-16 00:27:01 +04:00
pushd /boot > /dev/null
if [ -L vmlinuz-$kernel_flavour ]; then
2014-12-12 10:59:34 +03:00
if [ "\$(readlink vmlinuz-$kernel_flavour)" = "vmlinuz-\${KVER}" ]; then
2013-11-16 00:27:01 +04:00
rm -f vmlinuz-$kernel_flavour
fi
fi
if [ -L initrd-$kernel_flavour.img ]; then
2014-12-12 10:59:34 +03:00
if [ "\$(readlink initrd-$kernel_flavour.img)" = "initrd-\${KVER}.img" ]; then
2013-11-16 00:27:01 +04:00
rm -f initrd-$kernel_flavour.img
fi
fi
/usr/sbin/update-grub2
2013-11-16 00:27:01 +04:00
popd > /dev/null
%if %build_devel
if [ -L /lib/modules/\${KVER}/build ]; then
rm -f /lib/modules/\${KVER}/build
2013-11-16 00:27:01 +04:00
fi
if [ -L /lib/modules/\${KVER}/source ]; then
rm -f /lib/modules/\${KVER}/source
2013-11-16 00:27:01 +04:00
fi
%endif
exit 0
EOF
### Create kernel Postun script on the fly
cat > $kernel_files-postun <<EOF
KVER=%{kversion}-$kernel_flavour-%{buildrpmrel}
KVER_DEVEL=%{kversion}-$devel_flavour-%{buildrpmrel}
rm -f /boot/initrd-\${KVER}.img
rm -f /boot/initrd-\${KVER}_old.img
rm -rf /lib/modules/\${KVER} >/dev/null
2013-11-16 00:27:01 +04:00
if [ -d /var/lib/dkms ]; then
rm -f /var/lib/dkms/*/kernel-\${KVER_DEVEL}-%{_target_cpu} >/dev/null
rm -rf /var/lib/dkms/*/*/\${KVER_DEVEL} >/dev/null
rm -f /var/lib/dkms-binary/*/kernel-\${KVER_DEVEL}-%{_target_cpu} >/dev/null
rm -rf /var/lib/dkms-binary/*/*/\${KVER_DEVEL} >/dev/null
2013-11-16 00:27:01 +04:00
fi
EOF
}
CreateKernel() {
flavour=$1
PrepareKernel $flavour $flavour-%{buildrpmrel}
BuildKernel %{kversion}-$flavour-%{buildrpmrel}
%if %build_devel
SaveDevel $flavour
%endif
%if %build_debug
SaveDebug $flavour
%endif
CreateFiles $flavour
}
###
# DO it...
###
# Create a simulacro of buildroot
rm -rf %{temp_root}
install -d %{temp_root}
# make sure we are in the directory
cd %src_dir
%ifarch %{ix86}
%if %build_desktop586
CreateKernel desktop586
%endif
%endif
%if %build_desktop
CreateKernel desktop
%endif
%if %build_netbook
CreateKernel netbook
%endif
%if %build_server
CreateKernel server
%endif
%ifarch %{ix86}
%if %build_desktop_pae
CreateKernel desktop-pae
%endif
%endif
%ifarch %{ix86}
%if %build_netbook_pae
CreateKernel netbook-pae
%endif
%endif
%ifarch %{ix86}
%if %build_nrj_desktop586
CreateKernel nrj-desktop586
%endif
%endif
%if %build_nrj_desktop
CreateKernel nrj-desktop
%endif
%if %build_nrj_realtime
CreateKernel nrj-realtime
%endif
%if %build_nrj_server
CreateKernel nrj-server
%endif
2013-11-16 00:27:01 +04:00
%if %build_nrj_laptop
CreateKernel nrj-laptop
%endif
%if %build_nrj_netbook
CreateKernel nrj-netbook
%endif
%ifarch %{ix86}
%if %build_nrj_desktop_pae
CreateKernel nrj-desktop-pae
%endif
%endif
%ifarch %{ix86}
%if %build_nrj_realtime_pae
CreateKernel nrj-realtime-pae
%endif
%endif
%ifarch %{ix86}
%if %build_nrj_laptop_pae
CreateKernel nrj-laptop-pae
%endif
%endif
%ifarch %{ix86}
%if %build_nrj_netbook_pae
CreateKernel nrj-netbook-pae
%endif
%endif
%ifarch %{ix86}
%if %build_nrj_netbook_atom
CreateKernel nrj-netbook-atom
%endif
%endif
%ifarch %{ix86}
%if %build_nrj_netbook_atom_pae
CreateKernel nrj-netbook-atom-pae
%endif
%endif
%ifarch %{ix86}
%if %build_nrj_desktop_core2
CreateKernel nrj-desktop-core2
%endif
%endif
%ifarch %{ix86}
%if %build_nrj_desktop_core2_pae
CreateKernel nrj-desktop-core2-pae
%endif
%endif
%ifarch %{arm}
%if %build_iop32x
CreateKernel iop32x
%endif
%if %build_kirkwood
CreateKernel kirkwood
%endif
%if %build_versatile
CreateKernel versatile
%endif
%endif
# set extraversion to match srpm to get nice version reported by the tools
LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile
############################################################
### Linker start3 > Check point to build for omv or rosa ###
2013-11-16 00:27:01 +04:00
############################################################
%if %{build_perf}
%smake -C tools/perf -s HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} all
%smake -C tools/perf -s prefix=%{_prefix} 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
%make -C tools/power/cpupower CPUFREQ_BENCH=false
2013-11-16 00:27:01 +04:00
%endif
############################################################
### Linker end3 > Check point to build for omv or rosa ###
2013-11-16 00:27:01 +04:00
############################################################
# We don't make to repeat the depend code at the install phase
%if %build_source
%ifarch %{arm}
PrepareKernel "kirkwood" %{buildrpmrel}custom
%else
PrepareKernel "" %{buildrpmrel}custom
%endif
%smake -s mrproper
%endif
###
### install
###
%install
install -m 644 %{SOURCE4} .
cd %src_dir
# Directories definition needed for installing
%define target_source %{buildroot}%{_kerneldir}
%define target_boot %{buildroot}%{_bootdir}
%define target_modules %{buildroot}%{_modulesdir}
# We want to be able to test several times the install part
rm -rf %{buildroot}
cp -a %{temp_root} %{buildroot}
# Create directories infastructure
%if %build_source
install -d %{target_source}
tar cf - . | tar xf - -C %{target_source}
chmod -R a+rX %{target_source}
# we remove all the source files that we don't ship
# first architecture files
for i in alpha arc avr32 blackfin c6x cris frv h8300 hexagon ia64 m32r m68k m68knommu metag microblaze \
mips openrisc parisc powerpc s390 score sh sh64 sparc tile unicore32 v850 xtensa mn10300; do
rm -rf %{target_source}/arch/$i
done
%ifnarch %{arm}
rm -rf %{target_source}/include/kvm/arm*
%endif
2013-11-16 00:27:01 +04:00
# other misc files
rm -f %{target_source}/{.config.old,.config.cmd,.gitignore,.lst,.mailmap}
rm -f %{target_source}/{.missing-syscalls.d,arch/.gitignore,firmware/.gitignore}
rm -rf %{target_source}/.tmp_depmod/
#endif %build_source
%endif
# compressing modules
%if %{build_modxz}
find %{target_modules} -name "*.ko" | %kxargs xz -6e
%else
find %{target_modules} -name "*.ko" | %kxargs gzip -9
%endif
# We used to have a copy of PrepareKernel here
# Now, we make sure that the thing in the linux dir is what we want it to be
for i in %{target_modules}/*; do
rm -f $i/build $i/source
done
# sniff, if we compressed all the modules, we change the stamp :(
# we really need the depmod -ae here
pushd %{target_modules}
for i in *; do
/sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i
echo $?
done
for i in *; do
pushd $i
echo "Creating modules.description for $i"
modules=`find . -name "*.ko.[g,x]z"`
echo $modules | %kxargs /sbin/modinfo \
| perl -lne 'print "$name\t$1" if $name && /^description:\s*(.*)/; $name = $1 if m!^filename:\s*(.*)\.k?o!; $name =~ s!.*/!!' > modules.description
popd
done
popd
# need to set extraversion to match srpm again to avoid rebuild
LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -%{rpmrel}/" Makefile
%if %{build_perf}
# perf tool binary and supporting scripts/binaries
make -C tools/perf -s V=1 DESTDIR=%{buildroot} HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} install
# perf man pages (note: implicit rpm magic compresses them later)
make -C tools/perf -s V=1 DESTDIR=%{buildroot} HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} install-man
%endif
############################################################
### Linker start4 > Check point to build for omv or rosa ###
2013-11-16 00:27:01 +04:00
############################################################
%if %{build_cpupower}
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
install -m644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/cpupower
%endif
############################################################
### Linker start4 > Check point to build for omv or rosa ###
2013-11-16 00:27:01 +04:00
############################################################
###
### clean
###
%clean
rm -rf %{buildroot}
# We don't want to remove this, the whole reason of its existence is to be
# able to do several rpm --short-circuit -bi for testing install
# phase without repeating compilation phase
#rm -rf %{temp_root}
###
### source and doc file lists
###
%if %build_source
%files -n %{kname}-source-%{buildrel}
%dir %{_kerneldir}
%dir %{_kerneldir}/arch
%dir %{_kerneldir}/include
%{_kerneldir}/3rdparty
%{_kerneldir}/Documentation
%{_kerneldir}/arch/Kconfig
%{_kerneldir}/arch/arm
%{_kerneldir}/arch/arm64
%{_kerneldir}/arch/um
%{_kerneldir}/arch/x86
%{_kerneldir}/block
%{_kerneldir}/crypto
%{_kerneldir}/drivers
%{_kerneldir}/firmware
%{_kerneldir}/fs
%{_kerneldir}/include/Kbuild
%{_kerneldir}/include/acpi
%{_kerneldir}/include/asm-generic
%{_kerneldir}/include/clocksource
%{_kerneldir}/include/crypto
%{_kerneldir}/include/drm
%{_kerneldir}/include/dt-bindings
%{_kerneldir}/include/keys
%{_kerneldir}/include/linux
%{_kerneldir}/include/math-emu
%{_kerneldir}/include/media
%{_kerneldir}/include/memory
%{_kerneldir}/include/misc
%{_kerneldir}/include/net
%{_kerneldir}/include/pcmcia
%{_kerneldir}/include/ras
%{_kerneldir}/include/rdma
%{_kerneldir}/include/rxrpc
%{_kerneldir}/include/scsi
%{_kerneldir}/include/sound
%{_kerneldir}/include/target
%{_kerneldir}/include/trace
%{_kerneldir}/include/uapi
%{_kerneldir}/include/video
%{_kerneldir}/include/xen
%{_kerneldir}/init
%{_kerneldir}/ipc
%{_kerneldir}/kernel
%{_kerneldir}/lib
%{_kerneldir}/mm
%{_kerneldir}/net
%{_kerneldir}/virt
%{_kerneldir}/samples
%{_kerneldir}/scripts
%{_kerneldir}/security
%{_kerneldir}/sound
%{_kerneldir}/tools
%{_kerneldir}/usr
%{_kerneldir}/COPYING
%{_kerneldir}/CREDITS
%{_kerneldir}/Kbuild
%{_kerneldir}/Kconfig
%{_kerneldir}/MAINTAINERS
%{_kerneldir}/Makefile
%{_kerneldir}/README
%{_kerneldir}/REPORTING-BUGS
%doc README.kernel-sources
%files -n %{kname}-source-latest
%endif
%if %build_doc
%files -n %{kname}-doc
%doc linux-%{tar_ver}/Documentation/*
%endif
%if %{build_perf}
%files -n perf
%{_bindir}/perf
%{_bindir}/trace
2013-11-16 00:27:01 +04:00
%dir %{_prefix}/libexec/perf-core
%{_libdir}/libperf-gtk.so
%dir %{_libdir}/traceevent
%dir %{_libdir}/traceevent/plugins
%{_libdir}/traceevent/plugins/*
2013-11-16 00:27:01 +04:00
%{_prefix}/libexec/perf-core/*
%{_mandir}/man[1-8]/perf*
%{_sysconfdir}/bash_completion.d/perf
%endif
%if %{build_cpupower}
%files -n cpupower -f cpupower.lang
%{_bindir}/cpupower
%{_libdir}/libcpupower.so.0
%{_libdir}/libcpupower.so.0.0.0
%{_unitdir}/cpupower.service
%{_mandir}/man[1-8]/cpupower*
%config(noreplace) %{_sysconfdir}/sysconfig/cpupower
%files -n cpupower-devel
%{_libdir}/libcpupower.so
%{_includedir}/cpufreq.h
%endif