2015-04-28 16:36:29 +03:00
|
|
|
%define kernelversion 4
|
2016-10-23 22:01:06 +03:00
|
|
|
%define patchlevel 8
|
2013-11-16 00:27:01 +04:00
|
|
|
# sublevel is now used for -stable patches
|
2016-12-11 20:31:31 +03:00
|
|
|
%define sublevel 14
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2016-07-22 22:05:03 +03:00
|
|
|
# Release number. Increase this before a rebuild.
|
2016-07-29 13:47:55 +03:00
|
|
|
%define rpmrel 1
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
# kernel base name (also name of srpm)
|
|
|
|
%define kname kernel
|
|
|
|
%define rpmtag %{disttag}
|
|
|
|
|
|
|
|
# fakerel and fakever never change, they are used to fool
|
2015-07-01 16:47:47 +03:00
|
|
|
# rpm/urpmi/smart and ensure the kernels are installed,
|
|
|
|
# not upgraded so old kernel is not overwritten or removed
|
2013-11-16 00:27:01 +04:00
|
|
|
%define fakever 1
|
|
|
|
%define fakerel %mkrel 1
|
|
|
|
|
|
|
|
# version defines
|
|
|
|
%define kversion %{kernelversion}.%{patchlevel}.%{sublevel}
|
|
|
|
%define kverrel %{kversion}-%{rpmrel}
|
|
|
|
%define tar_ver %{kernelversion}.%{patchlevel}
|
|
|
|
|
2015-03-16 18:42:29 +03:00
|
|
|
%ifarch %{ix86}
|
|
|
|
# Use a standard suffix for 32-bit x86
|
|
|
|
%define arch_suffix i586
|
|
|
|
%else
|
|
|
|
%define arch_suffix %{_arch}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%define buildrpmrel %{rpmrel}%{rpmtag}-%{arch_suffix}
|
2013-11-16 00:27:01 +04:00
|
|
|
%define buildrel %{kversion}-%{buildrpmrel}
|
|
|
|
|
2014-10-23 21:06:02 +04:00
|
|
|
# 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}
|
2016-07-29 13:39:16 +03:00
|
|
|
############################################################################
|
|
|
|
|
|
|
|
# SELinux is now built in by default but some other hardening features
|
|
|
|
# are not.
|
|
|
|
%{?build_selinux}%{?!build_selinux:%bcond_with selinux}
|
|
|
|
%if %{with selinux}
|
|
|
|
%global enhanced_security 1
|
|
|
|
%else
|
|
|
|
%global enhanced_security 0
|
|
|
|
%endif
|
|
|
|
# Allow "rpmbuild --with enhanced_security <...>"
|
|
|
|
%{?_with_enhanced_security:%global enhanced_security 1}
|
|
|
|
############################################################################
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
# Build defines
|
2015-07-01 16:47:47 +03:00
|
|
|
%define build_doc 1
|
2016-07-26 11:45:23 +03:00
|
|
|
%define build_source 0
|
2013-11-16 00:27:01 +04:00
|
|
|
%define build_devel 1
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
%define build_debug 0
|
2013-11-16 00:27:01 +04:00
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
# Build nrj desktop kernels
|
2013-11-16 00:27:01 +04:00
|
|
|
%define build_nrj_desktop 1
|
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
# Build nrj laptop kernels
|
2014-01-13 15:57:59 +04:00
|
|
|
%define build_nrj_laptop 1
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
# build perf and cpupower tools
|
2016-01-06 17:46:38 +03:00
|
|
|
%define build_perf 1
|
2013-11-16 00:27:01 +04:00
|
|
|
%define build_cpupower 1
|
|
|
|
|
|
|
|
# compress modules with xz
|
|
|
|
%define build_modxz 1
|
|
|
|
# End of user definitions
|
|
|
|
|
|
|
|
# buildtime flags
|
|
|
|
%{?_without_nrj_desktop: %global build_nrj_desktop 0}
|
|
|
|
%{?_without_nrj_laptop: %global build_nrj_laptop 0}
|
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
%{?_with_nrj_desktop: %global build_nrj_desktop 1}
|
|
|
|
%{?_with_nrj_laptop: %global build_nrj_laptop 1}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%{?_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_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}
|
|
|
|
|
2016-07-21 15:59:26 +03:00
|
|
|
%if !%{build_debug}
|
|
|
|
# Disable debug rpms.
|
|
|
|
%define _enable_debug_packages %{nil}
|
|
|
|
%define debug_package %{nil}
|
|
|
|
%endif
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
############################################################
|
2014-07-11 16:00:31 +04:00
|
|
|
### 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)
|
2014-01-23 11:57:37 +04:00
|
|
|
%define kmake %make CC="$CC"
|
2013-11-16 00:27:01 +04:00
|
|
|
%else
|
2014-01-23 11:57:37 +04:00
|
|
|
%define kmake %make
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
# there are places where parallel make don't work
|
2014-01-23 11:57:37 +04:00
|
|
|
%define smake make
|
2014-01-22 18:31:57 +04:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
###########################################################
|
2014-07-11 16:00:31 +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")
|
|
|
|
|
|
|
|
#
|
|
|
|
# SRC RPM description
|
|
|
|
#
|
2016-07-26 11:41:00 +03:00
|
|
|
Summary: The Linux kernel
|
2013-11-16 00:27:01 +04:00
|
|
|
Name: %{kname}
|
|
|
|
Version: %{kversion}
|
|
|
|
Release: %{rpmrel}
|
|
|
|
License: GPLv2
|
|
|
|
Group: System/Kernel and hardware
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
ExclusiveArch: %{ix86} x86_64
|
2013-11-16 00:27:01 +04:00
|
|
|
URL: http://www.kernel.org
|
|
|
|
|
|
|
|
####################################################################
|
|
|
|
#
|
|
|
|
# Sources
|
|
|
|
#
|
|
|
|
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
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# This is for disabling *config, mrproper, prepare, scripts on -devel rpms
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
# TODO: is it needed?
|
2013-11-16 00:27:01 +04:00
|
|
|
Source2: disable-mrproper-prepare-scripts-configs-in-devel-rpms.patch
|
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
# Kernel configuration files.
|
|
|
|
# kernel-<arch>.config is the common part. kernel-<flavour>-<arch>.config is
|
|
|
|
# what should be added to it to get the initial configuration file for
|
|
|
|
# the particular kernel flavour.
|
|
|
|
Source110: kernel-%{arch_suffix}.config
|
|
|
|
Source111: kernel-nrj-desktop-%{arch_suffix}.config
|
|
|
|
Source112: kernel-nrj-laptop-%{arch_suffix}.config
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2015-03-17 20:53:12 +03:00
|
|
|
# Cpupower: the service, the config, etc.
|
2013-11-16 00:27:01 +04:00
|
|
|
Source50: cpupower.service
|
|
|
|
Source51: cpupower.config
|
2015-03-13 17:29:40 +03:00
|
|
|
Source52: cpupower-start.sh
|
2015-03-17 20:53:12 +03:00
|
|
|
Source53: cpupower.path
|
2013-11-16 00:27:01 +04:00
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
Source80: kernel.rpmlintrc
|
2016-07-26 11:24:24 +03:00
|
|
|
####################################################################
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# Patches
|
|
|
|
|
2016-07-22 22:05:03 +03:00
|
|
|
# The patch to make kernel x.y.z from x.y.0.
|
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
|
|
|
|
|
2016-07-26 11:24:24 +03:00
|
|
|
# ROSA-specific patches
|
|
|
|
|
|
|
|
# Adds explicit linking of the Perf Python extension with libdl, thus fixing
|
|
|
|
# the build.
|
|
|
|
Patch100: perf-python-ext-link-with-dl.patch
|
|
|
|
|
|
|
|
# Perf docs are built after all the kernels. To validate the xml files
|
|
|
|
# generated during that process, xmlto tries to get DTD files from the Net.
|
|
|
|
# If it fails, the whole build fails, which is unfortunate. Let us avoid
|
|
|
|
# this.
|
|
|
|
Patch101: perf-xmlto-skip-validation.patch
|
|
|
|
|
|
|
|
# Bug http://bugs.rosalinux.ru/show_bug.cgi?id=4791
|
|
|
|
Patch102: inotify-increase-max-user-watches.patch
|
|
|
|
|
|
|
|
# Export pci_ids.h to user space, needed by ldetect
|
|
|
|
# TODO: is it really needed now?
|
|
|
|
Patch103: include-kbuild-export-pci_ids.patch
|
|
|
|
|
|
|
|
# http://bugs.rosalinux.ru/show_bug.cgi?id=6235
|
|
|
|
# http://bugs.rosalinux.ru/show_bug.cgi?id=6459
|
|
|
|
Patch104: audit-make-it-less-verbose.patch
|
|
|
|
|
|
|
|
# http://bugs.rosalinux.ru/show_bug.cgi?id=5649#c6
|
|
|
|
Patch105: drm-cirrus-Use-16bpp-as-default.patch
|
|
|
|
|
|
|
|
# Increase vmalloc area, https://bugs.mageia.org/show_bug.cgi?id=904
|
|
|
|
Patch106: x86-increase-default-minimum-vmalloc-area-by-64MB-to-192MB.patch
|
|
|
|
|
|
|
|
# disable floppy autoloading (mga #4696)
|
|
|
|
Patch107: block-floppy-disable-pnp-modalias.patch
|
|
|
|
|
|
|
|
# prefer ata over ide drivers
|
|
|
|
Patch108: ata-prefer-ata-drivers-over-ide-drivers-when-both-are-built.patch
|
|
|
|
|
|
|
|
# AUFS from http://aufs.sourceforge.net/
|
|
|
|
Patch109: fs-aufs4.patch
|
|
|
|
|
|
|
|
# BFQ IO scheduler, http://algogroup.unimore.it/people/paolo/disk_sched/
|
2016-10-23 22:01:06 +03:00
|
|
|
Patch111: 0001-block-cgroups-kconfig-build-bits-for-BFQ-v7r11-4.8.0.patch
|
|
|
|
Patch112: 0002-block-introduce-the-BFQ-v7r11-I-O-sched-to-be-ported.patch
|
|
|
|
Patch113: 0003-block-bfq-add-Early-Queue-Merge-EQM-to-BFQ-v7r11-to-.patch
|
|
|
|
Patch114: 0004-Turn-BFQ-v7r11-into-BFQ-v8r4-for-4.8.0.patch
|
2016-07-29 13:39:16 +03:00
|
|
|
|
2016-11-21 17:13:00 +03:00
|
|
|
# https://bugs.freedesktop.org/show_bug.cgi?id=97822
|
|
|
|
# http://bugs.rosalinux.ru/show_bug.cgi?id=7533
|
|
|
|
Patch200: i915_hack_bug_97822.patch
|
|
|
|
|
2016-07-29 13:39:16 +03:00
|
|
|
# Sanitizing kernel memory
|
|
|
|
# We do not use "Patch:" here because apply_patched would always apply it
|
|
|
|
# then, it seems, even if we place "Patch: <..>" under a conditional.
|
|
|
|
Source701: sanitize-memory.patch
|
2013-11-16 00:27:01 +04:00
|
|
|
####################################################################
|
|
|
|
|
|
|
|
# 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 \
|
2016-07-26 11:41:00 +03:00
|
|
|
operating system. The kernel handles the basic functions \
|
2013-11-16 00:27:01 +04:00
|
|
|
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
|
|
|
|
|
2014-12-11 19:36:25 +03:00
|
|
|
%define requires1 grub2
|
2015-07-01 16:47:47 +03:00
|
|
|
%define requires2 dracut >= 041-11
|
|
|
|
%define requires3 kmod >= 20-1
|
2013-11-16 00:27:01 +04:00
|
|
|
%define requires4 sysfsutils >= 2.1.0-12
|
2016-07-26 13:23:48 +03:00
|
|
|
%define requires5 linux-firmware >= 20160318
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%define kprovides1 %{kname} = %{kverrel}
|
|
|
|
%define kprovides2 kernel = %{tar_ver}
|
|
|
|
%define kprovides3 alsa = 1.0.27
|
|
|
|
|
2014-07-11 16:00:31 +04:00
|
|
|
Autoreqprov: no
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2014-07-11 16:00:31 +04:00
|
|
|
BuildRequires: bc
|
|
|
|
BuildRequires: binutils
|
|
|
|
BuildRequires: gcc
|
|
|
|
# For power tools
|
|
|
|
BuildRequires: pkgconfig(ncurses)
|
2014-01-23 11:57:37 +04:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
BuildRequires: kmod-devel kmod-compat
|
2014-05-19 18:34:31 +04:00
|
|
|
|
|
|
|
%ifarch x86_64
|
|
|
|
BuildRequires: numa-devel
|
|
|
|
%endif
|
|
|
|
|
2014-07-11 16:00:31 +04:00
|
|
|
# for perf, cpufreq and all other tools
|
|
|
|
# for cpupower
|
|
|
|
%if %{build_cpupower}
|
|
|
|
BuildRequires: pciutils-devel
|
|
|
|
%endif
|
|
|
|
# for perf
|
|
|
|
%if %{build_perf}
|
|
|
|
BuildRequires: asciidoc
|
|
|
|
BuildRequires: audit-devel
|
2013-11-16 00:27:01 +04:00
|
|
|
BuildRequires: binutils-devel
|
2014-07-11 16:00:31 +04:00
|
|
|
BuildRequires: bison
|
|
|
|
BuildRequires: elfutils-devel
|
|
|
|
BuildRequires: flex
|
|
|
|
BuildRequires: libunwind-devel
|
2013-11-16 00:27:01 +04:00
|
|
|
BuildRequires: newt-devel
|
2014-07-11 16:00:31 +04:00
|
|
|
BuildRequires: perl-devel
|
|
|
|
BuildRequires: pkgconfig(gtk+-2.0)
|
2013-11-16 00:27:01 +04:00
|
|
|
BuildRequires: python-devel
|
|
|
|
BuildRequires: xmlto
|
2014-07-11 16:00:31 +04:00
|
|
|
BuildRequires: zlib-devel
|
2016-07-26 18:18:51 +03:00
|
|
|
BuildRequires: pkgconfig(libcrypto)
|
2014-07-11 16:00:31 +04:00
|
|
|
%endif
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2014-07-11 16:00:31 +04:00
|
|
|
# might be useful too:
|
|
|
|
Suggests: microcode
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%description
|
|
|
|
%common_desc_kernel
|
|
|
|
%common_desc_kernel_smp
|
|
|
|
|
|
|
|
# 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 \
|
|
|
|
Provides: should-restart = system \
|
|
|
|
Suggests: crda \
|
2015-04-16 18:27:39 +03:00
|
|
|
%if %build_devel \
|
2015-04-23 11:54:19 +03:00
|
|
|
Requires: %{kname}-%{1}-devel-%{buildrel} \
|
|
|
|
Requires(post): %{kname}-%{1}-devel-%{buildrel} \
|
2015-04-16 18:27:39 +03:00
|
|
|
%endif \
|
2013-11-16 00:27:01 +04:00
|
|
|
%ifarch %{ix86} \
|
|
|
|
Conflicts: arch(x86_64) \
|
|
|
|
%endif \
|
2015-03-13 19:13:08 +03:00
|
|
|
Summary: %{expand:%{summary_%(echo %{1} | sed -e "s/-/_/g")}} \
|
2013-11-16 00:27:01 +04:00
|
|
|
Group: System/Kernel and hardware \
|
|
|
|
%description -n %{kname}-%{1}-%{buildrel} \
|
2015-03-13 19:13:08 +03:00
|
|
|
%common_desc_kernel %{expand:%{info_%(echo %{1} | sed -e "s/-/_/g")}} \
|
2013-11-16 00:27:01 +04:00
|
|
|
%common_desc_kernel_smp \
|
|
|
|
\
|
|
|
|
%if %build_devel \
|
|
|
|
%package -n %{kname}-%{1}-devel-%{buildrel} \
|
|
|
|
Version: %{fakever} \
|
|
|
|
Release: %{fakerel} \
|
|
|
|
Requires: glibc-devel ncurses-devel make gcc perl \
|
2015-04-21 15:35:28 +03:00
|
|
|
Requires(post): dkms \
|
|
|
|
Requires(preun): dkms \
|
|
|
|
Summary: Development files for %{kname}-%{1}-%{buildrel} \
|
2013-11-16 00:27:01 +04:00
|
|
|
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 \
|
|
|
|
\
|
2015-11-20 16:53:38 +03:00
|
|
|
%package -n %{kname}-%{1}-%{kernelversion}.%{patchlevel}-latest \
|
2015-11-03 18:01:16 +03:00
|
|
|
Version: %{kversion} \
|
|
|
|
Release: %{rpmrel} \
|
|
|
|
Summary: Meta package for the latest %{kname}-%{1} in %{kernelversion}.%{patchlevel} series \
|
|
|
|
Group: System/Kernel and hardware \
|
|
|
|
Requires: %{kname}-%{1}-%{buildrel} \
|
|
|
|
%ifarch %{ix86} \
|
|
|
|
Conflicts: arch(x86_64) \
|
2016-07-21 16:09:18 +03:00
|
|
|
Obsoletes: %{kname}-%{1}-pae-%{kernelversion}.%{patchlevel}-latest < %{kversion}-%{release} \
|
|
|
|
Provides: %{kname}-%{1}-pae-%{kernelversion}.%{patchlevel}-latest = %{kversion}-%{release} \
|
2015-11-03 18:01:16 +03:00
|
|
|
%endif \
|
2015-11-20 16:53:38 +03:00
|
|
|
%description -n %{kname}-%{1}-%{kernelversion}.%{patchlevel}-latest \
|
2015-11-03 18:01:16 +03:00
|
|
|
This meta package aims to make sure you always have the \
|
|
|
|
latest %{kname}-%{1} %{kernelversion}.%{patchlevel}.x installed... \
|
|
|
|
\
|
2013-11-16 00:27:01 +04:00
|
|
|
%if %build_devel \
|
|
|
|
\
|
2015-11-20 16:53:38 +03:00
|
|
|
%package -n %{kname}-%{1}-%{kernelversion}.%{patchlevel}-devel-latest \
|
2015-11-03 18:01:16 +03:00
|
|
|
Version: %{kversion} \
|
|
|
|
Release: %{rpmrel} \
|
|
|
|
Summary: Meta package for the latest %{kname}-%{1}-devel in %{kernelversion}.%{patchlevel} series \
|
|
|
|
Group: Development/Kernel \
|
|
|
|
Requires: %{kname}-%{1}-devel-%{buildrel} \
|
|
|
|
%ifarch %{ix86} \
|
|
|
|
Conflicts: arch(x86_64) \
|
2016-07-21 16:09:18 +03:00
|
|
|
Obsoletes: %{kname}-%{1}-pae-%{kernelversion}.%{patchlevel}-devel-latest < %{kversion}-%{release} \
|
|
|
|
Provides: %{kname}-%{1}-pae-%{kernelversion}.%{patchlevel}-devel-latest = %{kversion}-%{release} \
|
2015-11-03 18:01:16 +03:00
|
|
|
%endif \
|
|
|
|
Provides: %{kname}-devel-latest \
|
2015-11-20 16:53:38 +03:00
|
|
|
%description -n %{kname}-%{1}-%{kernelversion}.%{patchlevel}-devel-latest \
|
2015-11-03 18:01:16 +03:00
|
|
|
This meta package aims to make sure you always have the \
|
|
|
|
latest %{kname}-%{1}-devel %{kernelversion}.%{patchlevel}.x installed... \
|
|
|
|
\
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif \
|
|
|
|
\
|
|
|
|
%post -n %{kname}-%{1}-%{buildrel} -f kernel_files.%{1}-post \
|
|
|
|
%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} \
|
2015-11-20 16:53:38 +03:00
|
|
|
%files -n %{kname}-%{1}-%{kernelversion}.%{patchlevel}-latest \
|
2013-11-16 00:27:01 +04:00
|
|
|
\
|
|
|
|
%if %build_devel \
|
|
|
|
%files -n %{kname}-%{1}-devel-%{buildrel} -f kernel_devel_files.%{1} \
|
2015-11-20 16:53:38 +03:00
|
|
|
%files -n %{kname}-%{1}-%{kernelversion}.%{patchlevel}-devel-latest \
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif \
|
|
|
|
\
|
|
|
|
%if %build_debug \
|
|
|
|
%files -n %{kname}-%{1}-%{buildrel}-debuginfo -f kernel_debug_files.%{1} \
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %build_nrj_desktop
|
2016-07-21 15:58:13 +03:00
|
|
|
%define summary_nrj_desktop A general-purpose Linux Kernel
|
|
|
|
%define info_nrj_desktop This is a general-purpose kernel.
|
2013-11-16 00:27:01 +04:00
|
|
|
%mkflavour nrj-desktop
|
|
|
|
%endif
|
2016-07-21 15:58:13 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%if %build_nrj_laptop
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
%define summary_nrj_laptop Linux Kernel for laptops
|
2016-07-21 15:58:13 +03:00
|
|
|
%define info_nrj_laptop This kernel is mostly intended for laptops.
|
2013-11-16 00:27:01 +04:00
|
|
|
%mkflavour nrj-laptop
|
|
|
|
%endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# kernel-source
|
|
|
|
#
|
|
|
|
%if %build_source
|
|
|
|
%package -n %{kname}-source-%{buildrel}
|
|
|
|
Version: %{fakever}
|
|
|
|
Release: %{fakerel}
|
|
|
|
Requires: glibc-devel, ncurses-devel, make, gcc, perl, diffutils
|
2016-07-26 11:41:00 +03:00
|
|
|
Summary: The source code of %{kname}-%{buildrel}
|
2013-11-16 00:27:01 +04:00
|
|
|
Group: Development/Kernel
|
|
|
|
Autoreqprov: no
|
|
|
|
Provides: kernel-source = %{kverrel}
|
|
|
|
Buildarch: noarch
|
|
|
|
|
|
|
|
%description -n %{kname}-source-%{buildrel}
|
2016-07-26 11:41:00 +03:00
|
|
|
The %{kname}-source package contains the source code for the 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.
|
|
|
|
|
2016-07-26 11:41:00 +03:00
|
|
|
If you only want the files needed to build third-party (dkms-*,...)
|
2013-11-16 00:27:01 +04:00
|
|
|
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}
|
2014-10-14 13:22:01 +04:00
|
|
|
Summary: The cpupower tools
|
2013-11-16 00:27:01 +04:00
|
|
|
Group: System/Kernel and hardware
|
|
|
|
Requires(post): rpm-helper >= 0.24.0-3
|
|
|
|
Requires(preun): rpm-helper >= 0.24.0-3
|
|
|
|
Obsoletes: cpufreq cpufrequtils
|
|
|
|
|
|
|
|
%description -n cpupower
|
2014-10-14 13:22:01 +04:00
|
|
|
The cpupower tools.
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%post -n cpupower
|
2014-10-14 13:22:01 +04:00
|
|
|
|
2014-04-18 15:05:40 +04:00
|
|
|
if [ $1 -ge 0 ]; then
|
2015-03-17 20:53:12 +03:00
|
|
|
# Do not enable/disable cpupower.service directly, because it should start
|
|
|
|
# when cpupower.path triggers it.
|
|
|
|
/bin/systemctl enable cpupower.path >/dev/null 2>&1 || :
|
|
|
|
/bin/systemctl start cpupower.path >/dev/null 2>&1 || :
|
2014-04-01 15:25:39 +04:00
|
|
|
fi
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%preun -n cpupower
|
2014-04-01 15:25:39 +04:00
|
|
|
if [ $1 -eq 0 ]; then
|
2015-03-17 20:53:12 +03:00
|
|
|
/bin/systemctl --no-reload disable cpupower.path > /dev/null 2>&1 || :
|
|
|
|
/bin/systemctl stop cpupower.path > /dev/null 2>&1 || :
|
2014-04-01 15:25:39 +04:00
|
|
|
fi
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%package -n cpupower-devel
|
|
|
|
Version: %{kversion}
|
|
|
|
Release: %{rpmrel}
|
2014-10-14 13:22:01 +04:00
|
|
|
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
|
|
|
|
cd %src_dir
|
|
|
|
|
2016-07-26 11:24:24 +03:00
|
|
|
%apply_patches
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2016-07-29 13:39:16 +03:00
|
|
|
%if %{enhanced_security}
|
|
|
|
patch -p1 --fuzz=0 < %{SOURCE701}
|
|
|
|
%endif
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
#
|
|
|
|
# Setup Begin
|
|
|
|
#
|
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
# Configs
|
|
|
|
cp %{SOURCE110} .
|
2013-11-16 00:27:01 +04:00
|
|
|
%if %build_debug
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
sed -i 's/# CONFIG_DEBUG_INFO is not set/CONFIG_DEBUG_INFO=y\nCONFIG_DEBUG_INFO_REDUCED=y/' \
|
|
|
|
./kernel-%{arch_suffix}.config
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
2016-07-29 13:39:16 +03:00
|
|
|
# Hardening features
|
|
|
|
%if %{enhanced_security}
|
|
|
|
sed -i 's/# CONFIG_PAX_MEMORY_SANITIZE is not set/CONFIG_PAX_MEMORY_SANITIZE=y/' \
|
|
|
|
./kernel-%{arch_suffix}.config
|
|
|
|
sed -i 's/# CONFIG_PAGE_POISONING is not set/CONFIG_PAGE_POISONING=y\nCONFIG_PAGE_POISONING_NO_SANITY=y/' \
|
|
|
|
./kernel-%{arch_suffix}.config
|
|
|
|
%endif
|
|
|
|
|
2016-07-22 13:50:32 +03:00
|
|
|
# We may not want to build nrj-desktop flavour in some cases but its config
|
|
|
|
# is nice to have. It is used when preparing the RPM with the sources,
|
|
|
|
# for example.
|
|
|
|
FLAVOURS="nrj-desktop"
|
|
|
|
cp %{SOURCE111} .
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
|
|
|
|
%if %{build_nrj_laptop}
|
|
|
|
cp %{SOURCE112} .
|
2016-07-22 13:50:32 +03:00
|
|
|
FLAVOURS="${FLAVOURS} nrj-laptop"
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
%endif
|
|
|
|
|
|
|
|
CONFIG_DIR=arch/x86/configs
|
|
|
|
mkdir -p "${CONFIG_DIR}"
|
|
|
|
|
|
|
|
for flav in ${FLAVOURS}; do
|
|
|
|
echo "Creating configuration file for \"$flav\" kernel."
|
|
|
|
cp ./kernel-%{arch_suffix}.config .config
|
|
|
|
# Make sure a newline is at the end of the basic part of the config.
|
|
|
|
echo >> .config
|
|
|
|
cat ./kernel-${flav}-%{arch_suffix}.config >> .config
|
|
|
|
make ARCH=%{_arch} oldconfig && \
|
|
|
|
mv .config arch/x86/configs/%{arch_suffix}_defconfig-${flav} && \
|
|
|
|
echo "Created arch/x86/configs/%{arch_suffix}_defconfig-${flav}."
|
|
|
|
done
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2016-07-22 16:37:05 +03:00
|
|
|
# Remove the no longer needed parts of the config files
|
2016-07-22 21:33:33 +03:00
|
|
|
rm -f ./kernel*.config
|
2016-07-22 16:37:05 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# make sure the kernel has the sublevel we know it has...
|
|
|
|
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
|
2015-10-13 10:17:01 +03:00
|
|
|
find . -name '.get_maintainer.ignore' | %kxargs rm -f
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
# Common target directories
|
|
|
|
%define _kerneldir /usr/src/linux-%{kversion}-%{buildrpmrel}
|
|
|
|
%define _bootdir /boot
|
|
|
|
%define _modulesdir /lib/modules
|
|
|
|
|
|
|
|
# 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
|
|
|
|
config_dir=arch/x86/configs
|
|
|
|
echo "Make config for kernel $extension"
|
2015-04-21 15:35:28 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
%smake -s mrproper
|
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
if [ -z "$name" ]; then
|
2016-07-22 13:50:32 +03:00
|
|
|
cp ${config_dir}/%{arch_suffix}_defconfig-nrj-desktop .config
|
2013-11-16 00:27:01 +04:00
|
|
|
else
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
cp ${config_dir}/%{arch_suffix}_defconfig-$name .config
|
2013-11-16 00:27:01 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# make sure EXTRAVERSION says what we want it to say
|
|
|
|
LC_ALL=C perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -$extension/" Makefile
|
|
|
|
}
|
|
|
|
|
|
|
|
BuildKernel() {
|
|
|
|
KernelVer=$1
|
|
|
|
|
|
|
|
echo "Building kernel $KernelVer"
|
|
|
|
|
|
|
|
%kmake -s all
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2016-07-21 17:28:38 +03:00
|
|
|
cp -f arch/x86/boot/bzImage %{temp_boot}/vmlinuz-$KernelVer
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
# modules
|
|
|
|
install -d %{temp_modules}/$KernelVer
|
|
|
|
%smake INSTALL_MOD_PATH=%{temp_root} KERNELRELEASE=$KernelVer modules_install
|
|
|
|
|
2015-04-21 15:35:28 +03:00
|
|
|
# headers
|
2015-04-17 14:53:53 +03:00
|
|
|
%make INSTALL_HDR_PATH=%{temp_root}%{_prefix} KERNELRELEASE=$KernelVer headers_install
|
|
|
|
find %{temp_root}%{_prefix} -name .install -or -name ..install.cmd | %kxargs rm -f
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
# remove /lib/firmware, we use a separate kernel-firmware
|
|
|
|
rm -rf %{temp_root}/lib/firmware
|
|
|
|
}
|
|
|
|
|
|
|
|
SaveDevel() {
|
|
|
|
devel_flavour=$1
|
|
|
|
|
2015-04-21 15:35:28 +03:00
|
|
|
KernelVer=%{kversion}-$devel_flavour-%{buildrpmrel}
|
|
|
|
DevelRoot=/usr/src/linux-$KernelVer
|
2013-11-16 00:27:01 +04:00
|
|
|
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
|
2016-10-24 11:02:17 +03:00
|
|
|
# cp -fR Documentation/DocBook/media/*.b64 $TempDevelRoot/Documentation/DocBook/media/
|
2013-11-16 00:27:01 +04:00
|
|
|
cp -fR include $TempDevelRoot
|
2014-07-11 16:00:31 +04:00
|
|
|
# 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
|
2015-10-12 16:52:36 +03:00
|
|
|
cp -fR kernel/time/timeconst.bc $TempDevelRoot/kernel/time
|
2013-11-16 00:27:01 +04:00
|
|
|
cp -fR tools/include $TempDevelRoot/tools/
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
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/purgatory/* $TempDevelRoot/arch/x86/purgatory/
|
|
|
|
cp -fR arch/x86/entry/syscalls/syscall* $TempDevelRoot/arch/x86/entry/syscalls/
|
|
|
|
cp -fR arch/x86/include $TempDevelRoot/arch/x86/
|
|
|
|
cp -fR arch/x86/tools $TempDevelRoot/arch/x86/
|
2013-11-16 00:27:01 +04:00
|
|
|
cp -fR .config Module.symvers $TempDevelRoot
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2015-01-13 19:32:41 +03:00
|
|
|
# SELinux needs security/selinux/include
|
|
|
|
cp -fR security/selinux/include $TempDevelRoot/security/selinux
|
|
|
|
|
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 \
|
2015-04-28 16:36:29 +03:00
|
|
|
mips mn10300 nios2 openrisc parisc powerpc s390 score sh sparc tile unicore32 xtensa; do
|
2013-11-16 00:27:01 +04:00
|
|
|
rm -rf $TempDevelRoot/arch/$i
|
|
|
|
done
|
|
|
|
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
rm -rf $TempDevelRoot/arch/arm*
|
|
|
|
rm -rf $TempDevelRoot/include/kvm/arm*
|
|
|
|
rm -rf $TempDevelRoot/include/soc
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
# 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}
|
|
|
|
|
2015-04-21 15:35:28 +03:00
|
|
|
# Create the symlinks needed by DKMS
|
|
|
|
ModulesRoot=%{temp_modules}/$KernelVer
|
|
|
|
mkdir -p $ModulesRoot
|
2013-11-16 00:27:01 +04:00
|
|
|
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/Documentation
|
|
|
|
$DevelRoot/arch/um
|
|
|
|
$DevelRoot/arch/x86
|
|
|
|
$DevelRoot/block
|
2015-12-27 21:42:29 +03:00
|
|
|
$DevelRoot/certs
|
2013-11-16 00:27:01 +04:00
|
|
|
$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
|
2015-07-01 16:47:47 +03:00
|
|
|
$DevelRoot/include/kvm
|
2013-11-16 00:27:01 +04:00
|
|
|
$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
|
2015-04-21 15:35:28 +03:00
|
|
|
%{_modulesdir}/$KernelVer/build
|
|
|
|
%{_modulesdir}/$KernelVer/source
|
2013-11-16 00:27:01 +04:00
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
### Create -devel Post script on the fly
|
|
|
|
cat > $kernel_devel_files-post <<EOF
|
2015-04-21 15:35:28 +03:00
|
|
|
/usr/sbin/dkms_autoinstaller start $KernelVer
|
2013-11-16 00:27:01 +04:00
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
|
|
### Create -devel Preun script on the fly
|
|
|
|
cat > $kernel_devel_files-preun <<EOF
|
2015-04-23 15:41:41 +03:00
|
|
|
for ii in \$(/usr/sbin/dkms status -k ${KernelVer} | awk '{ print \$1 \$2; }'); do
|
2015-04-21 20:54:48 +03:00
|
|
|
mod=\$(echo \$ii | awk -v FS=',' '{ print \$1; }')
|
|
|
|
ver=\$(echo \$ii | awk -v FS=',' '{ print \$2; }')
|
2015-04-23 15:41:41 +03:00
|
|
|
/usr/sbin/dkms --rpm_safe_upgrade uninstall -m \$mod -v \$ver -k ${KernelVer} || true
|
2015-04-21 15:35:28 +03:00
|
|
|
done
|
2015-04-23 12:11:47 +03:00
|
|
|
|
|
|
|
# If any DKMS modules with REMAKE_INITRD=yes in their configs have been
|
|
|
|
# uninstalled, initrd has been regenerated for the given kernel. However,
|
|
|
|
# the kernel itself might have been uninstalled before, so that (defunct)
|
|
|
|
# initrd image files would be left behind. Remove them if the kernel itself
|
|
|
|
# is no longer installed. Should work if they are ininstalled in parallel
|
|
|
|
# too.
|
2015-04-23 15:41:41 +03:00
|
|
|
if ! test -f /boot/vmlinuz-${KernelVer}; then
|
|
|
|
rm -f /boot/initrd-${KernelVer}.img
|
|
|
|
rm -f /boot/initrd-${KernelVer}_old.img
|
2015-04-23 12:11:47 +03:00
|
|
|
fi
|
2013-11-16 00:27:01 +04:00
|
|
|
EOF
|
|
|
|
|
|
|
|
### Create -devel Postun script on the fly
|
|
|
|
cat > $kernel_devel_files-postun <<EOF
|
2015-04-21 15:35:28 +03:00
|
|
|
rm -rf /usr/src/linux-$KernelVer >/dev/null
|
2015-04-22 10:42:42 +03:00
|
|
|
# depmod (called when removing DKMS modules) might have created files in
|
|
|
|
# /lib/modules/.../. Remove these first.
|
|
|
|
rm -rf /lib/modules/$KernelVer/modules*
|
2015-04-21 15:35:28 +03:00
|
|
|
# Remove the dir if it is already empty.
|
2015-04-21 20:54:48 +03:00
|
|
|
find /lib/modules/$KernelVer -maxdepth 0 -empty -exec rm -rf {} \; || true
|
2013-11-16 00:27:01 +04:00
|
|
|
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
|
2015-04-21 15:35:28 +03:00
|
|
|
KernelVer=%{kversion}-$kernel_flavour-%{buildrpmrel}
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
kernel_files=../kernel_files.$kernel_flavour
|
|
|
|
|
|
|
|
ker="vmlinuz"
|
2016-07-22 15:04:54 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
### Create the kernel_files.*
|
|
|
|
cat > $kernel_files <<EOF
|
2015-04-21 15:35:28 +03:00
|
|
|
%{_bootdir}/System.map-$KernelVer
|
|
|
|
%{_bootdir}/symvers-$KernelVer.xz
|
|
|
|
%{_bootdir}/config-$KernelVer
|
|
|
|
%{_bootdir}/$ker-$KernelVer
|
|
|
|
%{_modulesdir}/$KernelVer/kernel
|
|
|
|
%{_modulesdir}/$KernelVer/modules.*
|
2013-11-16 00:27:01 +04:00
|
|
|
EOF
|
|
|
|
|
|
|
|
%if %build_debug
|
|
|
|
cat ../kernel_exclude_debug_files.$kernel_flavour >> $kernel_files
|
|
|
|
%endif
|
|
|
|
|
|
|
|
### Create kernel Post script
|
2015-04-22 10:35:53 +03:00
|
|
|
# We always regenerate initrd here, even if it already exists. This may
|
|
|
|
# happen if kernel-<...>-devel is installed first, triggers rebuild of
|
|
|
|
# DKMS modules and some of these request remaking of initrd. The initrd
|
|
|
|
# that is created then will be non-functional. But when the user installs
|
|
|
|
# kernel-<...> package, that defunct initrd will be replaced with a working
|
|
|
|
# one here.
|
2015-04-23 11:54:19 +03:00
|
|
|
#
|
|
|
|
# depmod is also needed, because some DKMS-modules might have been installed
|
|
|
|
# when the devel package was installed but that was before the main modules
|
|
|
|
# were installed.
|
|
|
|
# This is also the reason the devel package is in Requires(post) for this
|
|
|
|
# package now: it must be installed completely before we call depmod here.
|
2013-11-16 00:27:01 +04:00
|
|
|
cat > $kernel_files-post <<EOF
|
2015-04-23 11:54:19 +03:00
|
|
|
/sbin/depmod -a $KernelVer
|
2015-04-21 15:35:28 +03:00
|
|
|
INITRD=/boot/initrd-$KernelVer.img
|
2015-04-22 10:35:53 +03:00
|
|
|
/sbin/dracut -f \${INITRD} $KernelVer
|
2014-12-11 19:36:25 +03:00
|
|
|
|
2015-04-22 15:07:16 +03:00
|
|
|
# File triggers from grub packages will handle this.
|
|
|
|
#/usr/sbin/update-grub2
|
2014-12-11 19:36:25 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
pushd /boot > /dev/null
|
|
|
|
if [ -L vmlinuz-$kernel_flavour ]; then
|
|
|
|
rm -f vmlinuz-$kernel_flavour
|
|
|
|
fi
|
|
|
|
if [ -L initrd-$kernel_flavour.img ]; then
|
|
|
|
rm -f initrd-$kernel_flavour.img
|
|
|
|
fi
|
|
|
|
popd > /dev/null
|
|
|
|
EOF
|
|
|
|
|
|
|
|
### Create kernel Preun script on the fly
|
|
|
|
cat > $kernel_files-preun <<EOF
|
|
|
|
pushd /boot > /dev/null
|
|
|
|
if [ -L vmlinuz-$kernel_flavour ]; then
|
2015-04-21 15:35:28 +03:00
|
|
|
if [ "\$(readlink vmlinuz-$kernel_flavour)" = "vmlinuz-$KernelVer" ]; then
|
2013-11-16 00:27:01 +04:00
|
|
|
rm -f vmlinuz-$kernel_flavour
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ -L initrd-$kernel_flavour.img ]; then
|
2015-04-21 15:35:28 +03:00
|
|
|
if [ "\$(readlink initrd-$kernel_flavour.img)" = "initrd-$KernelVer.img" ]; then
|
2013-11-16 00:27:01 +04:00
|
|
|
rm -f initrd-$kernel_flavour.img
|
|
|
|
fi
|
|
|
|
fi
|
2014-12-11 19:36:25 +03:00
|
|
|
|
2015-04-22 15:07:16 +03:00
|
|
|
# File triggers from grub packages will handle this.
|
|
|
|
#/usr/sbin/update-grub2
|
2014-12-11 19:36:25 +03:00
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
popd > /dev/null
|
|
|
|
exit 0
|
|
|
|
EOF
|
|
|
|
|
|
|
|
### Create kernel Postun script on the fly
|
|
|
|
cat > $kernel_files-postun <<EOF
|
2015-04-23 15:41:41 +03:00
|
|
|
rm -f /boot/initrd-${KernelVer}.img
|
|
|
|
rm -f /boot/initrd-${KernelVer}_old.img
|
2015-04-22 10:42:42 +03:00
|
|
|
# Third-party modules might have left something in /lib/modules/.../kernel/.
|
2015-04-23 15:41:41 +03:00
|
|
|
rm -rf /lib/modules/${KernelVer}/kernel/
|
|
|
|
rm -rf /lib/modules/${KernelVer}/modules*
|
2015-04-21 15:35:28 +03:00
|
|
|
# Remove /lib/modules/<...>/ if it is empty (-devel uses it too).
|
2015-04-23 15:41:41 +03:00
|
|
|
find /lib/modules/${KernelVer} -maxdepth 0 -empty -exec rm -rf {} \; || true
|
2013-11-16 00:27:01 +04:00
|
|
|
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
|
|
|
|
|
|
|
|
%if %build_nrj_desktop
|
|
|
|
CreateKernel nrj-desktop
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %build_nrj_laptop
|
|
|
|
CreateKernel nrj-laptop
|
|
|
|
%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
|
|
|
|
|
|
|
|
|
|
|
|
############################################################
|
2014-07-11 16:00:31 +04:00
|
|
|
### Linker start3 > Check point to build for omv or rosa ###
|
2013-11-16 00:27:01 +04:00
|
|
|
############################################################
|
|
|
|
%if %{build_perf}
|
2015-04-28 16:36:29 +03:00
|
|
|
%ifarch x86_64
|
|
|
|
%define perf_is_x64 1
|
|
|
|
%else
|
|
|
|
%define perf_is_x64 0
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%smake -C tools/perf -s IS_X86_64=%{perf_is_x64} HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} all
|
2014-07-11 16:00:31 +04:00
|
|
|
%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
|
2014-01-23 11:57:37 +04:00
|
|
|
%make -C tools/power/cpupower CPUFREQ_BENCH=false
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
############################################################
|
2014-07-11 16:00:31 +04:00
|
|
|
### 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
|
2016-07-22 13:50:32 +03:00
|
|
|
PrepareKernel "" %{buildrpmrel}-custom
|
2013-11-16 00:27:01 +04:00
|
|
|
%smake -s mrproper
|
|
|
|
%endif
|
|
|
|
|
|
|
|
###
|
|
|
|
### install
|
|
|
|
###
|
|
|
|
%install
|
|
|
|
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 \
|
2015-04-28 16:36:29 +03:00
|
|
|
mips nios2 openrisc parisc powerpc s390 score sh sh64 sparc tile unicore32 v850 xtensa mn10300; do
|
2013-11-16 00:27:01 +04:00
|
|
|
rm -rf %{target_source}/arch/$i
|
|
|
|
done
|
Revisited the set of kernel flavours and the generation of config files
Until now, the build system for the kernel supported a number of
flavours: nrj and non-nrj ones, desktop-, laptop-, server- and
netbook-oriented, etc.
It turned out over the years, however, that our users mostly need the
following:
* a kernel to use on the desktops (home and office use) with reasonable
default settings for performance and responsiveness;
* a kernel for laptops, with a bit more emphasis on power consumption.
Other variants were rarely used. We also did not have enough time to
properly support all these.
Besides, the kernels for ARM and other architectures need a somewhat
different build process than for x86. So, they are better off to be in
separate ABF projects, even if they are needed. No signs of ROSA on ARM
yet, btw.
So, I kept only nrj-desktop and nrj-laptop flavours and only x86.
Non-PAE systems also seem to be rare now, so I enabled PAE by default
for the 32-bit kernels. Non-PAE kernels are no longer built. If they are
needed, we may use a separate git branch or an ABF project for that.
To simplify debugging, maintenance and experimentation with the kernel
builds further, I revisited the process of preparing the kernel
configuration files. The goal is to get rid of a separate git repo with
the default configs (kernel-patches-and-configs) and keep everything in
this project.
The default config files are now kept here. For x86_64:
* kernel-x86_64.config contains the options for both nrj-desktop and
nrn-laptop flavours;
* kernel-{nrj_desktop|nrj_laptop}-x86_64.config files contain the
flavour-specific options.
This way, it is easier to track which config options changed when,
easier to experiment with the custom configs and so on.
The kernel will be built with debug info if rpmbuild is called with
"--with debug".
2016-07-21 13:56:25 +03:00
|
|
|
rm -rf %{target_source}/include/kvm/arm*
|
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/
|
2015-12-27 21:42:29 +03:00
|
|
|
rm -f %{target_source}/certs/.gitignore
|
2013-11-16 00:27:01 +04:00
|
|
|
|
2015-04-17 14:53:53 +03:00
|
|
|
# Remove .install and ..install.cmd files from this directory tree too.
|
|
|
|
find %{target_source}/include -name .install -or -name ..install.cmd | %kxargs rm -f
|
|
|
|
|
2015-04-21 19:03:58 +03:00
|
|
|
#endif %build_source
|
|
|
|
%endif
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# compressing modules
|
|
|
|
%if %{build_modxz}
|
|
|
|
find %{target_modules} -name "*.ko" | %kxargs xz -6e
|
|
|
|
%else
|
|
|
|
find %{target_modules} -name "*.ko" | %kxargs gzip -9
|
|
|
|
%endif
|
|
|
|
|
2015-04-21 19:03:58 +03:00
|
|
|
# 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
|
|
|
|
pushd %{target_modules}
|
|
|
|
for i in *; do
|
|
|
|
rm -f $i/build $i/source
|
|
|
|
ln -sf /usr/src/linux-$i $i/build
|
|
|
|
ln -sf /usr/src/linux-$i $i/source
|
|
|
|
done
|
|
|
|
|
2013-11-16 00:27:01 +04:00
|
|
|
# sniff, if we compressed all the modules, we change the stamp :(
|
|
|
|
# we really need the depmod -ae here
|
|
|
|
for i in *; do
|
|
|
|
/sbin/depmod -ae -b %{buildroot} -F %{target_boot}/System.map-$i $i
|
|
|
|
echo $?
|
|
|
|
done
|
|
|
|
|
|
|
|
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
|
2015-04-28 16:36:29 +03:00
|
|
|
make -C tools/perf -s V=1 DESTDIR=%{buildroot} IS_X86_64=%{perf_is_x64} HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} install
|
2013-11-16 00:27:01 +04:00
|
|
|
|
|
|
|
# perf man pages (note: implicit rpm magic compresses them later)
|
2015-04-28 16:36:29 +03:00
|
|
|
make -C tools/perf -s V=1 DESTDIR=%{buildroot} IS_X86_64=%{perf_is_x64} HAVE_CPLUS_DEMANGLE=1 prefix=%{_prefix} install-man
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
|
|
|
############################################################
|
2014-07-11 16:00:31 +04:00
|
|
|
### Linker start4 > Check point to build for omv or rosa ###
|
2013-11-16 00:27:01 +04:00
|
|
|
############################################################
|
|
|
|
%if %{build_cpupower}
|
2014-01-23 11:57:37 +04:00
|
|
|
make -C tools/power/cpupower DESTDIR=%{buildroot} libdir=%{_libdir} mandir=%{_mandir} CPUFREQ_BENCH=false install
|
2013-11-16 00:27:01 +04:00
|
|
|
rm -f %{buildroot}%{_libdir}/*.{a,la}
|
|
|
|
%find_lang cpupower
|
|
|
|
mv cpupower.lang ../
|
|
|
|
chmod 0755 %{buildroot}%{_libdir}/libcpupower.so*
|
|
|
|
mkdir -p %{buildroot}%{_unitdir} %{buildroot}%{_sysconfdir}/sysconfig
|
|
|
|
install -m644 %{SOURCE50} %{buildroot}%{_unitdir}/cpupower.service
|
2015-03-17 20:53:12 +03:00
|
|
|
install -m644 %{SOURCE53} %{buildroot}%{_unitdir}/cpupower.path
|
2013-11-16 00:27:01 +04:00
|
|
|
install -m644 %{SOURCE51} %{buildroot}%{_sysconfdir}/sysconfig/cpupower
|
2015-03-13 17:29:40 +03:00
|
|
|
install -m755 %{SOURCE52} %{buildroot}%{_bindir}/cpupower-start.sh
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
############################################################
|
2014-07-11 16:00:31 +04:00
|
|
|
### 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}/Documentation
|
|
|
|
%{_kerneldir}/arch/Kconfig
|
|
|
|
%{_kerneldir}/arch/arm
|
|
|
|
%{_kerneldir}/arch/arm64
|
|
|
|
%{_kerneldir}/arch/um
|
|
|
|
%{_kerneldir}/arch/x86
|
|
|
|
%{_kerneldir}/block
|
2015-12-27 21:42:29 +03:00
|
|
|
%{_kerneldir}/certs
|
2013-11-16 00:27:01 +04:00
|
|
|
%{_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
|
2015-07-01 16:47:47 +03:00
|
|
|
%{_kerneldir}/include/kvm
|
2013-11-16 00:27:01 +04:00
|
|
|
%{_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
|
2015-04-28 16:36:29 +03:00
|
|
|
%{_kerneldir}/include/soc
|
2013-11-16 00:27:01 +04:00
|
|
|
%{_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
|
|
|
|
|
|
|
|
%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
|
2015-04-28 16:36:29 +03:00
|
|
|
%ifarch x86_64
|
|
|
|
%{_bindir}/perf-read-vdso32
|
|
|
|
%endif
|
2014-07-11 16:00:31 +04:00
|
|
|
%{_bindir}/trace
|
2013-11-16 00:27:01 +04:00
|
|
|
%dir %{_prefix}/libexec/perf-core
|
2014-07-11 16:00:31 +04:00
|
|
|
%dir %{_libdir}/traceevent
|
|
|
|
%dir %{_libdir}/traceevent/plugins
|
2016-01-06 17:21:52 +03:00
|
|
|
%{_libdir}/libperf-gtk.so
|
2014-07-11 16:00:31 +04:00
|
|
|
%{_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
|
2015-12-27 21:42:29 +03:00
|
|
|
%{_datadir}/perf-core/strace/groups/file
|
2016-05-11 11:52:53 +03:00
|
|
|
%{_datadir}/doc/perf-tip/*.txt
|
2013-11-16 00:27:01 +04:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{build_cpupower}
|
|
|
|
%files -n cpupower -f cpupower.lang
|
|
|
|
%{_bindir}/cpupower
|
2015-03-13 17:29:40 +03:00
|
|
|
%{_bindir}/cpupower-start.sh
|
2013-11-16 00:27:01 +04:00
|
|
|
%{_libdir}/libcpupower.so.0
|
2016-08-23 21:35:47 +03:00
|
|
|
%{_libdir}/libcpupower.so.0.0.1
|
2013-11-16 00:27:01 +04:00
|
|
|
%{_unitdir}/cpupower.service
|
2015-03-17 20:53:12 +03:00
|
|
|
%{_unitdir}/cpupower.path
|
2013-11-16 00:27:01 +04:00
|
|
|
%{_mandir}/man[1-8]/cpupower*
|
|
|
|
%config(noreplace) %{_sysconfdir}/sysconfig/cpupower
|
|
|
|
|
|
|
|
%files -n cpupower-devel
|
|
|
|
%{_libdir}/libcpupower.so
|
|
|
|
%{_includedir}/cpufreq.h
|
|
|
|
%endif
|