forked from pool/kernel-source
Compare commits
2 Commits
slfo-1.2
...
bsc1253237
| Author | SHA256 | Date | |
|---|---|---|---|
| 5a68a1c7d1 | |||
| df354c556e |
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -21,3 +21,5 @@
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tar.?z filter=lfs diff=lfs merge=lfs -text
|
||||
|
||||
316
README.PATCH-POLICY.SUSE
Normal file
316
README.PATCH-POLICY.SUSE
Normal file
@@ -0,0 +1,316 @@
|
||||
SUSE Linux Enterprise Patch Policy
|
||||
==================================
|
||||
|
||||
|
||||
Summary
|
||||
-------
|
||||
|
||||
The SUSE Linux Enterprise (SLE) patch policy mirrors the mainline Linux
|
||||
community's policy for accepting changes. Each commit must contain a small and
|
||||
"obvious" change that can be reviewed individually and, once applied, be able to
|
||||
be used as a bisection point. The kernel should be able to build and boot
|
||||
between each applied patch. Since the SLE kernel is based on an official
|
||||
upstream kernel release and is followed by a hardening process, we expect that
|
||||
nearly all of the patches applied to the base release will be from subsequent
|
||||
official upstream releases intended to address specific issues or to allow for
|
||||
hardware/feature enablement.
|
||||
|
||||
|
||||
Background
|
||||
----------
|
||||
|
||||
Before covering the policy itself, we'll discuss a bit of background on how the
|
||||
source code tree is organized. If you've used the SLE kernel source tree
|
||||
at <https://github.com/SUSE/kernel-source> before, you've probably noticed that,
|
||||
unlike the mainline Linux kernel, we don't use a source-level Git repository as
|
||||
our "base". Instead, we use an official kernel.org Linux tar archive as the base
|
||||
and add a series of patches on top of it. This carries with it several benefits.
|
||||
The biggest is that we add metadata "tags" to our patches that allow us to
|
||||
easily associate patches with particular feature requests, bug reports, and/or
|
||||
the pedigree of the patch. Due to the nature of some of our feature requests, we
|
||||
must also occasionally carry patches that, for one reason or another, haven't
|
||||
been accepted into the mainline kernel repository yet. With a full Git
|
||||
repository, it would be difficult to associate the initial commit for a
|
||||
particular feature with any subsequent changes to it. Another benefit is more
|
||||
superficial: with the use of separate patches, we and our users are able to
|
||||
tell, at a glance, which patches are in any given kernel release simply by
|
||||
looking at the source package.
|
||||
|
||||
This approach works well but has limited options for typical debugging
|
||||
techniques such as bisection. The application of the patch series results in our
|
||||
fully operational SLE kernel but stopping the patch series midway can result in
|
||||
an unbuildable source tree. To help this and similar scenarios, we publish also
|
||||
a fully expanded Git repository at <https://github.com/SUSE/kernel> which
|
||||
exactly represents the code as if it were originally used as a standard source
|
||||
code tree repository. This allows us to work with the individual patches *and*
|
||||
have the ability to bisect the tree as the changes are applied. It also makes it
|
||||
easier for partners unfamiliar with how our source tree works to make the
|
||||
transition.
|
||||
|
||||
|
||||
Format
|
||||
------
|
||||
|
||||
The SLE patch format follows very closely what you would see on any mailing list
|
||||
associated with Linux kernel development. A SLE patch is formatted like an
|
||||
RFC822 mbox-style mail message, with a few extensions. If the patch is coming
|
||||
from the mainline Linux repository or a subsystem maintainer repository, SUSE
|
||||
has tools that can make adding these tags nearly painless.
|
||||
|
||||
Each patch should contain the "From" and "Subject" headers found in any email
|
||||
message. The From should contain the name and email address of the patch author.
|
||||
The Subject should contain a short description of the patch, prefixed with the
|
||||
subsystem affected.
|
||||
|
||||
For instance:
|
||||
|
||||
From: Jeff Mahoney <jeffm@suse.com>
|
||||
Subject: init: print hello world at boot time
|
||||
|
||||
Beyond that, we require several more headers, the full description of the patch,
|
||||
the certification tags used in the mainline kernel, and the patch contents.
|
||||
|
||||
The required headers are as follows:
|
||||
|
||||
* Git-commit: [a-f0-9]{40}
|
||||
|
||||
Contains the SHA-1 Git commit ID of the patch in either the mainline kernel
|
||||
repository or an official maintainer repository.
|
||||
|
||||
* Git-repo: URL-to-git-repo (starting with `git://`)
|
||||
|
||||
The URL to the Git repository containing the commit. This tag can be omitted
|
||||
if the commit is from the mainline kernel repository.
|
||||
|
||||
* Patch-mainline: vMajor.Minor.Patch{-optional-rc}
|
||||
|
||||
The official kernel release that contains this patch. In the case of a patch
|
||||
accepted into a maintainer branch, "Queued in subsystem maintainer repo" can
|
||||
be used. If the patch has been submitted to a subsystem mailing list for
|
||||
review and is nearly certain to be accepted,
|
||||
"Submitted <date> <list@site.org>" can be used. Otherwise, if the patch will
|
||||
never be in the upstream kernel, e.g. in the case of vendor-specific version
|
||||
numbers, etc., then "No" followed by the reason why it will not be accepted
|
||||
(or submitted). Please note that the reason must be compelling for it to be
|
||||
allowed into our kernel repository.
|
||||
|
||||
* References: list of references
|
||||
|
||||
A specific reason must exist for each patch to be included into the kernel
|
||||
repository. It can be a fix in response to a bug report or a patch submitted
|
||||
as part of the feature development cycle for a release. We use a shorthand to
|
||||
indicate why a particular patch will be included and it's possible to use more
|
||||
than one.
|
||||
|
||||
For feature requests, the feature will have to have gone through our feature
|
||||
tracking tool, a Jira instance at <https://jira.suse.com/>. Each feature
|
||||
request will have an ID associated with it and it can be added to the
|
||||
References tag using jsc#id, e.g. jsc#PED-12345.
|
||||
|
||||
For fixes to bug reports or patches for feature requests submitted via
|
||||
Bugzilla at <https://bugzilla.suse.com/>, the shorthand is bsc#number. Other
|
||||
shorthands referring to different Bugzilla instances are possible too, such as
|
||||
bko, for <https://bugzilla.kernel.org/>.
|
||||
|
||||
Next is the full description of the patch, which should explain why the patch is
|
||||
needed and an overview of what it does.
|
||||
|
||||
The last "header" portion of the patch contains the certification tags, which
|
||||
consist of "Signed-off-by" and "Acked-by". We and the upstream Linux community
|
||||
depend on patch submitters to "own" their submission and certify they have the
|
||||
right to submit code to the kernel repository. For patches coming from the
|
||||
mainline Linux kernel repository, the certification tags are already in place
|
||||
and only the submitter's tag needs to be added, unless one is also already part
|
||||
of the original patch. Likewise, the SUSE engineer who includes the submission
|
||||
in our kernel tree will add their own "Acked-by" tag.
|
||||
|
||||
The remaining part of the patch is the actual diff with changes. The patch
|
||||
content should be in the "-ab" format where the patch header itself only
|
||||
contains the filename without any timestamps. An optional `diffstat -p1` output
|
||||
may also be included.
|
||||
|
||||
Here's an example of a complete patch:
|
||||
|
||||
```
|
||||
From: Upstream Committer <coder@somesite.com>
|
||||
Subject: init: print hello world on boot
|
||||
Patch-mainline: v3.8-rc1
|
||||
Git-commit: deadbeefc0ffeeb1a4b1a4b1a4b1a4b1a4b1a4b1a4
|
||||
References: jsc#PED-12134 bsc#23123
|
||||
|
||||
The kernel started off like every other project. Let's add the hello
|
||||
world message in honor of its roots.
|
||||
|
||||
Signed-off-by: Upstream Committer <coder@somesite.com>
|
||||
Tested-by: Bill User <bill.user@example.com>
|
||||
Acked-by: Jeff Mahoney <jeffm@suse.com>
|
||||
---
|
||||
init/main.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/init/main.c
|
||||
+++ b/init/main.c
|
||||
@@ -807,6 +807,7 @@ static noinline int init_post(void)
|
||||
system_state = SYSTEM_RUNNING;
|
||||
numa_default_policy();
|
||||
|
||||
+ printk("Hello world!\n");
|
||||
|
||||
current->signal->flags |= SIGNAL_UNKILLABLE;
|
||||
|
||||
```
|
||||
|
||||
|
||||
Patch inclusion rules
|
||||
---------------------
|
||||
|
||||
As mentioned in the summary, we expect that most patches to the SLE kernel will
|
||||
come from subsequent official upstream kernel releases, or from subsystem
|
||||
maintainer repositories where the patch is on its way to become a part of an
|
||||
official upstream Linux release. The SLE kernel contains hardware enablement
|
||||
driver enhancement/backports for a wide range of devices offered by many
|
||||
vendors. In many cases, the drivers are self-contained but many others have
|
||||
shared dependencies on common infrastructure.
|
||||
|
||||
The shared dependencies on common infrastructure combined with the need to be
|
||||
able to bisect the resulting kernel means that we must require all partners to
|
||||
submit patch series consisting of individual patches that match upstream
|
||||
commits. In the case where a commit affects multiple drivers, it is acceptable
|
||||
to only include the portions that affect a particular driver as long as it is
|
||||
annotated by appending "(partial)" to the Git-commit line and documenting what
|
||||
is included or dropped. An example using the patch tools is included below.
|
||||
|
||||
|
||||
Tools
|
||||
-----
|
||||
|
||||
We understand that there are a bunch of rules to follow and that implementing
|
||||
them all can be tedious. SUSE has a set of tools to make working with the
|
||||
patches a lot easier. They are called patchtools and published at
|
||||
<https://download.opensuse.org/repositories/Kernel:/tools/>.
|
||||
|
||||
Two important tools are included: fixpatch and exportpatch. Fixpatch adds
|
||||
missing headers and formatting to existing patches, assuming there's at least a
|
||||
Git-commit tag present. Exportpatch, given a list of commit IDs on the command
|
||||
line, searches for each commit in the configured repositories and exports the
|
||||
patches.
|
||||
|
||||
Exportpatch has a number of options, the following list shows the most useful
|
||||
ones:
|
||||
|
||||
* `-w` | `--write`
|
||||
|
||||
Write out each commit into a separate file. The filenames are based on the
|
||||
subject of the header and they get output on stdout for use directly in a
|
||||
series file.
|
||||
|
||||
* `-d DIR` | `--dir=DIR`
|
||||
|
||||
Write out each commit into a designated directory. The default is to write
|
||||
into the current directory.
|
||||
|
||||
* `-F REF` | `--reference=REFERENCE`
|
||||
|
||||
Add a References tag to the patch output using the specified reference, can be
|
||||
repeated multiple times.
|
||||
|
||||
* `-x EXTRACT` | `--extract=EXTRACT`
|
||||
|
||||
It it sometimes desirable to split out chunks of patches that affect only a
|
||||
particular section of the code. This option accepts pathnames to extract.
|
||||
Anything not specified will be skipped. Paths ending with `/` designate
|
||||
everything under that hierarchy. This also adds the "(partial)" notation to
|
||||
the Git-commit tag and adds a Patch-filtered tag indicating which paths were
|
||||
used to extract.
|
||||
|
||||
Refer to the exportpatch(1) manual page for more details and a complete list of
|
||||
all options.
|
||||
|
||||
One useful feature of exportpatch is that 3-way merge diffs are handled
|
||||
automatically such that a new, exact 2-way diff is generated. Note that both the
|
||||
`-x` option and the automatic handling of merge commits can generate empty
|
||||
patches. Such patches are skipped entirely and no files are generated.
|
||||
|
||||
As a quick example, the following invocation would generate patches necessary
|
||||
for a backport of the ixgbe driver from v3.2 against the v3.0 kernel:
|
||||
|
||||
$ exportpatch -w -d ixgbe \
|
||||
-x drivers/net/ixgbe/ -x drivers/net/ethernet/intel/ixgbe/ \
|
||||
-F "jsc#PED-12345" -F "bsc#12354" \
|
||||
$(git log v3.0..v3.2 --pretty=oneline -- \
|
||||
drivers/net/ixgbe drivers/net/ethernet/intel/ixgbe | \
|
||||
cut -b 1-40) \
|
||||
> ixgbe/series
|
||||
|
||||
The tool automatically adds an Acked-by tag to the created patches unless you
|
||||
were involved in the original upstream commit process. Be aware that the
|
||||
produced result (obviously) doesn't include any infrastructure changes that
|
||||
might be needed for the patches to build.
|
||||
|
||||
The first patch in the series looks like this:
|
||||
|
||||
```
|
||||
From 6403eab143205a45a5493166ff8bf7e3646f4a77 Mon Sep 17 00:00:00 2001
|
||||
From: Joe Perches <joe@perches.com>
|
||||
Date: Fri, 3 Jun 2011 11:51:20 +0000
|
||||
Subject: drivers/net: Remove unnecessary semicolons
|
||||
Git-commit: 6403eab143205a45a5493166ff8bf7e3646f4a77 (partial)
|
||||
Patch-mainline: v3.1-rc1
|
||||
References: jsc#PED-12345 bsc#12354
|
||||
Patch-filtered: drivers/net/ixgbe/ drivers/net/ethernet/intel/ixgbe/
|
||||
|
||||
Semicolons are not necessary after switch/while/for/if braces
|
||||
so remove them.
|
||||
|
||||
Signed-off-by: Joe Perches <joe@perches.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Acked-by: Jeff Mahoney <jeffm@suse.com>
|
||||
---
|
||||
|
||||
drivers/net/ixgbe/ixgbe_82599.c | 4 ++--
|
||||
drivers/net/ixgbe/ixgbe_common.c | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/net/ixgbe/ixgbe_82599.c
|
||||
+++ b/drivers/net/ixgbe/ixgbe_82599.c
|
||||
@@ -1157,7 +1157,7 @@ s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 pballoc)
|
||||
default:
|
||||
/* bad value */
|
||||
return IXGBE_ERR_CONFIG;
|
||||
- };
|
||||
+ }
|
||||
|
||||
/* Move the flexible bytes to use the ethertype - shift 6 words */
|
||||
fdirctrl |= (0x6 << IXGBE_FDIRCTRL_FLEX_SHIFT);
|
||||
@@ -1245,7 +1245,7 @@ s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc)
|
||||
default:
|
||||
/* bad value */
|
||||
return IXGBE_ERR_CONFIG;
|
||||
- };
|
||||
+ }
|
||||
|
||||
/* Turn perfect match filtering on */
|
||||
fdirctrl |= IXGBE_FDIRCTRL_PERFECT_MATCH;
|
||||
|
||||
--- a/drivers/net/ixgbe/ixgbe_common.c
|
||||
+++ b/drivers/net/ixgbe/ixgbe_common.c
|
||||
@@ -1292,7 +1292,7 @@ static s32 ixgbe_ready_eeprom(struct ixgbe_hw *hw)
|
||||
|
||||
udelay(5);
|
||||
ixgbe_standby_eeprom(hw);
|
||||
- };
|
||||
+ }
|
||||
|
||||
/*
|
||||
* On some parts, SPI write time could vary from 0-20mSec on 3.3V
|
||||
@@ -1374,7 +1374,7 @@ static void ixgbe_shift_out_eeprom_bits(struct ixgbe_hw *hw, u16 data,
|
||||
* EEPROM
|
||||
*/
|
||||
mask = mask >> 1;
|
||||
- };
|
||||
+ }
|
||||
|
||||
/* We leave the "DI" bit set to "0" when we leave this routine. */
|
||||
eec &= ~IXGBE_EEC_DI;
|
||||
|
||||
```
|
||||
682
README.SUSE
682
README.SUSE
@@ -1,471 +1,435 @@
|
||||
WORKING WITH THE SUSE 2.6.x and 3.x KERNEL SOURCES
|
||||
Working with the SUSE Kernel Sources
|
||||
====================================
|
||||
|
||||
Andreas Gruenbacher <agruen@suse.de>, SUSE Labs, 2003, 2004, 2005, 2006
|
||||
Michal Marek <mmarek@suse.de>, SUSE Labs, 2010
|
||||
This document gives an overview of how SUSE Linux kernels are created, and
|
||||
describes tasks like building individual kernels and creating external kernel
|
||||
modules.
|
||||
|
||||
|
||||
This document gives an overview of how SUSE Linux kernels are
|
||||
created, and describes tasks like building individual kernels
|
||||
and creating external kernel modules.
|
||||
Overview
|
||||
--------
|
||||
|
||||
A companion HOWTO that describes how to build driver update disks (among
|
||||
other things) is available at:
|
||||
The SUSE kernels are generated from the upstream Linux kernel sources found at
|
||||
<https://kernel.org/>, on top of which a number of patches are applied. The
|
||||
expanded kernel source tree is configured and built, resulting in a binary
|
||||
kernel.
|
||||
|
||||
http://developer.novell.com/wiki/index.php/Creating_a_Driver_Update_Disk_%28DUD%29
|
||||
The add-on patches and configuration files are maintained in a Git repository at
|
||||
<https://github.com/SUSE/kernel-source>, with an alternative mirror at
|
||||
<https://github.com/openSUSE/kernel-source>.
|
||||
|
||||
A script named `scripts/tar-up.sh` packs up the files in the repository in a
|
||||
form suitable for rpmbuild. When building the RPM packages, the following
|
||||
binary packages get created:
|
||||
|
||||
TABLE OF CONTENTS
|
||||
* kernel-source
|
||||
|
||||
Overview
|
||||
Compiling your own kernel
|
||||
Building additional (external) modules
|
||||
Supported vs. unsupported modules
|
||||
Patch selection mechanism
|
||||
Where to find configuration files
|
||||
How to configure the kernel sources
|
||||
Module load paths
|
||||
The kernel source tree, generated by unpacking the vanilla kernel sources and
|
||||
applying the patches. The kernel sources are used by a number of other
|
||||
packages. They can also be used for compiling additional kernel modules.
|
||||
|
||||
* kernel-devel
|
||||
|
||||
OVERVIEW
|
||||
A complement of the kernel-source package that is needed to build external
|
||||
modules.
|
||||
|
||||
The kernels for SUSE are generated from the vanilla Linux kernel sources
|
||||
found at http://ftp.kernel.org, on top of which a number of patches are
|
||||
applied. The resulting kernel source tree is configured and built,
|
||||
resulting in a binary kernel.
|
||||
* kernel-`$FLAVOR`
|
||||
|
||||
The add-on patches and configuration files are maintained in
|
||||
a GIT repository at
|
||||
A number of binary kernels, for example, kernel-default for standard use,
|
||||
kernel-debug with extra debugging features, etc. These packages are all
|
||||
generated from the same kernel sources, and differ in the kernel
|
||||
configurations used.
|
||||
|
||||
http://gitorious.org/opensuse/kernel-source
|
||||
|
||||
A script (scripts/tar-up.sh) packs up the files in the repository in a
|
||||
form suitable for rpmbuild. When building the RPM packages, the
|
||||
following binary packages get created:
|
||||
* kernel-`$FLAVOR`-base
|
||||
|
||||
* kernel-source
|
||||
A subset of kernel-`$FLAVOR`, for use in virtualized guests that only require
|
||||
a few device and filesystem drivers.
|
||||
|
||||
The kernel source tree, generated by unpacking the vanilla kernel
|
||||
sources and applying the patches. The kernel sources are used by
|
||||
a number of other packages. They can also be used for compiling
|
||||
additional kernel modules.
|
||||
* kernel-`$FLAVOR`-devel
|
||||
|
||||
* kernel-$FLAVOR
|
||||
The files used for generating kernel module packages for use with
|
||||
kernel-`$FLAVOR`.
|
||||
|
||||
A number of binary kernels (for example, kernel-default for
|
||||
uniprocessor machines, kernel-smp for smp machines, etc.). These
|
||||
packages are all generated from the same kernel sources, and
|
||||
differ in the kernel configurations used.
|
||||
* kernel-syms
|
||||
|
||||
* kernel-$FLAVOR-base
|
||||
|
||||
A subset of kernel-$FLAVOR, for use in paravirtualized quests that
|
||||
only require a few device and filesystem drivers.
|
||||
|
||||
* kernel-$FLAVOR-devel
|
||||
|
||||
The files used for generating kernel module packages for use with
|
||||
kernel-$FLAVOR.
|
||||
|
||||
* kernel-syms
|
||||
|
||||
A meta package that pulls in the relevant kernel-$FLAVOR-devel
|
||||
packages for a given architecture.
|
||||
|
||||
|
||||
The repository contains the configuration files (.config) for all SUSE
|
||||
kernel flavors. All configuration files are included in the
|
||||
kernel-source package (see WHERE TO FIND CONFIGURATION FILES below).
|
||||
A meta package that pulls in the relevant kernel-`$FLAVOR`-devel packages for
|
||||
a given architecture.
|
||||
|
||||
The repository contains configuration files (`.config`) for all SUSE kernel
|
||||
flavors. All configuration files are included in the dependencies of the
|
||||
kernel-syms package, see [Where to find configuration
|
||||
files](#where-to-find-configuration-files) below.
|
||||
|
||||
In the installed system, the kernel-source package installs files in the
|
||||
following directories:
|
||||
|
||||
* `/usr/src/linux-$VERSION-$RELEASE/`
|
||||
|
||||
* /usr/src/linux-$VERSION-$RELEASE/
|
||||
The kernel sources.
|
||||
|
||||
The kernel sources.
|
||||
* `/usr/src/linux`
|
||||
|
||||
* /usr/src/linux
|
||||
A symbolic link to `/usr/src/linux-$VERSION-$RELEASE/`.
|
||||
|
||||
A symbolic link to /usr/src/linux-$VERSION-$RELEASE.
|
||||
* `/usr/share/doc/packages/kernel-source-$VERSION-$RELEASE/`
|
||||
|
||||
* /usr/src/linux-$VERSION-$RELEASE-obj/$ARCH/$FLAVOR/
|
||||
This document.
|
||||
|
||||
Kernel build object files for one kernel flavor. These
|
||||
files are used for compiling additional kernel modules.
|
||||
The kernel-`$FLAVOR`-devel packages install the following files:
|
||||
|
||||
* /usr/src/linux-obj
|
||||
* `/usr/src/linux-$VERSION-$RELEASE-obj/$ARCH/$FLAVOR/`
|
||||
|
||||
A symbolic link to /usr/src/linux-$VERSION-$RELEASE-obj/$ARCH/$FLAVOR.
|
||||
Kernel build object files for one kernel flavor. These files are used for
|
||||
compiling additional kernel modules.
|
||||
|
||||
* /usr/share/doc/packages/kernel-source/
|
||||
* `/usr/src/linux-obj/$ARCH/$FLAVOR`
|
||||
|
||||
This document and an external kernel module example.
|
||||
|
||||
* /etc/init.d/running-kernel
|
||||
|
||||
Init script that adapts the kernel sources in /usr/src/linux to
|
||||
the running kernel.
|
||||
A symbolic link to `/usr/src/linux-$VERSION-$RELEASE-obj/$ARCH/$FLAVOR/`.
|
||||
|
||||
|
||||
COMPILING YOUR OWN KERNEL
|
||||
Compiling your own kernel
|
||||
-------------------------
|
||||
|
||||
The kernel sources are found in the kernel-source package. The
|
||||
recommended way to produce a binary kernel is:
|
||||
The kernel sources are found in the kernel-source package. A binary kernel can
|
||||
be built from these sources as follows:
|
||||
|
||||
(1) Install kernel-source. Change to the /usr/src/linux directory.
|
||||
1. Install the kernel-source package.
|
||||
|
||||
(2) Create a build directory for use in configuring and building
|
||||
the kernel. Using /usr/src/linux directly requires root priviledges
|
||||
and will cause problems if you need to build kernel modules for
|
||||
other installed kernels.
|
||||
2. Create a build directory for use in configuring and building the kernel.
|
||||
Using `/usr/src/linux/` directly requires root privileges and will cause
|
||||
problems if you need to build kernel modules for other installed kernels.
|
||||
|
||||
(3) Configure the kernel (for example, ``make -C /usr/src/linux
|
||||
O=$(pwd) oldconfig'' or ``make -C /usr/src/linux O=$(pwd) cloneconfig'',
|
||||
see HOW TO CONFIGURE THE KERNEL SOURCES).
|
||||
3. Configure the kernel, see [How to configure the kernel
|
||||
sources](#how-to-configure-the-kernel-sources). For example,
|
||||
`make -C /usr/src/linux O=$PWD oldconfig`.
|
||||
|
||||
(4) Build the kernel and all its modules (``make'').
|
||||
4. Build the kernel and all its modules by invoking `make`.
|
||||
|
||||
(5) Make sure that /etc/modprobe.d/unsupported-modules contains
|
||||
5. Make sure that `/etc/modprobe.d/10-unsupported-modules.conf` contains
|
||||
|
||||
allow_unsupported_modules 1
|
||||
allow_unsupported_modules 1
|
||||
|
||||
otherwise modprobe will refuse to load any modules.
|
||||
otherwise modprobe will refuse to load any modules.
|
||||
|
||||
(6) Install the kernel and the modules (``make modules_install'',
|
||||
followed by ``make install''). This will automatically create
|
||||
an initrd for the new kernel as well (see ``mkinitrd -h'').
|
||||
6. Install the modules and kernel: `make modules_install`, followed by
|
||||
`make install`. This automatically creates an initrd for the new kernel and
|
||||
adds an entry to the GRUB boot menu.
|
||||
|
||||
(7) Add the kernel to the boot manager. When using lilo, run ``lilo''
|
||||
to update the boot map.
|
||||
|
||||
Instead of building binary kernels by hand, you can also build
|
||||
one of the kernel-$FLAVOR packages using RPM.
|
||||
Instead of building binary kernels by hand, you can also build one of the
|
||||
kernel-`$FLAVOR` packages using RPM.
|
||||
|
||||
|
||||
BUILDING ADDITIONAL (EXTERNAL) MODULES
|
||||
Building additional (external) modules
|
||||
--------------------------------------
|
||||
|
||||
A single binary kernel module generally only works for a specific
|
||||
version of the kernel source tree, for a specific architecture and
|
||||
configuration. This means that for each binary kernel that SUSE ships, a
|
||||
custom module must be built. This requirement is to some extent relaxed
|
||||
by the modversion mechanism: modversions attach a checksum to each
|
||||
symbol (function or variable) exported to modules by the kernel. This
|
||||
allows to use kernel modules that have been built for a kernel with a
|
||||
different version or release number in many cases, as long as none of
|
||||
the symbols the module uses have changed between the two kernel
|
||||
versions.
|
||||
A single binary kernel module generally only works for a specific version of the
|
||||
kernel source tree, for a specific architecture and configuration. This means
|
||||
that for each binary kernel that SUSE ships, a custom module must be built. This
|
||||
requirement is to some extent relaxed by the modversion mechanism: modversions
|
||||
attach a checksum to each symbol (function or variable) exported to modules by
|
||||
the kernel. This allows to use kernel modules that have been built for a kernel
|
||||
with a different version or release number in many cases, as long as none of the
|
||||
symbols the module uses have changed between the two kernel versions.
|
||||
|
||||
When releasing maintenance or security update kernels for a specific
|
||||
product, we carefully try to keep the kernel ABI stable. Despite this,
|
||||
we sometimes have no choice but to break binary compatibility. In this
|
||||
case, those kernel modules must be rebuilt.
|
||||
When releasing maintenance or security update kernels for a specific product, we
|
||||
carefully try to keep the kernel ABI stable. Despite this, we sometimes have no
|
||||
choice but to break binary compatibility. In this case, those kernel modules
|
||||
must be rebuilt.
|
||||
|
||||
Additional kernel modules for one of the SUSE kernel flavors can be
|
||||
built in three different ways:
|
||||
Additional kernel modules for one of the SUSE kernel flavors can be built in the
|
||||
following ways:
|
||||
|
||||
(1) by configuring the kernel sources in a separate build directory
|
||||
(see HOW TO CONFIGURE THE KERNEL SOURCES), or
|
||||
|
||||
(2) by using one of the standard configurations in
|
||||
/usr/src/linux-obj/$ARCH/$FLAVOR, or
|
||||
|
||||
(3) by creating a Kernel Module Package (KMP) as described in the
|
||||
Kernel Module Packages Manual, http://www.suse.de/~agruen/KMPM/.
|
||||
1. by doing an ad-hoc module build, using one of the standard configurations in
|
||||
`/usr/src/linux-obj/$ARCH/$FLAVOR`, or
|
||||
|
||||
2. by creating a Kernel Module Package (KMP) as described in the Kernel Module
|
||||
Packages Manual,
|
||||
<https://documentation.suse.com/sbp/all/html/SBP-KMP-Manual-SLE12SP2/index.html>.
|
||||
|
||||
The first method involves the following steps:
|
||||
|
||||
(1) Install the kernel-source package.
|
||||
1. Install the kernel-devel package.
|
||||
|
||||
(2) Configure the kernel, see HOW TO CONFIGURE THE KERNEL SOURCES.
|
||||
2. Install the kernel-`$FLAVOR`-devel package. This is necessary for symbol
|
||||
version information (`CONFIG_MODVERSIONS`).
|
||||
|
||||
(3) Create files required for compiling external modules:
|
||||
``make scripts'' and ``make prepare''.
|
||||
3. Compile the module(s) by changing into the module source directory and typing
|
||||
`make -C /usr/src/linux-obj/$ARCH/$FLAVOR M=$PWD`. Substitute `$ARCH` and
|
||||
`$FLAVOR` with the architecture and flavor for which to build the module(s).
|
||||
|
||||
(4) Compile the module(s) by changing into the module source directory
|
||||
and typing ``make -C $(your_build_dir) M=$(pwd)''.
|
||||
If the installed kernel sources match the running kernel, you can build
|
||||
modules for the running kernel by using the path
|
||||
`/lib/modules/$(uname -r)/build` as the `-C` option in the above command.
|
||||
(`build` is a symlink to `/usr/src/linux-obj/$ARCH/$FLAVOR`.)
|
||||
|
||||
(5) Install the module(s) by typing
|
||||
``make -C $(your_build_dir) M=$(pwd) modules_install''.
|
||||
4. Install the module(s) with
|
||||
`make -C /usr/src/linux-obj/$ARCH/$FLAVOR M=$PWD modules_install`.
|
||||
|
||||
Whenever building modules, please use the kernel build infrastructure as much as
|
||||
possible, and do not try to circumvent it. The `Documentation/kbuild` directory
|
||||
in the kernel sources documents kbuild makefiles.
|
||||
|
||||
|
||||
The second method involves the following steps:
|
||||
Supported vs. unsupported modules
|
||||
---------------------------------
|
||||
|
||||
(1) Install the kernel-source package.
|
||||
As an extension to the mainline kernel, modules can be tagged as supported
|
||||
(directly by SUSE, or indirectly by a third party) or unsupported. Modules which
|
||||
are known to be flakey or for which SUSE does not have the necessary expertise
|
||||
are marked as unsupported. Modules for which SUSE has third-party support
|
||||
agreements are marked as externally supported. Modules for which SUSE provides
|
||||
direct support are marked as supported.
|
||||
|
||||
(2) Install kernel-syms.$ARCH.rpm. This package is necessary for
|
||||
symbol version information (CONFIG_MODVERSIONS).
|
||||
The support status of a module can be queried with the modinfo tool. Modinfo
|
||||
will report one of the following:
|
||||
|
||||
(3) Compile the module(s) by changing into the module source directory
|
||||
and typing ``make -C /usr/src/linux-obj/$ARCH/$FLAVOR M=$(pwd)''.
|
||||
Substitute $ARCH and $FLAVOR with the architecture and flavor
|
||||
for which to build the module(s).
|
||||
* direct support by SUSE: "supported: yes",
|
||||
* third-party support: "supported: external",
|
||||
* unsupported modules: no supported tag.
|
||||
|
||||
If the installed kernel sources match the running kernel, you
|
||||
can build modules for the running kernel by using the path
|
||||
/lib/modules/$(uname -r)/build as the -C option in the above
|
||||
command. (build is a symlink to /usr/src/linux-obj/$ARCH/$FLAVOR).
|
||||
At runtime, the support status of a module can be obtained by reading
|
||||
`/sys/module/$MODULE/supported`.
|
||||
|
||||
Starting with SuSE Linux 9.2 / SLES9 Service Pack 1, the
|
||||
modversion information for the running kernel is also
|
||||
contained in the kernel-$FLAVOR packages, and so for building
|
||||
modules for the running kernel, the kernel-syms package is no
|
||||
longer required.
|
||||
Note that this information is available only if the module was not built
|
||||
directly into the kernel. Builtin modules are implicitly supported.
|
||||
|
||||
(4) Install the module(s) with
|
||||
``make -C /usr/src/linux-obj/$ARCH/$FLAVOR M=$(pwd) modules_install''.
|
||||
The aggregated support status for the entire kernel can be inspected by reading
|
||||
`/sys/kernel/supported`. The value is also included in Oopses.
|
||||
|
||||
The setting of the "unsupported" kernel command line parameter and
|
||||
`/proc/sys/kernel/unsupported` controls whether unsupported modules can be
|
||||
loaded or not, and whether or not loading an unsupported module causes a warning
|
||||
in the system log:
|
||||
|
||||
* 0 = only allow supported modules,
|
||||
* 1 = warn when loading unsupported modules,
|
||||
* 2 = don't warn.
|
||||
|
||||
Irrespective of this setting, loading an unsupported module sets a kernel taint
|
||||
flag. The taint status of the kernel can be inspected in
|
||||
`/proc/sys/kernel/tainted`. The taint flags are also included in Oopses.
|
||||
Relevant bits have the following meaning:
|
||||
|
||||
| Bit | Log | Number | Reason that got the kernel tainted |
|
||||
|----:|----:|-----------:|----------------------------------------------------|
|
||||
| 0 | G/P | 1 | proprietary module was loaded |
|
||||
| 12 | ␣/O | 4096 | externally-built ("out-of-tree") module was loaded |
|
||||
| 13 | ␣/E | 8192 | unsigned module was loaded |
|
||||
| 16 | ␣/X | 65536 | module with third-party support was loaded |
|
||||
| 31 | ␣/n | 2147483648 | unsupported module was loaded |
|
||||
|
||||
Bits 16 and 31 are specific to the SUSE kernels. Starting with SLE15-SP6,
|
||||
loading an externally supported module does not taint the kernel, but bit 16 (X)
|
||||
is still tracked per module and can be read in `/sys/module/$MODULE/taint`.
|
||||
Additionally, since SLE15-SP6, an unsupported module is indicated by the 'n'
|
||||
character, whereas it was previously represented by 'N'.
|
||||
|
||||
Out-of-tree modules do not have the supported flag set by default; that
|
||||
is, they are marked as unsupported. For building externally supported
|
||||
modules, please get in touch with the Solid Driver Program team, led by
|
||||
Scott Bahling, at <mailto:soliddriver@suse.com>.
|
||||
|
||||
|
||||
Whenever building modules, please use the kernel build infrastructure as
|
||||
much as possible, and do not try to circumvent it. The
|
||||
Documentation/kbuild directory in the kernel sources documents kbuild
|
||||
makefiles.
|
||||
Patch selection mechanism
|
||||
-------------------------
|
||||
|
||||
Please take a look at the demo module installed under
|
||||
/usr/share/doc/packages/kernel-source for a simple example of an Kernel
|
||||
Module Package (KMP).
|
||||
The SUSE kernels consist of the upstream kernel sources on top of which a number
|
||||
of patches is applied. The file `series.conf` determines which patches are
|
||||
applied and which are excluded. A script named `guards` converts `series.conf`
|
||||
into a plain list of patch files to be applied. Guards decides which patches to
|
||||
include and exclude based on a list of symbols. From the kernel-source.src.rpm
|
||||
package, a fully patched kernel source tree can be generated from vanilla
|
||||
sources + patches like this:
|
||||
|
||||
1. Install the package:
|
||||
|
||||
# rpm -i kernel-source-$RPMVERSION-$RPMRELEASE.src.rpm
|
||||
|
||||
2. Unpack the patches and the kernel sources:
|
||||
|
||||
# cd /usr/src/packages/SOURCES/
|
||||
# for f in patches.*.tar.bz2; do \
|
||||
tar -xjf "$f" || break; \
|
||||
done
|
||||
# tar -xJf linux-$SRCVERSION.tar.xz
|
||||
|
||||
3. Apply the patches
|
||||
|
||||
# for p in $(./guards < series.conf); do \
|
||||
patch -d linux-$SRCVERSION -p1 < $p || break; \
|
||||
done
|
||||
|
||||
The configuration script `config.conf` which is similar to `series.conf` is
|
||||
used for configuration file selection, see the section [Where to find
|
||||
configuration files](#where-to-find-configuration-files).
|
||||
|
||||
The file format of `series.conf` and `config.conf` should be apparent from the
|
||||
comments in `series.conf` and from the guards(1) manual page. You can generate
|
||||
this page by running `pod2man` on the `guards` script.
|
||||
|
||||
|
||||
SUPPORTED VS. UNSUPPORTED MODULES
|
||||
Where to find configuration files
|
||||
---------------------------------
|
||||
|
||||
As an extension to the mainline kernel, modules can be tagged as
|
||||
supported (directly by SUSE, or indirectly by a third party) or
|
||||
unsupported. Modules which are known to be flakey or for which SUSE does
|
||||
not have the necessary expertise are marked as unsupported. Modules for
|
||||
which SUSE has third-party support agreements are marked as externally
|
||||
supported. Modules for which SUSE provides direct support are marked as
|
||||
supported.
|
||||
Kernel configuration files are stored in the kernel Git repository. When packing
|
||||
up the repository, they end up in `config.tar.bz2`.
|
||||
|
||||
The support status of a module can be queried with the modinfo tool.
|
||||
Modinfo will report one of the following:
|
||||
|
||||
- direct support by SUSE: "supported: yes"
|
||||
- third-party support: "supported: external"
|
||||
- unsupported modules: no supported tag.
|
||||
|
||||
At runtime, the setting of the" unsupported" kernel command line
|
||||
parameter and /proc/sys/kernel/unsupported determines whether
|
||||
unsupported modules can be loaded or not, and whether or not loading an
|
||||
unsupported module causes a warning in the system log:
|
||||
|
||||
0 = only allow supported modules,
|
||||
1 = warn when loading unsupported modules,
|
||||
2 = don't warn.
|
||||
|
||||
Irrespective of this setting, loading an externally supported or unsupported
|
||||
module both set a kernel taint flag. The taint flags are included in
|
||||
Oopses. The taint status of the kernel can be inspected in
|
||||
/proc/sys/kernel/tainted: Bits 0 to 4 have the following meanings:
|
||||
|
||||
bit 0 = a module with a GPL-incompatible license was loaded (tainted & 1),
|
||||
bit 1 = module load was enforced (tainted & 2),
|
||||
bit 2 = an SMP-unsafe module was loaded (tainted & 4),
|
||||
bit 3 = (reserved),
|
||||
bit 4 = an unsupported module was loaded (tainted & 16),
|
||||
bit 5 = a module with third-party support was loaded (tainted & 32).
|
||||
bit 10 = a machine check exception has occurred (taint & 1024; x86_64 only
|
||||
so far).
|
||||
|
||||
The corresponding codes for the taint flags in Oopses are (x = unknown):
|
||||
|
||||
- "Pxxx" if bit 0 set or else
|
||||
"Gxxx" if bit 0 unset,
|
||||
|
||||
- "xFxx" if bit 1 set or else
|
||||
"x xx" if bit 1 unset,
|
||||
|
||||
- "xxSx" if set or else
|
||||
"xx x" if bit 2 unset,
|
||||
|
||||
- "xxxU" if bit 4 set or else
|
||||
"xxxX" if bit 5 set or else
|
||||
"xxx ".
|
||||
|
||||
By default, external modules will not have the supported flag (that is,
|
||||
they wil be marked as unsupported). For building externally supported
|
||||
modules, please get in touch with Kurt Garloff <garloff@suse.de>.
|
||||
|
||||
|
||||
PATCH SELECTION MECHANISM
|
||||
|
||||
The SUSE kernels consist of the vanilla kernel sources on top of which a
|
||||
number of patches is applied. The file series.conf determines which
|
||||
patches are applied and which are excluded. A script named "guards"
|
||||
converts series.conf into a plain list of patch files to be applied.
|
||||
Guards decides which patches to include and exclude based on a list of
|
||||
symbols. From the kernel-source.src.rpm package, a fully patched
|
||||
kernel source tree can be generated from vanilla sources + patches like
|
||||
this:
|
||||
|
||||
# Install the package:
|
||||
|
||||
$ rpm -i kernel-source.src.rpm
|
||||
|
||||
# Unpack the patches and the kernel sources:
|
||||
|
||||
$ cd /usr/src/packages/SOURCES
|
||||
$ for f in patches.*.tar.bz2; do \
|
||||
tar -xjf "$f" || break; \
|
||||
done
|
||||
$ tar -xjf linux-2.6.5.tar.bz2
|
||||
|
||||
# Apply the patches
|
||||
|
||||
$ for p in $(./guards < series.conf); do
|
||||
patch -d linux-2.6.5 -p1 < $p || break
|
||||
done
|
||||
|
||||
The configuration script config.conf which is similar to series.conf is
|
||||
used for configuration file selection. See the section WHERE TO FIND
|
||||
CONFIGURATION FILES.
|
||||
|
||||
The file format of series.conf and config.conf should be obvious from
|
||||
the comments in series.conf, and from the guards(1) manual page. (The
|
||||
guards(1) manual page can be generated by running pod2man on the guards
|
||||
script.)
|
||||
|
||||
|
||||
WHERE TO FIND CONFIGURATION FILES
|
||||
|
||||
Kernel configuration files are stored in the kernel GIT repository. When
|
||||
packing up the repository, they end up in config.tar.bz2.
|
||||
|
||||
The kernel-$FLAVOR packages are based on config/$ARCH/$FLAVOR.
|
||||
(kernel-default is based on config/$ARCH/default, for example). The
|
||||
kernel-$FLAVOR packages install their configuration files as
|
||||
/boot/config-$VER_STR (for example, /boot/config-2.6.5-99-default). The
|
||||
config is also packaged in the kernel-$FLAVOR-devel package as
|
||||
/usr/src/linux-obj/$ARCH/$FLAVOR/.config.
|
||||
The kernel-`$FLAVOR` packages are based on `config/$ARCH/$FLAVOR`, for instance,
|
||||
kernel-default is based on `config/$ARCH/default`. The kernel-`$FLAVOR` packages
|
||||
install their configuration files as `/boot/config-$VERSION-$RELEASE-$FLAVOR`.
|
||||
The config is also packaged in the kernel-`$FLAVOR`-devel package as
|
||||
`/usr/src/linux-obj/$ARCH/$FLAVOR/.config`.
|
||||
|
||||
In addition, the running kernel exposes a gzip compressed version of its
|
||||
configuration file as /proc/config.gz. The kernel sources can be
|
||||
configured based on /proc/config.gz with ``make cloneconfig''.
|
||||
configuration file as `/proc/config.gz`.
|
||||
|
||||
|
||||
HOW TO CONFIGURE THE KERNEL SOURCES
|
||||
How to configure the kernel sources
|
||||
-----------------------------------
|
||||
|
||||
Before a binary kernel is built or an additional loadable module
|
||||
for an existing kernel is created, the kernel must be configured.
|
||||
Before a binary kernel is built or an additional loadable module for an existing
|
||||
kernel is created, the kernel must be configured.
|
||||
|
||||
In order for a loadable module to work with an existing kernel, it must
|
||||
be created with a configuration that is identical to the kernel's
|
||||
configuration, or at least very close to that. Each configuration is
|
||||
contained in a single file. The kernel-syms package installs
|
||||
configurations for all standard SUSE kernel variants, so for building
|
||||
only external kernel modules it is not necessary to configure the kernel
|
||||
sources.
|
||||
In order for a loadable module to work with an existing kernel, it must be
|
||||
created with a configuration that is identical to the kernel's configuration, or
|
||||
at least very close to that. Each configuration is contained in a single file.
|
||||
The kernel-syms package installs configurations for all standard SUSE kernel
|
||||
variants, so for building only external kernel modules it is not necessary to
|
||||
configure the kernel sources.
|
||||
|
||||
Configuring the kernel sources for a specific configuration is
|
||||
straightfoward:
|
||||
Configuring the kernel sources for a specific configuration is straightforward:
|
||||
|
||||
- Locate the configuration file you want to use. (See WHERE TO FIND
|
||||
CONFIGURATION FILES above).
|
||||
* Locate the configuration file you want to use, see [Where to find
|
||||
configuration files](#where-to-find-configuration-files) above.
|
||||
|
||||
- Copy the configuration to the file .config in your build directory.
|
||||
* Copy the configuration to the file `.config` in your build directory.
|
||||
|
||||
- Run the following commands in sequence to apply the configuration,
|
||||
generate version information files, etc.:
|
||||
* Run the following commands in sequence to apply the configuration, generate
|
||||
version information files, etc.:
|
||||
|
||||
make -C /usr/src/linux O=$PWD clean
|
||||
make -C /usr/src/linux O=$PWD oldconfig
|
||||
$ make -C /usr/src/linux O=$PWD clean
|
||||
$ make -C /usr/src/linux O=$PWD oldconfig
|
||||
|
||||
Alternatively to ``make oldconfig'', you can also use ``make
|
||||
menuconfig'' for a text menu oriented user interface. If the kernel
|
||||
sources do not match the configuration file exactly, ``make
|
||||
oldconfig'' will prompt for settings that are undefined. Once this
|
||||
step is completed, a Makefile will have been created that eliminates
|
||||
the need to specify the locations of the kernel source and the build
|
||||
directory.
|
||||
If the kernel sources do not match the configuration file exactly,
|
||||
`make oldconfig` will prompt for settings that are undefined. When no
|
||||
`.config` file is initially copied to the target build directory, the command
|
||||
automatically uses `/boot/config-$(uname -r)` as the starting configuration.
|
||||
Alternatively to `make oldconfig`, you can also use `make menuconfig` for
|
||||
a text menu oriented user interface.
|
||||
|
||||
For configuring the kernel to match the running kernel, there is a
|
||||
shortcut ``make cloneconfig'' that expands the file /proc/config.gz
|
||||
into .config, and then runs ``make oldconfig''.
|
||||
Once this step is completed, a `Makefile` will have been created that
|
||||
eliminates the need to specify the locations of the kernel source and the
|
||||
build directory.
|
||||
|
||||
HOW TO ADD CUSTOM PATCHES
|
||||
* Update the configuration appropriately for the target use.
|
||||
|
||||
Typically patches are added to the appropriate patches.* directory (e.g.
|
||||
patches.fixes) and to series.conf. When the kernel-source package is
|
||||
exported from the git repository, the patch will be automatically added
|
||||
to the appropriate patch tarball.
|
||||
Configuration files for SUSE kernels include settings to integrate with
|
||||
signing support provided by the Open Build Service. When using such a
|
||||
configuration file directly, the build might fail due to missing files needed
|
||||
for signing kernel modules.
|
||||
|
||||
If your goal is to create a kernel with only a few additional patches
|
||||
and you don't want to be bothered with using the git repository, there
|
||||
is an easier way.
|
||||
The minimal steps to enable module signing and have the kernel build
|
||||
automatically generate a new key pair are as follows:
|
||||
|
||||
The kernel-source SRPM ships with two empty archives that can be be
|
||||
filled and automatically expanded when building the kernel. You can use
|
||||
these to add your own patches and config options without disturbing the
|
||||
rest of the kernel package. This is useful if you are using the openSUSE
|
||||
Build Service and link to the main kernel-source project instead of
|
||||
creating your own branch. The advantage to this is that your project
|
||||
will automatically receive all the changes that go into the main project
|
||||
without any further effort.
|
||||
$ ./source/scripts/config --enable CONFIG_MODULE_SIG \
|
||||
--enable CONFIG_MODULE_SIG_ALL --undefine CONFIG_MODULE_SIG_KEY
|
||||
$ make olddefconfig
|
||||
|
||||
To add a patch using this mechanism, just add it to the
|
||||
patches.addon.tar.bz2 archive and add an entry to the series.conf file.
|
||||
The archive will be expanded automatically with the other kernel patches
|
||||
when the source tree is constructed.
|
||||
Please refer to the upstream documentation located at
|
||||
`/usr/src/linux/Documentation/admin-guide/module-signing.rst` for complete
|
||||
information on how to configure module signing.
|
||||
|
||||
Some patches may add new Kconfig options. The config.addon.tar.bz2
|
||||
archive contains the same hierarchy as config.tar.bz2, but is under
|
||||
config.addon. You can add your new config options to files named after
|
||||
their config/ counterparts.
|
||||
|
||||
For example, the file used to configure the i386 default kernel is named
|
||||
config/i386/default. To add config options to that kernel, you would
|
||||
create a new file called config.addon/i386/default with the options as
|
||||
formatted in a normal Linux kernel .config file. This is important
|
||||
because the kernel build is non-interactive and will fail if it
|
||||
encounters new config options without entries in the config file.
|
||||
How to add custom patches
|
||||
-------------------------
|
||||
|
||||
MODULE LOAD PATHS
|
||||
Patches are typically added to the `patches.suse/` directory and an appropriate
|
||||
place in `series.conf`. When the kernel-source package is exported from the Git
|
||||
repository, the patch will be automatically added to the matching patch tarball.
|
||||
|
||||
If your goal is to create a kernel with only a few additional patches and you
|
||||
don't want to be bothered with using the Git repository, there is an easier way.
|
||||
|
||||
The kernel-source SRPM ships with two empty archives that can be filled and
|
||||
automatically expanded when building the kernel. You can use these to add your
|
||||
own patches and config options without disturbing the rest of the kernel
|
||||
package. This is useful if you are using the openSUSE Build Service and link to
|
||||
the main kernel-source project instead of creating your own branch. The
|
||||
advantage to this is that your project will automatically receive all the
|
||||
changes that go into the main project without any further effort.
|
||||
|
||||
To add a patch using this mechanism, just add it to the `patches.addon.tar.bz2`
|
||||
archive and add an entry to a `series` file inside the archive. The archive will
|
||||
be expanded automatically after the other kernel patches when the source tree is
|
||||
constructed.
|
||||
|
||||
Some patches may add new Kconfig options. The `config.addon.tar.bz2` archive
|
||||
contains the same hierarchy as `config.tar.bz2`, but is under `config.addon/`.
|
||||
You can add your new config options to files named after their `config/`
|
||||
counterparts.
|
||||
|
||||
For example, the file used to configure the x86_64 default kernel is named
|
||||
`config/x86_64/default`. To add config options to that kernel, you would create
|
||||
a new file called `config.addon/x86_64/default` with the options as formatted in
|
||||
a normal Linux kernel `.config` file. This is important because the kernel build
|
||||
is non-interactive and will fail if it encounters new config options without
|
||||
entries in the config file.
|
||||
|
||||
|
||||
Module load paths
|
||||
-----------------
|
||||
|
||||
Modules that belong to a specific kernel release are installed in
|
||||
/lib/modules/2.6.5-99-smp and similar. Note that this path contains the
|
||||
kernel package release number. Modules from KMPs must be installed
|
||||
below /lib/modules/2.6.5-99-smp/updates/ and similar: modules below
|
||||
updates/ have priority over other modules.
|
||||
`/lib/modules/$VERSION-$RELEASE-$FLAVOR/`. Modules from KMPs must be installed
|
||||
below `/lib/modules/$VERSION-$RELEASE-$FLAVOR/updates/` and similar: modules
|
||||
below `updates/` have priority over other modules.
|
||||
|
||||
When KMPs contain modules that are compatible between multiple installed
|
||||
kernels, symlinks are used to make those modules available to those
|
||||
compatible kernels like this:
|
||||
kernels, symlinks are used to make those modules available to those compatible
|
||||
kernels like this:
|
||||
|
||||
/lib/modules/2.6.16-100-smp/weak-updates/foo.ko ->
|
||||
/lib/modules/2.6.16-99-smp/updates/foo.ko
|
||||
`/lib/modules/$VERSION-$OTHER_RELEASE-$FLAVOR/weak-updates/foo.ko` →
|
||||
`/lib/modules/$VERSION-$RELEASE-$FLAVOR/updates/foo.ko`
|
||||
|
||||
Modules in the weak-updates directory have lower priority than modules
|
||||
in /lib/modules/2.6.16-100-smp/updates/, and higher priority than other
|
||||
modules in /lib/modules/2.6.16-100-smp.
|
||||
Modules in the `weak-updates/` directory have lower priority than modules in
|
||||
`/lib/modules/$VERSION-$OTHER_RELEASE-$FLAVOR/updates/`, and higher priority
|
||||
than other modules in `/lib/modules/$VERSION-$OTHER_RELEASE-$FLAVOR/`.
|
||||
|
||||
|
||||
REFERENCES
|
||||
Driver update disks
|
||||
-------------------
|
||||
|
||||
General
|
||||
A Driver Update Disk (DUD) is an update archive which makes it possible to use
|
||||
new device drivers to run installation of an (open)SUSE distribution. It allows
|
||||
to install the distribution on devices that were not supported at the time the
|
||||
distribution was created and be able to boot the installed system afterwards
|
||||
without having to manually install the new device drivers after the
|
||||
installation.
|
||||
|
||||
Documentation in the kernel source tree.
|
||||
For information how to create such an update, refer to the mkdud and mksusecd
|
||||
tools, and their documentation:
|
||||
|
||||
Linux Documentation Project, http://www.tldp.org/
|
||||
|
||||
Linux Weekly News, http://lwn.net
|
||||
|
||||
Rusty's Remarkably Unreliable Guides (Kernel Hacking
|
||||
and Kernel Locking guides),
|
||||
http://www.netfilter.org/unreliable-guides/
|
||||
|
||||
Kernel newbies, http://www.kernelnewbies.org/
|
||||
* <https://github.com/openSUSE/mkdud>,
|
||||
* <https://github.com/openSUSE/mksusecd>.
|
||||
|
||||
|
||||
Loadable Kernel Modules
|
||||
References
|
||||
----------
|
||||
|
||||
Peter Jay Salzman and Ori Pomerantz: Linux Kernel Module
|
||||
Programming Guide, Version 2.4, April 2003,
|
||||
http://www.tldp.org/guides.html
|
||||
General:
|
||||
|
||||
* Documentation in the kernel source tree,
|
||||
* LWN.net (Linux Weekly News), <https://lwn.net/>,
|
||||
* Kernel newbies, <https://kernelnewbies.org/>.
|
||||
|
||||
Kernel Module Packages
|
||||
Loadable kernel modules:
|
||||
|
||||
Andreas Gruenbacher: Kernel Module Packages Manual.
|
||||
Versions for CODE9 (SLES9, SUSE LINUX 10.0) and CODE10
|
||||
(SUSE Linux 10.1, SLES10),
|
||||
http://www.suse.de/~agruen/KMPM/
|
||||
* The Linux Kernel Module Programming Guide,
|
||||
<https://sysprog21.github.io/lkmpg/>.
|
||||
|
||||
Kernel module packages:
|
||||
|
||||
* Kernel Module Packages Manual, SUSE Linux Enterprise 12 SP2 or later and SUSE
|
||||
Linux Enterprise 15,
|
||||
<https://documentation.suse.com/sbp/all/html/SBP-KMP-Manual-SLE12SP2/index.html>,
|
||||
* SUSE SolidDriver Program, <https://drivers.suse.com/doc/SolidDriver/>.
|
||||
|
||||
240
_constraints
Normal file
240
_constraints
Normal file
@@ -0,0 +1,240 @@
|
||||
<constraints>
|
||||
<!-- Default 25GB for binary packages -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<package>kernel-default</package>
|
||||
<package>kernel-source:kernel-default</package>
|
||||
<package>kernel-kvmsmall</package>
|
||||
<package>kernel-source:kernel-kvmsmall</package>
|
||||
<package>kernel-vanilla</package>
|
||||
<package>kernel-source:kernel-vanilla</package>
|
||||
<package>kernel-zfcpdump</package>
|
||||
<package>kernel-source:kernel-zfcpdump</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<disk>
|
||||
<size unit="G">25</size>
|
||||
</disk>
|
||||
<memory>
|
||||
<size unit="G">4</size>
|
||||
</memory>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- 8GB RAM for kernel-syzkaller -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<package>kernel-syzkaller</package>
|
||||
<package>kernel-source:kernel-syzkaller</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<physicalmemory>
|
||||
<size unit="G">8</size>
|
||||
</physicalmemory>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- 8GB for kernel-source -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<package>kernel-source</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<disk>
|
||||
<size unit="G">8</size>
|
||||
</disk>
|
||||
</hardware>
|
||||
<hostlabel exclude="true">SLOW_DISK</hostlabel>
|
||||
</overwrite>
|
||||
|
||||
<!-- 4GB for kernel-docs -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<package>kernel-docs</package>
|
||||
<package>kernel-source:kernel-docs</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<physicalmemory>
|
||||
<size unit="G">4</size>
|
||||
</physicalmemory>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- 24GB for binary packages on armv6/7 -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>armv7l</arch>
|
||||
<arch>armv6l</arch>
|
||||
<package>kernel-default</package>
|
||||
<package>kernel-source:kernel-default</package>
|
||||
<package>kernel-kvmsmall</package>
|
||||
<package>kernel-source:kernel-kvmsmall</package>
|
||||
<package>kernel-vanilla</package>
|
||||
<package>kernel-source:kernel-vanilla</package>
|
||||
<package>kernel-zfcpdump</package>
|
||||
<package>kernel-source:kernel-zfcpdump</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<disk>
|
||||
<size unit="G">24</size>
|
||||
</disk>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- 16GB of disk and 2GB of memory for binary package on s390x -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>s390x</arch>
|
||||
<package>kernel-default</package>
|
||||
<package>kernel-source:kernel-default</package>
|
||||
<package>kernel-kvmsmall</package>
|
||||
<package>kernel-source:kernel-kvmsmall</package>
|
||||
<package>kernel-vanilla</package>
|
||||
<package>kernel-source:kernel-vanilla</package>
|
||||
<package>kernel-zfcpdump</package>
|
||||
<package>kernel-source:kernel-zfcpdump</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<disk>
|
||||
<size unit="G">16</size>
|
||||
</disk>
|
||||
<memory>
|
||||
<size unit="G">2</size>
|
||||
</memory>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- 8 CPUs for binary packages on x86 -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>i586</arch>
|
||||
<arch>x86_64</arch>
|
||||
<arch>riscv64</arch>
|
||||
<package>kernel-default</package>
|
||||
<package>kernel-source:kernel-default</package>
|
||||
<package>kernel-kvmsmall</package>
|
||||
<package>kernel-source:kernel-kvmsmall</package>
|
||||
<package>kernel-vanilla</package>
|
||||
<package>kernel-source:kernel-vanilla</package>
|
||||
<package>kernel-zfcpdump</package>
|
||||
<package>kernel-source:kernel-zfcpdump</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<jobs>8</jobs>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- 4 CPUs for binary packages on POWER -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>ppc</arch>
|
||||
<arch>ppc64</arch>
|
||||
<arch>ppc64le</arch>
|
||||
<package>kernel-default</package>
|
||||
<package>kernel-source:kernel-default</package>
|
||||
<package>kernel-kvmsmall</package>
|
||||
<package>kernel-source:kernel-kvmsmall</package>
|
||||
<package>kernel-vanilla</package>
|
||||
<package>kernel-source:kernel-vanilla</package>
|
||||
<package>kernel-zfcpdump</package>
|
||||
<package>kernel-source:kernel-zfcpdump</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<jobs>4</jobs>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- 2 CPUs for binary packages on ARM -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>aarch64</arch>
|
||||
<arch>armv6l</arch>
|
||||
<arch>armv7l</arch>
|
||||
<package>kernel-default</package>
|
||||
<package>kernel-source:kernel-default</package>
|
||||
<package>kernel-kvmsmall</package>
|
||||
<package>kernel-source:kernel-kvmsmall</package>
|
||||
<package>kernel-vanilla</package>
|
||||
<package>kernel-source:kernel-vanilla</package>
|
||||
<package>kernel-zfcpdump</package>
|
||||
<package>kernel-source:kernel-zfcpdump</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<jobs>2</jobs>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- Build on recent ARMv8.1 to avoid slow builders -->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>aarch64</arch>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<cpu>
|
||||
<flag>asimdrdm</flag>
|
||||
</cpu>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- 45GB for binary packages on aarch64 and x86-->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>aarch64</arch>
|
||||
<arch>x86_64</arch>
|
||||
<package>kernel-default</package>
|
||||
<package>kernel-source:kernel-default</package>
|
||||
<package>kernel-kvmsmall</package>
|
||||
<package>kernel-source:kernel-kvmsmall</package>
|
||||
<package>kernel-vanilla</package>
|
||||
<package>kernel-source:kernel-vanilla</package>
|
||||
<package>kernel-zfcpdump</package>
|
||||
<package>kernel-source:kernel-zfcpdump</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<disk>
|
||||
<size unit="G">45</size>
|
||||
</disk>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<!-- 52GB for binary packages on riscv64-->
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>riscv64</arch>
|
||||
<package>kernel-default</package>
|
||||
<package>kernel-source:kernel-default</package>
|
||||
<package>kernel-kvmsmall</package>
|
||||
<package>kernel-source:kernel-kvmsmall</package>
|
||||
<package>kernel-vanilla</package>
|
||||
<package>kernel-source:kernel-vanilla</package>
|
||||
<package>kernel-zfcpdump</package>
|
||||
<package>kernel-source:kernel-zfcpdump</package>
|
||||
</conditions>
|
||||
<hardware>
|
||||
<disk>
|
||||
<size unit="G">52</size>
|
||||
</disk>
|
||||
</hardware>
|
||||
</overwrite>
|
||||
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>i586</arch>
|
||||
<arch>x86_64</arch>
|
||||
<package>kernel-obs-qa</package>
|
||||
<package>kernel-source:kernel-obs-qa</package>
|
||||
</conditions>
|
||||
<sandbox>kvm</sandbox>
|
||||
</overwrite>
|
||||
|
||||
<overwrite>
|
||||
<conditions>
|
||||
<arch>i586</arch>
|
||||
<arch>x86_64</arch>
|
||||
<package>kernel-obs-qa-xen</package>
|
||||
<package>kernel-source:kernel-obs-qa-xen</package>
|
||||
</conditions>
|
||||
<sandbox>xen</sandbox>
|
||||
</overwrite>
|
||||
</constraints>
|
||||
|
||||
@@ -38,7 +38,7 @@ fi
|
||||
echo "set -ex"
|
||||
"$DIR"/guards "$@" <"$series" | \
|
||||
if $vanilla; then
|
||||
egrep '^patches\.(kernel\.org|rpmify)/'
|
||||
sed -rn '/^patches\.(kernel\.org|rpmify)\//p'
|
||||
else
|
||||
cat
|
||||
fi |\
|
||||
|
||||
13
arch-symbols
13
arch-symbols
@@ -1,8 +1,8 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
#############################################################################
|
||||
# Copyright (c) 2003-2005,2009 Novell, Inc.
|
||||
# All Rights Reserved.
|
||||
# Copyright (c) 2010-2022 SUSE LLC
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of version 2 of the GNU General Public License as
|
||||
@@ -14,25 +14,24 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, contact Novell, Inc.
|
||||
# along with this program; if not, contact https://www.suse.com/source-code/
|
||||
#
|
||||
# To contact Novell about this file by physical or electronic mail,
|
||||
# you may find current contact information at www.novell.com
|
||||
#############################################################################
|
||||
|
||||
|
||||
# With --list, list all known architectures, otherwise print the generic
|
||||
# name for this architecture (or the one specified on command line).
|
||||
|
||||
if [ "$1" = "--list" ]; then
|
||||
# List all known architectures
|
||||
echo i386 mips{,64} sparc{,64} ppc{,64} s390{,x} ia64 x86_64 alpha parisc armv5tel armv7hl arm64
|
||||
echo i386 mips{,64} sparc{,64} ppc{,64,64le} s390{,x} ia64 x86_64 alpha parisc armv6hl armv7hl arm64 riscv64
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
ARCH="$1"
|
||||
else
|
||||
ARCH="`arch`"
|
||||
ARCH="$(arch)"
|
||||
fi
|
||||
case "$ARCH" in
|
||||
# from rpm --eval '%ix86'
|
||||
|
||||
@@ -1,9 +1,66 @@
|
||||
#! /bin/bash
|
||||
|
||||
# lines 4 contains a timestamp...
|
||||
# This is a list of toolchain-dependent configs. That is: only those which
|
||||
# change .config when gcc, ld, or similar changes.
|
||||
#
|
||||
# please keep them sorted alphabetically
|
||||
declare -a IGNORED_CONFIGS_RE=(
|
||||
'ARCH_USING_PATCHABLE_FUNCTION_ENTRY'
|
||||
'AS_IS_\(GNU\|LLVM\)'
|
||||
'AS_HAS_[A-Z0-9_]*'
|
||||
'AS_VERSION'
|
||||
'AS_WRUSS' # x86_32
|
||||
'BUILTIN_RETURN_ADDRESS_STRIPS_PAC'
|
||||
'CC_ASM_FLAG_OUTPUT_BROKEN'
|
||||
'CC_CAN_[A-Z_]*'
|
||||
'CC_IMPLICIT_FALLTHROUGH'
|
||||
'CC_IS_\(CLANG\|GCC\)'
|
||||
'CC_HAS_[A-Z_]*'
|
||||
'CC_HAVE_[A-Z_]*'
|
||||
'CC_VERSION_TEXT'
|
||||
'CLANG_VERSION'
|
||||
'DRM_MSM_VALIDATE_XML'
|
||||
'DYNAMIC_SIGFRAME'
|
||||
'FTRACE_MCOUNT_USE_[A-Z_]*'
|
||||
'GCC_ASM_FLAG_OUTPUT_BROKEN'
|
||||
'GCC_ASM_GOTO_OUTPUT_BROKEN'
|
||||
'GCC_ASM_GOTO_OUTPUT_WORKAROUND'
|
||||
'GCC_VERSION'
|
||||
'G*CC[0-9]*_NO_[A-Z_]*'
|
||||
'HAS_LTO_CLANG'
|
||||
'HAVE_[A-Z]*_COMPILER'
|
||||
'HAVE_RUST'
|
||||
'HAVE_SHADOW_CALL_STACK'
|
||||
'LD_CAN_[A-Z_]*'
|
||||
'LD_IS_\(BFD\|LLD\)'
|
||||
'LD_VERSION'
|
||||
'LLD_VERSION'
|
||||
'OBJTOOL'
|
||||
'PAHOLE_HAS_[A-Z0-9_]*'
|
||||
'PAHOLE_VERSION'
|
||||
'RISCV_ISA_[A-Z_]*'
|
||||
'RUSTC_SUPPORTS_[A-Z0-9_]*'
|
||||
'SCHED_PROXY_EXEC'
|
||||
'TOOLCHAIN_HAS_[A-Z_]*'
|
||||
'TOOLCHAIN_NEEDS_[A-Z_]*'
|
||||
'TOOLS_SUPPORT_[A-Z_]*'
|
||||
'USE_X86_SEG_SUPPORT'
|
||||
)
|
||||
|
||||
declare -a SED_ARGS=()
|
||||
|
||||
for CONFIG in "${IGNORED_CONFIGS_RE[@]}"; do
|
||||
SED_ARGS+=(-e "/\\<CONFIG_$CONFIG\\>/ d")
|
||||
done
|
||||
|
||||
SED_ARGS+=(
|
||||
-e '/^# .* is not set$/p'
|
||||
-e '/^$\|^#/d'
|
||||
)
|
||||
|
||||
differences="$(
|
||||
diff -bU0 <(sed -e '/^# .* is not set$/p' -e '/^$\|^#/d' "$1" | sort) \
|
||||
<(sed -e '/^# .* is not set$/p' -e '/^$\|^#/d' "$2" | sort) \
|
||||
diff -bU0 <(sed "${SED_ARGS[@]}" "$1" | sort) \
|
||||
<(sed "${SED_ARGS[@]}" "$2" | sort) \
|
||||
| grep '^[-+][^-+]'
|
||||
)" || true
|
||||
if [ -n "$differences" ]; then
|
||||
|
||||
13
check-module-license
Normal file
13
check-module-license
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
rc=0
|
||||
for file in $(find "$@" -name '*.ko' -o -name '*.ko.xz' \
|
||||
-o -name '*.ko.gz' -o -name '*.ko.zst'); do
|
||||
l=$(/sbin/modinfo -F license "$file")
|
||||
if [ -z "$l" ]; then
|
||||
echo "ERROR: No license is included for module ${file##*/lib/modules/}"
|
||||
rc=1
|
||||
fi
|
||||
done
|
||||
|
||||
exit $rc
|
||||
@@ -1,36 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
sourcedir=$1
|
||||
modpath=$2
|
||||
|
||||
# Check for modules not listed in supported.conf: First, for each module
|
||||
# in the list, set mod_$module=1
|
||||
for module in $($sourcedir/guards --list < $sourcedir/supported.conf \
|
||||
| sed -e 's,.*/,,'); do
|
||||
m=${module##*/}
|
||||
m=${m%.ko}
|
||||
eval mod_${m//-/_}=1
|
||||
done
|
||||
|
||||
# Check if any installed module was not listed
|
||||
status=
|
||||
cd $modpath
|
||||
for module in $(find . -name '*.ko' | sort); do
|
||||
case "$module" in
|
||||
./kernel/drivers/staging/* | ./kernel/Documentation/*)
|
||||
continue ;;
|
||||
esac
|
||||
module=${module%.ko}
|
||||
m=${module##*/}
|
||||
m=${m//-/_}
|
||||
m="mod_$m"
|
||||
if [ -z "${!m}" ]; then
|
||||
if [ -z "$status" ]; then
|
||||
echo "Modules not listed in supported.conf:"
|
||||
status=1
|
||||
fi
|
||||
echo ${module#./}
|
||||
fi
|
||||
done
|
||||
|
||||
exit $status
|
||||
@@ -1,77 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
export LANG=POSIX
|
||||
|
||||
path=(.)
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--patches)
|
||||
path[${#path[@]}]=$2
|
||||
shift 2
|
||||
;;
|
||||
*)
|
||||
echo "Usage $0 [--patches <dir>]" >&2
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
if test "${path[*]}" = "."; then
|
||||
path=(. ..)
|
||||
fi
|
||||
|
||||
|
||||
source $(dirname $0)/config.sh
|
||||
parse_srcversion()
|
||||
{
|
||||
local IFS=.
|
||||
set -- ${SRCVERSION%%-*}
|
||||
VERSION=$1
|
||||
PATCHLEVEL=${2:-0}
|
||||
SUBLEVEL=${3:-0}
|
||||
EXTRAVERSION=${SRCVERSION#${SRCVERSION%%-*}}
|
||||
}
|
||||
parse_srcversion
|
||||
|
||||
EXTRA_SYMBOLS=$(set -- $([ -e $(dirname $0)/extra-symbols ] && cat $(dirname $0)/extra-symbols) ; echo $*)
|
||||
|
||||
series=$(mktemp)
|
||||
tmp_files="$series"
|
||||
trap 'rm -rf $tmp_files' EXIT
|
||||
warned=false
|
||||
while read patch; do
|
||||
dir=${patch%/*}
|
||||
for p in "${path[@]}"; do
|
||||
if test -d "$p/$dir"; then
|
||||
echo "$p/$patch"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
for p in "${path[@]}"; do
|
||||
if test -e "$p/$dir.tar.bz2"; then
|
||||
echo "unpacking $p/$dir.tar.bz2" >&2
|
||||
if ! $warned; then
|
||||
echo "pass --patches <directory with unpacked tarballs> to avoid this" >&2
|
||||
warned=true
|
||||
fi
|
||||
tmp_files="$tmp_files $dir"
|
||||
tar -xjf "$p/$dir.tar.bz2"
|
||||
echo "$patch"
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
echo "Can't find $patch" >&2
|
||||
exit 1
|
||||
done >"$series" < <($(dirname $0)/guards $EXTRA_SYMBOLS <series.conf)
|
||||
|
||||
# Parse all the changes to KERNELRELEASE out of all patches and
|
||||
# convert them to shell code that can be evaluated. Evaluate it.
|
||||
eval "$(
|
||||
<"$series" xargs awk '
|
||||
/^--- |^\+\+\+ / \
|
||||
{ M = match($2, /^[^\/]+\/Makefile( \t|$)/) }
|
||||
M && /^+(VERSION|PATCHLEVEL|SUBLEVEL|EXTRAVERSION)/ \
|
||||
{ print }
|
||||
' \
|
||||
| sed -e 's,^+,,' -e 's, *= *\(.*\),="\1",'
|
||||
)"
|
||||
|
||||
echo "$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION"
|
||||
File diff suppressed because it is too large
Load Diff
BIN
config.addon.tar.bz2
LFS
BIN
config.addon.tar.bz2
LFS
Binary file not shown.
46
config.conf
46
config.conf
@@ -8,52 +8,16 @@
|
||||
# kernel-binary and kernel-source rely on this
|
||||
#
|
||||
|
||||
+i386 i386/default
|
||||
+i386 i386/desktop
|
||||
+i386 i386/pae
|
||||
+i386 -syms i386/debug
|
||||
+i386 i386/xen
|
||||
+i386 -syms i386/ec2
|
||||
+i386 i386/vanilla
|
||||
+i386 -syms i386/trace
|
||||
|
||||
+ia64 ia64/default
|
||||
+ia64 -syms ia64/debug
|
||||
+ia64 ia64/vanilla
|
||||
+ia64 -syms ia64/trace
|
||||
|
||||
+x86_64 x86_64/default
|
||||
+x86_64 x86_64/desktop
|
||||
+x86_64 x86_64/xen
|
||||
+x86_64 -syms x86_64/ec2
|
||||
+x86_64 -syms x86_64/debug
|
||||
+x86_64 x86_64/vanilla
|
||||
+x86_64 -syms x86_64/trace
|
||||
+x86_64 -syms x86_64/kvmsmall
|
||||
|
||||
+ppc ppc/default
|
||||
+ppc ppc/vanilla
|
||||
+ppc64 ppc64/default
|
||||
+ppc64 -syms ppc64/trace
|
||||
+ppc64 -syms ppc64/debug
|
||||
+ppc64 ppc64/vanilla
|
||||
+ppc64le ppc64le/default
|
||||
+ppc64le ppc64le/vanilla
|
||||
|
||||
# ARM architectures
|
||||
+armv5tel armv5tel/versatile
|
||||
+armv7hl armv7hl/default
|
||||
+armv7hl armv7hl/imx51
|
||||
+armv7hl armv7hl/omap2plus
|
||||
+armv7hl armv7hl/u8500
|
||||
+armv7hl armv7hl/cubox
|
||||
+armv7hl armv7hl/exynos
|
||||
+arm64 arm64/default
|
||||
+arm64 arm64/vanilla
|
||||
|
||||
+s390 s390/s390
|
||||
+s390 -syms s390/trace
|
||||
+s390 s390/vanilla
|
||||
+s390x s390x/default
|
||||
+s390x -syms s390x/trace
|
||||
+s390x s390x/vanilla
|
||||
|
||||
# Maintained by jengelh
|
||||
# +sparc64 sparc64/default
|
||||
# +sparc64 -syms sparc64/net
|
||||
+s390x -syms s390x/zfcpdump
|
||||
|
||||
25
config.sh
25
config.sh
@@ -1,9 +1,24 @@
|
||||
# The version of the main tarball to use
|
||||
SRCVERSION=3.8
|
||||
SRCVERSION=4.12
|
||||
# variant of the kernel-source package, either empty or "-rt"
|
||||
VARIANT=
|
||||
# Use old style livepatch package names
|
||||
LIVEPATCH=kgraft
|
||||
# buildservice projects to build the kernel against
|
||||
OBS_PROJECT=openSUSE:Factory
|
||||
OBS_PROJECT_ARM=openSUSE:Factory:ARM
|
||||
IBS_PROJECT=SUSE:Factory:Head
|
||||
IBS_PROJECT_ARM=Devel:ARM:Factory
|
||||
OBS_PROJECT=SUSE:SLE-12-SP5:Update
|
||||
IBS_PROJECT=SUSE:SLE-12-SP5:Update
|
||||
# Bugzilla info
|
||||
BUGZILLA_SERVER="apibugzilla.suse.com"
|
||||
BUGZILLA_PRODUCT="SUSE Linux Enterprise Server 12 SP5"
|
||||
# Check the sorted patches section of series.conf
|
||||
SORT_SERIES=yes
|
||||
# Use the old way of building kernel-default-base directly from kernel-binary
|
||||
SPLIT_BASE=Yes
|
||||
# Do not sign non-efi kernels (not supported by pesign-obs-integration on older SLE)
|
||||
SB_EFI_ONLY=Yes
|
||||
# Modules not listed in supported.conf will abort the kernel build
|
||||
SUPPORTED_MODULES_CHECK=Yes
|
||||
# build documentation in HTML format
|
||||
BUILD_HTML=Yes
|
||||
# build documentation in PDF format
|
||||
BUILD_PDF=No
|
||||
|
||||
BIN
config.tar.bz2
LFS
BIN
config.tar.bz2
LFS
Binary file not shown.
@@ -1,60 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
#
|
||||
# Merge two kernel configs, eliminating duplicated assignments.
|
||||
# TODO:
|
||||
# support for #include-style directives in config files, to make the
|
||||
# kernel configs more maintainable
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
# ( { source => <file> name => ... value => ...}, { comment => ...}, ... )
|
||||
my @lines;
|
||||
# references into the @lines array
|
||||
my %variables;
|
||||
|
||||
sub store_var {
|
||||
my ($file, $line, $name, $value) = @_;
|
||||
|
||||
if (exists($variables{$name})) {
|
||||
if ($variables{$name}->{source} eq $file) {
|
||||
print STDERR "$file:$line: warning: $name redefined\n";
|
||||
}
|
||||
} else {
|
||||
my $new = {};
|
||||
push(@lines, $new);
|
||||
$variables{$name} = $new;
|
||||
}
|
||||
$variables{$name}->{source} = $file;
|
||||
$variables{$name}->{name} = $name;
|
||||
$variables{$name}->{value} = $value;
|
||||
}
|
||||
|
||||
sub store_comment {
|
||||
my ($comment) = @_;
|
||||
|
||||
push(@lines, { comment => $comment });
|
||||
}
|
||||
|
||||
while (<>) {
|
||||
chomp;
|
||||
if (/^CONFIG_(\w+)=(.*)/) {
|
||||
store_var($ARGV, $., $1, $2);
|
||||
} elsif (/^# CONFIG_(\w+) is not set/) {
|
||||
store_var($ARGV, $., $1, 'n');
|
||||
} elsif (/^$|^#/) {
|
||||
store_comment($_);
|
||||
} else {
|
||||
print STDERR "$ARGV:$.: warning: ignoring unknown line\n";
|
||||
}
|
||||
}
|
||||
|
||||
for my $line (@lines) {
|
||||
if (exists($line->{comment})) {
|
||||
print "$line->{comment}\n";
|
||||
} elsif ($line->{value} eq 'n') {
|
||||
print "# CONFIG_$line->{name} is not set\n";
|
||||
} else {
|
||||
print "CONFIG_$line->{name}=$line->{value}\n";
|
||||
}
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
relink() {
|
||||
if [ -h "$2" ]; then
|
||||
local old=$(readlink "$2")
|
||||
[ "$old" = "$1" ] && return 0
|
||||
echo "Changing symlink $2 from $old to $1"
|
||||
elif [ -e "$2" ]; then
|
||||
echo "Replacing file $2 with symlink to $1"
|
||||
fi
|
||||
rm -f "$2" \
|
||||
&& ln -s "$1" "$2"
|
||||
}
|
||||
|
||||
release="@KERNELRELEASE@@SRCVARIANT@-obj"
|
||||
arch_flavor="@CPU_ARCH_FLAVOR@"
|
||||
|
||||
relink ../../linux-$release/"$arch_flavor" /usr/src/linux-obj/"$arch_flavor"
|
||||
@@ -1,4 +0,0 @@
|
||||
# handle update from an older kernel-source with linux-obj as symlink
|
||||
if [ -h /usr/src/linux-obj ]; then
|
||||
rm -vf /usr/src/linux-obj
|
||||
fi
|
||||
@@ -1,18 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
trap 'rm -f "$filelist"' EXIT
|
||||
filelist=$(mktemp -t ${0##*/}.XXXXXXXXXX)
|
||||
grep -v '/kernel/drivers/staging/.*\.ko$' >"$filelist"
|
||||
shopt -s nullglob
|
||||
|
||||
# pretend that /boot/vmlinux-* is in the -base package and not in -devel
|
||||
if grep -q '/boot/System\.map\>' "$filelist"; then
|
||||
prefix=$(sed -rn 's:(.*)/boot/System\.map\>.*:\1:p; T; q' "$filelist")
|
||||
for f in "$prefix"/boot/vmlinux*; do
|
||||
echo "$f" >>"$filelist"
|
||||
done
|
||||
else
|
||||
perl -ni -e 'next if /\/boot\/vmlinux/ && !/\.debug$/; print' "$filelist"
|
||||
fi
|
||||
|
||||
/usr/lib/rpm/find-provides "$@" <"$filelist"
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use Getopt::Long;
|
||||
use File::Spec;
|
||||
use Getopt::Long qw(:config no_ignore_case);
|
||||
use strict;
|
||||
|
||||
&main();
|
||||
@@ -18,15 +19,26 @@ sub main
|
||||
&output($dev, $ndev, $dev_output, $ndev_output);
|
||||
}
|
||||
|
||||
sub rpm_quote_filename
|
||||
{
|
||||
# technically should also quote % -> %% " -> \" \ -> \\
|
||||
return map { "\"$_\"" } @_;
|
||||
}
|
||||
|
||||
sub scan
|
||||
{
|
||||
my $loc = shift @_;
|
||||
# Normalize file path, mainly to strip away the ending forward slash,
|
||||
# or any double forward slashes.
|
||||
my $loc = File::Spec->canonpath(shift @_);
|
||||
# We cannot use an absolute path (e.g. /usr/src/linux-5.14.21-150500.41)
|
||||
# during find because it's under build root, but rpm wants one later.
|
||||
my $abs_loc = rpm_path($loc);
|
||||
my(@dev, @ndev);
|
||||
|
||||
foreach $_ (`find "$loc"`)
|
||||
{
|
||||
chomp $_;
|
||||
if (!-f $_) {
|
||||
if (-d $_ && !-l $_) {
|
||||
# Generate directory list later.
|
||||
next;
|
||||
}
|
||||
@@ -34,19 +46,27 @@ sub scan
|
||||
m{^\Q$loc\E.*/Kconfig} ||
|
||||
m{^\Q$loc\E.*/Kbuild} ||
|
||||
m{^\Q$loc\E.*/Makefile} ||
|
||||
m{^\Q$loc\E/arch/[^/]+/boot/dts/include/dt-bindings\b} ||
|
||||
m{^\Q$loc\E/arch/[^/]+/include\b} ||
|
||||
m{^\Q$loc\E/arch/.*/module\.lds\b} ||
|
||||
m{^\Q$loc\E/arch/arm/[^/]+/include/mach\b} ||
|
||||
m{^\Q$loc\E/arch/arm/[^/]+/include/plat\b} ||
|
||||
m{^\Q$loc\E/arch/[^/]+/scripts\b} ||
|
||||
m{^\Q$loc\E/arch/[^/]+/tools\b} ||
|
||||
m{^\Q$loc\E/include/[^/]+\b} ||
|
||||
m{^\Q$loc\E/scripts\b};
|
||||
if (substr($_, 0, 1) ne "/") {
|
||||
# We cannot use an absolute path during find,
|
||||
# but rpm wants one later.
|
||||
$_ = "/$_";
|
||||
}
|
||||
$is_devel ? push(@dev, $_) : push(@ndev, $_);
|
||||
my $abs_path = rpm_path($_);
|
||||
$is_devel ? push(@dev, $abs_path) : push(@ndev, $abs_path);
|
||||
}
|
||||
|
||||
push(@dev, &calc_dirs("/$loc", \@dev));
|
||||
push(@ndev, &calc_dirs("/$loc", \@ndev));
|
||||
my @dev_dirs = calc_dirs($abs_loc, \@dev);
|
||||
my @ndev_dirs = calc_dirs($abs_loc, \@ndev);
|
||||
@dev = rpm_quote_filename(@dev);
|
||||
@ndev = rpm_quote_filename(@ndev);
|
||||
@dev_dirs = map { "\%dir $_" } rpm_quote_filename(@dev_dirs);
|
||||
@ndev_dirs = map { "\%dir $_" } rpm_quote_filename(@ndev_dirs);
|
||||
push(@dev, @dev_dirs);
|
||||
push(@ndev, @ndev_dirs);
|
||||
return (\@dev, \@ndev);
|
||||
}
|
||||
|
||||
@@ -56,15 +76,18 @@ sub calc_dirs
|
||||
my %dirs;
|
||||
|
||||
foreach my $file (@$files) {
|
||||
my $path = $file;
|
||||
my ($volume,$path,$basename) = File::Spec->splitpath($file);
|
||||
my @dirs = File::Spec->splitdir($path);
|
||||
do {
|
||||
$path =~ s{/[^/]+$}{};
|
||||
# Always create $path from catdir() to avoid ending forward slash
|
||||
$path = File::Spec->catdir(@dirs);
|
||||
$dirs{$path} = 1;
|
||||
pop @dirs;
|
||||
} while ($path ne $base);
|
||||
# This loop also makes sure that $base itself is included.
|
||||
}
|
||||
|
||||
return map { "\%dir $_" } keys %dirs;
|
||||
return keys %dirs;
|
||||
}
|
||||
|
||||
sub output
|
||||
@@ -80,3 +103,11 @@ sub output
|
||||
print FH join("\n", @$ndev), "\n";
|
||||
close FH;
|
||||
}
|
||||
|
||||
sub rpm_path
|
||||
{
|
||||
my $path = shift @_;
|
||||
# Always prepend forward slash and let canonpath take care of
|
||||
# duplicate forward slashes.
|
||||
return File::Spec->canonpath("/$path");
|
||||
}
|
||||
|
||||
74
guards
74
guards
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/perl -w
|
||||
#############################################################################
|
||||
##############################################################################
|
||||
# Copyright (c) 2003-2007,2009 Novell, Inc.
|
||||
# All Rights Reserved.
|
||||
# Copyright (c) 2010-2022 SUSE LLC
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of version 2 of the GNU General Public License as
|
||||
@@ -13,10 +13,8 @@
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, contact Novell, Inc.
|
||||
# along with this program; if not, contact https://www.suse.com/source-code/
|
||||
#
|
||||
# To contact Novell about this file by physical or electronic mail,
|
||||
# you may find current contact information at www.novell.com
|
||||
#############################################################################
|
||||
#
|
||||
# Guards:
|
||||
@@ -28,7 +26,7 @@
|
||||
#
|
||||
|
||||
use FileHandle;
|
||||
use Getopt::Long;
|
||||
use Getopt::Long qw(:config no_ignore_case);
|
||||
use strict;
|
||||
|
||||
# Prototypes
|
||||
@@ -36,20 +34,6 @@ sub files_in($$);
|
||||
sub parse($$);
|
||||
sub help();
|
||||
|
||||
#sub strip_ext($) {
|
||||
# local ($_) = @_;
|
||||
# s/\.(diff?|patch)$//;
|
||||
#}
|
||||
|
||||
#sub try_ext($) {
|
||||
# my ($path) = @_;
|
||||
# for my $p in (($path, "$path.diff", "$path.dif", "$path.patch")) {
|
||||
# return $p
|
||||
# if (-f $p);
|
||||
# }
|
||||
# return undef;
|
||||
#}
|
||||
|
||||
sub slashme($) {
|
||||
my ($dir) = @_;
|
||||
$dir =~ s#([^/])$#$&/#; # append a slash if necessary
|
||||
@@ -67,7 +51,18 @@ sub files_in($$) {
|
||||
my $dh = new FileHandle;
|
||||
my (@files, $file);
|
||||
|
||||
# @<file> syntax
|
||||
if ($path =~ s/^@//) {
|
||||
my $fh;
|
||||
open($fh, '<', $path) or die "$path: $!\n";
|
||||
@files = <$fh>;
|
||||
close($fh);
|
||||
chomp(@files);
|
||||
s:^$dir:: for @files;
|
||||
return @files;
|
||||
}
|
||||
|
||||
$path = slashme($path);
|
||||
opendir $dh, length("$dir$path") ? "$dir$path" : '.'
|
||||
or die "$dir$path: $!\n";
|
||||
while ($file = readdir($dh)) {
|
||||
@@ -99,7 +94,7 @@ sub parse($$) {
|
||||
next;
|
||||
}
|
||||
$line .= $_;
|
||||
my @guards = ();
|
||||
my @guards = ();
|
||||
foreach my $token (split /[\s\t\n]+/, $line) {
|
||||
next if $token eq "";
|
||||
if ($token =~ /^[-+]/) {
|
||||
@@ -126,8 +121,8 @@ sub help() {
|
||||
print "SYNOPSIS: $0 [--prefix=dir] [--path=dir1:dir2:...]\n" .
|
||||
" [--default=0|1] [--check|--list] [--invert-match]\n" .
|
||||
" [--with-guards] [--config=file] symbol ...\n\n" .
|
||||
" (Default values: --path='" . join(':', @path) . "', " .
|
||||
"--default=$default)\n";
|
||||
" Defaults: --default=$default\n" .
|
||||
" Use --path=\@<file> to read the list of entries from <file>\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
@@ -172,7 +167,7 @@ if ($check) {
|
||||
my @files;
|
||||
|
||||
foreach (@path) {
|
||||
@files = (@files, files_in($dir, slashme($_)));
|
||||
@files = (@files, files_in($dir, $_));
|
||||
}
|
||||
my %files = map { $_ => 0 } @files;
|
||||
|
||||
@@ -181,7 +176,11 @@ if ($check) {
|
||||
if (exists $files{$patch}) {
|
||||
$files{$patch}++;
|
||||
} else {
|
||||
print "Not found: $dir$patch\n";
|
||||
if ($config eq '-') {
|
||||
print "Not found: $dir$patch\n";
|
||||
} else {
|
||||
print "In $config but not found: $dir$patch\n";
|
||||
}
|
||||
$problems++;
|
||||
}});
|
||||
|
||||
@@ -192,15 +191,21 @@ if ($check) {
|
||||
next if $ref == 1;
|
||||
|
||||
if ($ref == 0) {
|
||||
print "Unused: $file\n" if $ref == 0;
|
||||
if ($config eq '-') {
|
||||
print "Unused: $file\n";
|
||||
} else {
|
||||
print "Not in $config: $file\n";
|
||||
}
|
||||
$problems++;
|
||||
}
|
||||
if ($ref > 1) {
|
||||
print "Warning: multiple uses: $file\n" if $ref > 1;
|
||||
print "Warning: multiple uses";
|
||||
print " in $config" if $config ne '-';
|
||||
print ": $file\n";
|
||||
# This is not an error if the entries are mutually exclusive...
|
||||
}
|
||||
}
|
||||
exit $problems ? 1 : 0;
|
||||
exit ($problems ? 1 : 0);
|
||||
|
||||
} elsif ($list) {
|
||||
parse($fh, sub {
|
||||
@@ -257,9 +262,8 @@ guards - select from a list of files guarded by conditions
|
||||
=head1 SYNOPSIS
|
||||
|
||||
F<guards> [--prefix=F<dir>] [--path=F<dir1:dir2:...>] [--default=<0|1>]
|
||||
[--check|--list] [--invert-match] [--with-guards] [--config=<file>]
|
||||
I<symbol> ...
|
||||
|
||||
[--check|--list] [--invert-match] [--with-guards] [--config=<file>]
|
||||
I<symbol> ...
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
@@ -293,10 +297,12 @@ The I<--check> option is used to compare the specification file against the
|
||||
file system. If files are referenced in the specification that do not exist, or
|
||||
if files are not enlisted in the specification file warnings are printed. The
|
||||
I<--path> option can be used to specify which directory or directories to scan.
|
||||
Multiple directories are eparated by a colon (C<:>) character. The
|
||||
I<--prefix> option specifies the location of the files.
|
||||
Multiple directories are separated by a colon (C<:>) character. The
|
||||
I<--prefix> option specifies the location of the files. Alternatively, the
|
||||
I<--path=@E<lt>fileE<gt>> syntax can be used to specify a file from which the
|
||||
file names will be read.
|
||||
|
||||
Use I<--list> to list all files independend of any rules. Use I<--invert-match>
|
||||
Use I<--list> to list all files independent of any rules. Use I<--invert-match>
|
||||
to list only the excluded patches. Use I<--with-guards> to also include all
|
||||
inclusion and exclusion rules.
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
#ifdef __x86_64__
|
||||
/*
|
||||
* Force the linker to use the older memcpy variant, so that the user programs
|
||||
* work on older systems
|
||||
*/
|
||||
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
|
||||
#endif
|
||||
103
kabi.pl
103
kabi.pl
@@ -2,13 +2,16 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Getopt::Long;
|
||||
use Getopt::Long qw(:config no_ignore_case);
|
||||
use Data::Dumper;
|
||||
|
||||
# ( { sym => regexp, mod => regexp, fail => 0/1 }, ... )
|
||||
my @rules;
|
||||
my ($opt_verbose, $opt_rules);
|
||||
|
||||
# if Module.symvers also lists namespaces (>=5.4)
|
||||
my $use_namespaces;
|
||||
|
||||
sub load_rules {
|
||||
my $file = shift;
|
||||
my $errors = 0;
|
||||
@@ -33,8 +36,14 @@ sub load_rules {
|
||||
$pattern =~ s/\*/.*/g;
|
||||
$pattern =~ s/\?/./g;
|
||||
$pattern =~ s/.*/^$&\$/;
|
||||
|
||||
# If it matches a module path or vmlinux
|
||||
if ($pattern =~ /\/|^vmlinux$/) {
|
||||
$new->{mod} = $pattern;
|
||||
# If it's not a path and the string is all uppercase, assume it's a namespace
|
||||
} elsif ($use_namespaces &&
|
||||
$pattern !~ /\// && $pattern eq uc($pattern)) {
|
||||
$new->{namespace} = $pattern;
|
||||
} else {
|
||||
$new->{sym} = $pattern;
|
||||
}
|
||||
@@ -47,20 +56,49 @@ sub load_rules {
|
||||
close($fh);
|
||||
}
|
||||
|
||||
# Return 1 if using new (>=5.4) Module.symvers format with namespaces
|
||||
sub symvers_uses_namespaces {
|
||||
my $file = shift;
|
||||
xopen(my $fh, '<', $file);
|
||||
my $line = <$fh>;
|
||||
chomp $line;
|
||||
|
||||
# The new (>=5.4) Module.symvers format has 4 tabs (5 fields):
|
||||
#
|
||||
# crc\tsymbol\tmodule\texport_type\tnamespace
|
||||
#
|
||||
# The older Module.symvers format only has 3 tabs (4 fields):
|
||||
#
|
||||
# crc\tsymbol\tmodule\texport_type
|
||||
|
||||
my $num_tabs = $line =~ tr/\t//;
|
||||
if ($num_tabs > 3) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
sub load_symvers {
|
||||
my $file = shift;
|
||||
my %res;
|
||||
my $errors = 0;
|
||||
my $new;
|
||||
|
||||
xopen(my $fh, '<', $file);
|
||||
while (<$fh>) {
|
||||
my @l = split(/\s+/);
|
||||
if (@l < 3) {
|
||||
chomp;
|
||||
my @l = split(/\t/, $_, -1);
|
||||
if (@l < 4) {
|
||||
print STDERR "$file:$.: unknown line\n";
|
||||
$errors++;
|
||||
next;
|
||||
}
|
||||
my $new = { crc => $l[0], mod => $l[2] };
|
||||
if ($use_namespaces) {
|
||||
$new = { crc => $l[0], mod => $l[2], type => $l[3], namespace => $l[4] };
|
||||
} else {
|
||||
$new = { crc => $l[0], mod => $l[2], type => $l[3] };
|
||||
}
|
||||
$res{$l[1]} = $new;
|
||||
}
|
||||
if (!%res) {
|
||||
@@ -71,25 +109,53 @@ sub load_symvers {
|
||||
return %res;
|
||||
}
|
||||
|
||||
# Each bit represents a restriction of the export and adding a restriction
|
||||
# fails the check
|
||||
my $type_GPL = 0x1;
|
||||
my $type_NOW = 0x2;
|
||||
my $type_UNUSED = 0x4;
|
||||
my %types = (
|
||||
EXPORT_SYMBOL => 0x0,
|
||||
EXPORT_SYMBOL_GPL => $type_GPL | $type_NOW,
|
||||
EXPORT_SYMBOL_GPL_FUTURE => $type_GPL,
|
||||
EXPORT_UNUSED_SYMBOL => $type_UNUSED,
|
||||
EXPORT_UNUSED_SYMBOL_GPL => $type_UNUSED | $type_GPL | $type_NOW
|
||||
);
|
||||
|
||||
sub type_compatible {
|
||||
my ($old, $new) = @_;
|
||||
|
||||
for my $type ($old, $new) {
|
||||
if (!exists($types{$type})) {
|
||||
print STDERR "error: unrecognized export type $type.\n";
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
# if $new has a bit set that $old does not -> fail
|
||||
return !(~$types{$old} & $types{$new});
|
||||
}
|
||||
|
||||
my $kabi_errors = 0;
|
||||
sub kabi_change {
|
||||
my ($sym, $mod, $oldcrc, $newcrc) = @_;
|
||||
my ($sym, $symvers, $message) = @_;
|
||||
my $fail = 1;
|
||||
|
||||
for my $rule (@rules) {
|
||||
if ($rule->{mod} && $mod =~ $rule->{mod} ||
|
||||
$rule->{sym} && $sym =~ $rule->{sym}) {
|
||||
if ($rule->{mod} && $symvers->{mod} =~ $rule->{mod} ||
|
||||
$rule->{sym} && $sym =~ $rule->{sym} ||
|
||||
($use_namespaces && $rule->{namespace} &&
|
||||
$symvers->{namespace} =~ $rule->{namespace})) {
|
||||
$fail = $rule->{fail};
|
||||
last;
|
||||
}
|
||||
}
|
||||
return unless $fail or $opt_verbose;
|
||||
print STDERR "KABI: symbol $sym($mod) ";
|
||||
if ($newcrc) {
|
||||
print STDERR "changed crc from $oldcrc to $newcrc"
|
||||
} else {
|
||||
print STDERR "lost";
|
||||
|
||||
print STDERR "KABI: symbol $sym(mod:$symvers->{mod}";
|
||||
if ($use_namespaces && $symvers->{namespace}) {
|
||||
print STDERR " ns:$symvers->{namespace}";
|
||||
}
|
||||
print STDERR ") $message";
|
||||
if ($fail) {
|
||||
$kabi_errors++;
|
||||
print STDERR "\n";
|
||||
@@ -110,6 +176,10 @@ if (!$res || @ARGV != 2) {
|
||||
print STDERR "Usage: $0 [--rules <rules file>] Module.symvers.old Module.symvers\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Determine symvers format
|
||||
$use_namespaces = symvers_uses_namespaces($ARGV[0]);
|
||||
|
||||
if (defined($opt_rules)) {
|
||||
load_rules($opt_rules);
|
||||
}
|
||||
@@ -118,10 +188,13 @@ my %new = load_symvers($ARGV[1]);
|
||||
|
||||
for my $sym (sort keys(%old)) {
|
||||
if (!$new{$sym}) {
|
||||
kabi_change($sym, $old{$sym}->{mod}, $old{$sym}->{crc}, 0);
|
||||
kabi_change($sym, $old{$sym}, "lost");
|
||||
} elsif ($old{$sym}->{crc} ne $new{$sym}->{crc}) {
|
||||
kabi_change($sym, $new{$sym}->{mod}, $old{$sym}->{crc},
|
||||
$new{$sym}->{crc});
|
||||
kabi_change($sym, $old{$sym}, "changed crc from " .
|
||||
"$old{$sym}->{crc} to $new{$sym}->{crc}");
|
||||
} elsif (!type_compatible($old{$sym}->{type}, $new{$sym}->{type})) {
|
||||
kabi_change($sym, $old{$sym}, "changed type from " .
|
||||
"$old{$sym}->{type} to $new{$sym}->{type}");
|
||||
}
|
||||
}
|
||||
if ($kabi_errors) {
|
||||
|
||||
BIN
kabi.tar.bz2
LFS
BIN
kabi.tar.bz2
LFS
Binary file not shown.
20
kernel-binary-conflicts
Normal file
20
kernel-binary-conflicts
Normal file
@@ -0,0 +1,20 @@
|
||||
# List of old packages not compatible with this kernel
|
||||
# The kernel cannot be installed without overriding the dependency
|
||||
# Listing the packages here means that OBS cannot see them and will start the
|
||||
# build and only fail at install check. On the other hand the message from
|
||||
# install check is much more intelligible than 'package has conflict' reported
|
||||
# by OBS.
|
||||
#
|
||||
# <package> <accepatable version>
|
||||
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
sysfsutils 2.0
|
||||
apparmor-profiles 2.1.0
|
||||
apparmor-parser 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
udev 118
|
||||
lvm2 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
hyper-v 4
|
||||
# drc-info requires powerpc-utils update jsc#SLE-11054, jsc#ECO-920
|
||||
powerpc-utils 1.3.7.1
|
||||
@@ -1,881 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-@FLAVOR@
|
||||
#
|
||||
# Copyright (c) @YEAR@ SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion @SRCVERSION@
|
||||
%define patchversion @PATCHVERSION@
|
||||
%define variant @VARIANT@%{nil}
|
||||
%define vanilla_only @VANILLA_ONLY@
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor @FLAVOR@
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{@SCRIPTS@})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-@FLAVOR@
|
||||
Summary: @SUMMARY@
|
||||
Version: @RPMVERSION@
|
||||
Release: @RELEASE@
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
@PROVIDES_OBSOLETES@
|
||||
@SOURCES@
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: @ARCHS@
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
@NOSOURCE@
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
@DESCRIPTION@
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 @UNPACK_PATCHES@
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: @SUMMARY@ - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
@DESCRIPTION@
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: @SUMMARY@ - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
@DESCRIPTION@
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
40
kernel-cert-subpackage
Normal file
40
kernel-cert-subpackage
Normal file
@@ -0,0 +1,40 @@
|
||||
%package -n %{-n*}-ueficert
|
||||
Summary: UEFI Secure Boot Certificate For Package %{-n*}-kmp
|
||||
Group: System/Kernel
|
||||
Requires(pre): suse-kernel-rpm-scriptlets
|
||||
Requires(post): suse-kernel-rpm-scriptlets
|
||||
Requires: suse-kernel-rpm-scriptlets
|
||||
Requires(preun): suse-kernel-rpm-scriptlets
|
||||
Requires(postun): suse-kernel-rpm-scriptlets
|
||||
%description -n %{-n*}-ueficert
|
||||
This package contains the UEFI Secure Boot certificate used to sign
|
||||
modules in the %{-n*}-kmp packages.
|
||||
|
||||
%define run_if_exists run_if_exists() { \
|
||||
if [ -x "$1" ] ; then \
|
||||
"$@" \
|
||||
else \
|
||||
echo Cannot execute "$1" >&2 \
|
||||
fi \
|
||||
} \
|
||||
run_if_exists
|
||||
|
||||
%pre -n %{-n*}-ueficert
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/cert-pre --certs "@CERTS@" "$@"
|
||||
|
||||
%post -n %{-n*}-ueficert
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/cert-post --certs "@CERTS@" "$@"
|
||||
|
||||
%preun -n %{-n*}-ueficert
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/cert-preun --certs "@CERTS@" "$@"
|
||||
|
||||
%postun -n %{-n*}-ueficert
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/cert-postun --certs "@CERTS@" "$@"
|
||||
|
||||
%posttrans -n %{-n*}-ueficert
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/cert-posttrans --certs "@CERTS@" "$@"
|
||||
|
||||
%files -n %{-n*}-ueficert
|
||||
%defattr(-, root, root)
|
||||
%dir /etc/uefi
|
||||
/etc/uefi/certs
|
||||
27769
kernel-cubox.changes
27769
kernel-cubox.changes
File diff suppressed because it is too large
Load Diff
@@ -1,959 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-cubox
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor cubox
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-cubox
|
||||
Summary: Kernel for SolidRun Cubox
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: armv7hl
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
The standard kernel for Marvell Dove SoC, as found in
|
||||
the SolidRun Cubox.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: Kernel for SolidRun Cubox - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
The standard kernel for Marvell Dove SoC, as found in
|
||||
the SolidRun Cubox.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: Kernel for SolidRun Cubox - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
The standard kernel for Marvell Dove SoC, as found in
|
||||
the SolidRun Cubox.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
27769
kernel-debug.changes
27769
kernel-debug.changes
File diff suppressed because it is too large
Load Diff
@@ -1,962 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-debug
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor debug
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-debug
|
||||
Summary: A Debug Version of the Kernel
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
%ifarch ppc64
|
||||
Provides: kernel-kdump
|
||||
Obsoletes: kernel-kdump
|
||||
%endif
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: %ix86 ia64 ppc64 x86_64
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
This kernel has several debug facilities enabled that hurt performance.
|
||||
Only use this kernel when investigating problems.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: A Debug Version of the Kernel - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
This kernel has several debug facilities enabled that hurt performance.
|
||||
Only use this kernel when investigating problems.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: A Debug Version of the Kernel - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
This kernel has several debug facilities enabled that hurt performance.
|
||||
Only use this kernel when investigating problems.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
112
kernel-default-base.spec.txt
Normal file
112
kernel-default-base.spec.txt
Normal file
@@ -0,0 +1,112 @@
|
||||
#
|
||||
# Sample spec file using the subpackage infrastructure.
|
||||
#
|
||||
# Copyright (c) 2019 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
# needssslcertforbuild
|
||||
|
||||
# To be defined by user
|
||||
%define build_flavor default
|
||||
# variant includes dash: %%define variant -azure
|
||||
%define variant %{nil}
|
||||
%define subpackage base
|
||||
%define extrasummary base modules
|
||||
%define extradescription This package contains only the base modules, required in all installs.
|
||||
|
||||
%define misc_modules button edd iscsi_ibft i6300esb
|
||||
|
||||
%define virtio_modules virtio_blk virtio-rng virtio_console virtio-gpu \
|
||||
virtio_net virtio_scsi virtio virtio_balloon virtio_input virtio_mmio \
|
||||
virtio_pci virtio_ring
|
||||
|
||||
%define xen_modules xen-blkfront xen-kbdfront xen-netfront xen-fbfront xenblk xennet
|
||||
|
||||
%define vmware_modules vmw_balloon vmw_vmci vmxnet3 vmw_pvscsi vmw_vsock_vmci_transport
|
||||
|
||||
%define hyperv_modules hid-hyperv hv_balloon hv_utils \
|
||||
hv_vmbus hyperv-keyboard hv_netvsc hv_storvsc scsi_transport_fc hyperv_fb
|
||||
|
||||
%define net_drivers 8390 ne2k-pci tulip e100 e1000 e1000e 8139cp 8139too
|
||||
|
||||
%define scsi_modules scsi_transport_iscsi sd_mod sg sr_mod st scsi_mod
|
||||
|
||||
%define block_drivers loop dm-mod ahci ata_piix mptsas mptspi BusLogic sym53c8xx aam53c974
|
||||
|
||||
%define usb_modules usb-common usbcore ehci-hcd ehci-pci ohci-hcd ohci-pci uhci-hcd \
|
||||
xhci-hcd xhci-pci typec_ucsi ucsi_acpi typec ums-alauda ums-cypress ums-datafab \
|
||||
ums-eneub6250 ums-freecom ums-isd200 ums-jumpshot ums-karma ums-onetouch \
|
||||
ums-realtek ums-sddr09 ums-sddr55 ums-usbat usb-storage
|
||||
|
||||
%define filesystems autofs4 btrfs ext4 vfat isofs jbd2 mbcache nfsv2 nfsv3 nfsv4 overlay xfs \
|
||||
nls_cp437 nls_iso8859-1
|
||||
|
||||
%define networking tun veth bridge arp_tables arpt_mangle arptable_filter br_netfilter \
|
||||
ip_tables ipt_ECN ipt_MASQUERADE ipt_REJECT ipt_SYNPROXY ipt_ah ipt_rpfilter \
|
||||
iptable_filter iptable_mangle iptable_nat iptable_raw iptable_security \
|
||||
nf_conntrack_ipv4 nf_defrag_ipv4 nf_dup_ipv4 nf_log_arp nf_log_ipv4 nf_nat_h323 \
|
||||
nf_nat_ipv4 nf_nat_masquerade_ipv4 nf_nat_pptp nf_nat_proto_gre \
|
||||
nf_nat_snmp_basic ip6_tables ip6t_MASQUERADE ip6t_NPT ip6t_REJECT ip6t_SYNPROXY \
|
||||
ip6t_ah ip6t_eui64 ip6t_frag ip6t_hbh ip6t_ipv6header ip6t_mh ip6t_rpfilter \
|
||||
ip6t_rt ip6table_filter ip6table_mangle ip6table_nat ip6table_raw \
|
||||
ip6table_security nf_conntrack_ipv6 nf_defrag_ipv6 nf_dup_ipv6 nf_log_ipv6 \
|
||||
nf_nat_ipv6 nf_nat_masquerade_ipv6 ip_set ip_set_bitmap_ip ip_set_bitmap_ipmac \
|
||||
ip_set_bitmap_port ip_set_hash_ip ip_set_hash_ipmark ip_set_hash_ipport \
|
||||
ip_set_hash_ipportip ip_set_hash_ipportnet ip_set_hash_mac ip_set_hash_net \
|
||||
ip_set_hash_netiface ip_set_hash_netnet ip_set_hash_netport \
|
||||
ip_set_hash_netportnet ip_set_list_set nf_conntrack nf_conntrack_amanda \
|
||||
nf_conntrack_broadcast nf_conntrack_ftp nf_conntrack_h323 nf_conntrack_irc \
|
||||
nf_conntrack_netbios_ns nf_conntrack_netlink nf_conntrack_pptp \
|
||||
nf_conntrack_proto_gre nf_conntrack_sane nf_conntrack_sip nf_conntrack_slp \
|
||||
nf_conntrack_snmp nf_conntrack_tftp nf_log_common nf_nat nf_nat_amanda \
|
||||
nf_nat_ftp nf_nat_irc nf_nat_redirect nf_nat_sip nf_nat_tftp nf_synproxy_core \
|
||||
nfnetlink nfnetlink_acct nfnetlink_cthelper nfnetlink_cttimeout nfnetlink_log \
|
||||
nfnetlink_queue x_tables xt_AUDIT xt_CHECKSUM xt_CLASSIFY xt_CONNSECMARK xt_CT \
|
||||
xt_DSCP xt_HL xt_HMARK xt_IDLETIMER xt_LED xt_LOG xt_NETMAP xt_NFLOG xt_NFQUEUE \
|
||||
xt_RATEEST xt_REDIRECT xt_SECMARK xt_TCPMSS xt_TCPOPTSTRIP xt_TEE xt_TPROXY \
|
||||
xt_TRACE xt_addrtype xt_bpf xt_cgroup xt_cluster xt_comment xt_connbytes \
|
||||
xt_connlabel xt_connlimit xt_connmark xt_conntrack xt_cpu xt_dccp xt_devgroup \
|
||||
xt_dscp xt_ecn xt_esp xt_hashlimit xt_helper xt_hl xt_ipcomp xt_iprange xt_l2tp \
|
||||
xt_length xt_limit xt_mac xt_mark xt_multiport xt_nat xt_nfacct xt_osf xt_owner \
|
||||
xt_physdev xt_pkttype xt_policy xt_quota xt_rateest xt_realm xt_recent xt_sctp \
|
||||
xt_set xt_socket xt_state xt_statistic xt_string xt_tcpmss xt_tcpudp xt_time \
|
||||
xt_u32 af_packet
|
||||
|
||||
%define modules %usb_modules %net_drivers %scsi_modules %block_drivers \
|
||||
%hyperv_modules %virtio_modules %vmware_modules %xen_modules \
|
||||
%networking %filesystems %misc_modules
|
||||
|
||||
# Reasonable defaults that might be overriden if needed
|
||||
%define kernel_package_name kernel-%build_flavor
|
||||
%define package_name %kernel_package_name-%subpackage
|
||||
%define url %(rpm -q --qf '%%{URL}' %kernel_package_name)
|
||||
%define group %(rpm -q --qf '%%{GROUP}' %kernel_package_name)
|
||||
%define summary %(rpm -q --qf '%%{SUMMARY}' %kernel_package_name) - %extrasummary
|
||||
|
||||
Name: %package_name
|
||||
BuildRequires: %kernel_package_name
|
||||
BuildRequires: %kernel_package_name-devel
|
||||
BuildRequires: kernel-subpackage-macros
|
||||
Summary: %summary
|
||||
URL: %url
|
||||
Group: %group
|
||||
License: GPL-2.0-only
|
||||
|
||||
# Internal stuff begins
|
||||
%define rpm_kver %(rpm -q --qf '%%{VERSION}' %kernel_package_name)
|
||||
%define rpm_krel %(rpm -q --qf '%%{RELEASE}' %kernel_package_name)
|
||||
Version: %rpm_kver
|
||||
Release: %rpm_krel.<RELEASE>
|
||||
|
||||
%define scriptdir /usr/lib/rpm/kernel
|
||||
%include %scriptdir/kernel-subpackage-spec
|
||||
299140
kernel-default.changes
299140
kernel-default.changes
File diff suppressed because it is too large
Load Diff
2312
kernel-default.spec
2312
kernel-default.spec
File diff suppressed because it is too large
Load Diff
27769
kernel-desktop.changes
27769
kernel-desktop.changes
File diff suppressed because it is too large
Load Diff
@@ -1,995 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-desktop
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor desktop
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-desktop
|
||||
Summary: Kernel optimized for the desktop
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: %ix86 x86_64
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
This kernel is optimized for the desktop. It is configured for lower latency
|
||||
and has many of the features that aren't usually used on desktop machines
|
||||
disabled.
|
||||
|
||||
%ifarch %ix86
|
||||
This kernel supports up to 64GB of main memory. It requires Physical
|
||||
Addressing Extensions (PAE), which were introduced with the Pentium Pro
|
||||
processor.
|
||||
|
||||
PAE is not only more physical address space but also important for the
|
||||
"no execute" feature which disables execution of code that is marked as
|
||||
non-executable. Therefore, the PAE kernel should be used on any systems
|
||||
that support it, regardless of the amount of main memory.
|
||||
%endif
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: Kernel optimized for the desktop - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
This kernel is optimized for the desktop. It is configured for lower latency
|
||||
and has many of the features that aren't usually used on desktop machines
|
||||
disabled.
|
||||
|
||||
%ifarch %ix86
|
||||
This kernel supports up to 64GB of main memory. It requires Physical
|
||||
Addressing Extensions (PAE), which were introduced with the Pentium Pro
|
||||
processor.
|
||||
|
||||
PAE is not only more physical address space but also important for the
|
||||
"no execute" feature which disables execution of code that is marked as
|
||||
non-executable. Therefore, the PAE kernel should be used on any systems
|
||||
that support it, regardless of the amount of main memory.
|
||||
%endif
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: Kernel optimized for the desktop - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
This kernel is optimized for the desktop. It is configured for lower latency
|
||||
and has many of the features that aren't usually used on desktop machines
|
||||
disabled.
|
||||
|
||||
%ifarch %ix86
|
||||
This kernel supports up to 64GB of main memory. It requires Physical
|
||||
Addressing Extensions (PAE), which were introduced with the Pentium Pro
|
||||
processor.
|
||||
|
||||
PAE is not only more physical address space but also important for the
|
||||
"no execute" feature which disables execution of code that is marked as
|
||||
non-executable. Therefore, the PAE kernel should be used on any systems
|
||||
that support it, regardless of the amount of main memory.
|
||||
%endif
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
299140
kernel-docs.changes
299140
kernel-docs.changes
File diff suppressed because it is too large
Load Diff
316
kernel-docs.spec
316
kernel-docs.spec
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package kernel-docs
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -12,86 +12,272 @@
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
%define patchversion 3.8.2
|
||||
%define srcversion 4.12
|
||||
%define patchversion 4.12.14
|
||||
%define git_commit 5725decbef8de98414e5d1eea61d668325003e24
|
||||
%define variant %{nil}
|
||||
%define build_html 1
|
||||
%define build_pdf 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,group-source-files.pl,split-modules,modversions,kabi.pl,arch-symbols,check-module-license,splitflist,mergedep,moddep,modflist,kernel-subpackage-build})
|
||||
|
||||
Name: kernel-docs
|
||||
Summary: Kernel Documentation
|
||||
Version: 3.8.2
|
||||
Version: 4.12.14
|
||||
%if 0%{?is_kotd}
|
||||
Release: <RELEASE>.g5725dec
|
||||
%else
|
||||
Release: 0
|
||||
BuildRequires: docbook-toys docbook-utils ghostscript_any libjpeg-devel texlive transfig xmlto xorg-x11-devel
|
||||
BuildRequires: kernel-source%variant
|
||||
Url: http://www.kernel.org/
|
||||
License: GPL-2.0
|
||||
%endif
|
||||
Summary: Kernel Documentation
|
||||
License: GPL-2.0-only
|
||||
Group: Documentation/Man
|
||||
Provides: %name = %version-%source_rel
|
||||
URL: https://www.kernel.org/
|
||||
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
|
||||
BuildRequires: bash-sh
|
||||
%endif
|
||||
# TW (4.13 or later) no longer needs xmlto
|
||||
%if 0%{?sle_version}
|
||||
BuildRequires: xmlto
|
||||
%endif
|
||||
%if %build_pdf || %build_html
|
||||
# ReST handling
|
||||
BuildRequires: ImageMagick
|
||||
BuildRequires: graphviz
|
||||
BuildRequires: graphviz-gd
|
||||
BuildRequires: graphviz-gnome
|
||||
%if ! 0%{?suse_version} || 0%{?suse_version} > 1500
|
||||
BuildRequires: python3-base
|
||||
BuildRequires: python3-PyYAML
|
||||
BuildRequires: python3-Sphinx
|
||||
BuildRequires: texlive-amscls
|
||||
%else
|
||||
%if 0%{?suse_version} && 0%{?suse_version} < 1500
|
||||
BuildRequires: python-packaging
|
||||
BuildRequires: python-six
|
||||
BuildRequires: python-Sphinx
|
||||
%else
|
||||
BuildRequires: python3-base
|
||||
BuildRequires: python3-Sphinx < 3
|
||||
%endif
|
||||
%endif
|
||||
BuildRequires: texlive-anyfontsize
|
||||
%if %build_pdf
|
||||
%if 0%{?suse_version} && 0%{?suse_version} < 1500
|
||||
BuildRequires: python-Sphinx-latex
|
||||
%else
|
||||
BuildRequires: python3-base
|
||||
BuildRequires: python3-Sphinx-latex
|
||||
%endif
|
||||
BuildRequires: texlive-adjustbox
|
||||
BuildRequires: texlive-dejavu
|
||||
BuildRequires: texlive-dejavu-fonts
|
||||
BuildRequires: texlive-glyphlist
|
||||
BuildRequires: texlive-makeindex
|
||||
BuildRequires: texlive-varwidth
|
||||
BuildRequires: texlive-xetex
|
||||
BuildRequires: texlive-zapfding
|
||||
%endif
|
||||
%endif
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Source: kernel-spec-macros
|
||||
Source0: https://www.kernel.org/pub/linux/kernel/v4.x/linux-%srcversion.tar.xz
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source19: kernel-binary-conflicts
|
||||
Source20: obsolete-kmps
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source35: group-source-files.pl
|
||||
Source36: README.PATCH-POLICY.SUSE
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source40: source-timestamp
|
||||
Source46: split-modules
|
||||
Source47: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source52: kernel-source%variant.changes
|
||||
Source57: kernel-cert-subpackage
|
||||
Source60: config.sh
|
||||
Source63: arch-symbols
|
||||
Source65: kernel-spec-macros
|
||||
Source75: release-projects
|
||||
Source76: check-module-license
|
||||
Source78: modules.fips
|
||||
Source79: splitflist
|
||||
Source80: mergedep
|
||||
Source81: moddep
|
||||
Source82: modflist
|
||||
Source83: kernel-subpackage-build
|
||||
Source84: kernel-subpackage-spec
|
||||
Source85: kernel-default-base.spec.txt
|
||||
Source86: old_changelog.txt
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source114: patches.drm.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 3
|
||||
NoSource: 14
|
||||
NoSource: 16
|
||||
NoSource: 17
|
||||
NoSource: 19
|
||||
NoSource: 20
|
||||
NoSource: 21
|
||||
NoSource: 23
|
||||
NoSource: 33
|
||||
NoSource: 35
|
||||
NoSource: 36
|
||||
NoSource: 37
|
||||
NoSource: 38
|
||||
NoSource: 40
|
||||
NoSource: 46
|
||||
NoSource: 47
|
||||
NoSource: 48
|
||||
NoSource: 49
|
||||
NoSource: 50
|
||||
NoSource: 52
|
||||
NoSource: 57
|
||||
NoSource: 60
|
||||
NoSource: 63
|
||||
NoSource: 65
|
||||
NoSource: 75
|
||||
NoSource: 76
|
||||
NoSource: 78
|
||||
NoSource: 79
|
||||
NoSource: 80
|
||||
NoSource: 81
|
||||
NoSource: 82
|
||||
NoSource: 83
|
||||
NoSource: 84
|
||||
NoSource: 85
|
||||
NoSource: 86
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 113
|
||||
NoSource: 114
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
Provides: %name = %version-%source_rel
|
||||
Provides: %name-srchash-%git_commit
|
||||
|
||||
%description
|
||||
These are the PDF documents and man pages (section 9) built from
|
||||
thecurrent kernel sources.
|
||||
|
||||
|
||||
A few basic documents from the current kernel sources.
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
cp -av /etc/texmf/web2c/texmf.cnf .
|
||||
cat << EOF >> texmf.cnf
|
||||
main_memory.pdfjadetex = 2500000
|
||||
hash_extra.pdfjadetex = 70000
|
||||
max_strings.pdfjadetex = 120000
|
||||
save_size.pdfjadetex = 10000
|
||||
EOF
|
||||
%setup -T -c
|
||||
|
||||
%build
|
||||
# use texmf.cnf from local source
|
||||
export TEXMFCNF=$RPM_BUILD_DIR
|
||||
export LANG=en_US
|
||||
make -C /usr/src/linux%variant O=$PWD -k -i mandocs %{?jobs:-j%jobs}
|
||||
make -C /usr/src/linux%variant O=$PWD -k -i pdfdocs %{?jobs:-j%jobs}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
install -d $RPM_BUILD_ROOT/%{_mandir}/man9
|
||||
# filter out obscure device drivers - they clutter up the rpm and don't add any real value
|
||||
find Documentation/DocBook/ -name '*.9.gz' |
|
||||
egrep -v 'man/(sis[69]|rio|fsl|struct_rio|RIO|mpc85|set_rx_mode|mdio_(read|write)|mii_ioctl|mca_|z8530|nand|sppp|piix|(read|write)_zs)' |
|
||||
while read i ; do
|
||||
cp $i $RPM_BUILD_ROOT/%{_mandir}/man9
|
||||
done
|
||||
install -d $RPM_BUILD_ROOT/usr/share/doc/kernel
|
||||
cp -a Documentation/DocBook/*.pdf $RPM_BUILD_ROOT/usr/share/doc/kernel || true
|
||||
if [ -d Documentation/kdb ] ; then
|
||||
for i in Documentation/kdb/*.m* ; do
|
||||
k=`basename $i`
|
||||
k=${k/man/9}
|
||||
k=${k/mm/9}
|
||||
cp $i $RPM_BUILD_ROOT/%{_mandir}/man9/$k
|
||||
done
|
||||
fi
|
||||
|
||||
ln -s /usr/share/man/man9/request_threaded_irq.9.gz $RPM_BUILD_ROOT/usr/share/man/man9/request_irq.9.gz
|
||||
|
||||
cp -a /usr/src/linux%variant/{COPYING,CREDITS,MAINTAINERS,README,REPORTING-BUGS} .
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc COPYING CREDITS MAINTAINERS README REPORTING-BUGS
|
||||
%{_mandir}/man9/*
|
||||
%docdir /usr/share/doc/kernel
|
||||
/usr/share/doc/kernel
|
||||
%if 0%{?suse_version} && 0%{?suse_version} < 1500
|
||||
%doc COPYING
|
||||
%else
|
||||
%license COPYING
|
||||
%endif
|
||||
%doc CREDITS MAINTAINERS README
|
||||
%doc old_changelog.txt
|
||||
|
||||
%if %build_pdf
|
||||
%package pdf
|
||||
Summary: Kernel Documentation (PDF)
|
||||
Group: Documentation/Other
|
||||
|
||||
%description pdf
|
||||
These are PDF documents built from the current kernel sources.
|
||||
|
||||
%source_timestamp
|
||||
|
||||
%files pdf
|
||||
%dir %{_datadir}/doc/kernel
|
||||
%docdir %{_datadir}/doc/kernel/pdf
|
||||
%{_datadir}/doc/kernel/pdf
|
||||
%endif
|
||||
|
||||
%if %build_html
|
||||
%package html
|
||||
Summary: Kernel Documentation (HTML)
|
||||
Group: Documentation/HTML
|
||||
|
||||
%description html
|
||||
These are HTML documents built from the current kernel sources.
|
||||
|
||||
%source_timestamp
|
||||
|
||||
%files html
|
||||
%dir %{_datadir}/doc/kernel
|
||||
%docdir %{_datadir}/doc/kernel/html
|
||||
%{_datadir}/doc/kernel/html
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 108 -a 109 -a 110 -a 111 -a 113 -a 114 -a 120 -a 121
|
||||
cp -a linux-%srcversion/{COPYING,CREDITS,MAINTAINERS,README} .
|
||||
cp %_sourcedir/old_changelog.txt .
|
||||
cd linux-%srcversion
|
||||
%_sourcedir/apply-patches %_sourcedir/series.conf %my_builddir %symbols
|
||||
|
||||
%build
|
||||
# for reproducible builds (bsc#1238303)
|
||||
export PARALLELISM=1
|
||||
cd linux-%srcversion
|
||||
export LANG=en_US.utf8
|
||||
%if %build_html
|
||||
mkdir -p html
|
||||
make %{?make_arg} O=$PWD/html \
|
||||
%if ! 0%{?suse_version} || 0%{?suse_version} >= 1500
|
||||
PYTHON=python3 \
|
||||
%endif
|
||||
htmldocs
|
||||
%endif
|
||||
%if %build_pdf
|
||||
mkdir -p pdf
|
||||
make %{?make_arg} O=$PWD/pdf \
|
||||
%if ! 0%{?suse_version} || 0%{?suse_version} >= 1500
|
||||
PYTHON=python3 \
|
||||
%endif
|
||||
pdfdocs
|
||||
%endif
|
||||
|
||||
%install
|
||||
cd linux-%srcversion
|
||||
%if %build_html
|
||||
install -d %{buildroot}%{_datadir}/doc/kernel/html/rst
|
||||
cp -a html/Documentation/output/* %{buildroot}%{_datadir}/doc/kernel/html/rst || true
|
||||
%endif
|
||||
|
||||
%if %build_pdf
|
||||
install -d %{buildroot}%{_datadir}/doc/kernel/pdf
|
||||
for i in pdf/Documentation/output/latex/*.pdf; do
|
||||
cp -a $i %{buildroot}%{_datadir}/doc/kernel/pdf
|
||||
done
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-docs@VARIANT@
|
||||
#
|
||||
# Copyright (c) @YEAR@ SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
%define patchversion @PATCHVERSION@
|
||||
%define variant @VARIANT@%{nil}
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
Name: kernel-docs@VARIANT@
|
||||
Summary: Kernel Documentation
|
||||
Version: @RPMVERSION@
|
||||
Release: @RELEASE@
|
||||
BuildRequires: docbook-toys docbook-utils ghostscript_any libjpeg-devel texlive transfig xmlto xorg-x11-devel
|
||||
BuildRequires: kernel-source%variant
|
||||
Url: http://www.kernel.org/
|
||||
License: GPL-2.0
|
||||
Group: Documentation/Man
|
||||
Provides: %name = %version-%source_rel
|
||||
BuildArch: noarch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Source: kernel-spec-macros
|
||||
|
||||
%description
|
||||
These are the PDF documents and man pages (section 9) built from
|
||||
thecurrent kernel sources.
|
||||
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
cp -av /etc/texmf/web2c/texmf.cnf .
|
||||
cat << EOF >> texmf.cnf
|
||||
main_memory.pdfjadetex = 2500000
|
||||
hash_extra.pdfjadetex = 70000
|
||||
max_strings.pdfjadetex = 120000
|
||||
save_size.pdfjadetex = 10000
|
||||
EOF
|
||||
%setup -T -c
|
||||
|
||||
%build
|
||||
# use texmf.cnf from local source
|
||||
export TEXMFCNF=$RPM_BUILD_DIR
|
||||
export LANG=en_US
|
||||
make -C /usr/src/linux%variant O=$PWD -k -i mandocs %{?jobs:-j%jobs}
|
||||
make -C /usr/src/linux%variant O=$PWD -k -i pdfdocs %{?jobs:-j%jobs}
|
||||
|
||||
%install
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
install -d $RPM_BUILD_ROOT/%{_mandir}/man9
|
||||
# filter out obscure device drivers - they clutter up the rpm and don't add any real value
|
||||
find Documentation/DocBook/ -name '*.9.gz' |
|
||||
egrep -v 'man/(sis[69]|rio|fsl|struct_rio|RIO|mpc85|set_rx_mode|mdio_(read|write)|mii_ioctl|mca_|z8530|nand|sppp|piix|(read|write)_zs)' |
|
||||
while read i ; do
|
||||
cp $i $RPM_BUILD_ROOT/%{_mandir}/man9
|
||||
done
|
||||
install -d $RPM_BUILD_ROOT/usr/share/doc/kernel
|
||||
cp -a Documentation/DocBook/*.pdf $RPM_BUILD_ROOT/usr/share/doc/kernel || true
|
||||
if [ -d Documentation/kdb ] ; then
|
||||
for i in Documentation/kdb/*.m* ; do
|
||||
k=`basename $i`
|
||||
k=${k/man/9}
|
||||
k=${k/mm/9}
|
||||
cp $i $RPM_BUILD_ROOT/%{_mandir}/man9/$k
|
||||
done
|
||||
fi
|
||||
|
||||
ln -s /usr/share/man/man9/request_threaded_irq.9.gz $RPM_BUILD_ROOT/usr/share/man/man9/request_irq.9.gz
|
||||
|
||||
cp -a /usr/src/linux%variant/{COPYING,CREDITS,MAINTAINERS,README,REPORTING-BUGS} .
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%doc COPYING CREDITS MAINTAINERS README REPORTING-BUGS
|
||||
%{_mandir}/man9/*
|
||||
%docdir /usr/share/doc/kernel
|
||||
/usr/share/doc/kernel
|
||||
|
||||
%changelog
|
||||
27769
kernel-ec2.changes
27769
kernel-ec2.changes
File diff suppressed because it is too large
Load Diff
965
kernel-ec2.spec
965
kernel-ec2.spec
@@ -1,965 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-ec2
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor ec2
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-ec2
|
||||
Summary: The Amazon EC2 Xen Kernel
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: %ix86 x86_64
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
The Linux kernel for Xen paravirtualization.
|
||||
|
||||
This kernel can only be used both as an unprivileged ("xenU")
|
||||
kernel (for Amazon EC2).
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: The Amazon EC2 Xen Kernel - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
The Linux kernel for Xen paravirtualization.
|
||||
|
||||
This kernel can only be used both as an unprivileged ("xenU")
|
||||
kernel (for Amazon EC2).
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: The Amazon EC2 Xen Kernel - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
The Linux kernel for Xen paravirtualization.
|
||||
|
||||
This kernel can only be used both as an unprivileged ("xenU")
|
||||
kernel (for Amazon EC2).
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
27769
kernel-exynos.changes
27769
kernel-exynos.changes
File diff suppressed because it is too large
Load Diff
@@ -1,956 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-exynos
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor exynos
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-exynos
|
||||
Summary: Kernel for Samsung's Exynos SoC
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: armv7hl
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
The standard kernel for Samsung's Exynos 4 & 5 SoC, as found in the Origen board.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: Kernel for Samsung's Exynos SoC - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
The standard kernel for Samsung's Exynos 4 & 5 SoC, as found in the Origen board.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: Kernel for Samsung's Exynos SoC - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
The standard kernel for Samsung's Exynos 4 & 5 SoC, as found in the Origen board.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
27769
kernel-imx51.changes
27769
kernel-imx51.changes
File diff suppressed because it is too large
Load Diff
@@ -1,959 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-imx51
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor imx51
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-imx51
|
||||
Summary: Kernel for Freescale's iMX SoC
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: armv7hl
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
The standard kernel for Freescale's i.MX51 SoC, as found in
|
||||
devices like the Genesi EfikaMX family.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: Kernel for Freescale's iMX SoC - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
The standard kernel for Freescale's i.MX51 SoC, as found in
|
||||
devices like the Genesi EfikaMX family.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: Kernel for Freescale's iMX SoC - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
The standard kernel for Freescale's i.MX51 SoC, as found in
|
||||
devices like the Genesi EfikaMX family.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
277185
kernel-kvmsmall.changes
Normal file
277185
kernel-kvmsmall.changes
Normal file
File diff suppressed because it is too large
Load Diff
1987
kernel-kvmsmall.spec
Normal file
1987
kernel-kvmsmall.spec
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,6 @@
|
||||
%package -n %{-n*}-%1
|
||||
%define _this_kmp_version %{-v*}_k%(echo %2 | sed -r 'y/-/_/; s/^(2\.6\.[0-9]+)_/\\1.0_/; # use 2.6.x.0 for mainline kernels')
|
||||
%package -n %{-n*}-kmp-%1
|
||||
%define _this_kmp_kernel_version k%(echo %2 | sed -r 'y/-/_/')
|
||||
%define _this_kmp_version %{-v*}_%_this_kmp_kernel_version
|
||||
Version: %_this_kmp_version
|
||||
Release: %{-r*}
|
||||
%(
|
||||
@@ -8,7 +9,7 @@ for spec in {%_sourcedir,%_specdir}/%name.spec /dev/null; do
|
||||
done
|
||||
awk '
|
||||
BEGIN { tags["summary"] = "Summary: %summary"
|
||||
tags["group"] = "Group: %group" }
|
||||
tags["group"] = "" }
|
||||
/^%%/ { in_pkg_header = \
|
||||
($0 ~ /^%%package[ \t]+KMP[ \t]*$/ ||
|
||||
$0 ~ /^%%package[ \t]+-n[ \t]*%name-KMP[ \t]*$/)
|
||||
@@ -17,17 +18,36 @@ in_pkg_header && /^(Summary|Group):[ \t]*/ \
|
||||
{ tag = tolower($1) ; sub(/:$/, "", tag)
|
||||
tags[tag] = $0 }
|
||||
END { print tags["summary"]
|
||||
print tags["group"] }
|
||||
if ( tags["group"] != "" ) print tags["group"] }
|
||||
' $spec
|
||||
)
|
||||
Provides: %{-n*} = %_this_kmp_version
|
||||
Provides: %{-n*} = %{-v*}
|
||||
Provides: %{-n*}-kmp = %_this_kmp_version
|
||||
Provides: %{-n*}-kmp = %{-v*}
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{-n*}-kmp-%1-%_this_kmp_kernel_version
|
||||
Requires: coreutils grep
|
||||
Requires(pre): suse-kernel-rpm-scriptlets
|
||||
Requires(post): suse-kernel-rpm-scriptlets
|
||||
Requires: suse-kernel-rpm-scriptlets
|
||||
Requires(preun): suse-kernel-rpm-scriptlets
|
||||
Requires(postun): suse-kernel-rpm-scriptlets
|
||||
%{-c:Requires: %{-n*}-ueficert}
|
||||
Enhances: kernel-%1
|
||||
Supplements: packageand(kernel-%1:%{-n*})
|
||||
Conflicts: %{-n*}-kmp-%1-%_this_kmp_kernel_version
|
||||
AutoReqProv: on
|
||||
|
||||
%define run_if_exists run_if_exists() { \
|
||||
if [ -x "$1" ] ; then \
|
||||
"$@" \
|
||||
else \
|
||||
echo Cannot execute "$1" >&2 \
|
||||
fi \
|
||||
} \
|
||||
run_if_exists
|
||||
|
||||
%{-p:%{expand:%(cd %_sourcedir; cat %{-p*})}}
|
||||
%description -n %{-n*}-%1
|
||||
%description -n %{-n*}-kmp-%1
|
||||
%(
|
||||
for spec in {%_sourcedir,%_specdir}/%name.spec /dev/null; do
|
||||
[ -e $spec ] && break
|
||||
@@ -49,28 +69,32 @@ in_desc { print; good = 1 }
|
||||
END { exit(! good) }
|
||||
' $spec
|
||||
)
|
||||
%post -n %{-n*}-%1
|
||||
nvr=%{-n*}-%1-%_this_kmp_version-%{-r*}
|
||||
wm2=/usr/lib/module-init-tools/weak-modules2
|
||||
if [ -x $wm2 ]; then
|
||||
%{-b:KMP_NEEDS_MKINITRD=1} /bin/bash -${-/e/} $wm2 --add-kmp $nvr
|
||||
fi
|
||||
%preun -n %{-n*}-%1
|
||||
nvr=%{-n*}-%1-%_this_kmp_version-%{-r*}
|
||||
rpm -ql $nvr | sed -n '/\.ko$/p' > /var/run/rpm-$nvr-modules
|
||||
%postun -n %{-n*}-%1
|
||||
nvr=%{-n*}-%1-%_this_kmp_version-%{-r*}
|
||||
modules=( $(cat /var/run/rpm-$nvr-modules) )
|
||||
rm -f /var/run/rpm-$nvr-modules
|
||||
if [ ${#modules[*]} = 0 ]; then
|
||||
echo "WARNING: $nvr does not contain any kernel modules" >&2
|
||||
exit 0
|
||||
fi
|
||||
wm2=/usr/lib/module-init-tools/weak-modules2
|
||||
if [ -x $wm2 ]; then
|
||||
printf '%s\n' "${modules[@]}" | /bin/bash -${-/e/} $wm2 --remove-kmp $nvr
|
||||
fi
|
||||
%files -n %{-n*}-%1
|
||||
%pre -n %{-n*}-kmp-%1
|
||||
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-pre --name "%{-n*}-kmp-%1" \
|
||||
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
||||
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
||||
%post -n %{-n*}-kmp-%1
|
||||
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-post --name "%{-n*}-kmp-%1" \
|
||||
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
||||
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
||||
%preun -n %{-n*}-kmp-%1
|
||||
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-preun --name "%{-n*}-kmp-%1" \
|
||||
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
||||
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
||||
%postun -n %{-n*}-kmp-%1
|
||||
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-postun --name "%{-n*}-kmp-%1" \
|
||||
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
||||
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
||||
%posttrans -n %{-n*}-kmp-%1
|
||||
%{-b:KMP_NEEDS_MKINITRD=1; export KMP_NEEDS_MKINITRD}
|
||||
%run_if_exists /usr/lib/module-init-tools/kernel-scriptlets/kmp-posttrans --name "%{-n*}-kmp-%1" \
|
||||
--version "%_this_kmp_version" --release "%{-r*}" --kernelrelease "%2" \
|
||||
--flavor "%1" --usrmerged "%{usrmerged}" "$@"
|
||||
%files -n %{-n*}-kmp-%1
|
||||
%{-f:%{expand:%(cd %_sourcedir; cat %{-f*})}}
|
||||
%{!-f:%defattr (-,root,root)}
|
||||
%{!-f:/lib/modules/%2-%1}
|
||||
%{!-f:%{kernel_module_directory}/%2-%1}
|
||||
|
||||
277185
kernel-obs-build.changes
Normal file
277185
kernel-obs-build.changes
Normal file
File diff suppressed because it is too large
Load Diff
183
kernel-obs-build.spec
Normal file
183
kernel-obs-build.spec
Normal file
@@ -0,0 +1,183 @@
|
||||
#
|
||||
# spec file for package kernel-obs-build
|
||||
#
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
# needsrootforbuild
|
||||
|
||||
|
||||
#!BuildIgnore: post-build-checks
|
||||
|
||||
%define patchversion 4.12.14
|
||||
%define variant %{nil}
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%if 0%{?suse_version}
|
||||
%if "%{nil}"
|
||||
%global kernel_flavor %{nil}
|
||||
%else
|
||||
%ifarch %ix86
|
||||
%global kernel_flavor -pae
|
||||
%else
|
||||
%ifarch armv7l armv7hl
|
||||
%global kernel_flavor -lpae
|
||||
%else
|
||||
%global kernel_flavor -default
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
%global kernel_package kernel%kernel_flavor-srchash-5725decbef8de98414e5d1eea61d668325003e24
|
||||
%endif
|
||||
%if 0%{?rhel_version}
|
||||
%global kernel_package kernel
|
||||
%endif
|
||||
|
||||
Name: kernel-obs-build
|
||||
Version: 4.12.14
|
||||
%if 0%{?is_kotd}
|
||||
Release: <RELEASE>.g5725dec
|
||||
%else
|
||||
Release: 0
|
||||
%endif
|
||||
Summary: package kernel and initrd for OBS VM builds
|
||||
License: GPL-2.0-only
|
||||
Group: SLES
|
||||
Provides: kernel-obs-build-srchash-5725decbef8de98414e5d1eea61d668325003e24
|
||||
BuildRequires: coreutils
|
||||
BuildRequires: device-mapper
|
||||
BuildRequires: dracut
|
||||
BuildRequires: %kernel_package
|
||||
BuildRequires: util-linux
|
||||
%if 0%{?suse_version} > 1550 || 0%{?sle_version} > 150200
|
||||
BuildRequires: zstd
|
||||
%endif
|
||||
ExclusiveArch: aarch64 ppc64le s390x x86_64
|
||||
|
||||
%description
|
||||
This package is repackaging already compiled kernels to make them usable
|
||||
inside of Open Build Service (OBS) VM builds. An initrd with some basic
|
||||
kernel modules is generated as well, but further kernel modules can be
|
||||
loaded during build when installing the kernel package.
|
||||
|
||||
%files
|
||||
/.build.cmdline.*
|
||||
/.build.console.*
|
||||
/.build.hostarch.*
|
||||
/.build.initrd.*
|
||||
/.build.kernel.*
|
||||
|
||||
%prep
|
||||
|
||||
%build
|
||||
# set 'date of last password change' to a static value (bsc#1189305)
|
||||
sed -i 's/^\(root:\*:\)[1-9][0-9]*\(::::::\)/\142\2/' /etc/shadow
|
||||
mkdir -p /usr/lib/dracut/modules.d/80obs
|
||||
cat > /usr/lib/dracut/modules.d/80obs/module-setup.sh <<EOF
|
||||
#!/bin/bash
|
||||
|
||||
# called by dracut
|
||||
check() {
|
||||
return 0
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
installkernel() {
|
||||
hostonly='' instmods obs
|
||||
}
|
||||
|
||||
# called by dracut
|
||||
install() {
|
||||
inst_hook pre-udev 10 "\$moddir"/setup_obs.sh
|
||||
}
|
||||
EOF
|
||||
chmod a+rx /usr/lib/dracut/modules.d/80obs/module-setup.sh
|
||||
cat > /usr/lib/dracut/modules.d/80obs/setup_obs.sh <<EOF
|
||||
#!/bin/sh
|
||||
info "Loading kernel modules for OBS"
|
||||
info " Loop..."
|
||||
modprobe -q loop max_loop=64
|
||||
info " binfmt misc..."
|
||||
modprobe -q binfmt_misc
|
||||
EOF
|
||||
chmod a+rx /usr/lib/dracut/modules.d/80obs/setup_obs.sh
|
||||
# Configure systemd in kernel-obs-build's initrd not to limit TasksMax,
|
||||
# we run with build as PID 1 (boo#965564)
|
||||
echo "DefaultTasksMax=infinity" >> /etc/systemd/system.conf
|
||||
echo "DefaultTasksAccounting=no" >> /etc/systemd/system.conf
|
||||
echo 127.0.0.1 localhost > /etc/hosts # omit build-machine host name (boo#1084909)
|
||||
|
||||
# a longer list to have them also available for qemu cross builds where x86_64 kernel runs in eg. arm env.
|
||||
# this list of modules where available on build workers of build.opensuse.org, so we stay compatible.
|
||||
export KERNEL_MODULES="
|
||||
loop dm-crypt essiv dm-mod dm-snapshot binfmt-misc fuse kqemu squashfs ext2 ext3 ext4 btrfs
|
||||
xfs nf_conntrack_ipv6 binfmt_misc virtio_pci virtio_mmio virtio_blk virtio_rng fat vfat
|
||||
nls_cp437 nls_iso8859-1 ibmvscsi sd_mod e1000 ibmveth overlay 9p 9pnet_virtio qemu_fw_cfg
|
||||
algif_hash aegis128 xts bridge br_netfilter nf_nat nf_tables xt_conntrack iptable_nat iptable_filter
|
||||
iso9660"
|
||||
|
||||
# manually load all modules to make sure they're available
|
||||
for i in $KERNEL_MODULES; do
|
||||
(
|
||||
echo "info ' $i'"
|
||||
echo "modprobe -q $i"
|
||||
) >> /usr/lib/dracut/modules.d/80obs/setup_obs.sh
|
||||
done
|
||||
|
||||
ROOT=""
|
||||
[ -e "/dev/vda" ] && ROOT="-d /dev/vda"
|
||||
[ -e /dev/hda1 ] && ROOT="-d /dev/hda1" # for xen builds
|
||||
%define kernel_name vmlinu?
|
||||
%ifarch s390 s390x
|
||||
%define kernel_name image
|
||||
%endif
|
||||
%ifarch %arm
|
||||
%define kernel_name zImage
|
||||
%endif
|
||||
%ifarch aarch64 riscv64
|
||||
%define kernel_name Image
|
||||
%endif
|
||||
|
||||
# --host-only mode is needed for unlimited TasksMax workaround (boo#965564)
|
||||
dracut --reproducible --host-only --no-hostonly-cmdline \
|
||||
--no-early-microcode --nofscks --strip --hardlink \
|
||||
--drivers="$KERNEL_MODULES" --force /tmp/initrd.kvm \
|
||||
%if 0%{?suse_version} > 1550 || 0%{?sle_version} > 150200
|
||||
--compress "zstd -19 -T0" \
|
||||
%endif
|
||||
$(echo /boot/%{kernel_name}-*%{kernel_flavor} | sed -n -e 's,[^-]*-\(.*'%{kernel_flavor}'\),\1,p')
|
||||
|
||||
#cleanup
|
||||
rm -rf /usr/lib/dracut/modules.d/80obs
|
||||
|
||||
%install
|
||||
install -d -m 0755 %{buildroot}
|
||||
cp -v /boot/%{kernel_name}-*%{kernel_flavor} %{buildroot}/.build.kernel.kvm
|
||||
cp -v /tmp/initrd.kvm %{buildroot}/.build.initrd.kvm
|
||||
|
||||
# inform worker kernel parameters to invoke
|
||||
CMDLINE="elevator=noop nmi_watchdog=0 rw ia32_emulation=1"
|
||||
echo "$CMDLINE" > %{buildroot}/.build.cmdline.kvm
|
||||
|
||||
# inform worker about availability of virtio-serial
|
||||
touch %{buildroot}/.build.console.kvm
|
||||
if grep -qx CONFIG_VIRTIO_CONSOLE=y /boot/config-*%{kernel_flavor} ; then
|
||||
echo "virtio" > %{buildroot}/.build.console.kvm
|
||||
fi
|
||||
|
||||
#inform worker about arch
|
||||
#see obs-build commit e47399d738e51
|
||||
uname -m > %{buildroot}/.build.hostarch.kvm
|
||||
|
||||
%changelog
|
||||
277185
kernel-obs-qa.changes
Normal file
277185
kernel-obs-qa.changes
Normal file
File diff suppressed because it is too large
Load Diff
74
kernel-obs-qa.spec
Normal file
74
kernel-obs-qa.spec
Normal file
@@ -0,0 +1,74 @@
|
||||
#
|
||||
# spec file for package kernel-obs-qa
|
||||
#
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
# needsrootforbuild
|
||||
|
||||
|
||||
%define patchversion 4.12.14
|
||||
%define variant %{nil}
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
Name: kernel-obs-qa
|
||||
Version: 4.12.14
|
||||
%if 0%{?is_kotd}
|
||||
Release: <RELEASE>.g5725dec
|
||||
%else
|
||||
Release: 0
|
||||
%endif
|
||||
Summary: Basic QA tests for the kernel
|
||||
License: GPL-2.0-only
|
||||
Group: SLES
|
||||
BuildRequires: kernel-default
|
||||
# kernel-obs-build must be also configured as VMinstall, but is required
|
||||
# here as well to avoid that qa and build package build parallel
|
||||
%if ! 0%{?qemu_user_space_build}
|
||||
BuildRequires: kernel-obs-build-srchash-5725decbef8de98414e5d1eea61d668325003e24
|
||||
%endif
|
||||
BuildRequires: modutils
|
||||
ExclusiveArch: aarch64 ppc64le s390x x86_64
|
||||
|
||||
%description
|
||||
This package is using the kernel compiled within Open Build Service(OBS)
|
||||
projects and runs basic tests.
|
||||
|
||||
%files
|
||||
/usr/share/%name
|
||||
|
||||
%prep
|
||||
|
||||
%build
|
||||
|
||||
%check
|
||||
# More tests are comming, currently the main test is the existens of
|
||||
# this spec file. It does trigger a build within OBS VM which is using
|
||||
# the kernel of the same project.
|
||||
|
||||
# test suites should be packaged in other packages, but build required
|
||||
# and called here.
|
||||
|
||||
krel=$(uname -r)
|
||||
if test ! -d "/lib/modules/$krel/kernel" && test ! -d "/usr/lib/modules/$krel/kernel"; then
|
||||
echo "Kernel package for $krel not installed; exiting"
|
||||
exit 0
|
||||
fi
|
||||
/sbin/modprobe loop
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/usr/share/%name
|
||||
touch %{buildroot}/usr/share/%name/logfile
|
||||
|
||||
%changelog
|
||||
27769
kernel-omap2plus.changes
27769
kernel-omap2plus.changes
File diff suppressed because it is too large
Load Diff
@@ -1,959 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-omap2plus
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor omap2plus
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-omap2plus
|
||||
Summary: Kernel for Texas instrument's OMAP SoC
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: armv7hl
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
The standard kernel for Texas instrument's OMAP SoC, as
|
||||
found in devices like the PandaBoard and BeagleBoard.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: Kernel for Texas instrument's OMAP SoC - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
The standard kernel for Texas instrument's OMAP SoC, as
|
||||
found in devices like the PandaBoard and BeagleBoard.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: Kernel for Texas instrument's OMAP SoC - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
The standard kernel for Texas instrument's OMAP SoC, as
|
||||
found in devices like the PandaBoard and BeagleBoard.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
27769
kernel-pae.changes
27769
kernel-pae.changes
File diff suppressed because it is too large
Load Diff
980
kernel-pae.spec
980
kernel-pae.spec
@@ -1,980 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-pae
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor pae
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-pae
|
||||
Summary: Kernel with PAE Support
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
%ifarch %ix86
|
||||
Provides: kernel-bigsmp
|
||||
Obsoletes: kernel-bigsmp
|
||||
%endif
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: %ix86
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
This kernel supports up to 64GB of main memory. It requires Physical
|
||||
Addressing Extensions (PAE), which were introduced with the Pentium Pro
|
||||
processor.
|
||||
|
||||
PAE is not only more physical address space but also important for the
|
||||
"no execute" feature which disables execution of code that is marked as
|
||||
non-executable. Therefore, the PAE kernel should be used on any systems
|
||||
that support it, regardless of the amount of main memory.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: Kernel with PAE Support - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
This kernel supports up to 64GB of main memory. It requires Physical
|
||||
Addressing Extensions (PAE), which were introduced with the Pentium Pro
|
||||
processor.
|
||||
|
||||
PAE is not only more physical address space but also important for the
|
||||
"no execute" feature which disables execution of code that is marked as
|
||||
non-executable. Therefore, the PAE kernel should be used on any systems
|
||||
that support it, regardless of the amount of main memory.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: Kernel with PAE Support - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
This kernel supports up to 64GB of main memory. It requires Physical
|
||||
Addressing Extensions (PAE), which were introduced with the Pentium Pro
|
||||
processor.
|
||||
|
||||
PAE is not only more physical address space but also important for the
|
||||
"no execute" feature which disables execution of code that is marked as
|
||||
non-executable. Therefore, the PAE kernel should be used on any systems
|
||||
that support it, regardless of the amount of main memory.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
27769
kernel-s390.changes
27769
kernel-s390.changes
File diff suppressed because it is too large
Load Diff
959
kernel-s390.spec
959
kernel-s390.spec
@@ -1,959 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-s390
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor s390
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-s390
|
||||
Summary: The Standard Kernel
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
%ifarch s390
|
||||
Provides: kernel-32bit
|
||||
Obsoletes: kernel-32bit
|
||||
%endif
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: s390
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
The standard kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: The Standard Kernel - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
The standard kernel.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: The Standard Kernel - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
The standard kernel.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
299140
kernel-source.changes
299140
kernel-source.changes
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,14 @@
|
||||
# These zero-length files are correct:
|
||||
addFilter("zero-length /usr/src/linux-3\..*obj/.*include/config.*h")
|
||||
addFilter("zero-length /usr/src/linux-.*-obj/.*/include/config.*h")
|
||||
addFilter("zero-length /usr/src/linux-.*-obj/.*/include/config/.*")
|
||||
# vdsos are special
|
||||
addFilter("shared-lib-without-dependency-information /lib/modules/3\..*/vdso/.*")
|
||||
addFilter("missing-PT_GNU_STACK-section /lib/modules/3\..*/vdso/")
|
||||
addFilter("shared-lib-without-dependency-information .*/lib/modules/[1-9].*/vdso/.*")
|
||||
addFilter("missing-PT_GNU_STACK-section .*/lib/modules/[1-9].*/vdso/.*")
|
||||
# This is a stale symlink until the kernel-source package is installed:
|
||||
addFilter("dangling-symlink /lib/modules/3\..*/source")
|
||||
addFilter("dangling-symlink .*/lib/modules/[1-9].*/source")
|
||||
# These hidden files are fine:
|
||||
addFilter ("hidden-file-or-dir /usr/src/linux-3\..*-obj/.*/.config")
|
||||
addFilter ("hidden-file-or-dir /usr/src/linux-3\..*-obj/.*/.kernel-binary.spec.buildenv")
|
||||
addFilter("hidden-file-or-dir /usr/src/linux-.*-obj/.*/.config")
|
||||
addFilter("hidden-file-or-dir /usr/src/linux-.*-obj/.*/.kernel-binary.spec.buildenv")
|
||||
addFilter("hidden-file-or-dir /boot/\..*\.hmac")
|
||||
# a precompiled eBPF test
|
||||
addFilter("arch-independent-package-contains-binary-or-object /usr/src/linux-.*/.*/action-ebpf")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package kernel-source
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -12,78 +12,90 @@
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# icecream 0
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define srcversion 4.12
|
||||
%define patchversion 4.12.14
|
||||
%define git_commit 5725decbef8de98414e5d1eea61d668325003e24
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
%define gcc_package gcc
|
||||
%define gcc_compiler gcc
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define src_install_dir usr/src/linux-%kernelrelease%variant
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,group-source-files.pl,split-modules,modversions,kabi.pl,arch-symbols,check-module-license,splitflist,mergedep,moddep,modflist,kernel-subpackage-build})
|
||||
|
||||
Name: kernel-source
|
||||
Summary: The Linux Kernel Sources
|
||||
Version: 3.8.2
|
||||
Version: 4.12.14
|
||||
%if 0%{?is_kotd}
|
||||
Release: <RELEASE>.g5725dec
|
||||
%else
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
%endif
|
||||
Summary: The Linux Kernel Sources
|
||||
License: GPL-2.0-only
|
||||
Group: Development/Sources
|
||||
Url: http://www.kernel.org/
|
||||
URL: https://www.kernel.org/
|
||||
AutoReqProv: off
|
||||
BuildRequires: coreutils sed
|
||||
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
|
||||
BuildRequires: bash-sh
|
||||
%endif
|
||||
BuildRequires: coreutils
|
||||
BuildRequires: fdupes
|
||||
Requires(post): coreutils sed
|
||||
Provides: multiversion(kernel)
|
||||
Provides: linux
|
||||
Provides: %name = %version-%source_rel
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
BuildRequires: python3-base
|
||||
BuildRequires: sed
|
||||
BuildArch: noarch
|
||||
Prefix: /usr/src
|
||||
|
||||
%define src_install_dir usr/src/linux-%kernelrelease%variant
|
||||
|
||||
# if undefined use legacy location of before SLE15
|
||||
%if %{undefined _rpmmacrodir}
|
||||
%define _rpmmacrodir /etc/rpm
|
||||
%endif
|
||||
|
||||
Source0: https://www.kernel.org/pub/linux/kernel/v4.x/linux-%srcversion.tar.xz
|
||||
%if "https://www.kernel.org/pub/linux/kernel/v4.x/" != ""
|
||||
Source1: https://www.kernel.org/pub/linux/kernel/v4.x/linux-%srcversion.tar.sign
|
||||
Source2: linux.keyring
|
||||
%endif
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source19: kernel-binary-conflicts
|
||||
Source20: obsolete-kmps
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source36: README.PATCH-POLICY.SUSE
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source46: split-modules
|
||||
Source47: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source57: kernel-cert-subpackage
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source75: release-projects
|
||||
Source76: check-module-license
|
||||
Source78: modules.fips
|
||||
Source79: splitflist
|
||||
Source80: mergedep
|
||||
Source81: moddep
|
||||
Source82: modflist
|
||||
Source83: kernel-subpackage-build
|
||||
Source84: kernel-subpackage-spec
|
||||
Source85: kernel-default-base.spec.txt
|
||||
Source86: old_changelog.txt
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
@@ -91,25 +103,44 @@ Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source114: patches.drm.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
Prefix: /usr/src
|
||||
Requires(post): coreutils sed
|
||||
# Source is only complete with devel files.
|
||||
Requires: kernel-devel = %version-%release
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Provides: %name = %version-%source_rel
|
||||
Provides: %name-srchash-%git_commit
|
||||
Provides: linux
|
||||
Provides: multiversion(kernel)
|
||||
# extra packages needed for building a kernel from scratch
|
||||
Recommends: bc
|
||||
Recommends: bison
|
||||
Recommends: flex
|
||||
Recommends: libelf-devel
|
||||
Recommends: openssl-devel
|
||||
# pahole needed for BTF
|
||||
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
|
||||
Recommends: dwarves >= 1.22
|
||||
%endif
|
||||
# dracut no longer carries installkernel
|
||||
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
|
||||
Recommends: kernel-install-tools
|
||||
%endif
|
||||
Recommends: %gcc_package
|
||||
%obsolete_rebuilds %name
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
# Force bzip2 instead of lzma compression to
|
||||
# 1) allow install on older dist versions, and
|
||||
# 2) decrease build times (bsc#962356 boo#1175882)
|
||||
%define _binary_payload w9.bzdio
|
||||
|
||||
%define symbols %(set -- $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
|
||||
%define variant_symbols %(case %name in (*-rt) echo "RT" ;; esac)
|
||||
|
||||
%define do_vanilla "%variant" == ""
|
||||
|
||||
@@ -118,12 +149,23 @@ Linux kernel sources with many fixes and improvements.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
|
||||
%post
|
||||
%relink_function
|
||||
|
||||
relink linux-%kernelrelease%variant /usr/src/linux%variant
|
||||
|
||||
%files -f nondevel.files
|
||||
|
||||
%package -n kernel-devel%variant
|
||||
Summary: Development files needed for building kernel modules
|
||||
Group: Development/Sources
|
||||
AutoReqProv: off
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-devel%variant = %version-%source_rel
|
||||
Provides: multiversion(kernel)
|
||||
Requires: kernel-macros
|
||||
Requires(post): coreutils
|
||||
%obsolete_rebuilds kernel-devel%variant
|
||||
|
||||
%description -n kernel-devel%variant
|
||||
Kernel-level headers and Makefiles required for development of
|
||||
@@ -131,86 +173,127 @@ external kernel modules.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
|
||||
%post -n kernel-devel%variant
|
||||
%relink_function
|
||||
|
||||
relink linux-%kernelrelease%variant /usr/src/linux%variant
|
||||
|
||||
%files -n kernel-devel%variant -f devel.files
|
||||
%ghost /usr/src/linux%variant
|
||||
%doc /usr/share/doc/packages/*
|
||||
|
||||
# Note: The kernel-macros package intentionally does not provide
|
||||
# multiversion(kernel) nor is its name decorated with the variant (-rt)
|
||||
%package -n kernel-macros
|
||||
Summary: RPM macros for building Kernel Module Packages
|
||||
Group: Development/Sources
|
||||
Provides: kernel-subpackage-macros
|
||||
|
||||
%description -n kernel-macros
|
||||
This package provides the rpm macros and templates for Kernel Module Packages
|
||||
|
||||
|
||||
%source_timestamp
|
||||
|
||||
%if "%variant" == ""
|
||||
%files -n kernel-macros
|
||||
%{_rpmmacrodir}/macros.kernel-source
|
||||
/usr/lib/rpm/kernel-*-subpackage
|
||||
%dir /usr/lib/rpm/kernel
|
||||
/usr/lib/rpm/kernel/*
|
||||
%endif
|
||||
|
||||
%package vanilla
|
||||
Summary: Vanilla Linux kernel sources with minor build fixes.
|
||||
%obsolete_rebuilds %name-vanilla
|
||||
Summary: Vanilla Linux kernel sources with minor build fixes
|
||||
Group: Development/Sources
|
||||
AutoReqProv: off
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-vanilla = %version-%source_rel
|
||||
Provides: multiversion(kernel)
|
||||
Requires: kernel-macros
|
||||
# dracut no longer carries installkernel
|
||||
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
|
||||
Recommends: kernel-install-tools
|
||||
%endif
|
||||
|
||||
%description vanilla
|
||||
Vanilla Linux kernel sources with minor build fixes.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
|
||||
%if %do_vanilla
|
||||
%files vanilla
|
||||
/usr/src/linux-%kernelrelease-vanilla
|
||||
%endif
|
||||
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "Please get a copy of linux-%srcversion.tar.bz2 from" \
|
||||
"ftp://ftp.kernel.org/pub/linux/kernel/v2.6/."
|
||||
fi
|
||||
|
||||
echo "Symbol(s): %symbols"
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
%setup -q -c -T -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 108 -a 109 -a 110 -a 111 -a 113 -a 114 -a 120 -a 121
|
||||
|
||||
%build
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/src
|
||||
cd $RPM_BUILD_ROOT/usr/src
|
||||
%install
|
||||
mkdir -p %{buildroot}/usr/src
|
||||
pushd %{buildroot}/usr/src
|
||||
|
||||
# Unpack the vanilla kernel sources
|
||||
tar -xjf %_sourcedir/linux-%srcversion.tar.bz2
|
||||
tar -xf %{S:0}
|
||||
find . -xtype l -delete -printf "deleted '%f'\n"
|
||||
if test "%srcversion" != "%kernelrelease%variant"; then
|
||||
mv linux-%srcversion linux-%kernelrelease%variant
|
||||
fi
|
||||
|
||||
%if %do_vanilla
|
||||
%if %vanilla_only
|
||||
mv \
|
||||
%else
|
||||
cp -al \
|
||||
%endif
|
||||
linux-%kernelrelease%variant linux-%kernelrelease-vanilla
|
||||
cd linux-%kernelrelease-vanilla
|
||||
%_sourcedir/apply-patches --vanilla %_sourcedir/series.conf %my_builddir %symbols
|
||||
sed -i -e 's/\$(CROSS_COMPILE)gcc/\$(CROSS_COMPILE)%gcc_compiler/g' Makefile
|
||||
grep '\$(CROSS_COMPILE)%gcc_compiler' Makefile
|
||||
rm -f $(find . -name ".gitignore")
|
||||
# Hardlink duplicate files automatically (from package fdupes).
|
||||
%fdupes $PWD
|
||||
cd ..
|
||||
%endif
|
||||
|
||||
%if ! %vanilla_only
|
||||
ln -sf linux%variant linux%variant # dummy symlink
|
||||
|
||||
cd linux-%kernelrelease%variant
|
||||
%_sourcedir/apply-patches %_sourcedir/series.conf %my_builddir %symbols
|
||||
sed -i -e 's/\$(CROSS_COMPILE)gcc/\$(CROSS_COMPILE)%gcc_compiler/g' Makefile
|
||||
grep '\$(CROSS_COMPILE)%gcc_compiler' Makefile
|
||||
rm -f $(find . -name ".gitignore")
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes).
|
||||
%fdupes $RPM_BUILD_ROOT
|
||||
%fdupes $PWD
|
||||
cd ..
|
||||
popd
|
||||
|
||||
%install
|
||||
%if ! %vanilla_only
|
||||
# Install the documentation and example Kernel Module Package.
|
||||
DOC=$RPM_BUILD_ROOT/usr/share/doc/packages/%name
|
||||
mkdir -p $DOC
|
||||
cp %_sourcedir/README.SUSE %_sourcedir/config-options.changes.txt $DOC
|
||||
ln -s /usr/share/doc/packages/%name/README.SUSE %buildroot/%src_install_dir/
|
||||
DOC=/usr/share/doc/packages/%name-%kernelrelease
|
||||
mkdir -p %buildroot/$DOC
|
||||
cp %_sourcedir/README.SUSE %buildroot/$DOC
|
||||
ln -s $DOC/README.SUSE %buildroot/%src_install_dir/
|
||||
|
||||
install -m 755 -d $RPM_BUILD_ROOT/etc/rpm
|
||||
install -m 644 %_sourcedir/macros.kernel-source $RPM_BUILD_ROOT/etc/rpm/
|
||||
install -m 755 -d $RPM_BUILD_ROOT/usr/lib/rpm
|
||||
install -m 644 %_sourcedir/kernel-module-subpackage \
|
||||
$RPM_BUILD_ROOT/usr/lib/rpm/
|
||||
%if "%variant" == ""
|
||||
install -m 755 -d %{buildroot}%{_rpmmacrodir}
|
||||
install -m 644 %_sourcedir/macros.kernel-source %{buildroot}%{_rpmmacrodir}
|
||||
echo "%%kernel_module_directory %{kernel_module_directory}" >> %{buildroot}%{_rpmmacrodir}/macros.kernel-source
|
||||
|
||||
for script in post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/source-$script.sh > %name-$script.sh
|
||||
done
|
||||
install -m 755 -d %{buildroot}/usr/lib/rpm
|
||||
install -m 644 %_sourcedir/kernel-{module,cert}-subpackage \
|
||||
%{buildroot}/usr/lib/rpm/
|
||||
install -m 755 -d %{buildroot}/usr/lib/rpm/kernel
|
||||
install -m 755 %_sourcedir/{splitflist,mergedep,moddep,modflist,kernel-subpackage-build} %{buildroot}/usr/lib/rpm/kernel
|
||||
install -m 644 %_sourcedir/kernel-subpackage-spec %{buildroot}/usr/lib/rpm/kernel
|
||||
install -m 644 %_sourcedir/kernel-spec-macros %{buildroot}/usr/lib/rpm/kernel
|
||||
install -m 644 -T %_sourcedir/kernel-default-base.spec.txt %{buildroot}/usr/lib/rpm/kernel/kernel-default-base.spec
|
||||
%endif
|
||||
|
||||
pushd "%buildroot"
|
||||
perl "%_sourcedir/group-source-files.pl" \
|
||||
@@ -218,35 +301,18 @@ perl "%_sourcedir/group-source-files.pl" \
|
||||
-L "%src_install_dir"
|
||||
popd
|
||||
|
||||
find %{buildroot}/usr/src/linux* -type f -name '*.[ch]' -perm /0111 -exec chmod -v a-x {} +
|
||||
# OBS checks don't like /usr/bin/env in script interpreter lines
|
||||
grep -Elr '^#! */(usr/)?bin/env ' %{buildroot}/usr/src/linux* | while read f; do
|
||||
sed -re '1 { s_^#! */usr/bin/env +/_#!/_ ; s_^#! */usr/bin/env +([^/])_#!/usr/bin/\1_ }' \
|
||||
-e '1 { s_^#! */bin/env +/_#!/_ ; s_^#! */bin/env +([^/])_#!/usr/bin/\1_ }' -i "$f"
|
||||
done
|
||||
# kernel-source and kernel-$flavor-devel are built independently, but the
|
||||
# shipped sources (/usr/src/linux/) need to be older than generated files
|
||||
# (/usr/src/linux-obj). We rely on the git commit timestamp to not point into
|
||||
# the future and be thus lower than the timestamps of files built from the
|
||||
# source (bnc#669669).
|
||||
ts="$(head -n1 %_sourcedir/source-timestamp)"
|
||||
find %buildroot/usr/src/linux* ! -type l | xargs touch -d "$ts"
|
||||
|
||||
%post -f %name-post.sh
|
||||
|
||||
%post -n kernel-devel%variant -f %name-post.sh
|
||||
|
||||
%files -f nondevel.files
|
||||
%defattr(-, root, root)
|
||||
/usr/src/linux%variant-%kernelrelease/README.SUSE
|
||||
|
||||
%files -n kernel-devel%variant -f devel.files
|
||||
%defattr(-,root,root)
|
||||
%ghost /usr/src/linux%variant
|
||||
/usr/share/doc/packages/%name
|
||||
/etc/rpm/macros.kernel-source
|
||||
/usr/lib/rpm/kernel-module-subpackage
|
||||
%endif
|
||||
|
||||
%if %do_vanilla
|
||||
|
||||
%files vanilla
|
||||
%defattr(-, root, root)
|
||||
/usr/src/linux-%kernelrelease-vanilla
|
||||
%endif
|
||||
find %buildroot/usr/src/linux* ! -type l -print0 | xargs -0 touch -d "$ts"
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -1,252 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-source@VARIANT@
|
||||
#
|
||||
# Copyright (c) @YEAR@ SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# icecream 0
|
||||
|
||||
%define srcversion @SRCVERSION@
|
||||
%define patchversion @PATCHVERSION@
|
||||
%define variant @VARIANT@%{nil}
|
||||
%define vanilla_only @VANILLA_ONLY@
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define src_install_dir usr/src/linux-%kernelrelease%variant
|
||||
|
||||
Name: kernel-source@VARIANT@
|
||||
Summary: The Linux Kernel Sources
|
||||
Version: @RPMVERSION@
|
||||
Release: @RELEASE@
|
||||
License: GPL-2.0
|
||||
Group: Development/Sources
|
||||
Url: http://www.kernel.org/
|
||||
AutoReqProv: off
|
||||
BuildRequires: coreutils sed
|
||||
BuildRequires: fdupes
|
||||
Requires(post): coreutils sed
|
||||
Provides: multiversion(kernel)
|
||||
Provides: linux
|
||||
Provides: %name = %version-%source_rel
|
||||
Source0: @TARBALL_URL@linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildArch: noarch
|
||||
Prefix: /usr/src
|
||||
# Source is only complete with devel files.
|
||||
Requires: kernel-devel = %version-%release
|
||||
|
||||
%(chmod +x %_sourcedir/{@SCRIPTS@})
|
||||
|
||||
%define symbols %(set -- $([ -e %_sourcedir/extra-symbols ] && cat %_sourcedir/extra-symbols) ; echo $*)
|
||||
%define variant_symbols %(case %name in (*-rt) echo "RT" ;; esac)
|
||||
|
||||
%define do_vanilla "%variant" == ""
|
||||
|
||||
%description
|
||||
Linux kernel sources with many fixes and improvements.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%package -n kernel-devel%variant
|
||||
Summary: Development files needed for building kernel modules
|
||||
Group: Development/Sources
|
||||
AutoReqProv: off
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-devel%variant = %version-%source_rel
|
||||
|
||||
%description -n kernel-devel%variant
|
||||
Kernel-level headers and Makefiles required for development of
|
||||
external kernel modules.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%package vanilla
|
||||
Summary: Vanilla Linux kernel sources with minor build fixes.
|
||||
Group: Development/Sources
|
||||
AutoReqProv: off
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-vanilla = %version-%source_rel
|
||||
|
||||
%description vanilla
|
||||
Vanilla Linux kernel sources with minor build fixes.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "Please get a copy of linux-%srcversion.tar.bz2 from" \
|
||||
"ftp://ftp.kernel.org/pub/linux/kernel/v2.6/."
|
||||
fi
|
||||
|
||||
echo "Symbol(s): %symbols"
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T @UNPACK_PATCHES@
|
||||
|
||||
%build
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/src
|
||||
cd $RPM_BUILD_ROOT/usr/src
|
||||
|
||||
# Unpack the vanilla kernel sources
|
||||
tar -xjf %_sourcedir/linux-%srcversion.tar.bz2
|
||||
if test "%srcversion" != "%kernelrelease%variant"; then
|
||||
mv linux-%srcversion linux-%kernelrelease%variant
|
||||
fi
|
||||
|
||||
%if %do_vanilla
|
||||
%if %vanilla_only
|
||||
mv \
|
||||
%else
|
||||
cp -al \
|
||||
%endif
|
||||
linux-%kernelrelease%variant linux-%kernelrelease-vanilla
|
||||
cd linux-%kernelrelease-vanilla
|
||||
%_sourcedir/apply-patches --vanilla %_sourcedir/series.conf %my_builddir %symbols
|
||||
rm -f $(find . -name ".gitignore")
|
||||
cd ..
|
||||
%endif
|
||||
|
||||
%if ! %vanilla_only
|
||||
ln -sf linux%variant linux%variant # dummy symlink
|
||||
|
||||
cd linux-%kernelrelease%variant
|
||||
%_sourcedir/apply-patches %_sourcedir/series.conf %my_builddir %symbols
|
||||
rm -f $(find . -name ".gitignore")
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes).
|
||||
%fdupes $RPM_BUILD_ROOT
|
||||
|
||||
%install
|
||||
%if ! %vanilla_only
|
||||
# Install the documentation and example Kernel Module Package.
|
||||
DOC=$RPM_BUILD_ROOT/usr/share/doc/packages/%name
|
||||
mkdir -p $DOC
|
||||
cp %_sourcedir/README.SUSE %_sourcedir/config-options.changes.txt $DOC
|
||||
ln -s /usr/share/doc/packages/%name/README.SUSE %buildroot/%src_install_dir/
|
||||
|
||||
install -m 755 -d $RPM_BUILD_ROOT/etc/rpm
|
||||
install -m 644 %_sourcedir/macros.kernel-source $RPM_BUILD_ROOT/etc/rpm/
|
||||
install -m 755 -d $RPM_BUILD_ROOT/usr/lib/rpm
|
||||
install -m 644 %_sourcedir/kernel-module-subpackage \
|
||||
$RPM_BUILD_ROOT/usr/lib/rpm/
|
||||
|
||||
for script in post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/source-$script.sh > %name-$script.sh
|
||||
done
|
||||
|
||||
pushd "%buildroot"
|
||||
perl "%_sourcedir/group-source-files.pl" \
|
||||
-D "$OLDPWD/devel.files" -N "$OLDPWD/nondevel.files" \
|
||||
-L "%src_install_dir"
|
||||
popd
|
||||
|
||||
# kernel-source and kernel-$flavor-devel are built independently, but the
|
||||
# shipped sources (/usr/src/linux/) need to be older than generated files
|
||||
# (/usr/src/linux-obj). We rely on the git commit timestamp to not point into
|
||||
# the future and be thus lower than the timestamps of files built from the
|
||||
# source (bnc#669669).
|
||||
ts="$(head -n1 %_sourcedir/source-timestamp)"
|
||||
find %buildroot/usr/src/linux* ! -type l | xargs touch -d "$ts"
|
||||
|
||||
%post -f %name-post.sh
|
||||
|
||||
%post -n kernel-devel%variant -f %name-post.sh
|
||||
|
||||
%files -f nondevel.files
|
||||
%defattr(-, root, root)
|
||||
/usr/src/linux%variant-%kernelrelease/README.SUSE
|
||||
|
||||
%files -n kernel-devel%variant -f devel.files
|
||||
%defattr(-,root,root)
|
||||
%ghost /usr/src/linux%variant
|
||||
/usr/share/doc/packages/%name
|
||||
/etc/rpm/macros.kernel-source
|
||||
/usr/lib/rpm/kernel-module-subpackage
|
||||
%endif
|
||||
|
||||
%if %do_vanilla
|
||||
|
||||
%files vanilla
|
||||
%defattr(-, root, root)
|
||||
/usr/src/linux-%kernelrelease-vanilla
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
@@ -6,31 +6,82 @@
|
||||
|
||||
%define using_buildservice 0%{?opensuse_bs}
|
||||
|
||||
# source_rel is the package release string, without the rebuild counter
|
||||
# generated by the build service. In non-official builds, the upstream
|
||||
# EXTRAVERSION component is also part of the release string,
|
||||
# e.g. next.20110101.9.6 (hyphens are replaced by periods). Builds in the
|
||||
# official distribution projects replace the release string though.
|
||||
%define source_rel %release
|
||||
%if %using_buildservice
|
||||
%define source_rel %(release=%release; echo ${release%.*})
|
||||
%if ! 0%{?using_buildservice}
|
||||
%define using_buildservice 0%(echo %disturl | grep -q '^obs://build\.[^.]*suse\.' && echo 1)
|
||||
%endif
|
||||
|
||||
# release_num is the numeric source revision part of the release number,
|
||||
# i.e. source_rel without the upstream tags like -rcX. A hyphen is added
|
||||
# automatically for convenient use.
|
||||
# examples: rc3 -> "", rc3.1 -> -1, next.20110101.9 -> -9
|
||||
#
|
||||
# patchversion is inserted into the spec files by the mkspec script, it is the
|
||||
# upstream release string unchanged, e.g. 2.6.38-rc3
|
||||
%define release_num %(upstream=%patchversion; upstream=${upstream#%version}; upstream=${upstream#-}; upstream=${upstream//-/.}; rel="%source_rel" ; res="${rel#$upstream}"; res=${res#.}; echo ${res:+-}${res})
|
||||
# TW is usrmerged
|
||||
%if 0%{?suse_version} >= 1550
|
||||
%define usrmerged 1
|
||||
%else
|
||||
%define usrmerged 0
|
||||
%endif
|
||||
|
||||
# source_rel is the package release string, without the rebuild counter
|
||||
# generated by the build service. If the release string has a non-digit
|
||||
# suffix, we keep that suffix and strip the rightmost digit component.
|
||||
# This is used in KOTD builds: 2.1.g1234567 -> 2.g1234567
|
||||
# In PTF projects, there is no rebuild counter, so we leave the release
|
||||
# string intact.
|
||||
%define source_rel %release
|
||||
%define obsolete_rebuilds() %nil
|
||||
%define obsolete_rebuilds_subpackage() %nil
|
||||
%if %using_buildservice && ! 0%{?is_ptf}
|
||||
%define source_rel %(echo %release | sed -r 's/\\.[0-9]+($|\\.[^.]*[^.0-9][^.]*$)/\\1/')
|
||||
# If the rebuild counter is > 1, obsolete all previous rebuilds (boo#867595)
|
||||
%define obsolete_rebuilds() %( \
|
||||
set -- $(echo %release | sed -rn 's/(.*\\.)([0-9]+)($|\\.[^.]*[^.0-9][^.]*$)/\\1 \\2 \\3/p') \
|
||||
if test -n "$2" && test "$2" -gt 99; then echo "warning: Rebuild counter too high in %release" >&2; exit 0; fi \
|
||||
for i in $(seq 1 $(($2-1))) ; do echo "Obsoletes: %1 = %version-$1$i$3" ; done \
|
||||
)
|
||||
%define obsolete_rebuilds_subpackage() %( \
|
||||
set -- $(echo %release | sed -rn 's/(.*\\.)([0-9]+)($|\\.[^.]*[^.0-9][^.]*$)/\\1 \\2 \\3/p') \
|
||||
if test -n "$2" && test "$2" -gt 99; then echo "warning: Rebuild counter too high in %release" >&2; exit 0; fi \
|
||||
cnt=$2
|
||||
set -- $(echo %source_rel | sed -rn 's/(.*\\.)([0-9]+)($|\\.[^.]*[^.0-9][^.]*$)/\\1 \\2 \\3/p') \
|
||||
if test -n "$2" && test "$2" -gt 99; then echo "warning: Upload counter too high in %source_rel" >&2; exit 0; fi \
|
||||
for i in $(seq 1 $2) ; do for j in $(seq 1 $cnt) ; do [ $i = $2 ] && [ $j = $cnt ] && break \
|
||||
echo "Obsoletes: %1 = %version-$1$i.$j$3" \
|
||||
done ; done \
|
||||
)
|
||||
%endif
|
||||
|
||||
# how the kernel release string (uname -r) should look like
|
||||
%define kernelrelease %patchversion%release_num
|
||||
%define kernelrelease %patchversion-%source_rel
|
||||
|
||||
# Compare the kernel version to the given argument, return value semantics
|
||||
# same as strcmp(3). Example: %%if %%{kver_cmp 4.8} > 0 ... %%endif
|
||||
%define kver_cmp() %{lua: print(rpm.vercmp(rpm.expand("%patchversion"), rpm.expand("%1")))}
|
||||
|
||||
%define my_builddir %_builddir/%{name}-%{version}
|
||||
|
||||
# macro to add the source timestamp to package descriptions
|
||||
%define source_timestamp %(sed '1s/^/Source Timestamp: /' %_sourcedir/source-timestamp || :)
|
||||
|
||||
# vim: ft=spec
|
||||
# function used in developent package scriptlets
|
||||
%define relink_function relink() { \
|
||||
if [ -h "$2" ]; then \
|
||||
local old=$(readlink "$2") \
|
||||
[ "$old" = "$1" ] && return 0 \
|
||||
echo "Changing symlink $2 from $old to $1" \
|
||||
elif [ -e "$2" ]; then \
|
||||
echo "Replacing file $2 with symlink to $1" \
|
||||
fi \
|
||||
rm -f "$2" && ln -s "$1" "$2" \
|
||||
}
|
||||
|
||||
%if %{usrmerged}
|
||||
%define kernel_module_directory /usr/lib/modules
|
||||
%else
|
||||
%define kernel_module_directory /lib/modules
|
||||
%endif
|
||||
|
||||
# Very basic macro for conditional execution.
|
||||
%define run_if_exists run_if_exists() { \
|
||||
if [ -x "$1" ] ; then \
|
||||
"$@" \
|
||||
else \
|
||||
echo Cannot execute "$1" >&2 \
|
||||
fi \
|
||||
} \
|
||||
run_if_exists
|
||||
|
||||
76
kernel-subpackage-build
Normal file
76
kernel-subpackage-build
Normal file
@@ -0,0 +1,76 @@
|
||||
#!/bin/bash -xe
|
||||
# %scriptdir/kernel-subpackage-build %kernel_package_name %rpm_kver-%rpm_krel %package_name-%version-%release
|
||||
|
||||
scriptdir=$(dirname $0)
|
||||
kernel_package_name=$1
|
||||
kernel_nvrq=$(echo $1-$2 | sed -e 's/[.]/[.]/g')
|
||||
package_nvr=$3
|
||||
|
||||
|
||||
set -o pipefail
|
||||
install -d -m 0755 $RPM_BUILD_ROOT/boot
|
||||
|
||||
$scriptdir/splitflist $kernel_package_name kernel.flist kernel-ghost.flist
|
||||
echo Ghost files:
|
||||
cat kernel-ghost.flist
|
||||
|
||||
rpm -q --qf '%{PREIN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > prein.sh
|
||||
rpm -q --qf '%{POSTIN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > postin.sh
|
||||
rpm -q --qf '%{PREUN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > preun.sh
|
||||
rpm -q --qf '%{POSTUN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > postun.sh
|
||||
rpm -q --qf '%{POSTTRANS}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > posttrans.sh
|
||||
|
||||
[ -z "$(rpm -q --triggers $kernel_package_name)" ] # not handled
|
||||
|
||||
KREL=$(sed -rne '/^(\/usr)?\/lib\/modules\/([^/]+)$/{s,.*/,,;p;q}' < kernel.flist)
|
||||
grep -q /usr/lib/modules/ kernel.flist && USR=/usr
|
||||
|
||||
$scriptdir/mergedep $KREL > modules.dep
|
||||
|
||||
|
||||
$scriptdir/moddep modules.dep request-modules modules
|
||||
|
||||
$scriptdir/modflist kernel.flist modules modules.flist /lib/modules/$KREL/modules.builtin
|
||||
grep -v "^$USR/lib/modules/$KREL\\(\$\\|/kernel\\)" < kernel.flist >> modules.flist || :
|
||||
|
||||
tar -C / -cf- -T modules.flist | tar -C $RPM_BUILD_ROOT -xvf-
|
||||
|
||||
[ -z "$USR" ] || ln -s usr/lib $RPM_BUILD_ROOT/lib
|
||||
moderr="$(/usr/sbin/depmod -b $RPM_BUILD_ROOT -e -F /boot/System.map-$KREL $KREL 2>&1 > /dev/null)"
|
||||
[ -z "$USR" ] || rm $RPM_BUILD_ROOT/lib
|
||||
|
||||
if [ "$moderr" ] ; then
|
||||
echo Picked modules have errors:
|
||||
echo $moderr
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "%defattr(-,root,root)" > subpackage.flist
|
||||
echo "%dir $USR/lib/modules/$KREL" >> subpackage.flist
|
||||
grep -v "^$USR/lib/modules/$KREL\\(\$\\|/kernel\\)" < kernel.flist >> subpackage.flist || :
|
||||
echo $USR/lib/modules/$KREL/kernel >> subpackage.flist
|
||||
while read name rest; do
|
||||
echo "%ghost $name"
|
||||
done < kernel-ghost.flist >> subpackage.flist
|
||||
|
||||
# recreate ghost files in build root
|
||||
while read name mode size mtime link; do
|
||||
t=$(( mode&0170000 ))
|
||||
p="${mode:0-4:4}"
|
||||
(( p != 0 )) || p=''
|
||||
if (( t == 0100000 )); then
|
||||
install -D -m "${p:-0644}" /dev/null "$RPM_BUILD_ROOT$name"
|
||||
if [ -f "$RPM_BUILD_ROOT$name".xz ] ; then xzcat "$RPM_BUILD_ROOT$name".xz > "$RPM_BUILD_ROOT$name"
|
||||
elif [ -f "$RPM_BUILD_ROOT$name".gz ] ; then zcat "$RPM_BUILD_ROOT$name".gz > "$RPM_BUILD_ROOT$name"
|
||||
elif [ -f "$RPM_BUILD_ROOT$name".zst ] ; then zstdcat "$RPM_BUILD_ROOT$name".zst > "$RPM_BUILD_ROOT$name"
|
||||
else dd if=/dev/null bs=1 count=0 status=none seek="$size" of="$RPM_BUILD_ROOT$name"
|
||||
fi
|
||||
touch -h --date="@$mtime" "$RPM_BUILD_ROOT$name"
|
||||
elif (( t == 0040000 )); then
|
||||
install -d -m "${p:-0755}" "$RPM_BUILD_ROOT$name"
|
||||
touch -h -date="@$mtime" "$RPM_BUILD_ROOT$name"
|
||||
elif (( t == 0120000 )); then
|
||||
ln -s "$link" "$RPM_BUILD_ROOT$name"
|
||||
touch -h --date="@$mtime" "$RPM_BUILD_ROOT$name"
|
||||
fi
|
||||
done < kernel-ghost.flist
|
||||
116
kernel-subpackage-spec
Normal file
116
kernel-subpackage-spec
Normal file
@@ -0,0 +1,116 @@
|
||||
%define rpm_kver %(rpm -q --qf '%%{VERSION}' %kernel_package_name)
|
||||
%define rpm_krel %(rpm -q --qf '%%{RELEASE}' %kernel_package_name)
|
||||
|
||||
%include /usr/lib/rpm/kernel/kernel-spec-macros
|
||||
|
||||
# Force bzip2 instead of lzma compression to
|
||||
# 1) allow install on older dist versions, and
|
||||
# 2) decrease build times (bsc#962356)
|
||||
# %%define _binary_payload w9.bzdio
|
||||
# Do not recompute the build-id of vmlinux in find-debuginfo.sh (bsc#964063)
|
||||
%undefine _unique_build_ids
|
||||
%define _no_recompute_build_ids 1
|
||||
# prevent usr/lib/debug/boot/vmlinux-4.12.14-11.10-default-4.12.14-11.10.ppc64le.debug
|
||||
%undefine _unique_debug_names
|
||||
|
||||
%define kernel_requires %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'manual,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
||||
%define kernel_requires_pre %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'pre,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
||||
%define kernel_requires_preun %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'preun,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
||||
%define kernel_requires_post %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'post,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
||||
%define kernel_requires_postun %(rpm -q --queryformat '[%%{REQUIREFLAGS:deptype},%%{REQUIRENEVRS}\\n]' %kernel_package_name | grep -vE 'rpmlib,|interp,' | grep -E 'postun,' | sed -e 's/.*,//' | tr '\\n' ' ')
|
||||
%define kernel_base_provides %(rpm -q --queryformat '[%%{PROVIDENEVRS}\\n]' %kernel_package_name | sed -E 's/^%kernel_package_name(-srchash| =)/%name\\1/g' | grep -vE '^(ksym|kmod|firmware)[(]' | tr '\\n' ' )')
|
||||
%define kernel_base_obsoletes %(rpm -q --queryformat '[%%{OBSOLETENEVRS}\\n]' %kernel_package_name | sed -E 's/^%kernel_package_name(-srchash| =)/%name\\1/g' | grep -vE '^(ksym|kmod|firmware)[(]' | tr '\\n' ' )')
|
||||
%define kernel_base_conflicts %(rpm -q --queryformat '[%%{CONFLICTNEVRS}\\n]' %kernel_package_name | grep -vE '^(ksym|kmod|firmware)[(]' | tr '\\n' ' )')
|
||||
%define kernel_base_recommends %(rpm -q --queryformat '[%%{RECOMMENDNEVRS}\\n]' %kernel_package_name | grep -v '^kernel-firmware' | grep -vE '^(ksym|kmod|firmware)[(]' | tr '\\n' ' )')
|
||||
|
||||
%if ! %(expr 1 - 1)
|
||||
%if "%{kernel_requires}" != ""
|
||||
Requires: %kernel_requires
|
||||
%endif
|
||||
%if "%{kernel_requires_pre}" != ""
|
||||
Requires(pre): %kernel_requires_pre
|
||||
%endif
|
||||
%if "%{kernel_requires_preun}" != ""
|
||||
Requires(preun):%kernel_requires_preun
|
||||
%endif
|
||||
%if "%{kernel_requires_post}" != ""
|
||||
Requires(post): %kernel_requires_post
|
||||
%endif
|
||||
%if "%{kernel_requires_postun}" != ""
|
||||
Requires(postun):%kernel_requires_postun
|
||||
%endif
|
||||
%endif
|
||||
%if "%{kernel_base_provides}" != ""
|
||||
Provides: %{kernel_base_provides}
|
||||
%endif
|
||||
%if "%{kernel_base_obsoletes}" != ""
|
||||
Obsoletes: %{kernel_base_obsoletes}
|
||||
%endif
|
||||
%if "%{kernel_base_conflicts}" != ""
|
||||
Conflicts: %{kernel_base_conflicts}
|
||||
%endif
|
||||
%if "%{kernel_base_recommends}" != ""
|
||||
Recommends: %{kernel_base_recommends}
|
||||
%endif
|
||||
# This should give Conflicts: %%kernel_package_name = %%source_rel as old
|
||||
# kernel-default-base did. Together with the %%obsolete_rebuilds translated
|
||||
# from %%kernel_package_name to %%name we should be set for obsoletes against
|
||||
# kernel rebuilds.
|
||||
Conflicts: %(rpm -q --queryformat '[%%{PROVIDENEVRS}\n]' %kernel_package_name | grep '^%kernel_package_name =' | sort -V | head -n 1)
|
||||
# To protect against obsolete rebuilds of self we need a provide equivalent to
|
||||
# %%source_rel on this package version, and do obsolete of lower upload numbers
|
||||
# and lower rebuild numbers of %%name built against same kernel.
|
||||
# The %%source-rel is calculated from the subpackage version here.
|
||||
Provides: %name = %version-%source_rel
|
||||
%obsolete_rebuilds_subpackage %name
|
||||
|
||||
%description
|
||||
%(rpm -q --qf '%%{DESCRIPTION}' %kernel_package_name)
|
||||
%extradescription
|
||||
|
||||
This is a subpackage of %kernel_package_name. Development files are in
|
||||
%kernel_package_name-devel, sources in kernel-source%variant, and
|
||||
debug information in %kernel_package_name-debuginfo.
|
||||
|
||||
%package rebuild
|
||||
Summary: Empty package to ensure rebuilding %name in OBS
|
||||
Group: Other
|
||||
Requires: %kernel_package_name = %rpm_kver-%rpm_krel
|
||||
|
||||
%description rebuild
|
||||
This is empty package that ensures %name is rebuilt every time
|
||||
%kernel_package_name is rebuilt in OBS.
|
||||
|
||||
There is no reason to install this package.
|
||||
|
||||
%files rebuild
|
||||
|
||||
%prep
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux*'
|
||||
# Modules should be already signed, do not sign again (bsc#1251930)
|
||||
export BRP_PESIGN_FILES=""
|
||||
|
||||
echo "%{?modules}" | tr ', ' '\n\n' > request-modules
|
||||
%scriptdir/kernel-subpackage-build %kernel_package_name %rpm_kver-%rpm_krel %package_name-%version-%release
|
||||
|
||||
%pre -f prein.sh
|
||||
|
||||
%post -f postin.sh
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%posttrans -f posttrans.sh
|
||||
|
||||
%files -f subpackage.flist
|
||||
|
||||
%changelog
|
||||
299140
kernel-syms.changes
299140
kernel-syms.changes
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package kernel-syms
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -12,69 +12,43 @@
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
%define git_commit 5725decbef8de98414e5d1eea61d668325003e24
|
||||
%define variant %{nil}
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
Name: kernel-syms
|
||||
Summary: Kernel Symbol Versions (modversions)
|
||||
Version: 3.8.2
|
||||
%if %using_buildservice
|
||||
Release: 0
|
||||
Version: 4.12.14
|
||||
%if 0%{?is_kotd}
|
||||
Release: <RELEASE>.g5725dec
|
||||
%else
|
||||
%define kernel_source_release %(LC_ALL=C rpm -q kernel-devel%variant-%version --qf "%{RELEASE}" | grep -v 'not installed' || echo 0)
|
||||
Release: %kernel_source_release
|
||||
Release: 0
|
||||
%endif
|
||||
License: GPL-2.0
|
||||
Summary: Kernel Symbol Versions (modversions)
|
||||
License: GPL-2.0-only
|
||||
Group: Development/Sources
|
||||
Url: http://www.kernel.org/
|
||||
AutoReqProv: off
|
||||
URL: https://www.kernel.org/
|
||||
BuildRequires: coreutils
|
||||
%ifarch armv7hl
|
||||
Requires: kernel-cubox-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch aarch64 armv7hl %ix86 ia64 ppc ppc64 s390x x86_64
|
||||
ExclusiveArch: aarch64 ppc64le s390x x86_64
|
||||
Prefix: /usr/src
|
||||
AutoReqProv: off
|
||||
Source: README.KSYMS
|
||||
%ifarch aarch64 ppc64le s390x x86_64
|
||||
Requires: kernel-default-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch %ix86 x86_64
|
||||
Requires: kernel-desktop-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch armv7hl
|
||||
Requires: kernel-exynos-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch armv7hl
|
||||
Requires: kernel-imx51-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch armv7hl
|
||||
Requires: kernel-omap2plus-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch %ix86
|
||||
Requires: kernel-pae-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch s390
|
||||
Requires: kernel-s390-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch armv7hl
|
||||
Requires: kernel-u8500-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch armv5tel
|
||||
Requires: kernel-versatile-devel = %version-%source_rel
|
||||
%endif
|
||||
%ifarch %ix86 x86_64
|
||||
Requires: kernel-xen-devel = %version-%source_rel
|
||||
%endif
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name = %version-%source_rel
|
||||
Source: README.KSYMS
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: %ix86 aarch64 armv5tel armv7hl ia64 ppc ppc64 s390 s390x x86_64
|
||||
Prefix: /usr/src
|
||||
Provides: %name = %version-%source_rel
|
||||
Provides: %name-srchash-%git_commit
|
||||
Provides: multiversion(kernel)
|
||||
|
||||
# Force bzip2 instead of lzma compression to
|
||||
# 1) allow install on older dist versions, and
|
||||
# 2) decrease build times (bsc#962356 boo#1175882)
|
||||
%define _binary_payload w9.bzdio
|
||||
|
||||
%description
|
||||
Kernel symbols, such as functions and variables, have version
|
||||
@@ -86,14 +60,14 @@ package dependencies.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
|
||||
%files
|
||||
%dir %_docdir/%name
|
||||
%_docdir/%name/README.SUSE
|
||||
|
||||
%prep
|
||||
|
||||
%install
|
||||
install -m 644 -D %{SOURCE0} %buildroot/%_docdir/%name/README.SUSE
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%dir %_docdir/%name
|
||||
%_docdir/%name/README.SUSE
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-syms@VARIANT@
|
||||
#
|
||||
# Copyright (c) @YEAR@ SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
%define variant @VARIANT@%{nil}
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
Name: kernel-syms@VARIANT@
|
||||
Summary: Kernel Symbol Versions (modversions)
|
||||
Version: @RPMVERSION@
|
||||
%if %using_buildservice
|
||||
Release: @RELEASE@
|
||||
%else
|
||||
%define kernel_source_release %(LC_ALL=C rpm -q kernel-devel%variant-%version --qf "%{RELEASE}" | grep -v 'not installed' || echo 0)
|
||||
Release: %kernel_source_release
|
||||
%endif
|
||||
License: GPL-2.0
|
||||
Group: Development/Sources
|
||||
Url: http://www.kernel.org/
|
||||
AutoReqProv: off
|
||||
BuildRequires: coreutils
|
||||
@REQUIRES@
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name = %version-%source_rel
|
||||
Source: README.KSYMS
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: @ARCHS@
|
||||
Prefix: /usr/src
|
||||
|
||||
%description
|
||||
Kernel symbols, such as functions and variables, have version
|
||||
information attached to them. This package contains the symbol versions
|
||||
for the standard kernels.
|
||||
|
||||
This package is needed for compiling kernel module packages with proper
|
||||
package dependencies.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
|
||||
%install
|
||||
install -m 644 -D %{SOURCE0} %buildroot/%_docdir/%name/README.SUSE
|
||||
|
||||
%files
|
||||
%defattr(-, root, root)
|
||||
%dir %_docdir/%name
|
||||
%_docdir/%name/README.SUSE
|
||||
|
||||
%changelog
|
||||
27769
kernel-trace.changes
27769
kernel-trace.changes
File diff suppressed because it is too large
Load Diff
@@ -1,967 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-trace
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor trace
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-trace
|
||||
Summary: The Standard Kernel with Tracing Features
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
%ifarch ppc64
|
||||
Provides: kernel-kdump
|
||||
Obsoletes: kernel-kdump
|
||||
%endif
|
||||
%ifarch s390
|
||||
Provides: kernel-32bit
|
||||
Obsoletes: kernel-32bit
|
||||
%endif
|
||||
%ifarch s390x
|
||||
Provides: kernel-64bit
|
||||
Obsoletes: kernel-64bit
|
||||
%endif
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: %ix86 ia64 ppc64 s390 s390x x86_64
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
This kernel has different tracing features enabled (e.g. utrace, ftrace).
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: The Standard Kernel with Tracing Features - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
This kernel has different tracing features enabled (e.g. utrace, ftrace).
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: The Standard Kernel with Tracing Features - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
This kernel has different tracing features enabled (e.g. utrace, ftrace).
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
27769
kernel-u8500.changes
27769
kernel-u8500.changes
File diff suppressed because it is too large
Load Diff
@@ -1,959 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-u8500
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor u8500
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-u8500
|
||||
Summary: Kernel for ST-Ericsson's Nova SoC
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: armv7hl
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
The standard kernel for ST-Ericsson's Nova SoC, as found in
|
||||
devices like the Snowball.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: Kernel for ST-Ericsson's Nova SoC - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
The standard kernel for ST-Ericsson's Nova SoC, as found in
|
||||
devices like the Snowball.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: Kernel for ST-Ericsson's Nova SoC - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
The standard kernel for ST-Ericsson's Nova SoC, as found in
|
||||
devices like the Snowball.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
299140
kernel-vanilla.changes
299140
kernel-vanilla.changes
File diff suppressed because it is too large
Load Diff
2204
kernel-vanilla.spec
2204
kernel-vanilla.spec
File diff suppressed because it is too large
Load Diff
27769
kernel-versatile.changes
27769
kernel-versatile.changes
File diff suppressed because it is too large
Load Diff
@@ -1,956 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-versatile
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor versatile
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-versatile
|
||||
Summary: Kernel for Versatile SoC
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: armv5tel
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
The standard kernel for Versatile SoC, or for emulation with QEMU.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: Kernel for Versatile SoC - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
The standard kernel for Versatile SoC, or for emulation with QEMU.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: Kernel for Versatile SoC - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
The standard kernel for Versatile SoC, or for emulation with QEMU.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
27769
kernel-xen.changes
27769
kernel-xen.changes
File diff suppressed because it is too large
Load Diff
965
kernel-xen.spec
965
kernel-xen.spec
@@ -1,965 +0,0 @@
|
||||
#
|
||||
# spec file for package kernel-xen
|
||||
#
|
||||
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
# This makes the OBS store the project cert as %_sourcedir/_projectcert.crt
|
||||
# needssslcertforbuild
|
||||
|
||||
%define srcversion 3.8
|
||||
%define patchversion 3.8.2
|
||||
%define variant %{nil}
|
||||
%define vanilla_only 0
|
||||
|
||||
%include %_sourcedir/kernel-spec-macros
|
||||
|
||||
%define build_flavor xen
|
||||
%define build_default (%build_flavor == "default")
|
||||
%define build_kdump (%build_flavor == "kdump")
|
||||
%define build_xen (%build_flavor == "xen" || %build_flavor == "ec2")
|
||||
%define build_vanilla (%build_flavor == "vanilla")
|
||||
%define build_ps3 (%build_flavor == "ps3")
|
||||
|
||||
%define build_src_dir %my_builddir/linux-%srcversion
|
||||
%define src_install_dir /usr/src/linux-%kernelrelease%variant
|
||||
%define obj_install_dir %src_install_dir-obj
|
||||
%define rpm_install_dir %buildroot%obj_install_dir
|
||||
%define kernel_build_dir %my_builddir/linux-obj
|
||||
|
||||
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,check-supported-list,group-source-files.pl,find-provides,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,configtool.pl,log.sh,try-disable-staging-driver})
|
||||
|
||||
%global cpu_arch %(%_sourcedir/arch-symbols %_target_cpu)
|
||||
%define cpu_arch_flavor %cpu_arch/%build_flavor
|
||||
|
||||
# Define some CONFIG variables as rpm macros as well. (rpm cannot handle
|
||||
# defining them all at once.)
|
||||
%define config_vars CONFIG_MODULES CONFIG_KMSG_IDS CONFIG_SPLIT_PACKAGE CONFIG_ENTERPRISE_SUPPORT CONFIG_EFI_STUB
|
||||
%{expand:%(eval "$(test -n "%cpu_arch_flavor" && tar -xjf %_sourcedir/config.tar.bz2 --to-stdout config/%cpu_arch_flavor)"; for config in %config_vars; do echo "%%global $config ${!config:-n}"; done)}
|
||||
%define split_base (%CONFIG_SPLIT_PACKAGE == "y")
|
||||
%define split_extra (%CONFIG_SPLIT_PACKAGE == "y" && %CONFIG_ENTERPRISE_SUPPORT == "y")
|
||||
|
||||
%ifarch %ix86 x86_64
|
||||
%define install_vdso 1
|
||||
%else
|
||||
%define install_vdso 0
|
||||
%endif
|
||||
|
||||
Name: kernel-xen
|
||||
Summary: The Xen Kernel
|
||||
Version: 3.8.2
|
||||
Release: 0
|
||||
License: GPL-2.0
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
BuildRequires: coreutils module-init-tools sparse bc
|
||||
BuildRequires: fdupes
|
||||
# Used to sign the kernel in the buildservice
|
||||
BuildRequires: pesign-obs-integration
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %{name}_%_target_cpu = %version-%release
|
||||
Provides: %name = %version-%source_rel
|
||||
%if %split_base
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
# Obsolete the -base subpackage from 11.1 and 11.2 development phase
|
||||
Obsoletes: %name-base <= 2.6.31
|
||||
%endif
|
||||
Requires(pre): coreutils awk
|
||||
# Need a module-init-tools with /usr/lib/module-init-tools/weak-modules2
|
||||
Requires(post): module-init-tools >= 3.4
|
||||
# This Requires is wrong, because the post/postun scripts have a
|
||||
# test -x update-bootloader, having perl-Bootloader is not a hard requirement.
|
||||
# But, there is no way to tell rpm or yast to schedule the installation
|
||||
# of perl-Bootloader before kernel-binary.rpm if both are in the list of
|
||||
# packages to install/update. Likewise, this is true for mkinitrd.
|
||||
# Need a perl-Bootloader with /usr/lib/bootloader/bootloader_entry
|
||||
Requires(post): perl-Bootloader >= 0.4.15
|
||||
%if %build_vanilla
|
||||
Requires(post): mkinitrd
|
||||
%else
|
||||
# Require a mkinitrd that can handle usbhid/hid-generic built-in (bnc#773559)
|
||||
Requires(post): mkinitrd >= 2.7.1
|
||||
%endif
|
||||
# Install the package providing /etc/SuSE-release early enough, so that
|
||||
# the grub entry has correct title (bnc#757565)
|
||||
Requires(post): distribution-release
|
||||
# Do not install p-b and mkinitrd for the install check, the %post script is
|
||||
# able to handle this
|
||||
#!BuildIgnore: perl-Bootloader mkinitrd distribution-release
|
||||
# Remove some packages that are installed automatically by the build system,
|
||||
# but are not needed to build the kernel
|
||||
#!BuildIgnore: autoconf automake gettext-runtime libtool cvs gettext-tools m4 udev insserv
|
||||
|
||||
%ifarch ia64
|
||||
# arch/ia64/scripts/unwcheck.py
|
||||
BuildRequires: python
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
%if %build_vanilla && 0%{?suse_version} < 1130
|
||||
BuildRequires: dwarfextract
|
||||
%endif
|
||||
%endif
|
||||
%ifarch %arm
|
||||
BuildRequires: u-boot-tools
|
||||
%endif
|
||||
%if %build_xen
|
||||
%ifarch %ix86
|
||||
%if %build_flavor != "ec2"
|
||||
Provides: kernel-xenpae = %version
|
||||
Obsoletes: kernel-xenpae < %version
|
||||
%endif
|
||||
%endif
|
||||
#!BuildIgnore: xen
|
||||
%endif
|
||||
|
||||
Provides: %name-nongpl = %version
|
||||
Obsoletes: %name-nongpl < %version
|
||||
%if %build_vanilla
|
||||
# force bzip2 instead of lzma compression to allow install on older dist versions
|
||||
%define _binary_payload w9.bzdio
|
||||
%endif
|
||||
# dead network if installed on SLES10, otherwise it will work (mostly)
|
||||
Conflicts: sysfsutils < 2.0
|
||||
Conflicts: apparmor-profiles <= 2.1
|
||||
Conflicts: apparmor-parser < 2.3
|
||||
# root-lvm only works with newer udevs
|
||||
Conflicts: udev < 118
|
||||
Conflicts: lvm2 < 2.02.33
|
||||
# Interface to hv_kvp_daemon changed
|
||||
Conflicts: hyper-v < 4
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
Provides: kernel = %version-%source_rel
|
||||
|
||||
|
||||
Source0: http://www.kernel.org/pub/linux/kernel/v3.x/linux-%srcversion.tar.bz2
|
||||
Source2: source-post.sh
|
||||
Source3: kernel-source.rpmlintrc
|
||||
Source8: devel-pre.sh
|
||||
Source9: devel-post.sh
|
||||
Source10: preun.sh
|
||||
Source11: postun.sh
|
||||
Source12: pre.sh
|
||||
Source13: post.sh
|
||||
Source14: series.conf
|
||||
Source16: guards
|
||||
Source17: apply-patches
|
||||
Source21: config.conf
|
||||
Source23: supported.conf
|
||||
Source33: check-for-config-changes
|
||||
Source34: check-supported-list
|
||||
Source35: group-source-files.pl
|
||||
Source37: README.SUSE
|
||||
Source38: README.KSYMS
|
||||
Source39: config-options.changes.txt
|
||||
Source40: source-timestamp
|
||||
Source44: find-provides
|
||||
Source45: split-modules
|
||||
Source46: modversions
|
||||
Source48: macros.kernel-source
|
||||
Source49: kernel-module-subpackage
|
||||
Source50: kabi.pl
|
||||
Source51: mkspec
|
||||
Source52: kernel-source%variant.changes
|
||||
Source53: kernel-source.spec.in
|
||||
Source54: kernel-binary.spec.in
|
||||
Source55: kernel-syms.spec.in
|
||||
Source56: kernel-docs.spec.in
|
||||
Source60: config.sh
|
||||
Source61: compute-PATCHVERSION.sh
|
||||
Source62: old-packages.conf
|
||||
Source63: arch-symbols
|
||||
Source64: package-descriptions
|
||||
Source65: kernel-spec-macros
|
||||
Source66: configtool.pl
|
||||
Source67: log.sh
|
||||
Source68: host-memcpy-hack.h
|
||||
Source69: try-disable-staging-driver
|
||||
Source100: config.tar.bz2
|
||||
Source101: config.addon.tar.bz2
|
||||
Source102: patches.arch.tar.bz2
|
||||
Source103: patches.drivers.tar.bz2
|
||||
Source104: patches.fixes.tar.bz2
|
||||
Source105: patches.rpmify.tar.bz2
|
||||
Source106: patches.suse.tar.bz2
|
||||
Source107: patches.xen.tar.bz2
|
||||
Source108: patches.addon.tar.bz2
|
||||
Source109: patches.kernel.org.tar.bz2
|
||||
Source110: patches.apparmor.tar.bz2
|
||||
Source111: patches.rt.tar.bz2
|
||||
Source112: patches.trace.tar.bz2
|
||||
Source113: patches.kabi.tar.bz2
|
||||
Source120: kabi.tar.bz2
|
||||
Source121: sysctl.tar.bz2
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
ExclusiveArch: %ix86 x86_64
|
||||
%define kmp_target_cpu %_target_cpu
|
||||
%ifarch %ix86
|
||||
# Only i386/default supports i586, mark other flavors' packages as i686
|
||||
%if ! %build_default
|
||||
BuildArch: i686
|
||||
# KMPs are always built as i586, because rpm does not allow to build
|
||||
# subpackages for different architectures. Therefore, we change the
|
||||
# /usr/src/linux-obj/<arch> symlink to i586.
|
||||
%define kmp_target_cpu i586
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# These files are found in the kernel-source package:
|
||||
NoSource: 0
|
||||
NoSource: 100
|
||||
NoSource: 101
|
||||
NoSource: 102
|
||||
NoSource: 103
|
||||
NoSource: 104
|
||||
NoSource: 105
|
||||
NoSource: 106
|
||||
NoSource: 107
|
||||
NoSource: 108
|
||||
NoSource: 109
|
||||
NoSource: 110
|
||||
NoSource: 111
|
||||
NoSource: 112
|
||||
NoSource: 113
|
||||
NoSource: 120
|
||||
NoSource: 121
|
||||
|
||||
# The following KMPs have been integrated into the kernel package,
|
||||
# grouped by the last product that contained them.
|
||||
# sles10 / 10.3
|
||||
Obsoletes: iwlwifi-kmp-%build_flavor
|
||||
Obsoletes: ipw3945-kmp-%build_flavor
|
||||
# sles10 / 11.0
|
||||
Obsoletes: uvcvideo-kmp-%build_flavor
|
||||
# 11.0
|
||||
Obsoletes: atl2-kmp-%build_flavor
|
||||
Obsoletes: wlan-ng-kmp-%build_flavor
|
||||
Obsoletes: et131x-kmp-%build_flavor
|
||||
Obsoletes: ivtv-kmp-%build_flavor
|
||||
Obsoletes: at76_usb-kmp-%build_flavor
|
||||
Obsoletes: pcc-acpi-kmp-%build_flavor
|
||||
Obsoletes: btusb-kmp-%build_flavor
|
||||
# sle11-ga
|
||||
Obsoletes: enic-kmp-%build_flavor
|
||||
Obsoletes: fnic-kmp-%build_flavor
|
||||
Obsoletes: brocade-bfa-kmp-%build_flavor
|
||||
Obsoletes: kvm-kmp-%build_flavor
|
||||
Obsoletes: perfmon-kmp-%build_flavor
|
||||
Obsoletes: iwlagn-2-6-27-kmp-%build_flavor
|
||||
Obsoletes: msi-wmi-kmp-%build_flavor
|
||||
# sle11
|
||||
Obsoletes: ocfs2-kmp-%build_flavor
|
||||
# 11.1
|
||||
Obsoletes: quickcam-kmp-%build_flavor < 0.6.7
|
||||
|
||||
# Provide the exported symbols as "ksym(symbol) = hash"
|
||||
%define __find_provides %_sourcedir/find-provides %name
|
||||
|
||||
# Will modules not listed in supported.conf abort the kernel build (0/1)?
|
||||
%define supported_modules_check 0
|
||||
|
||||
%description
|
||||
The Linux kernel for Xen paravirtualization.
|
||||
|
||||
This kernel can be used both as the domain0 ("xen0") and as an
|
||||
unprivileged ("xenU") kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%prep
|
||||
if ! [ -e %_sourcedir/linux-%srcversion.tar.bz2 ]; then
|
||||
echo "The %name-%version.nosrc.rpm package does not contain the" \
|
||||
"complete sources. Please install kernel-source-%version.src.rpm."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
SYMBOLS=
|
||||
if test -e %_sourcedir/extra-symbols; then
|
||||
SYMBOLS=$(cat %_sourcedir/extra-symbols)
|
||||
echo "extra symbol(s):" $SYMBOLS
|
||||
fi
|
||||
|
||||
# Unpack all sources and patches
|
||||
%setup -q -c -T -a 0 -a 100 -a 101 -a 102 -a 103 -a 104 -a 105 -a 106 -a 107 -a 108 -a 109 -a 110 -a 111 -a 112 -a 113 -a 120 -a 121
|
||||
|
||||
mkdir -p %kernel_build_dir
|
||||
|
||||
supported_conf() {
|
||||
%_sourcedir/guards $* < %_sourcedir/supported.conf | \
|
||||
sed 's,.*/,,; s,\.ko$,,' | sort -u
|
||||
}
|
||||
|
||||
# Generate the list of modules to be marked as supported
|
||||
{ supported_conf base
|
||||
supported_conf --default=0 external | sed 's/$/ external/'
|
||||
} > %kernel_build_dir/Module.supported
|
||||
supported_conf --default=0 base >%kernel_build_dir/Module.base
|
||||
|
||||
cd linux-%srcversion
|
||||
|
||||
%_sourcedir/apply-patches \
|
||||
%if %{build_vanilla}
|
||||
--vanilla \
|
||||
%endif
|
||||
%_sourcedir/series.conf .. $SYMBOLS
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
# Override the timestamp 'uname -v' reports with the source timestamp and
|
||||
# the commit hash.
|
||||
date=$(head -n 1 %_sourcedir/source-timestamp)
|
||||
commit=$(sed -n 's/GIT Revision: //p' %_sourcedir/source-timestamp)
|
||||
cat > .kernel-binary.spec.buildenv <<EOF
|
||||
export KBUILD_BUILD_TIMESTAMP="$(LANG=C date -d "$date") (${commit:0:7})"
|
||||
export KBUILD_VERBOSE=0
|
||||
export KBUILD_SYMTYPES=1
|
||||
export KBUILD_OVERRIDE=1
|
||||
export KBUILD_BUILD_USER=geeko
|
||||
export KBUILD_BUILD_HOST=buildhost
|
||||
export HOST_EXTRACFLAGS="-include %_sourcedir/host-memcpy-hack.h"
|
||||
EOF
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
if [ -f %_sourcedir/localversion ] ; then
|
||||
cat %_sourcedir/localversion > localversion
|
||||
fi
|
||||
|
||||
if test -e ../config.addon/%cpu_arch_flavor; then
|
||||
# FIXME: config.addon doesn't affect the %CONFIG_ macros defined at
|
||||
# the top of the specfile
|
||||
%_sourcedir/configtool.pl ../config{,.addon}/%cpu_arch_flavor >.config
|
||||
else
|
||||
cp ../config/%cpu_arch_flavor .config
|
||||
fi
|
||||
%build_src_dir/scripts/config \
|
||||
--set-str CONFIG_LOCALVERSION %release_num-%build_flavor \
|
||||
--enable CONFIG_SUSE_KERNEL \
|
||||
%if 0%{?__debug_package:1}
|
||||
--enable CONFIG_DEBUG_INFO \
|
||||
--disable CONFIG_DEBUG_INFO_REDUCED
|
||||
%else
|
||||
--disable CONFIG_DEBUG_INFO
|
||||
%endif
|
||||
|
||||
MAKE_ARGS="$MAKE_ARGS -C %build_src_dir O=$PWD"
|
||||
if test -e %_sourcedir/TOLERATE-UNKNOWN-NEW-CONFIG-OPTIONS; then
|
||||
yes '' | make oldconfig $MAKE_ARGS
|
||||
else
|
||||
cp .config .config.orig
|
||||
make silentoldconfig $MAKE_ARGS < /dev/null
|
||||
%_sourcedir/check-for-config-changes .config.orig .config
|
||||
rm .config.orig
|
||||
fi
|
||||
|
||||
make prepare $MAKE_ARGS
|
||||
make scripts $MAKE_ARGS
|
||||
krel=$(make -s kernelrelease $MAKE_ARGS)
|
||||
|
||||
if [ "$krel" != "%kernelrelease-%build_flavor" ]; then
|
||||
echo "Kernel release mismatch: $krel != %kernelrelease-%build_flavor" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make clean $MAKE_ARGS
|
||||
|
||||
rm -f source
|
||||
find . ! -type d -printf '%%P\n' > %my_builddir/obj-files
|
||||
|
||||
%build
|
||||
cd %kernel_build_dir
|
||||
source .kernel-binary.spec.buildenv
|
||||
|
||||
# create *.symref files in the tree
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symtypes-%build_flavor; then
|
||||
%_sourcedir/modversions --unpack . < $_
|
||||
fi
|
||||
|
||||
# The %{_smp_mflags} macro is defined to a number, make will spawn that many jobs.
|
||||
# There are several ways how to define it:
|
||||
# If you are using the build script:
|
||||
# build --jobs=N kernel-$flavor.spec
|
||||
# With plain rpmbuild:
|
||||
# rpmbuild -ba --define 'jobs N' kernel-$flavor.spec
|
||||
# To spawn as many jobs as there are cpu cores:
|
||||
# rpmbuild -ba --define "%_smp_mflags -j 0$(grep -Ec 'cpu[0-9]' /proc/stat)" \
|
||||
# kernel-$flavor.spec
|
||||
# You can also set this permanently in ~/.rpmmacros:
|
||||
# %_smp_mflags -j 0%(grep -Ec 'cpu[0-9]' /proc/stat)
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
chmod +x ../linux-%srcversion/scripts/kmsg-doc
|
||||
MAKE_ARGS="$MAKE_ARGS D=2"
|
||||
%endif
|
||||
|
||||
while true; do
|
||||
make %{?_smp_mflags} all $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y 2>&1 \
|
||||
| tee buildlog
|
||||
if test "${PIPESTATUS[0]}" -eq 0; then
|
||||
break
|
||||
fi
|
||||
# In the linux-next and vanilla branches, we try harder to build a
|
||||
# package.
|
||||
if test 0%vanilla_only -gt 0 &&
|
||||
%_sourcedir/try-disable-staging-driver buildlog; then
|
||||
echo "Retrying make"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%install
|
||||
|
||||
%if %CONFIG_EFI_STUB == "y"
|
||||
# sign the kernel in the buildservice
|
||||
%ifarch x86_64
|
||||
# XXX: only do it on x86_64, as the repackaging changes kernel-pae
|
||||
# from i686 to i586
|
||||
export BRP_PESIGN_FILES="/boot/vmlinuz-%kernelrelease-%build_flavor"
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# get rid of /usr/lib/rpm/brp-strip-debug
|
||||
# strip removes too much from the vmlinux ELF binary
|
||||
export NO_BRP_STRIP_DEBUG=true
|
||||
export STRIP_KEEP_SYMTAB='*/vmlinux-*'
|
||||
|
||||
# /lib/modules/%kernelrelease-%build_flavor/build will be a stale symlink until the
|
||||
# kernel-devel package is installed. Don't check for stale symlinks
|
||||
# in the brp-symlink check:
|
||||
export NO_BRP_STALE_LINK_ERROR=yes
|
||||
|
||||
cd %kernel_build_dir
|
||||
|
||||
mkdir -p %buildroot/boot
|
||||
# (Could strip out non-public symbols.)
|
||||
cp -p System.map %buildroot/boot/System.map-%kernelrelease-%build_flavor
|
||||
|
||||
add_vmlinux()
|
||||
{
|
||||
local vmlinux=boot/vmlinux-%kernelrelease-%build_flavor compressed=false
|
||||
|
||||
if test $1 == "--compressed"; then
|
||||
compressed=true
|
||||
fi
|
||||
cp vmlinux %buildroot/$vmlinux
|
||||
>%my_builddir/vmlinux.debug.files
|
||||
%if 0%{?__debug_package:1}
|
||||
if $compressed; then
|
||||
local vmlinux_debug=usr/lib/debug/$vmlinux.debug
|
||||
mkdir -p $(dirname %buildroot/$vmlinux_debug)
|
||||
/usr/lib/rpm/debugedit -b $RPM_BUILD_DIR -d /usr/src/debug \
|
||||
-l vmlinux.sourcefiles %buildroot/$vmlinux
|
||||
# FIXME: create and package build-id symlinks
|
||||
objcopy --only-keep-debug \
|
||||
%buildroot/$vmlinux \
|
||||
%buildroot/$vmlinux_debug || :
|
||||
objcopy --add-gnu-debuglink=%buildroot/$vmlinux_debug \
|
||||
--strip-debug \
|
||||
%buildroot/$vmlinux || :
|
||||
mkdir -p %buildroot/usr/src/debug
|
||||
LANG=C sort -z -u vmlinux.sourcefiles | grep -Ezv "<(built-in|stdin)>" \
|
||||
| ( cd %_builddir && cpio -pd0m %buildroot/usr/src/debug )
|
||||
find %buildroot/usr/src/debug -type d -print0 | xargs -0 -r chmod 0755
|
||||
find %buildroot/usr/src/debug -type f -print0 | xargs -0 -r chmod 0644
|
||||
echo -e "%%defattr(-, root, root)\\n/$vmlinux_debug" >%my_builddir/vmlinux.debug.files
|
||||
else
|
||||
# make vmlinux executable so that find-debuginfo.sh picks it up
|
||||
# (TODO: fix find-debuginfo.sh instead)
|
||||
chmod +x %buildroot/$vmlinux
|
||||
fi
|
||||
%endif
|
||||
if $compressed; then
|
||||
gzip -n -9 %buildroot/$vmlinux
|
||||
chmod a-x %buildroot/$vmlinux.gz
|
||||
fi
|
||||
}
|
||||
|
||||
%if %build_kdump
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%else
|
||||
|
||||
# architecture specifics
|
||||
%ifarch %ix86 x86_64
|
||||
add_vmlinux --compressed
|
||||
image=bzImage
|
||||
%if %build_xen
|
||||
test -f arch/x86/boot/$image || image=vmlinuz
|
||||
%endif
|
||||
cp -p arch/x86/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch alpha
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/alpha/boot/vmlinux.gz %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch ppc ppc64
|
||||
add_vmlinux
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch ia64
|
||||
add_vmlinux --compressed
|
||||
mv %buildroot/boot/vmlinux-%kernelrelease-%build_flavor.gz \
|
||||
%buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinuz
|
||||
%endif
|
||||
%ifarch s390 s390x
|
||||
add_vmlinux --compressed
|
||||
cp -p arch/s390/boot/image %buildroot/boot/image-%kernelrelease-%build_flavor
|
||||
image=image
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
cp -p arch/s390/boot/kerntypes.o %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)"; then
|
||||
dwarfextract vmlinux %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
mkdir -p %buildroot/usr/share/man/man9
|
||||
find man -name '*.9' -exec install -m 644 -D '{}' %buildroot/usr/share/man/man9/ ';'
|
||||
%endif
|
||||
%endif
|
||||
%ifarch sparc64
|
||||
add_vmlinux --compressed
|
||||
image=zImage
|
||||
cp -p arch/sparc/boot/$image %buildroot/boot/vmlinuz-%kernelrelease-%build_flavor
|
||||
image=vmlinux
|
||||
%endif
|
||||
%ifarch %arm
|
||||
add_vmlinux --compressed
|
||||
case "%build_flavor" in
|
||||
default)
|
||||
image=zImage
|
||||
;;
|
||||
*)
|
||||
# quickly compile uImage so we have something to boot from
|
||||
make %{?_smp_mflags} uImage $MAKE_ARGS CONFIG_DEBUG_SECTION_MISMATCH=y
|
||||
image=uImage
|
||||
;;
|
||||
esac
|
||||
cp -p arch/arm/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
%ifarch aarch64
|
||||
add_vmlinux --compressed
|
||||
image=Image
|
||||
cp -p arch/arm64/boot/$image %buildroot/boot/$image-%kernelrelease-%build_flavor
|
||||
%endif
|
||||
|
||||
# end of build_kdump
|
||||
%endif
|
||||
|
||||
for sub in '-base' '' '-extra'; do
|
||||
case "$sub" in
|
||||
'-base' | '') base_package=1 ;;
|
||||
*) base_package=0 ;;
|
||||
esac
|
||||
for script in preun postun pre post devel-pre devel-post; do
|
||||
sed -e "s:@KERNELRELEASE@:%kernelrelease:g" \
|
||||
-e "s:@IMAGE@:$image:g" \
|
||||
-e "s:@FLAVOR""@:%build_flavor:g" \
|
||||
-e "s:@SUBPACKAGE@:%name$sub:g" \
|
||||
-e "s:@BASE_PACKAGE@:$base_package:g" \
|
||||
-e "s:@RPM_VERSION_RELEASE@:%version-%release:g" \
|
||||
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
|
||||
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
|
||||
-e "s:@SRCVARIANT@:%variant:g" \
|
||||
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
|
||||
done
|
||||
done
|
||||
|
||||
%if %build_kdump || %build_xen || %build_vanilla || %build_ps3
|
||||
# keep this -suffix list in sync with post.sh and postun.sh
|
||||
suffix=-%build_flavor
|
||||
%endif
|
||||
ln -s $image$suffix %buildroot/boot/$image$suffix
|
||||
ln -s initrd$suffix %buildroot/boot/initrd$suffix
|
||||
|
||||
cp -p .config %buildroot/boot/config-%kernelrelease-%build_flavor
|
||||
sysctl_file=%buildroot/boot/sysctl.conf-%kernelrelease-%build_flavor
|
||||
for file in %my_builddir/sysctl/{defaults,%cpu_arch/arch-defaults,%cpu_arch_flavor}; do
|
||||
if [ -f "$file" ]; then
|
||||
cat "$file"
|
||||
fi
|
||||
done | sed '1i # Generated file - do not edit.' >$sysctl_file
|
||||
if [ ! -s $sysctl_file ]; then
|
||||
rm $sysctl_file
|
||||
fi
|
||||
|
||||
%if %install_vdso
|
||||
# Install the unstripped vdso's that are linked in the kernel image
|
||||
make vdso_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
%endif
|
||||
|
||||
# Create a dummy initrd with roughly the size the real one will have.
|
||||
# That way, YaST will know that this package requires some additional
|
||||
# space in /boot.
|
||||
dd if=/dev/zero of=%buildroot/boot/initrd-%kernelrelease-%build_flavor \
|
||||
bs=1024 seek=2047 count=1
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
mkdir -p %rpm_install_dir/%cpu_arch_flavor
|
||||
mkdir -p %buildroot/usr/src/linux-obj/%cpu_arch
|
||||
ln -s %build_flavor %buildroot/usr/src/linux-obj/%cpu_arch_flavor
|
||||
|
||||
gzip -n -c9 < Module.symvers > %buildroot/boot/symvers-%kernelrelease-%build_flavor.gz
|
||||
|
||||
make modules_install $MAKE_ARGS INSTALL_MOD_PATH=%buildroot
|
||||
|
||||
if ! %_sourcedir/check-supported-list \
|
||||
%_sourcedir %buildroot/lib/modules/%kernelrelease-%build_flavor; then
|
||||
%if %supported_modules_check
|
||||
exit 1
|
||||
%endif
|
||||
echo "Consistency check error: please update supported.conf."
|
||||
fi
|
||||
|
||||
%ifarch s390 s390x
|
||||
if test -e arch/s390/boot/kerntypes.o; then
|
||||
:
|
||||
elif test -x "$(which dwarfextract 2>/dev/null)" -a \
|
||||
-f %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor; then
|
||||
find %buildroot -name "*.ko" > kofiles.list
|
||||
dwarfextract %buildroot/boot/Kerntypes-%kernelrelease-%build_flavor -C kofiles.list || echo "dwarfextract failed ($?)"
|
||||
fi
|
||||
%endif
|
||||
|
||||
# Also put the resulting file in %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
# so that kernel-devel + kernel-%build_flavor is sufficient for building
|
||||
# modules that have modversions as well.
|
||||
mkdir -p %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
cp Module.symvers %rpm_install_dir/%cpu_arch/%build_flavor
|
||||
|
||||
# Table of types used in exported symbols (for modversion debugging).
|
||||
%_sourcedir/modversions --pack . > %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
if [ -s %buildroot/boot/symtypes-%kernelrelease-%build_flavor ]; then
|
||||
gzip -n -9 %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
else
|
||||
rm -f %buildroot/boot/symtypes-%kernelrelease-%build_flavor
|
||||
fi
|
||||
|
||||
# Some architecture's $(uname -m) output is different from the ARCH
|
||||
# parameter that needs to be passed to kbuild. Create symlinks from
|
||||
# $(uname -m) to the ARCH directory.
|
||||
if [ ! -e %rpm_install_dir/%kmp_target_cpu ]; then
|
||||
ln -sf %cpu_arch %rpm_install_dir/%kmp_target_cpu
|
||||
ln -sf %cpu_arch %buildroot/usr/src/linux-obj/%kmp_target_cpu
|
||||
fi
|
||||
|
||||
# We were building in %my_builddir/linux-%srcversion, but the sources will
|
||||
# later be installed in /usr/src/linux-%srcversion-%source_rel. Fix up the
|
||||
# build symlink.
|
||||
rm -f %buildroot/lib/modules/%kernelrelease-%build_flavor/{source,build}
|
||||
ln -s %src_install_dir \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/source
|
||||
ln -s %obj_install_dir/%cpu_arch/%build_flavor \
|
||||
%buildroot/lib/modules/%kernelrelease-%build_flavor/build
|
||||
|
||||
# Abort if there are any undefined symbols
|
||||
msg="$(/sbin/depmod -F %buildroot/boot/System.map-%kernelrelease-%build_flavor \
|
||||
-b %buildroot -ae %kernelrelease-%build_flavor 2>&1)"
|
||||
if [ $? -ne 0 ] || echo "$msg" | grep 'needs unknown symbol'; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
%if %split_base
|
||||
%_sourcedir/split-modules -d %buildroot \
|
||||
-o %my_builddir \
|
||||
-b %kernel_build_dir/Module.base \
|
||||
%if ! %supported_modules_check
|
||||
-i \
|
||||
%endif
|
||||
-s %kernel_build_dir/Module.supported
|
||||
%if ! %split_extra
|
||||
cat %my_builddir/unsupported-modules >>%my_builddir/main-modules
|
||||
%endif
|
||||
|
||||
%else
|
||||
( cd %buildroot
|
||||
find lib/modules/%kernelrelease-%build_flavor -type f -name '*.ko' -printf '/%%p\n'
|
||||
) > %my_builddir/base-modules
|
||||
%endif
|
||||
|
||||
res=0
|
||||
if test -e %my_builddir/kabi/%cpu_arch/symvers-%build_flavor; then
|
||||
# check for kabi changes
|
||||
%_sourcedir/kabi.pl --rules %my_builddir/kabi/severities \
|
||||
%my_builddir/kabi/%cpu_arch/symvers-%build_flavor \
|
||||
Module.symvers || res=$?
|
||||
fi
|
||||
if [ $res -ne 0 ]; then
|
||||
# %ignore_kabi_badness is defined in the Kernel:* projects in the
|
||||
# OBS to be able to build the KOTD in spite of kabi errors
|
||||
if [ 0%{?ignore_kabi_badness} -eq 0 -a \
|
||||
! -e %my_builddir/kabi/%cpu_arch/ignore-%build_flavor -a \
|
||||
! -e %_sourcedir/IGNORE-KABI-BADNESS ]; then
|
||||
echo "Create a file IGNORE-KABI-BADNESS in the kernel-source" \
|
||||
"directory to build this kernel even though its badness is" \
|
||||
"higher than allowed for an official kernel."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# arch/powerpc/lib/crtsavres.o is required for building external
|
||||
# modules on powerpc
|
||||
if [ -f %kernel_build_dir/arch/powerpc/lib/crtsavres.o ]; then
|
||||
echo arch/powerpc/lib/crtsavres.o >> %my_builddir/obj-files
|
||||
fi
|
||||
|
||||
tar -cf - -T %my_builddir/obj-files | \
|
||||
tar -xf - -C %rpm_install_dir/%cpu_arch_flavor
|
||||
# bnc#507084
|
||||
find %rpm_install_dir/%cpu_arch_flavor/scripts -type f -perm -111 | \
|
||||
while read f; do
|
||||
case "$(file -b "$f")" in
|
||||
ELF\ *\ executable*)
|
||||
strip "$f"
|
||||
esac
|
||||
done
|
||||
# Replace the absolute with a relative path
|
||||
sed -i "s,%build_src_dir,../../../linux-%kernelrelease%variant,g" \
|
||||
%rpm_install_dir/%cpu_arch_flavor/Makefile
|
||||
fi
|
||||
|
||||
add_dirs_to_filelist() {
|
||||
sed -rn '
|
||||
# print file name
|
||||
p
|
||||
# remove filelist macros
|
||||
s:%%[a-z]+(\([^)]+\))? ?::g
|
||||
# add %%dir prefix
|
||||
s:^:%%dir :
|
||||
# print all parents
|
||||
:a
|
||||
# skip directories owned by other packages
|
||||
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
|
||||
s:/[^/]+$::p
|
||||
ta
|
||||
' "$@" | sort -u
|
||||
}
|
||||
|
||||
# Collect the file lists.
|
||||
shopt -s nullglob
|
||||
> %my_builddir/kernel-devel.files
|
||||
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
|
||||
f=${file##%buildroot}
|
||||
echo "$f" >> %my_builddir/kernel-devel.files
|
||||
done
|
||||
|
||||
{ cd %buildroot
|
||||
find boot \
|
||||
\( -type l -o -name 'initrd-*' \) -printf '%%%%ghost /%%p\n' -o \
|
||||
-type f -name 'vmlinux-*' -printf '%%%%attr(0644, root, root) /%%p\n' -o \
|
||||
-type f -printf '/%%p\n'
|
||||
|
||||
# Add the auto-generated (by mkdumprd) kdump initrd to %ghost so that
|
||||
# the file gets removed when uninstalling the kernel.
|
||||
echo '%%ghost /boot/initrd-%kernelrelease-%build_flavor-kdump'
|
||||
touch $RPM_BUILD_ROOT/boot/initrd-%kernelrelease-%build_flavor-kdump
|
||||
|
||||
if [ %CONFIG_MODULES = y ]; then
|
||||
find lib/modules/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
\( -path '*/modules.*' ! -path '*/modules.order' \
|
||||
! -path '*/modules.builtin' \) -printf '%%%%ghost /%%p\n' \
|
||||
-o -name '*.ko' -prune -o -printf '/%%p\n'
|
||||
cat %my_builddir/base-modules
|
||||
fi
|
||||
test -d lib/firmware/%kernelrelease-%build_flavor && \
|
||||
find lib/firmware/%kernelrelease-%build_flavor \
|
||||
-type d -o \
|
||||
-printf '/%%p\n'
|
||||
if [ -e .%_docdir/%name ]; then
|
||||
echo "%%doc %_docdir/%name"
|
||||
fi
|
||||
} | sort -u >%my_builddir/tmp
|
||||
cat %my_builddir/tmp %my_builddir/kernel-devel.files | sort | uniq -u | \
|
||||
add_dirs_to_filelist >%my_builddir/kernel-base.files
|
||||
rm %my_builddir/tmp
|
||||
|
||||
%if %split_base
|
||||
add_dirs_to_filelist %my_builddir/{kernel-base.files,main-modules} \
|
||||
> %my_builddir/kernel-main.files
|
||||
%endif
|
||||
%if %split_extra
|
||||
add_dirs_to_filelist %my_builddir/unsupported-modules > %my_builddir/kernel-extra.files
|
||||
%endif
|
||||
|
||||
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
|
||||
# much, but it keeps rpmlint from breaking the package build. Note that we skip
|
||||
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
|
||||
%fdupes $RPM_BUILD_ROOT/lib
|
||||
|
||||
%preun -f preun.sh
|
||||
|
||||
%postun -f postun.sh
|
||||
|
||||
%pre -f pre.sh
|
||||
|
||||
%post -f post.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files -f kernel-main.files
|
||||
%defattr(-, root, root)
|
||||
%else
|
||||
|
||||
%files -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package base
|
||||
Summary: The Xen Kernel - base modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: kernel-base = %version-%source_rel
|
||||
Conflicts: %name = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description base
|
||||
The Linux kernel for Xen paravirtualization.
|
||||
|
||||
This kernel can be used both as the domain0 ("xen0") and as an
|
||||
unprivileged ("xenU") kernel.
|
||||
|
||||
This package contains only the base modules, required in all installs.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun base -f preun-base.sh
|
||||
|
||||
%postun base -f postun-base.sh
|
||||
|
||||
%pre base -f pre-base.sh
|
||||
|
||||
%post base -f post-base.sh
|
||||
|
||||
%if %split_base
|
||||
|
||||
%files base -f kernel-base.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%package extra
|
||||
Summary: The Xen Kernel - Unsupported kernel modules
|
||||
Group: System/Kernel
|
||||
Url: http://www.kernel.org/
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-extra_%_target_cpu = %version-%release
|
||||
Provides: kernel-extra = %version-%source_rel
|
||||
Requires: %{name}_%_target_cpu = %version-%release
|
||||
Requires(pre): coreutils awk
|
||||
Requires(post): module-init-tools
|
||||
Requires(post): perl-Bootloader
|
||||
Requires(post): mkinitrd
|
||||
Supplements: packageand(product(SUSE_SLED):%{name}_%_target_cpu)
|
||||
%ifarch %ix86
|
||||
Conflicts: libc.so.6()(64bit)
|
||||
%endif
|
||||
|
||||
%description extra
|
||||
The Linux kernel for Xen paravirtualization.
|
||||
|
||||
This kernel can be used both as the domain0 ("xen0") and as an
|
||||
unprivileged ("xenU") kernel.
|
||||
|
||||
This package contains additional modules not supported by Novell.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%preun extra -f preun-extra.sh
|
||||
|
||||
%postun extra -f postun-extra.sh
|
||||
|
||||
%pre extra -f pre-extra.sh
|
||||
|
||||
%post extra -f post-extra.sh
|
||||
|
||||
%if %split_extra
|
||||
|
||||
%files extra -f kernel-extra.files
|
||||
%defattr(-, root, root)
|
||||
%endif
|
||||
|
||||
%if %CONFIG_KMSG_IDS == "y"
|
||||
|
||||
%package man
|
||||
Summary: The collection of man pages generated by the kmsg script.
|
||||
Group: System/Kernel
|
||||
|
||||
%description man
|
||||
This package includes the man pages that have been generated from the
|
||||
kmsg message documentation comments.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files man
|
||||
%defattr(-,root,root)
|
||||
/usr/share/man/man9/*
|
||||
%endif
|
||||
|
||||
%package devel
|
||||
Summary: Development files necessary for building kernel modules
|
||||
Group: Development/Sources
|
||||
Provides: multiversion(kernel)
|
||||
Provides: %name-devel = %version-%source_rel
|
||||
Requires: kernel-devel%variant = %version-%source_rel
|
||||
Supplements: packageand(%name:kernel-devel%variant)
|
||||
PreReq: coreutils
|
||||
|
||||
%description devel
|
||||
This package contains files necessary for building kernel modules (and
|
||||
kernel module packages) against the %build_flavor flavor of the kernel.
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%if %CONFIG_MODULES == "y"
|
||||
|
||||
%pre devel -f devel-pre.sh
|
||||
|
||||
%post devel -f devel-post.sh
|
||||
|
||||
%files devel -f kernel-devel.files
|
||||
%defattr(-,root,root)
|
||||
%dir %obj_install_dir
|
||||
%dir %obj_install_dir/%cpu_arch
|
||||
%dir /usr/src/linux-obj
|
||||
%dir /usr/src/linux-obj/%cpu_arch
|
||||
%ghost /usr/src/linux-obj/%cpu_arch_flavor
|
||||
%obj_install_dir/%cpu_arch_flavor
|
||||
%if %kmp_target_cpu != %cpu_arch
|
||||
%obj_install_dir/%kmp_target_cpu
|
||||
/usr/src/linux-obj/%kmp_target_cpu
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%package devel-debuginfo
|
||||
# rpm doesn't notice that vmlinux.debug belongs to the gzipped vmlinux.gz
|
||||
Summary: Debug information for package %name-devel
|
||||
Group: Development/Debug
|
||||
|
||||
%description devel-debuginfo
|
||||
Debug information for package %name-devel
|
||||
|
||||
|
||||
%source_timestamp
|
||||
%files devel-debuginfo -f vmlinux.debug.files
|
||||
|
||||
%changelog
|
||||
277185
kernel-zfcpdump.changes
Normal file
277185
kernel-zfcpdump.changes
Normal file
File diff suppressed because it is too large
Load Diff
1971
kernel-zfcpdump.spec
Normal file
1971
kernel-zfcpdump.spec
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:fce774b5313e73949cb35f128e91e7b2ccd7fa2438abc5cff69267e504395a45
|
||||
size 84623657
|
||||
BIN
linux-4.12.tar.xz
LFS
Normal file
BIN
linux-4.12.tar.xz
LFS
Normal file
Binary file not shown.
167
log.sh
167
log.sh
@@ -1,167 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# log.sh - Automate insertion of patches into a kernel rpm tree managed
|
||||
# with series.conf
|
||||
#
|
||||
# Usage example:
|
||||
#
|
||||
# osc branch openSUSE:11.3/kernel-source
|
||||
# osc co home:philipsb:branches:openSUSE:11.3:Update:Test/kernel-source
|
||||
# mv ~/linux-2.6/driver-fix-for-something.patch .
|
||||
# echo -e "\tpatches.drivers/driver-fix-for-something.patch" >> series.conf
|
||||
# ./log.sh
|
||||
# osc commit
|
||||
|
||||
#############################################################################
|
||||
# Copyright (c) 2004-2006,2008-2010 Novell, Inc.
|
||||
# All Rights Reserved.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or
|
||||
# modify it under the terms of version 2 of the GNU General Public License as
|
||||
# published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, contact Novell, Inc.
|
||||
#
|
||||
# To contact Novell about this file by physical or electronic mail,
|
||||
# you may find current contact information at www.novell.com
|
||||
#############################################################################
|
||||
|
||||
# Construct a changes entry and commit log from a patch.
|
||||
|
||||
CHANGES=kernel-source.changes
|
||||
|
||||
trap 'rm -rf "$tmpdir"' EXIT
|
||||
tmpdir=$(mktemp -d /tmp/${0##*/}.XXXXXX)
|
||||
message=$tmpdir/message
|
||||
|
||||
log_entry() {
|
||||
local entry=$1
|
||||
|
||||
echo "$entry" \
|
||||
| fmt --width 65 \
|
||||
| sed -e '1s/^/- /' -e '2,$s/^/ /' \
|
||||
>> $message
|
||||
}
|
||||
|
||||
|
||||
patch_meta() {
|
||||
local patch=$1
|
||||
|
||||
subject=$(formail -c -x Subject < "$patch" \
|
||||
| sed -e 's, *\[[#/ A-Za-z0-9-]*\],,')
|
||||
subject=${subject## }
|
||||
subject=${subject%.}
|
||||
|
||||
set -- $(formail -c -x References -x Reference < "$patch")
|
||||
references="$*"
|
||||
}
|
||||
|
||||
patch_log_entry() {
|
||||
local patch=$1 subject references old_subj old_ref old_patch="$tmpdir/old"
|
||||
|
||||
git show "HEAD:$patch" >"$old_patch" 2>/dev/null
|
||||
patch_meta "$old_patch"
|
||||
old_subj="$subject"
|
||||
old_ref="$references"
|
||||
|
||||
patch_meta "$patch"
|
||||
|
||||
local msg
|
||||
if test -z "$subject" -o "$subject" != "$old_subj"; then
|
||||
msg="$subject${references:+ ($references)}"
|
||||
elif test "$references" != "$old_ref"; then
|
||||
if test -n "$references"; then
|
||||
msg="Update references ($references)"
|
||||
fi
|
||||
else
|
||||
msg="Refresh"
|
||||
fi
|
||||
|
||||
log_entry "$patch: $msg${msg:+.}"
|
||||
}
|
||||
|
||||
find_patches() {
|
||||
osc diff series.conf \
|
||||
| sed -n "s/^+\s*\(patches.*\)/\1/p"
|
||||
}
|
||||
|
||||
for file in "$@" $(find_patches); do
|
||||
dirname=$(dirname $file)
|
||||
basename=$(basename $file)
|
||||
archive=$dirname.tar.bz2
|
||||
|
||||
if [ ! -f $basename ]; then
|
||||
echo "ERROR: $basename added to series.conf but doesn't exist in $PWD"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -d $dirname ]; then
|
||||
tar xvf $archive
|
||||
fi
|
||||
|
||||
mv $basename $dirname
|
||||
rm $archive
|
||||
tar cfj $archive $dirname
|
||||
|
||||
files[${#files[@]}]=$file
|
||||
done
|
||||
|
||||
if [ ${#files[@]} -eq 0 ]; then
|
||||
echo "No modified files" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for file in "${files[@]}"; do
|
||||
if [ "${file:0:1}" = - ]; then
|
||||
log_entry "${file:1}: Delete."
|
||||
else
|
||||
case "$file" in
|
||||
config/*)
|
||||
if [ -z "$configs_updated" ]; then
|
||||
log_entry "Update config files."
|
||||
configs_updated=1
|
||||
fi
|
||||
;;
|
||||
|
||||
patches.*)
|
||||
patch_log_entry "$file"
|
||||
;;
|
||||
|
||||
kabi/*/symvers-* | kabi/*/symtypes-* | kabi/*/symsets-* )
|
||||
if [ -z "$symvers_updated" ]; then
|
||||
log_entry "Update reference module symbol versions."
|
||||
symvers_updated=1
|
||||
fi
|
||||
;;
|
||||
|
||||
series.conf)
|
||||
# don't log changes in there
|
||||
;;
|
||||
|
||||
*)
|
||||
log_entry "$file: "
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -s $message ]; then
|
||||
echo "- " >> $message
|
||||
fi
|
||||
|
||||
if osc vc $CHANGES $message; then
|
||||
entry=$(sed -ne '1,2d' -e '/^--*$/!p' -e '/^--*$/q' $CHANGES)
|
||||
entry=${entry##$'\n'}
|
||||
entry=${entry%%$'\n'}
|
||||
fi
|
||||
|
||||
for c in *.changes; do
|
||||
[ $c = $CHANGES ] && continue
|
||||
cp $CHANGES $c
|
||||
done
|
||||
@@ -1,12 +1,59 @@
|
||||
# A few cross-distro definitions:
|
||||
%kernel_build_shell_package %{lua: \
|
||||
if ((tonumber(rpm.expand("0%{?suse_version}")) > 1500) or (tonumber(rpm.expand("0%{?sle_version}")) > 150300)) then \
|
||||
print( "bash-sh" ) \
|
||||
else \
|
||||
print( "" ) \
|
||||
end
|
||||
}
|
||||
%usrmerged %{lua: susever = rpm.expand('%{?suse_version}'); if susever ~= '' and tonumber(susever) > 1550 then print('1') else print('0') end }
|
||||
%kernel_module_package_release 1
|
||||
%kernel_module_package_buildreqs module-init-tools kernel-syms
|
||||
%kernel_module_package_buildreqs modutils kernel-syms kmod-compat suse-kernel-rpm-scriptlets %kernel_build_shell_package
|
||||
|
||||
%cpu_arch %(case %_target_cpu in \
|
||||
# from rpm --eval '%ix86' \
|
||||
(i?86 | pentium3 | pentium4 | athlon | geode) \
|
||||
echo "i386" \
|
||||
;; \
|
||||
(aarch64) \
|
||||
echo "arm64" \
|
||||
;; \
|
||||
(*)\
|
||||
echo "%_target_cpu" \
|
||||
;; \
|
||||
esac)
|
||||
|
||||
%linux_arch %(case %cpu_arch in \
|
||||
(x86_64 | i386) \
|
||||
echo "x86" \
|
||||
;; \
|
||||
(ppc*) \
|
||||
echo "powerpc" \
|
||||
;; \
|
||||
(s390x) \
|
||||
echo "s390" \
|
||||
;; \
|
||||
(arm64) \
|
||||
echo "arm64" \
|
||||
;; \
|
||||
(armv*) \
|
||||
echo "arm" \
|
||||
;; \
|
||||
(riscv*) \
|
||||
echo "riscv" \
|
||||
;;
|
||||
(*) \
|
||||
echo "%cpu_arch" \
|
||||
;; \
|
||||
esac)
|
||||
|
||||
%linux_make_arch ARCH=%linux_arch
|
||||
|
||||
# Defines %flavors_to_build and %kernel_source() as a side effect.
|
||||
%_kernel_module_package(n:v:r:t:f:Xp:b) \
|
||||
%_kernel_module_package(n:v:r:t:f:Xp:bc:) \
|
||||
%{expand:%( \
|
||||
subpkg=%{-t*}%{!-t:/usr/lib/rpm/kernel-module-subpackage} \
|
||||
echo "%%define _suse_kernel_module_subpackage(n:v:r:f:p:b) %%{expand:%%(cd %_sourcedir; cat $subpkg; echo %%%%nil)}" \
|
||||
echo "%%define _suse_kernel_module_subpackage(n:v:r:f:p:bc) %%{expand:%%(cd %_sourcedir; cat $subpkg; echo %%%%nil)}" \
|
||||
flavors_to_build= \
|
||||
flavors="%*" \
|
||||
for flavor in $(ls /usr/src/linux-obj/%_target_cpu 2>/dev/null); do \
|
||||
@@ -16,10 +63,10 @@
|
||||
(*) \
|
||||
[ -z "%{-X}" -a -n "$flavors" ] && continue ;; \
|
||||
esac \
|
||||
krel=$(make -s -C /usr/src/linux-obj/%_target_cpu/$flavor kernelrelease) \
|
||||
krel=$(make -si -C /usr/src/linux-obj/%_target_cpu/$flavor/ %linux_make_arch kernelrelease 2>/dev/null) \
|
||||
kver=${krel%%-*} \
|
||||
flavors_to_build="$flavors_to_build $flavor" \
|
||||
echo "%%_suse_kernel_module_subpackage -n %{-n*}%{!-n:%name}-kmp -v %{-v*}%{!-v:%version} -r %{-r*}%{!-r:%release} %{-p} %{-b} $flavor $kver" \
|
||||
echo "%%_suse_kernel_module_subpackage -n %{-n*}%{!-n:%name} -v %{-v*}%{!-v:%version} -r %{-r*}%{!-r:%release} %{-f} %{-p} %{-b} %{-c:-c} $flavor $kver" \
|
||||
done \
|
||||
echo "%%global flavors_to_build${flavors_to_build:-%%nil}" \
|
||||
echo "%%{expand:%%(test -z '%flavors_to_build' && echo %%%%internal_kmp_error)}" \
|
||||
@@ -31,13 +78,23 @@
|
||||
echo "Summary: %summary" \
|
||||
echo "Group: %group" \
|
||||
echo "%description -n %{-n*}%{!-n:%name}-kmp-_dummy_" \
|
||||
%{-c:
|
||||
for fmt in DER PEM; do h=$(openssl x509 -inform $fmt -fingerprint -noout -in %{-c*}); if test -n "$h"; then break; fi; done \
|
||||
cert=$(echo "$h" | sed -rn 's/^SHA1 Fingerprint=//; T; s/://g; s/(.{8}).*/\\1/p')
|
||||
: The -n expanstion in kernel-cert-subpackage only works if
|
||||
: -n is actually passed to the macro. Fix this here, so that
|
||||
: we do not have to modify the modsign-repackage script
|
||||
sed "s|@CERTS@|$cert|g; s|%%{-n.}|%{-n*}%{!-n:%name}|g" /usr/lib/rpm/kernel-cert-subpackage \
|
||||
echo "%%global __spec_install_pre %%__spec_install_pre \\\\\
|
||||
mkdir -p %%buildroot/etc/uefi/certs; openssl x509 -in %{-c*} -inform $fmt -out %%buildroot/etc/uefi/certs/${cert}.crt -outform DER" } \
|
||||
)}
|
||||
|
||||
# kernel_module_package: simply pass on all options and arguments.
|
||||
%kernel_module_package(n:v:r:t:f:xp:b) \
|
||||
%{expand:%%_kernel_module_package %{-x:-X} %{-n} %{-v} %{-r} %{-t} %{-f} %{-p} %*}
|
||||
%kernel_module_package(n:v:r:t:f:xp:bc:) \
|
||||
%{expand:%%_kernel_module_package %{-x:-X} %{-n} %{-v} %{-r} %{-t} %{-f} %{-p} %{-b} %{-c} %*}
|
||||
|
||||
# suse_kernel_module_package: invert the meaning of the -x flag. (You are not
|
||||
# supposed to understand why a simple %{-x:}%{!-x:-x} won't work.)
|
||||
%suse_kernel_module_package(n:v:r:s:f:xp:b) \
|
||||
%{expand:%%_kernel_module_package %{-x: }%{!-x:-X} %{-n} %{-v} %{-r} %{-s:-t %{-s*}} %{-f} %{-p} %*}
|
||||
%suse_kernel_module_package(n:v:r:s:f:xp:bc:) \
|
||||
%{expand:%%_kernel_module_package %{-x: }%{!-x:-X} %{-n} %{-v} %{-r} %{-s:-t %{-s*}} %{-f} %{-p} %{-b} %{-c} %*}
|
||||
|
||||
|
||||
28
mergedep
Normal file
28
mergedep
Normal file
@@ -0,0 +1,28 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
KREL=$1
|
||||
|
||||
{ cat /lib/modules/$KREL/modules.dep ;
|
||||
cat /lib/modules/$KREL/modules.softdep | grep : | sed -e 's/^softdep //' -e 's/ \(pre\|post\):/:/' ; } \
|
||||
| \
|
||||
while read l ; do
|
||||
MOD=$(echo "$l" | sed -e 's/:.*//')
|
||||
MOD=$(basename $MOD)
|
||||
case $MOD in
|
||||
*.ko.xz|*.ko.gz|*.ko.zst)
|
||||
MOD=${MOD%.*};;
|
||||
esac
|
||||
MOD=${MOD%.ko}
|
||||
DEPS="$(echo "$l" | sed -e 's/.*://')"
|
||||
moddeps=""
|
||||
for dep in $DEPS ; do
|
||||
dep=$(basename $dep)
|
||||
case $dep in
|
||||
*.ko.xz|*.ko.gz|*.ko.zst)
|
||||
dep=${dep%.*};;
|
||||
esac
|
||||
dep=${dep%.ko}
|
||||
moddeps="$moddeps $dep"
|
||||
done
|
||||
[ -n "$moddeps" ] && echo $MOD:$moddeps ||:
|
||||
done
|
||||
313
mkspec
313
mkspec
@@ -1,313 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use File::Copy;
|
||||
use Getopt::Long;
|
||||
|
||||
my $dir = ".";
|
||||
my $rpmrelease;
|
||||
my $patches="";
|
||||
|
||||
GetOptions(
|
||||
"patches=s" => \$patches,
|
||||
"release=s" => \$rpmrelease
|
||||
) or die "Usage: $0 [--release <release>] [--patches <dir>]\n";
|
||||
|
||||
# flavor -> [supported archs]
|
||||
my %flavor_archs = parse_config_conf();
|
||||
# subset to include in kernel-syms
|
||||
my %syms_flavor_archs = parse_config_conf("syms");
|
||||
|
||||
# template name -> template body
|
||||
my %templates = read_spec_templates();
|
||||
|
||||
# config.sh variables
|
||||
my %vars = parse_config_sh();
|
||||
my ($srcversion, $variant, $vanilla_only) =
|
||||
($vars{'SRCVERSION'}, $vars{'VARIANT'}, $vars{'VANILLA_ONLY'});
|
||||
$vanilla_only ||= "0";
|
||||
|
||||
# package name -> [summary, description]
|
||||
my %binary_descriptions = parse_descriptions();
|
||||
|
||||
$patches="--patches $patches" if $patches;
|
||||
my $patchversion = `$dir/compute-PATCHVERSION.sh $patches`;
|
||||
chomp $patchversion;
|
||||
my $rpmversion = $patchversion;
|
||||
# stuff the -rcX tag into the rpm version if possible;
|
||||
$rpmversion =~ s/\.0-rc/.rc/;
|
||||
$rpmversion =~ s/-rc\d+//;
|
||||
$rpmversion =~ s/-/./g;
|
||||
|
||||
if (defined($rpmrelease)) {
|
||||
# convince abuild that we really want this release number
|
||||
xopen(my $fh, '>', "$dir/get_release_number.sh");
|
||||
print $fh "#!/bin/sh\n";
|
||||
print $fh "echo \"$rpmrelease.0\"\n";
|
||||
close($fh);
|
||||
chmod(0755, "$dir/get_release_number.sh");
|
||||
} else {
|
||||
$rpmrelease = "0";
|
||||
}
|
||||
$rpmrelease =~ s/-/./g;
|
||||
|
||||
my $sources = join("", $templates{source} =~ /\nSource\d+:[^\n]*/mg);
|
||||
# Find all SourceN: foo.tar.bz2 lines and generate the NoSource:
|
||||
# lines and the %setup line
|
||||
my @tarballs = ($sources =~ /\nSource(\d+):[^\n]*\.tar\.bz2/mg);
|
||||
my $nosource = join("\n", map { "NoSource: $_" } @tarballs);
|
||||
# Source0 (the linux tarball) is unpacked manually
|
||||
@tarballs = grep { $_ > 0 } @tarballs;
|
||||
my $unpack_patches = join(" ", map { "-a $_" } @tarballs);
|
||||
# List of scripts to automatically chmod +x before build
|
||||
my $scripts = join(",", grep { is_script($_) }
|
||||
($sources =~ /\nSource\d+:\s*([^\s]*)/mg));
|
||||
|
||||
my $tarball_url;
|
||||
if ($srcversion =~ /^(\d+)(?:\.\d+)*(-rc\d+)?$/) {
|
||||
$tarball_url = "http://www.kernel.org/pub/linux/kernel/v$1.x/";
|
||||
$tarball_url .= "testing/" if $2;
|
||||
} else {
|
||||
# kernel.org has no tarballs for linux-next or vanilla snapshots
|
||||
$tarball_url = "";
|
||||
}
|
||||
|
||||
my %macros = (
|
||||
VARIANT => $variant,
|
||||
VANILLA_ONLY => $vanilla_only,
|
||||
SRCVERSION => $srcversion,
|
||||
PATCHVERSION => $patchversion,
|
||||
RPMVERSION => $rpmversion,
|
||||
TARBALL_URL => $tarball_url,
|
||||
RELEASE => $rpmrelease,
|
||||
SOURCES => $sources,
|
||||
NOSOURCE => $nosource,
|
||||
UNPACK_PATCHES => $unpack_patches,
|
||||
SCRIPTS => $scripts,
|
||||
YEAR => (localtime time)[5] + 1900,
|
||||
);
|
||||
|
||||
# binary spec files
|
||||
for my $flavor (sort keys(%flavor_archs)) {
|
||||
my ($summary, $description);
|
||||
if (!exists($binary_descriptions{"kernel-$flavor"})) {
|
||||
print STDERR "warning: no description for kernel-$flavor found\n";
|
||||
$summary = "The Linux Kernel";
|
||||
$description = "The Linux Kernel.";
|
||||
} else {
|
||||
$summary = $binary_descriptions{"kernel-$flavor"}->[0];
|
||||
$description = $binary_descriptions{"kernel-$flavor"}->[1];
|
||||
}
|
||||
|
||||
do_spec('binary', "kernel-$flavor.spec", %macros,
|
||||
FLAVOR => $flavor,
|
||||
SUMMARY => $summary,
|
||||
DESCRIPTION => $description,
|
||||
ARCHS => join(" ", arch2rpm(@{$flavor_archs{$flavor}})),
|
||||
PROVIDES_OBSOLETES => provides_obsoletes($flavor, @{$flavor_archs{$flavor}}),
|
||||
);
|
||||
}
|
||||
# kernel-source.spec
|
||||
do_spec('source', "kernel-source$variant.spec", %macros);
|
||||
|
||||
# kernel-docs.spec
|
||||
do_spec('docs', "kernel-docs$variant.spec", %macros);
|
||||
|
||||
# kernel-syms.spec
|
||||
{
|
||||
my $requires = "";
|
||||
my %all_archs;
|
||||
for my $flavor (sort keys(%syms_flavor_archs)) {
|
||||
next if $flavor eq "vanilla";
|
||||
my @archs = arch2rpm(@{$syms_flavor_archs{$flavor}});
|
||||
$all_archs{$_} = 1 for @archs;
|
||||
$requires .= "%ifarch @archs\n";
|
||||
$requires .= "Requires: kernel-$flavor-devel = \%version-\%source_rel\n";
|
||||
$requires .= "%endif\n";
|
||||
}
|
||||
chomp $requires;
|
||||
if (keys(%all_archs)) {
|
||||
do_spec('syms', "kernel-syms$variant.spec", %macros,
|
||||
REQUIRES => $requires,
|
||||
ARCHS => join(" ", sort(keys(%all_archs))));
|
||||
}
|
||||
}
|
||||
|
||||
exit 0;
|
||||
|
||||
|
||||
|
||||
sub parse_config_conf {
|
||||
my @symbols = @_;
|
||||
my $symbols = join(' ', @symbols);
|
||||
my %res;
|
||||
|
||||
for my $arch (split(/\s+/, `$dir/arch-symbols --list`)) {
|
||||
my @flavors = `$dir/guards $arch $symbols < $dir/config.conf`;
|
||||
next if @flavors == 0;
|
||||
chomp @flavors;
|
||||
@flavors = map { s/.*\///; $_ } @flavors;
|
||||
for my $flavor (@flavors) {
|
||||
$res{$flavor} ||= [];
|
||||
push(@{$res{$flavor}}, $arch);
|
||||
}
|
||||
}
|
||||
for my $flavor (keys(%res)) {
|
||||
$res{$flavor} = [sort @{$res{$flavor}}];
|
||||
}
|
||||
return %res;
|
||||
}
|
||||
|
||||
sub read_spec_templates {
|
||||
my %res;
|
||||
|
||||
for my $template (qw(binary source syms docs)) {
|
||||
xopen(my $fh, '<', "$dir/kernel-$template.spec.in");
|
||||
local $/ = undef;
|
||||
$res{$template} = <$fh>;
|
||||
close($fh);
|
||||
}
|
||||
return %res;
|
||||
}
|
||||
|
||||
# return a hash of config.sh variables
|
||||
sub parse_config_sh {
|
||||
my %res;
|
||||
|
||||
xopen(my $fh, '<', "$dir/config.sh");
|
||||
while (<$fh>) {
|
||||
chomp;
|
||||
if (/^\s*([A-Z_]+)=(.*)/) {
|
||||
$res{$1} = $2;
|
||||
}
|
||||
}
|
||||
close($fh);
|
||||
return %res;
|
||||
}
|
||||
|
||||
sub parse_descriptions {
|
||||
my %res;
|
||||
my $current;
|
||||
my $blank = "";
|
||||
# 0 - expect summary, 1 - eating blank lines, 2 - reading description
|
||||
my $state = 0;
|
||||
|
||||
xopen(my $fh, '<', "$dir/package-descriptions");
|
||||
while (<$fh>) {
|
||||
next if /^\s*#/;
|
||||
|
||||
if (/^==+\s+([^\s]+)\s+==+\s*$/) {
|
||||
my $package = $1;
|
||||
if ($current) {
|
||||
chomp $current->[1];
|
||||
}
|
||||
$current = ["", ""];
|
||||
$res{$package} = $current;
|
||||
$state = 0;
|
||||
next;
|
||||
}
|
||||
if (/^$/) {
|
||||
if ($state == 2) {
|
||||
$blank .= $_;
|
||||
}
|
||||
next;
|
||||
}
|
||||
# non-blank line and not === package ===
|
||||
if ($state == 0) {
|
||||
chomp;
|
||||
$current->[0] = $_;
|
||||
$state = 1;
|
||||
} elsif ($state == 1) {
|
||||
$current->[1] = $_;
|
||||
$blank = "";
|
||||
$state = 2;
|
||||
} else {
|
||||
$current->[1] .= $blank;
|
||||
$blank = "";
|
||||
$current->[1] .= $_;
|
||||
}
|
||||
}
|
||||
if ($current) {
|
||||
chomp $current->[1];
|
||||
}
|
||||
close($fh);
|
||||
return %res;
|
||||
}
|
||||
|
||||
sub is_script {
|
||||
my $script = shift;
|
||||
|
||||
return undef if $script =~ /\.(tar\.(gz|bz2)|in|conf)$/;
|
||||
return undef if $script =~ /^README/;
|
||||
return 1 if $script =~ /\.pl$/;
|
||||
open(my $fh, '<', $script) or return undef;
|
||||
sysread($fh, my $shebang, 2);
|
||||
close($fh);
|
||||
return 1 if $shebang eq "#!";
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub arch2rpm {
|
||||
if (wantarray) {
|
||||
return map { _arch2rpm($_) } @_;
|
||||
}
|
||||
return _arch2rpm($_[0]);
|
||||
}
|
||||
sub _arch2rpm {
|
||||
my $arch = shift;
|
||||
return "\%ix86" if $arch eq "i386";
|
||||
return "aarch64" if $arch eq "arm64";
|
||||
return $arch;
|
||||
}
|
||||
|
||||
sub provides_obsoletes {
|
||||
my $flavor = shift;
|
||||
my @archs = @_;
|
||||
my $res = "";
|
||||
|
||||
for my $arch (@archs) {
|
||||
my @packs = `$dir/guards $arch $flavor <$dir/old-packages.conf`;
|
||||
chomp @packs;
|
||||
next if (!@packs);
|
||||
my $rpmarch = arch2rpm($arch);
|
||||
chomp $rpmarch;
|
||||
$res .= "\%ifarch $rpmarch\n";
|
||||
$res .= "Provides: @packs\n";
|
||||
$res .= "Obsoletes: @packs\n";
|
||||
$res .= "\%endif\n";
|
||||
}
|
||||
chomp $res;
|
||||
return $res;
|
||||
}
|
||||
|
||||
sub do_spec {
|
||||
my $template = shift;
|
||||
my $specfile = shift;
|
||||
my %macros = @_;
|
||||
|
||||
my $text = $templates{$template};
|
||||
my $prev_text;
|
||||
do {
|
||||
$prev_text = $text;
|
||||
for my $m (keys %macros) {
|
||||
$text =~ s/\@$m\@/$macros{$m}/g;
|
||||
}
|
||||
} while ($prev_text ne $text);
|
||||
print "$specfile\n";
|
||||
xopen(my $fh, '>', "$dir/$specfile");
|
||||
print $fh $text;
|
||||
close($fh);
|
||||
|
||||
return if $specfile eq "kernel-source$variant.spec";
|
||||
my $changesfile = $specfile;
|
||||
$changesfile =~ s/\.spec$//;
|
||||
$changesfile .= ".changes";
|
||||
copy("$dir/kernel-source$variant.changes", $changesfile);
|
||||
}
|
||||
|
||||
sub xopen {
|
||||
open($_[0], $_[1], $_[2]) or die "$_[2]: $!\n";
|
||||
}
|
||||
|
||||
21
moddep
Normal file
21
moddep
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
dependencies=$1
|
||||
modules=$2
|
||||
result=$3
|
||||
|
||||
cat $modules | tr ' ' '\n' > $result
|
||||
echo > $result~
|
||||
|
||||
while ! diff -q $result~ $result > /dev/null ; do
|
||||
cp $result $result~
|
||||
while read MOD ; do
|
||||
moddeps="$(grep ^$MOD: $dependencies | sed -e 's/.*://' ||:)"
|
||||
for DEP in $moddeps ; do
|
||||
if ! grep -q ^$DEP\$ $result ; then
|
||||
echo $DEP >> $result
|
||||
echo $MOD: $DEP
|
||||
fi
|
||||
done
|
||||
done < $result
|
||||
done
|
||||
10
modflist
Normal file
10
modflist
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh -e
|
||||
flist=$1
|
||||
modules=$2
|
||||
output=$3
|
||||
mod_builtin=$4
|
||||
|
||||
while read MOD ; do
|
||||
[ -n "$MOD" ] || continue
|
||||
cat $flist | grep -E "/$MOD[.]ko([.]xz|[.]gz|[.]zst)?\$" >> $output || { grep -q /$MOD[.]ko\$ $mod_builtin && echo Module $MOD built-in ;} || echo Module $MOD missing
|
||||
done < $modules
|
||||
76
modules.fips
Normal file
76
modules.fips
Normal file
@@ -0,0 +1,76 @@
|
||||
ablk_helper
|
||||
aes_s390
|
||||
aes_ti
|
||||
aes_x86_64
|
||||
aesni-intel
|
||||
af_alg
|
||||
algif_hash
|
||||
anubis
|
||||
arc4
|
||||
authenc
|
||||
blowfish_common
|
||||
blowfish_generic
|
||||
blowfish_x86_64
|
||||
camellia_generic
|
||||
camellia_x86_64
|
||||
cast5_generic
|
||||
cast6_generic
|
||||
cast_common
|
||||
cbc
|
||||
ccm
|
||||
cmac
|
||||
cryptd
|
||||
crypto_user
|
||||
ctr
|
||||
cts
|
||||
deflate
|
||||
des3_ede-x86_64
|
||||
des_generic
|
||||
des_s390
|
||||
drbg
|
||||
ecb
|
||||
ecdh_generic
|
||||
fcrypt
|
||||
gcm
|
||||
gf128mul
|
||||
ghash-clmulni-intel
|
||||
ghash_generic
|
||||
ghash_s390
|
||||
glue_helper
|
||||
keywrap
|
||||
khazad
|
||||
lrw
|
||||
md4
|
||||
michael_mic
|
||||
pcbc
|
||||
rmd128
|
||||
rmd160
|
||||
rmd256
|
||||
rmd320
|
||||
salsa20_generic
|
||||
salsa20_x86_64
|
||||
seed
|
||||
serpent_generic
|
||||
serpent_sse2_x86_64
|
||||
sha1-mb
|
||||
sha1_s390
|
||||
sha1_ssse3
|
||||
sha256-mb
|
||||
sha256_s390
|
||||
sha256_ssse3
|
||||
sha3_generic
|
||||
sha512-mb
|
||||
sha512_generic
|
||||
sha512_s390
|
||||
sha512_ssse3
|
||||
tcrypt
|
||||
tea
|
||||
tgr192
|
||||
twofish_common
|
||||
twofish_generic
|
||||
twofish_x86_64
|
||||
twofish_x86_64_3way
|
||||
vmac
|
||||
wp512
|
||||
xcbc
|
||||
xts
|
||||
@@ -3,7 +3,7 @@
|
||||
use File::Basename;
|
||||
use File::Path;
|
||||
use File::Find;
|
||||
use Getopt::Long;
|
||||
use Getopt::Long qw(:config no_ignore_case);
|
||||
use strict;
|
||||
|
||||
my %symbol_type_name = (
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
6144
|
||||
11
obsolete-kmps
Normal file
11
obsolete-kmps
Normal file
@@ -0,0 +1,11 @@
|
||||
# List of KMPs integrated into the kernel
|
||||
# These KMPs shoud be removed when the kernel is installed
|
||||
# <basename> <upper bound of shipped versions>
|
||||
|
||||
# sle12-sp1 / Leap 42.1
|
||||
xen 4.6.1
|
||||
compat-wireless 4.4
|
||||
# TW 4.8
|
||||
ftsteutates 20160601
|
||||
# SLE12-SP3 / Leap 42.3
|
||||
drm 4.12
|
||||
@@ -1,36 +0,0 @@
|
||||
# Defines which package names to include in the Provides and
|
||||
# Obsoletes tags of spec files.
|
||||
#
|
||||
# When generating Provides, `p' is defined. When generating
|
||||
# Obsoletes, `o' is defined.
|
||||
#
|
||||
# +ARCH: include only for this architecture.
|
||||
# -!symbol: exclude unless symbol is also defined.
|
||||
#
|
||||
# Guards are always evaluated from left to right; the last
|
||||
# guard that matches determines whether a line is included
|
||||
# or not.
|
||||
#
|
||||
# For testing this file, run scripts/old-config.sh.
|
||||
#
|
||||
|
||||
# i386 =================================================================
|
||||
+i386 -!default smp kernel-smp
|
||||
|
||||
+i386 -!pae kernel-bigsmp
|
||||
|
||||
# x86_64 ===============================================================
|
||||
+x86_64 -!default smp kernel-smp
|
||||
|
||||
# ia64 =================================================================
|
||||
+ia64 -!default kernel-sn2
|
||||
|
||||
# ppc/ppc64 ============================================================
|
||||
|
||||
+ppc -!ppc64 kernel-pmac64 kernel-pseries64 kernel-iseries64
|
||||
+ppc64 -vanilla kernel-kdump
|
||||
|
||||
# s390/s390x ===========================================================
|
||||
+s390 -!s390 kernel-32bit
|
||||
|
||||
+s390x -!s390x kernel-64bit
|
||||
1
old_changelog.txt
Normal file
1
old_changelog.txt
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -1,157 +0,0 @@
|
||||
# Descriptions of the binary kernel packages. The format is
|
||||
#
|
||||
# === <package name> ===
|
||||
# Summary (single line)
|
||||
#
|
||||
# Long description (multiple
|
||||
# lines)
|
||||
#
|
||||
# Descriptions of the -base and -extra subpackages are derived from the
|
||||
# main descriptions.
|
||||
|
||||
=== kernel-debug ===
|
||||
A Debug Version of the Kernel
|
||||
|
||||
This kernel has several debug facilities enabled that hurt performance.
|
||||
Only use this kernel when investigating problems.
|
||||
|
||||
=== kernel-default ===
|
||||
The Standard Kernel
|
||||
|
||||
The standard kernel for both uniprocessor and multiprocessor systems.
|
||||
|
||||
=== kernel-desktop ===
|
||||
Kernel optimized for the desktop
|
||||
|
||||
This kernel is optimized for the desktop. It is configured for lower latency
|
||||
and has many of the features that aren't usually used on desktop machines
|
||||
disabled.
|
||||
|
||||
%ifarch %ix86
|
||||
This kernel supports up to 64GB of main memory. It requires Physical
|
||||
Addressing Extensions (PAE), which were introduced with the Pentium Pro
|
||||
processor.
|
||||
|
||||
PAE is not only more physical address space but also important for the
|
||||
"no execute" feature which disables execution of code that is marked as
|
||||
non-executable. Therefore, the PAE kernel should be used on any systems
|
||||
that support it, regardless of the amount of main memory.
|
||||
%endif
|
||||
|
||||
=== kernel-kdump ===
|
||||
kernel for kdump
|
||||
|
||||
This kernel is intended for kdump. It can not be booted with a normal
|
||||
bootloader, the kexec tool has to be used to load it. Once the system
|
||||
crashes, the loaded kernel will be started to grab debug info from the
|
||||
crashed kernel.
|
||||
|
||||
=== kernel-net ===
|
||||
Minimal kernel with disk and net support
|
||||
|
||||
This kernel carries only networking and disk drivers to fit into the
|
||||
standard Sun OpenBoot download buffer, and is intended for the
|
||||
initial install and rescue mode only.
|
||||
|
||||
=== kernel-pae ===
|
||||
Kernel with PAE Support
|
||||
|
||||
This kernel supports up to 64GB of main memory. It requires Physical
|
||||
Addressing Extensions (PAE), which were introduced with the Pentium Pro
|
||||
processor.
|
||||
|
||||
PAE is not only more physical address space but also important for the
|
||||
"no execute" feature which disables execution of code that is marked as
|
||||
non-executable. Therefore, the PAE kernel should be used on any systems
|
||||
that support it, regardless of the amount of main memory.
|
||||
|
||||
=== kernel-ppc64 ===
|
||||
Kernel for ppc64 Systems
|
||||
|
||||
This package contains the kernel for:
|
||||
|
||||
IBM pSeries 64bit machines IBM iSeries 64bit machines Apple G5 machines
|
||||
Sony Playstation 3
|
||||
|
||||
The boot file is /boot/vmlinux.
|
||||
|
||||
The home page of the ppc64 project is http://www.penguinppc.org/
|
||||
|
||||
=== kernel-ps3 ===
|
||||
kernel for ps3 bootloader
|
||||
|
||||
This package contains the kernel for the PS3 bootloader. PS3 systems
|
||||
only have 4MB of flash memory for the bootloader, so this kernel needs
|
||||
to be as small as possible and is _not_ meant to be installed in the
|
||||
final system.
|
||||
|
||||
=== kernel-s390 ===
|
||||
The Standard Kernel
|
||||
|
||||
The standard kernel.
|
||||
|
||||
=== kernel-trace ===
|
||||
The Standard Kernel with Tracing Features
|
||||
|
||||
This kernel has different tracing features enabled (e.g. utrace, ftrace).
|
||||
|
||||
=== kernel-vanilla ===
|
||||
The Standard Kernel - without any SUSE patches
|
||||
|
||||
The standard kernel - without any SUSE patches
|
||||
|
||||
=== kernel-xen ===
|
||||
The Xen Kernel
|
||||
|
||||
The Linux kernel for Xen paravirtualization.
|
||||
|
||||
This kernel can be used both as the domain0 ("xen0") and as an
|
||||
unprivileged ("xenU") kernel.
|
||||
|
||||
=== kernel-ec2 ===
|
||||
The Amazon EC2 Xen Kernel
|
||||
|
||||
The Linux kernel for Xen paravirtualization.
|
||||
|
||||
This kernel can only be used both as an unprivileged ("xenU")
|
||||
kernel (for Amazon EC2).
|
||||
|
||||
=== kernel-vmi ===
|
||||
VMI-enabled kernel
|
||||
|
||||
The Linux Kernel designed to run on top of a virtual machine
|
||||
interface layer (VMI).
|
||||
|
||||
=== kernel-imx51 ===
|
||||
Kernel for Freescale's iMX SoC
|
||||
|
||||
The standard kernel for Freescale's i.MX51 SoC, as found in
|
||||
devices like the Genesi EfikaMX family.
|
||||
|
||||
=== kernel-omap2plus ===
|
||||
Kernel for Texas instrument's OMAP SoC
|
||||
|
||||
The standard kernel for Texas instrument's OMAP SoC, as
|
||||
found in devices like the PandaBoard and BeagleBoard.
|
||||
|
||||
=== kernel-u8500 ===
|
||||
Kernel for ST-Ericsson's Nova SoC
|
||||
|
||||
The standard kernel for ST-Ericsson's Nova SoC, as found in
|
||||
devices like the Snowball.
|
||||
|
||||
=== kernel-cubox ===
|
||||
Kernel for SolidRun Cubox
|
||||
|
||||
The standard kernel for Marvell Dove SoC, as found in
|
||||
the SolidRun Cubox.
|
||||
|
||||
=== kernel-exynos ===
|
||||
Kernel for Samsung's Exynos SoC
|
||||
|
||||
The standard kernel for Samsung's Exynos 4 & 5 SoC, as found in the Origen board.
|
||||
|
||||
=== kernel-versatile ===
|
||||
Kernel for Versatile SoC
|
||||
|
||||
The standard kernel for Versatile SoC, or for emulation with QEMU.
|
||||
BIN
patches.addon.tar.bz2
LFS
BIN
patches.addon.tar.bz2
LFS
Binary file not shown.
BIN
patches.apparmor.tar.bz2
LFS
BIN
patches.apparmor.tar.bz2
LFS
Binary file not shown.
BIN
patches.arch.tar.bz2
LFS
BIN
patches.arch.tar.bz2
LFS
Binary file not shown.
BIN
patches.drivers.tar.bz2
LFS
BIN
patches.drivers.tar.bz2
LFS
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user