Sync from SUSE:ALP:Source:Standard:1.0 kernel-source revision d5f47f4ab5d61f93d205bb1dd2c32d8f

This commit is contained in:
Adrian Schröter 2024-02-10 20:22:20 +01:00
commit 8070b2dbce
95 changed files with 710902 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

6
README.KSYMS Normal file
View File

@ -0,0 +1,6 @@
This file is a place holder for the kernel-syms{,-rt} package. It is used
to group build dependencies for all kernel flavors.
The KMP build process will build KMPs against all installed kernel flavors
automatically. If you don't need to build against other flavors than the
ones you've already installed - it is safe to uninstall this package.

316
README.PATCH-POLICY.SUSE Normal file
View 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;
```

423
README.SUSE Normal file
View File

@ -0,0 +1,423 @@
Working with the SUSE Kernel Sources
====================================
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
--------
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.
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:
* kernel-source
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
A complement of the kernel-source package that is needed to build external
modules.
* kernel-`$FLAVOR`
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.
* kernel-`$FLAVOR`-base
A subset of kernel-`$FLAVOR`, for use in virtualized guests 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 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/`
The kernel sources.
* `/usr/src/linux`
A symbolic link to `/usr/src/linux-$VERSION-$RELEASE/`.
* `/usr/share/doc/packages/kernel-source-$VERSION-$RELEASE/`
This document.
The kernel-`$FLAVOR`-devel packages install the following files:
* `/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/src/linux-obj/$ARCH/$FLAVOR`
A symbolic link to `/usr/src/linux-$VERSION-$RELEASE-obj/$ARCH/$FLAVOR/`.
Compiling your own kernel
-------------------------
The kernel sources are found in the kernel-source package. A binary kernel can
be built from these sources as follows:
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 privileges and will cause
problems if you need to build kernel modules for other installed kernels.
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 by invoking `make`.
5. Make sure that `/etc/modprobe.d/10-unsupported-modules.conf` contains
allow_unsupported_modules 1
otherwise modprobe will refuse to load any modules.
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.
Instead of building binary kernels by hand, you can also build one of the
kernel-`$FLAVOR` packages using RPM.
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.
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 the
following ways:
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-devel package.
2. Install the kernel-`$FLAVOR`-devel package. This is necessary for symbol
version information (`CONFIG_MODVERSIONS`).
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).
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`.)
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.
Supported vs. unsupported modules
---------------------------------
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.
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`.
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.
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>.
Patch selection mechanism
-------------------------
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.
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`, 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`.
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.
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 straightforward:
* 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.
* 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
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.
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.
* Update the configuration appropriately for the target use.
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.
The minimal steps to enable module signing and have the kernel build
automatically generate a new key pair are as follows:
$ ./source/scripts/config --enable CONFIG_MODULE_SIG \
--enable CONFIG_MODULE_SIG_ALL --undefine CONFIG_MODULE_SIG_KEY
$ make olddefconfig
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.
How to add custom patches
-------------------------
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/$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:
`/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/$VERSION-$OTHER_RELEASE-$FLAVOR/updates/`, and higher priority
than other modules in `/lib/modules/$VERSION-$OTHER_RELEASE-$FLAVOR/`.
Driver update disks
-------------------
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.
For information how to create such an update, refer to the mkdud and mksusecd
tools, and their documentation:
* <https://github.com/openSUSE/mkdud>,
* <https://github.com/openSUSE/mksusecd>.
References
----------
General:
* Documentation in the kernel source tree,
* LWN.net (Linux Weekly News), <https://lwn.net/>,
* Kernel newbies, <https://kernelnewbies.org/>.
Loadable kernel modules:
* Peter Jay Salzman, Michael Burian, Ori Pomerantz: The Linux Kernel Module
Programming Guide, Version 2.6,
<https://tldp.org/LDP/lkmpg/2.6/html/index.html>.
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/>.

268
_constraints Normal file
View File

@ -0,0 +1,268 @@
<constraints>
<!-- Default 35GB for binary packages -->
<overwrite>
<conditions>
<package>kernel-64kb</package>
<package>kernel-source:kernel-64kb</package>
<package>kernel-debug</package>
<package>kernel-source:kernel-debug</package>
<package>kernel-default</package>
<package>kernel-source:kernel-default</package>
<package>kernel-kvmsmall</package>
<package>kernel-source:kernel-kvmsmall</package>
<package>kernel-zfcpdump</package>
<package>kernel-source:kernel-zfcpdump</package>
</conditions>
<hardware>
<disk>
<size unit="G">35</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-64kb</package>
<package>kernel-source:kernel-64kb</package>
<package>kernel-debug</package>
<package>kernel-source:kernel-debug</package>
<package>kernel-default</package>
<package>kernel-source:kernel-default</package>
<package>kernel-kvmsmall</package>
<package>kernel-source:kernel-kvmsmall</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-64kb</package>
<package>kernel-source:kernel-64kb</package>
<package>kernel-debug</package>
<package>kernel-source:kernel-debug</package>
<package>kernel-default</package>
<package>kernel-source:kernel-default</package>
<package>kernel-kvmsmall</package>
<package>kernel-source:kernel-kvmsmall</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-64kb</package>
<package>kernel-source:kernel-64kb</package>
<package>kernel-debug</package>
<package>kernel-source:kernel-debug</package>
<package>kernel-default</package>
<package>kernel-source:kernel-default</package>
<package>kernel-kvmsmall</package>
<package>kernel-source:kernel-kvmsmall</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-64kb</package>
<package>kernel-source:kernel-64kb</package>
<package>kernel-debug</package>
<package>kernel-source:kernel-debug</package>
<package>kernel-default</package>
<package>kernel-source:kernel-default</package>
<package>kernel-kvmsmall</package>
<package>kernel-source:kernel-kvmsmall</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-64kb</package>
<package>kernel-source:kernel-64kb</package>
<package>kernel-debug</package>
<package>kernel-source:kernel-debug</package>
<package>kernel-default</package>
<package>kernel-source:kernel-default</package>
<package>kernel-kvmsmall</package>
<package>kernel-source:kernel-kvmsmall</package>
<package>kernel-zfcpdump</package>
<package>kernel-source:kernel-zfcpdump</package>
</conditions>
<hardware>
<jobs>2</jobs>
</hardware>
</overwrite>
<!-- POWER9 now required on ppc64le -->
<overwrite>
<conditions>
<arch>ppc64le</arch>
</conditions>
<hardware>
<cpu>
<flag>power9</flag>
</cpu>
</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-64kb</package>
<package>kernel-source:kernel-64kb</package>
<package>kernel-debug</package>
<package>kernel-source:kernel-debug</package>
<package>kernel-default</package>
<package>kernel-source:kernel-default</package>
<package>kernel-kvmsmall</package>
<package>kernel-source:kernel-kvmsmall</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-64kb</package>
<package>kernel-source:kernel-64kb</package>
<package>kernel-debug</package>
<package>kernel-source:kernel-debug</package>
<package>kernel-default</package>
<package>kernel-source:kernel-default</package>
<package>kernel-kvmsmall</package>
<package>kernel-source:kernel-kvmsmall</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>

12
_multibuild Normal file
View File

@ -0,0 +1,12 @@
<multibuild>
<package>dtb-aarch64</package>
<package>kernel-64kb</package>
<package>kernel-debug</package>
<package>kernel-default</package>
<package>kernel-docs</package>
<package>kernel-kvmsmall</package>
<package>kernel-obs-build</package>
<package>kernel-obs-qa</package>
<package>kernel-syms</package>
<package>kernel-zfcpdump</package>
</multibuild>

47
apply-patches Normal file
View File

@ -0,0 +1,47 @@
#!/bin/sh
#
# Given a series.conf file and a directory with patches, applies them to the
# current directory.
# Used by kernel-source.spec.in and kernel-binary.spec.in
USAGE="$0 [--vanilla] <series.conf> <patchdir> [symbol ...]"
set -e
set -o pipefail
vanilla=false
if test "$1" == "--vanilla"; then
vanilla=true
shift
fi
if test $# -lt 2; then
echo "$USAGE" >&2
exit 1
fi
DIR="${0%/*}"
SERIES_CONF=$1
PATCH_DIR=$2
shift 2
trap 'rm -f "$series"' EXIT
series=$(mktemp)
# support for patches in patches.addon/series
cp "$SERIES_CONF" "$series"
if ! $vanilla && test -e "$PATCH_DIR/patches.addon/series"; then
# make it user-friendly and automatically prepend "patches.addon/"
# if there is no "/"
sed -r 's|^([[:space:]]*)([^#[:space:]][^/]*)$|\1patches.addon/\2|' \
"$PATCH_DIR/patches.addon/series" >>"$series"
fi
(
echo "trap 'echo \"*** patch \$_ failed ***\"' ERR"
echo "set -ex"
"$DIR"/guards "$@" <"$series" | \
if $vanilla; then
sed -rn '/^patches\.(kernel\.org|rpmify)\//p'
else
cat
fi |\
sed "s|^|patch -s -F0 -E -p1 --no-backup-if-mismatch -i $PATCH_DIR/|"
) | sh

47
arch-symbols Normal file
View File

@ -0,0 +1,47 @@
#!/bin/bash
#############################################################################
# Copyright (c) 2003-2005,2009 Novell, Inc.
# 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
# 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 https://www.suse.com/source-code/
#
#############################################################################
# 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,64le} s390{,x} ia64 x86_64 alpha parisc armv6hl armv7hl arm64 riscv64
exit 0
fi
if [ -n "$1" ]; then
ARCH="$1"
else
ARCH="$(arch)"
fi
case "$ARCH" in
# from rpm --eval '%ix86'
i?86 | pentium3 | pentium4 | athlon | geode)
echo i386
;;
aarch64)
echo arm64
;;
*)
echo "$ARCH"
;;
esac

56
check-for-config-changes Normal file
View File

@ -0,0 +1,56 @@
#! /bin/bash
# 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=(
'AS_HAS_[A-Z0-9_]*'
'AS_VERSION'
'AS_WRUSS' # x86_32
'BUILTIN_RETURN_ADDRESS_STRIPS_PAC'
'CC_CAN_[A-Z_]*'
'CC_HAS_[A-Z_]*'
'CC_HAVE_[A-Z_]*'
'CC_VERSION_TEXT'
'DYNAMIC_SIGFRAME'
'FTRACE_MCOUNT_USE_[A-Z_]*'
'GCC_VERSION'
'G*CC[0-9]*_NO_[A-Z_]*'
'HAVE_[A-Z]*_COMPILER'
'HAVE_SHADOW_CALL_STACK'
'LD_VERSION'
'OBJTOOL'
'PAHOLE_HAS_[A-Z0-9_]*'
'PAHOLE_VERSION'
'RISCV_ISA_[A-Z_]*'
'TOOLCHAIN_HAS_[A-Z_]*'
'TOOLCHAIN_NEEDS_[A-Z_]*'
'TOOLS_SUPPORT_[A-Z_]*'
)
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 "${SED_ARGS[@]}" "$1" | sort) \
<(sed "${SED_ARGS[@]}" "$2" | sort) \
| grep '^[-+][^-+]'
)" || true
if [ -n "$differences" ]; then
echo
echo "Changes after running \`make oldconfig':"
echo "$differences"
echo
if echo "$differences" | grep -q '^+' ; then
exit 1
fi
fi

13
check-module-license Normal file
View 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

15
compress-vmlinux.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -x
# Once the brp script is reasonably widespread, we will remove the specfile
# hack and this script
if test -x /usr/lib/rpm/brp-suse.d/brp-99-compress-vmlinux; then
exit 0
fi
vmlinux=$1
if test -e "$vmlinux" -a -e "$vmlinux.gz"; then
# Deliberately not using gzip -n; the vmlinux image has a predictable
# timestamp (bnc#880848#c20)
gzip -k -9 -f "$vmlinux"
fi

77
compute-PATCHVERSION.sh Normal file
View File

@ -0,0 +1,77 @@
#! /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 -e "$p/$patch"; 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"

BIN
config.addon.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

25
config.conf Normal file
View File

@ -0,0 +1,25 @@
# Kernel configuration file selection.
# See the arch-symbols script for a list of symbols defined.
# -syms excludes a flavor from the kernel-syms package (vanilla is excluded
# automatically).
#
# IMPORTANT: the subdirectory names map to cpuarch
# kernel-binary and kernel-source rely on this
#
+x86_64 x86_64/default
+x86_64 -syms x86_64/debug
+x86_64 -syms x86_64/kvmsmall
+ppc64le ppc64le/default
+ppc64le -syms ppc64le/debug
+ppc64le -syms ppc64le/kvmsmall
+arm64 arm64/default
+arm64 -syms arm64/debug
+arm64 arm64/64kb
+arm64 -syms arm64/kvmsmall
+s390x s390x/default
+s390x -syms s390x/zfcpdump

26
config.sh Normal file
View File

@ -0,0 +1,26 @@
# The version of the main tarball to use
SRCVERSION=6.4
# variant of the kernel-source package, either empty or "-rt"
VARIANT=
# enable kernel module compression
COMPRESS_MODULES="zstd"
COMPRESS_VMLINUX="xz"
# Compile binary devicetrees on master and stable branches.
BUILD_DTBS="Yes"
# Generate a _multibuild file
MULTIBUILD="Yes"
# Use new style livepatch package names
LIVEPATCH=livepatch
# buildservice projects to build the kernel against
OBS_PROJECT=SUSE:ALP:Source:Standard:Core:1.0:Build
OBS_PROJECT_ARM=openSUSE:Factory:ARM
IBS_PROJECT=SUSE:ALP:Source:Standard:Core:1.0:Build
# Bugzilla info
BUGZILLA_SERVER="apibugzilla.suse.com"
BUGZILLA_PRODUCT="ALP"
SPLIT_OPTIONAL=No
SUPPORTED_MODULES_CHECK=Yes
# build documentation in HTML format
BUILD_HTML=Yes
# build documentation in PDF format
BUILD_PDF=No

BIN
config.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

196
constraints.in Normal file
View File

@ -0,0 +1,196 @@
<constraints>
<!-- Default 35GB for binary packages -->
<overwrite>
<conditions>
@BINARY_PACKAGES_XML@
</conditions>
<hardware>
<disk>
<size unit="G">35</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@VARIANT@:kernel-syzkaller</package>
</conditions>
<hardware>
<physicalmemory>
<size unit="G">8</size>
</physicalmemory>
</hardware>
</overwrite>
<!-- 8GB for kernel-source@VARIANT@ -->
<overwrite>
<conditions>
<package>kernel-source@VARIANT@</package>
</conditions>
<hardware>
<disk>
<size unit="G">8</size>
</disk>
</hardware>
<hostlabel exclude="true">SLOW_DISK</hostlabel>
</overwrite>
<!-- 4GB for kernel-docs@VARIANT@ -->
<overwrite>
<conditions>
<package>kernel-docs@VARIANT@</package>
<package>kernel-source@VARIANT@:kernel-docs@VARIANT@</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>
@BINARY_PACKAGES_XML@
</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>
@BINARY_PACKAGES_XML@
</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>
@BINARY_PACKAGES_XML@
</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>
@BINARY_PACKAGES_XML@
</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>
@BINARY_PACKAGES_XML@
</conditions>
<hardware>
<jobs>2</jobs>
</hardware>
</overwrite>
<!-- POWER9 now required on ppc64le -->
<overwrite>
<conditions>
<arch>ppc64le</arch>
</conditions>
<hardware>
<cpu>
<flag>power9</flag>
</cpu>
</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>
@BINARY_PACKAGES_XML@
</conditions>
<hardware>
<disk>
<size unit="G">45</size>
</disk>
</hardware>
</overwrite>
<!-- 52GB for binary packages on riscv64-->
<overwrite>
<conditions>
<arch>riscv64</arch>
@BINARY_PACKAGES_XML@
</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@VARIANT@: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@VARIANT@:kernel-obs-qa-xen</package>
</conditions>
<sandbox>xen</sandbox>
</overwrite>
</constraints>

60753
dtb-aarch64.changes Normal file

File diff suppressed because it is too large Load Diff

863
dtb-aarch64.spec Normal file
View File

@ -0,0 +1,863 @@
#
# spec file for package dtb-aarch64
#
# Copyright (c) 2024 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/
#
%define srcversion 6.4
%define patchversion 6.4.0
%define variant %{nil}
%include %_sourcedir/kernel-spec-macros
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,group-source-files.pl,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,log.sh,try-disable-staging-driver,compress-vmlinux.sh,mkspec-dtb,check-module-license,klp-symbols,splitflist,mergedep,moddep,modflist,kernel-subpackage-build})
Name: dtb-aarch64
Version: 6.4.0
%if 0%{?is_kotd}
Release: <RELEASE>.g820ec3d
%else
Release: 0
%endif
Summary: Device Tree files for $MACHINES
License: GPL-2.0-only
Group: System/Boot
URL: https://www.kernel.org/
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
ExclusiveArch: aarch64
%else
ExclusiveArch: do_not_build
%endif
BuildRequires: cpp
BuildRequires: dtc >= 1.4.3
BuildRequires: xz
Requires: kernel = %version
Source0: https://www.kernel.org/pub/linux/kernel/v6.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
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
Source58: constraints.in
Source60: config.sh
Source61: compute-PATCHVERSION.sh
Source62: old-flavors
Source63: arch-symbols
Source64: package-descriptions
Source65: kernel-spec-macros
Source67: log.sh
Source68: host-memcpy-hack.h
Source69: try-disable-staging-driver
Source70: kernel-obs-build.spec.in
Source71: kernel-obs-qa.spec.in
Source72: compress-vmlinux.sh
Source73: dtb.spec.in.in
Source74: mkspec-dtb
Source75: release-projects
Source76: check-module-license
Source77: klp-symbols
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: 51
NoSource: 52
NoSource: 53
NoSource: 54
NoSource: 55
NoSource: 56
NoSource: 57
NoSource: 58
NoSource: 60
NoSource: 61
NoSource: 62
NoSource: 63
NoSource: 64
NoSource: 65
NoSource: 67
NoSource: 68
NoSource: 69
NoSource: 70
NoSource: 71
NoSource: 72
NoSource: 73
NoSource: 74
NoSource: 75
NoSource: 76
NoSource: 77
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
%description
Device Tree files for $MACHINES.
%package -n dtb-allwinner
Summary: Allwinner based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-allwinner
Device Tree files for Allwinner based arm64 systems.
%package -n dtb-altera
Summary: Altera based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-altera
Device Tree files for Altera based arm64 systems.
%package -n dtb-amazon
Summary: Amazon based arm64 systems
Group: System/Boot
Provides: dtb-al = %version
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-amazon
Device Tree files for Amazon based arm64 systems.
%package -n dtb-amd
Summary: AMD based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-amd
Device Tree files for AMD based arm64 systems.
%package -n dtb-amlogic
Summary: Amlogic based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-amlogic
Device Tree files for Amlogic based arm64 systems.
%package -n dtb-apm
Summary: AppliedMicro based arm64 systems
Group: System/Boot
Provides: dtb-apm-mustang = %version
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-apm
Device Tree files for AppliedMicro based arm64 systems.
%package -n dtb-apple
Summary: Apple SOC based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-apple
Device Tree files for Apple SOC based arm64 systems.
%package -n dtb-arm
Summary: ARM Ltd. based arm64 systems
Group: System/Boot
Provides: dtb-foundation-v8 = %version
Provides: dtb-rtsm_ve-aemv8a = %version
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-arm
Device Tree files for ARM Ltd. based arm64 systems.
%package -n dtb-broadcom
Summary: Broadcom based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-broadcom
Device Tree files for Broadcom based arm64 systems.
%package -n dtb-cavium
Summary: Cavium based arm64 systems
Group: System/Boot
Provides: dtb-thunder-88xx = %version
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-cavium
Device Tree files for Cavium based arm64 systems.
%package -n dtb-exynos
Summary: Samsung Exynos based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-exynos
Device Tree files for Samsung Exynos based arm64 systems.
%package -n dtb-freescale
Summary: NXP (Freescale) based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-freescale
Device Tree files for NXP (Freescale) based arm64 systems.
%package -n dtb-hisilicon
Summary: HiSilicon based arm64 systems
Group: System/Boot
Provides: dtb-hisilicon64 = %version
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-hisilicon
Device Tree files for HiSilicon based arm64 systems.
%package -n dtb-lg
Summary: LG based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-lg
Device Tree files for LG based arm64 systems.
%package -n dtb-marvell
Summary: Marvell based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-marvell
Device Tree files for Marvell based arm64 systems.
%package -n dtb-mediatek
Summary: MediaTek based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-mediatek
Device Tree files for MediaTek based arm64 systems.
%package -n dtb-nvidia
Summary: Nvidia based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-nvidia
Device Tree files for Nvidia based arm64 systems.
%package -n dtb-qcom
Summary: Qualcomm based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-qcom
Device Tree files for Qualcomm based arm64 systems.
%package -n dtb-renesas
Summary: Renesas based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-renesas
Device Tree files for Renesas based arm64 systems.
%package -n dtb-rockchip
Summary: Rockchip based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-rockchip
Device Tree files for Rockchip based arm64 systems.
%package -n dtb-socionext
Summary: Socionext based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-socionext
Device Tree files for Socionext based arm64 systems.
%package -n dtb-sprd
Summary: Spreadtrum based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-sprd
Device Tree files for Spreadtrum based arm64 systems.
%package -n dtb-xilinx
Summary: Xilinx based arm64 systems
Group: System/Boot
Provides: multiversion(dtb)
Requires(post): coreutils
%description -n dtb-xilinx
Device Tree files for Xilinx based arm64 systems.
%prep
# 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 108 -a 109 -a 110 -a 111 -a 113 -a 114 -a 120 -a 121
cd linux-%srcversion
%_sourcedir/apply-patches %_sourcedir/series.conf ..
%build
source=linux-%srcversion
cp $source/COPYING .
SRCDIR=$PWD/$source
mkdir pp
PPDIR=$PWD/pp
export DTC_FLAGS="-R 4 -p 0x1000"
DTC_FLAGS="$DTC_FLAGS -@"
cd $source/arch/arm64/boot/dts
for dts in allwinner/*.dts altera/*.dts amazon/*.dts amd/*.dts amlogic/*.dts apm/*.dts apple/*.dts arm/*.dts broadcom/*.dts cavium/*.dts exynos/*.dts freescale/*.dts hisilicon/*.dts lg/*.dts marvell/*.dts mediatek/*.dts nvidia/*.dts qcom/*.dts renesas/*.dts rockchip/*.dts socionext/*.dts sprd/*.dts xilinx/*.dts ; do
target=${dts%*.dts}
mkdir -p $PPDIR/$(dirname $target)
cpp -x assembler-with-cpp -undef -D__DTS__ -nostdinc -I. -I$SRCDIR/include/ -I$SRCDIR/scripts/dtc/include-prefixes/ -P $target.dts -o $PPDIR/$target.dts
dtc $DTC_FLAGS -I dts -O dtb -i ./$(dirname $target) -o $PPDIR/$target.dtb $PPDIR/$target.dts
done
%define dtbdir /boot/dtb-%kernelrelease
%install
cd pp
for dts in allwinner/*.dts altera/*.dts amazon/*.dts amd/*.dts amlogic/*.dts apm/*.dts apple/*.dts arm/*.dts broadcom/*.dts cavium/*.dts exynos/*.dts freescale/*.dts hisilicon/*.dts lg/*.dts marvell/*.dts mediatek/*.dts nvidia/*.dts qcom/*.dts renesas/*.dts rockchip/*.dts socionext/*.dts sprd/*.dts xilinx/*.dts ; do
target=${dts%*.dts}
install -m 755 -d %{buildroot}%{dtbdir}/$(dirname $target)
# install -m 644 COPYING %{buildroot}%{dtbdir}/$(dirname $target)
install -m 644 $target.dtb %{buildroot}%{dtbdir}/$(dirname $target)
%ifarch aarch64 riscv64
# HACK: work around U-Boot ignoring vendor dir
baselink=%{dtbdir}/$(basename $target).dtb
vendordir=$(basename $(dirname $target))
ln -s $target.dtb %{buildroot}$baselink
echo $baselink >> ../dtb-$vendordir.list
%endif
done
cd -
%post -n dtb-allwinner
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-altera
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-amazon
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-amd
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-amlogic
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-apm
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-apple
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-arm
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-broadcom
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-cavium
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-exynos
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-freescale
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-hisilicon
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-lg
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-marvell
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-mediatek
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-nvidia
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-qcom
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-renesas
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-rockchip
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-socionext
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-sprd
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%post -n dtb-xilinx
cd /boot
# If /boot/dtb is a symlink, remove it, so that we can replace it.
[ -d dtb ] && [ -L dtb ] && rm -f dtb
# Unless /boot/dtb exists as real directory, create a symlink.
[ -d dtb ] || ln -sf dtb-%kernelrelease dtb
%ifarch aarch64 riscv64
%files -n dtb-allwinner -f dtb-allwinner.list
%else
%files -n dtb-allwinner
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/allwinner
%{dtbdir}/allwinner/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-altera -f dtb-altera.list
%else
%files -n dtb-altera
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/altera
%{dtbdir}/altera/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-amazon -f dtb-amazon.list
%else
%files -n dtb-amazon
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/amazon
%{dtbdir}/amazon/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-amd -f dtb-amd.list
%else
%files -n dtb-amd
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/amd
%{dtbdir}/amd/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-amlogic -f dtb-amlogic.list
%else
%files -n dtb-amlogic
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/amlogic
%{dtbdir}/amlogic/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-apm -f dtb-apm.list
%else
%files -n dtb-apm
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/apm
%{dtbdir}/apm/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-apple -f dtb-apple.list
%else
%files -n dtb-apple
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/apple
%{dtbdir}/apple/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-arm -f dtb-arm.list
%else
%files -n dtb-arm
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/arm
%{dtbdir}/arm/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-broadcom -f dtb-broadcom.list
%else
%files -n dtb-broadcom
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/broadcom
%{dtbdir}/broadcom/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-cavium -f dtb-cavium.list
%else
%files -n dtb-cavium
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/cavium
%{dtbdir}/cavium/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-exynos -f dtb-exynos.list
%else
%files -n dtb-exynos
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/exynos
%{dtbdir}/exynos/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-freescale -f dtb-freescale.list
%else
%files -n dtb-freescale
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/freescale
%{dtbdir}/freescale/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-hisilicon -f dtb-hisilicon.list
%else
%files -n dtb-hisilicon
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/hisilicon
%{dtbdir}/hisilicon/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-lg -f dtb-lg.list
%else
%files -n dtb-lg
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/lg
%{dtbdir}/lg/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-marvell -f dtb-marvell.list
%else
%files -n dtb-marvell
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/marvell
%{dtbdir}/marvell/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-mediatek -f dtb-mediatek.list
%else
%files -n dtb-mediatek
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/mediatek
%{dtbdir}/mediatek/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-nvidia -f dtb-nvidia.list
%else
%files -n dtb-nvidia
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/nvidia
%{dtbdir}/nvidia/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-qcom -f dtb-qcom.list
%else
%files -n dtb-qcom
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/qcom
%{dtbdir}/qcom/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-renesas -f dtb-renesas.list
%else
%files -n dtb-renesas
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/renesas
%{dtbdir}/renesas/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-rockchip -f dtb-rockchip.list
%else
%files -n dtb-rockchip
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/rockchip
%{dtbdir}/rockchip/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-socionext -f dtb-socionext.list
%else
%files -n dtb-socionext
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/socionext
%{dtbdir}/socionext/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-sprd -f dtb-sprd.list
%else
%files -n dtb-sprd
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/sprd
%{dtbdir}/sprd/*.dtb
%ifarch aarch64 riscv64
%files -n dtb-xilinx -f dtb-xilinx.list
%else
%files -n dtb-xilinx
%endif
%defattr(-,root,root)
%ghost /boot/dtb
%dir %{dtbdir}
%dir %{dtbdir}/xilinx
%{dtbdir}/xilinx/*.dtb
%changelog

100
dtb.spec.in.in Normal file
View File

@ -0,0 +1,100 @@
#
# spec file for package $NAME
#
# Copyright (c) @YEAR@ 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/
#
%define srcversion @SRCVERSION@
%define patchversion @PATCHVERSION@
%define variant @VARIANT@%{nil}
%include %_sourcedir/kernel-spec-macros
%(chmod +x %_sourcedir/{@SCRIPTS@})
Name: $NAME
Version: @RPMVERSION@
%if 0%{?is_kotd}
Release: <RELEASE>.g@COMMIT@
%else
Release: @RELEASE@
%endif
Summary: Device Tree files for $MACHINES
License: GPL-2.0-only
Group: System/Boot
URL: https://www.kernel.org/
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
$ARCH_RESTRICTIONS
%else
ExclusiveArch: do_not_build
%endif
BuildRequires: cpp
BuildRequires: dtc >= 1.4.3
BuildRequires: xz
Requires: kernel = %version
@SOURCES@
%description
Device Tree files for $MACHINES.
$SUBPKG_DESC
%prep
# Unpack all sources and patches
%setup -q -c -T -a 0 @UNPACK_PATCHES@
cd linux-%srcversion
%_sourcedir/apply-patches %_sourcedir/series.conf ..
%build
source=linux-%srcversion
cp $source/COPYING .
SRCDIR=$PWD/$source
mkdir pp
PPDIR=$PWD/pp
export DTC_FLAGS="-R 4 -p 0x1000"
DTC_FLAGS="$DTC_FLAGS -@"
cd $source/$DTS_folder
for dts in $ALL_SUPPORTED_DTB; do
target=${dts%*.dts}
mkdir -p $PPDIR/$(dirname $target)
cpp -x assembler-with-cpp -undef -D__DTS__ -nostdinc -I. -I$SRCDIR/include/ -I$SRCDIR/scripts/dtc/include-prefixes/ -P $target.dts -o $PPDIR/$target.dts
dtc $DTC_FLAGS -I dts -O dtb -i ./$(dirname $target) -o $PPDIR/$target.dtb $PPDIR/$target.dts
done
%define dtbdir /boot/dtb-%kernelrelease
%install
cd pp
for dts in $ALL_SUPPORTED_DTB; do
target=${dts%*.dts}
install -m 755 -d %{buildroot}%{dtbdir}/$(dirname $target)
# install -m 644 COPYING %{buildroot}%{dtbdir}/$(dirname $target)
install -m 644 $target.dtb %{buildroot}%{dtbdir}/$(dirname $target)
%ifarch aarch64 riscv64
# HACK: work around U-Boot ignoring vendor dir
baselink=%{dtbdir}/$(basename $target).dtb
vendordir=$(basename $(dirname $target))
ln -s $target.dtb %{buildroot}$baselink
echo $baselink >> ../dtb-$vendordir.list
%endif
done
cd -
$SUBPKG_POST
$SUBPKG_FILES
%changelog

101
group-source-files.pl Normal file
View File

@ -0,0 +1,101 @@
#!/usr/bin/perl
use File::Spec;
use Getopt::Long;
use strict;
&main();
sub main
{
my($dev_output, $ndev_output, $loc) = ("-", "-", ".");
&Getopt::Long::Configure(qw(bundling));
&GetOptions(
"D=s" => \$dev_output,
"N=s" => \$ndev_output,
"L=s" => \$loc,
);
my($dev, $ndev) = &scan($loc);
&output($dev, $ndev, $dev_output, $ndev_output);
}
sub scan
{
# 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 (-d $_ && !-l $_) {
# Generate directory list later.
next;
}
my $is_devel =
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};
my $abs_path = rpm_path($_);
$is_devel ? push(@dev, $abs_path) : push(@ndev, $abs_path);
}
push(@dev, &calc_dirs($abs_loc, \@dev));
push(@ndev, &calc_dirs($abs_loc, \@ndev));
return (\@dev, \@ndev);
}
sub calc_dirs
{
my($base, $files) = @_;
my %dirs;
foreach my $file (@$files) {
my ($volume,$path,$basename) = File::Spec->splitpath($file);
my @dirs = File::Spec->splitdir($path);
do {
# 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;
}
sub output
{
my($dev, $ndev, $dev_out, $ndev_out) = @_;
local *FH;
open(FH, "> $dev_out") || warn "Error writing to $dev_out: $!";
print FH join("\n", @$dev), "\n";
close FH;
open(FH, "> $ndev_out") || warn "Error writing to $ndev_out: $!";
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");
}

311
guards Normal file
View File

@ -0,0 +1,311 @@
#!/usr/bin/perl -w
##############################################################################
# Copyright (c) 2003-2007,2009 Novell, Inc.
# 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
# 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 https://www.suse.com/source-code/
#
#############################################################################
#
# Guards:
#
# +xxx include if xxx is defined
# -xxx exclude if xxx is defined
# +!xxx include if xxx is not defined
# -!xxx exclude if xxx is not defined
#
use FileHandle;
use Getopt::Long;
use strict;
# Prototypes
sub files_in($$);
sub parse($$);
sub help();
sub slashme($) {
my ($dir) = @_;
$dir =~ s#([^/])$#$&/#; # append a slash if necessary
if ($dir eq './') {
return '';
} else {
return $dir;
}
}
# Generate a list of files in a directory
#
sub files_in($$) {
my ($dir, $path) = @_;
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)) {
next if $file =~ /^(\.|\.\.|\.#.*|CVS|.*~)$/;
if (-d "$dir$path$file") {
@files = (@files, files_in($dir, "$path$file/"));
} else {
#print "[$path$file]\n";
push @files, "$path$file";
}
}
closedir $dh;
return @files;
}
# Parse a configuration file
# Callback called with ($patch, @guards) arguments
#
sub parse($$) {
my ($fh, $callback) = @_;
my $line = "";
while (<$fh>) {
chomp;
s/(^|\s+)#.*//;
if (s/\\$/ /) {
$line .= $_;
next;
}
$line .= $_;
my @guards = ();
foreach my $token (split /[\s\t\n]+/, $line) {
next if $token eq "";
if ($token =~ /^[-+]/) {
push @guards, $token;
} else {
#print "[" . join(",", @guards) . "] $token\n";
&$callback($token, @guards);
}
}
$line = "";
}
}
# Command line options
#
my ($dir, $config, $default, $check, $list, $invert_match, $with_guards) =
( '', '-', 1, 0, 0, 0, 0);
my @path;
# Help text
#
sub help() {
print "$0 - select from a list of files guarded by conditions\n";
print "SYNOPSIS: $0 [--prefix=dir] [--path=dir1:dir2:...]\n" .
" [--default=0|1] [--check|--list] [--invert-match]\n" .
" [--with-guards] [--config=file] symbol ...\n\n" .
" Defaults: --default=$default\n" .
" Use --path=\@<file> to read the list of entries from <file>\n";
exit 0;
}
# Parse command line options
#
Getopt::Long::Configure ("bundling");
eval {
unless (GetOptions (
'd|prefix=s' => \$dir,
'c|config=s' => \$config,
'C|check' => \$check,
'l|list' => \$list,
'w|with-guards' => \$with_guards,
'p|path=s' => \@path,
'D|default=i' => \$default,
'v|invert-match' => \$invert_match,
'h|help' => sub { help(); exit 0; })) {
help();
exit 1;
}
};
if ($@) {
print "$@";
help();
exit 1;
}
@path = ('.')
unless (@path);
@path = split(/:/, join(':', @path));
my $fh = ($config eq '-') ? \*STDIN : new FileHandle($config)
or die "$config: $!\n";
$dir = slashme($dir);
if ($check) {
# Check for duplicate files, or for files that are not referenced by
# the specification.
my $problems = 0;
my @files;
foreach (@path) {
@files = (@files, files_in($dir, $_));
}
my %files = map { $_ => 0 } @files;
parse($fh, sub {
my ($patch, @guards) = @_;
if (exists $files{$patch}) {
$files{$patch}++;
} else {
if ($config eq '-') {
print "Not found: $dir$patch\n";
} else {
print "In $config but not found: $dir$patch\n";
}
$problems++;
}});
$fh->close();
my ($file, $ref);
while (($file, $ref) = each %files) {
next if $ref == 1;
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";
print " in $config" if $config ne '-';
print ": $file\n";
# This is not an error if the entries are mutually exclusive...
}
}
exit $problems ? 1 : 0;
} elsif ($list) {
parse($fh, sub {
my ($patch, @guards) = @_;
print join(' ', @guards), ' '
if (@guards && $with_guards);
print "$dir$patch\n";
});
} else {
# Generate a list of patches to apply.
my %symbols = map { $_ => 1 } @ARGV;
parse($fh, sub {
my ($patch, @guards) = @_;
my $selected;
if (@guards) {
# If the first guard is -xxx, the patch is included by default;
# if it is +xxx, the patch is excluded by default.
$selected = ($guards[0] =~ /^-/);
foreach (@guards) {
/^([-+])(!?)(.*)?/
or die "Bad guard '$_'\n";
# Check if the guard matches
if (($2 eq '!' && !exists $symbols{$3}) ||
($2 eq '' && ( $3 eq '' || exists $symbols{$3}))) {
# Include or exclude
$selected = ($1 eq '+');
}
}
} else {
# If there are no guards, use the specified default result.
$selected = $default;
}
print "$dir$patch\n"
if $selected ^ $invert_match;
});
$fh->close();
exit 0;
}
__END__
=head1 NAME
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> ...
=head1 DESCRIPTION
The script reads a configuration file that may contain so-called guards, file
names, and comments, and writes those file names that satisfy all guards to
standard output. The script takes a list of symbols as its arguments. Each line
in the configuration file is processed separately. Lines may start with a
number of guards. The following guards are defined:
=over
+I<xxx> Include the file(s) on this line if the symbol I<xxx> is defined.
-I<xxx> Exclude the file(s) on this line if the symbol I<xxx> is defined.
+!I<xxx> Include the file(s) on this line if the symbol I<xxx> is not defined.
-!I<xxx> Exclude the file(s) on this line if the symbol I<xxx> is not defined.
- Exclude this file. Used to avoid spurious I<--check> messages.
=back
The guards are processed left to right. The last guard that matches determines
if the file is included. If no guard is specified, the I<--default>
setting determines if the file is included.
If no configuration file is specified, the script reads from standard input.
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 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 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.
=head1 AUTHOR
Andreas Gruenbacher <agruen@suse.de>, SUSE Labs

7
host-memcpy-hack.h Normal file
View File

@ -0,0 +1,7 @@
#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

204
kabi.pl Normal file
View File

@ -0,0 +1,204 @@
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
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;
xopen(my $fh, '<', $file);
while (<$fh>) {
chomp;
s/#.*//;
next if /^\s*$/;
my ($pattern, $verdict) = split(/\s+/);
my $new = {};
if (uc($verdict) eq "PASS") {
$new->{fail} = 0;
} elsif (uc($verdict) eq "FAIL") {
$new->{fail} = 1;
} else {
print STDERR "$file:$.: invalid verdict \"$verdict\", must be either PASS or FAIL.\n";
$errors++;
next;
}
# simple glob -> regexp conversion
$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;
}
push(@rules, $new);
}
if ($errors && !@rules) {
print STDERR "error: only garbage found in $file.\n";
exit 1;
}
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>) {
chomp;
my @l = split(/\t/, $_, -1);
if (@l < 4) {
print STDERR "$file:$.: unknown line\n";
$errors++;
next;
}
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) {
print STDERR "error: no symvers found in $file.\n";
exit 1;
}
close($fh);
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, $symvers, $message) = @_;
my $fail = 1;
for my $rule (@rules) {
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:$symvers->{mod}";
if ($use_namespaces && $symvers->{namespace}) {
print STDERR " ns:$symvers->{namespace}";
}
print STDERR ") $message";
if ($fail) {
$kabi_errors++;
print STDERR "\n";
} else {
print STDERR " (tolerated)\n";
}
}
sub xopen {
open($_[0], $_[1], @_[2..$#_]) or die "$_[2]: $!\n";
}
my $res = GetOptions(
'verbose|v' => \$opt_verbose,
'rules|r=s' => \$opt_rules,
);
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);
}
my %old = load_symvers($ARGV[0]);
my %new = load_symvers($ARGV[1]);
for my $sym (sort keys(%old)) {
if (!$new{$sym}) {
kabi_change($sym, $old{$sym}, "lost");
} elsif ($old{$sym}->{crc} ne $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) {
print STDERR "KABI: aborting due to kabi changes.\n";
exit 1;
}
exit 0;

BIN
kabi.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

60753
kernel-64kb.changes Normal file

File diff suppressed because it is too large Load Diff

2012
kernel-64kb.spec Normal file

File diff suppressed because it is too large Load Diff

18
kernel-binary-conflicts Normal file
View File

@ -0,0 +1,18 @@
# 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

1536
kernel-binary.spec.in Normal file

File diff suppressed because it is too large Load Diff

40
kernel-cert-subpackage Normal file
View 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

60753
kernel-debug.changes Normal file

File diff suppressed because it is too large Load Diff

2004
kernel-debug.spec Normal file

File diff suppressed because it is too large Load Diff

View 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 \
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

60753
kernel-default.changes Normal file

File diff suppressed because it is too large Load Diff

2096
kernel-default.spec Normal file

File diff suppressed because it is too large Load Diff

60753
kernel-docs.changes Normal file

File diff suppressed because it is too large Load Diff

325
kernel-docs.spec Normal file
View File

@ -0,0 +1,325 @@
#
# spec file for package kernel-docs
#
# Copyright (c) 2024 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/
#
%define srcversion 6.4
%define patchversion 6.4.0
%define git_commit 820ec3d69b9d3e6787e13e9a181b4a5d076291bf
%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,mkspec,compute-PATCHVERSION.sh,arch-symbols,log.sh,try-disable-staging-driver,compress-vmlinux.sh,mkspec-dtb,check-module-license,klp-symbols,splitflist,mergedep,moddep,modflist,kernel-subpackage-build})
Name: kernel-docs
Summary: Kernel Documentation
License: GPL-2.0-only
Group: Documentation/Man
Version: 6.4.0
%if 0%{?is_kotd}
Release: <RELEASE>.g820ec3d
%else
Release: 0
%endif
%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
URL: https://www.kernel.org/
Provides: %name = %version-%source_rel
Provides: %name-srchash-%git_commit
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
BuildArch: noarch
%else
ExclusiveArch: do_not_build
%endif
Source0: https://www.kernel.org/pub/linux/kernel/v6.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
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
Source58: constraints.in
Source60: config.sh
Source61: compute-PATCHVERSION.sh
Source62: old-flavors
Source63: arch-symbols
Source64: package-descriptions
Source65: kernel-spec-macros
Source67: log.sh
Source68: host-memcpy-hack.h
Source69: try-disable-staging-driver
Source70: kernel-obs-build.spec.in
Source71: kernel-obs-qa.spec.in
Source72: compress-vmlinux.sh
Source73: dtb.spec.in.in
Source74: mkspec-dtb
Source75: release-projects
Source76: check-module-license
Source77: klp-symbols
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: 51
NoSource: 52
NoSource: 53
NoSource: 54
NoSource: 55
NoSource: 56
NoSource: 57
NoSource: 58
NoSource: 60
NoSource: 61
NoSource: 62
NoSource: 63
NoSource: 64
NoSource: 65
NoSource: 67
NoSource: 68
NoSource: 69
NoSource: 70
NoSource: 71
NoSource: 72
NoSource: 73
NoSource: 74
NoSource: 75
NoSource: 76
NoSource: 77
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
%description
A few basic documents from the current kernel sources.
%source_timestamp
%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
%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
%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
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
%files
%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
%files pdf
%dir %{_datadir}/doc/kernel
%docdir %{_datadir}/doc/kernel/pdf
%{_datadir}/doc/kernel/pdf
%endif
%if %build_html
%files html
%dir %{_datadir}/doc/kernel
%docdir %{_datadir}/doc/kernel/html
%{_datadir}/doc/kernel/html
%endif
%changelog

187
kernel-docs.spec.in Normal file
View File

@ -0,0 +1,187 @@
#
# spec file for package kernel-docs@VARIANT@
#
# Copyright (c) @YEAR@ 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/
#
%define srcversion @SRCVERSION@
%define patchversion @PATCHVERSION@
%define git_commit @COMMIT_FULL@
%define variant @VARIANT@%{nil}
%define build_html @BUILD_HTML@
%define build_pdf @BUILD_PDF@
%include %_sourcedir/kernel-spec-macros
%(chmod +x %_sourcedir/{@SCRIPTS@})
Name: kernel-docs@VARIANT@
Summary: Kernel Documentation
License: GPL-2.0-only
Group: Documentation/Man
Version: @RPMVERSION@
%if 0%{?is_kotd}
Release: <RELEASE>.g@COMMIT@
%else
Release: @RELEASE@
%endif
%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
URL: https://www.kernel.org/
Provides: %name = %version-%source_rel
Provides: %name-srchash-%git_commit
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
BuildArch: noarch
%else
ExclusiveArch: do_not_build
%endif
@SOURCES@
%description
A few basic documents from the current kernel sources.
%source_timestamp
%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
%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
%endif
%prep
%setup -q -c -T -a 0 @UNPACK_PATCHES@
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
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
%files
%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
%files pdf
%dir %{_datadir}/doc/kernel
%docdir %{_datadir}/doc/kernel/pdf
%{_datadir}/doc/kernel/pdf
%endif
%if %build_html
%files html
%dir %{_datadir}/doc/kernel
%docdir %{_datadir}/doc/kernel/html
%{_datadir}/doc/kernel/html
%endif
%changelog

60753
kernel-kvmsmall.changes Normal file

File diff suppressed because it is too large Load Diff

2028
kernel-kvmsmall.spec Normal file

File diff suppressed because it is too large Load Diff

100
kernel-module-subpackage Normal file
View File

@ -0,0 +1,100 @@
%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*}
%(
for spec in {%_sourcedir,%_specdir}/%name.spec /dev/null; do
[ -e $spec ] && break
done
awk '
BEGIN { tags["summary"] = "Summary: %summary"
tags["group"] = "" }
/^%%/ { in_pkg_header = \
($0 ~ /^%%package[ \t]+KMP[ \t]*$/ ||
$0 ~ /^%%package[ \t]+-n[ \t]*%name-KMP[ \t]*$/)
next }
in_pkg_header && /^(Summary|Group):[ \t]*/ \
{ tag = tolower($1) ; sub(/:$/, "", tag)
tags[tag] = $0 }
END { print tags["summary"]
if ( tags["group"] != "" ) print tags["group"] }
' $spec
)
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*}-kmp-%1
%(
for spec in {%_sourcedir,%_specdir}/%name.spec /dev/null; do
[ -e $spec ] && break
done
awk '
/^%%/ { in_desc = \
($0 ~ /^%%description[ \t]+KMP[ \t]*$/ ||
$0 ~ /^%%description[ \t]+-n[ \t]*%name-KMP[ \t]*$/)
next }
in_desc { print; good = 1 }
END { exit(! good) }
' $spec || \
awk '
/^%%/ { in_desc = \
($0 ~ /^%%description[ \t]*$/ ||
$0 ~ /^%%description[ \t]+-n[ \t]*%name[ \t]*$/)
next }
in_desc { print; good = 1 }
END { exit(! good) }
' $spec
)
%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 "0%{?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 "0%{?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 "0%{?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 "0%{?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 "0%{?usrmerged}" "$@"
%files -n %{-n*}-kmp-%1
%{-f:%{expand:%(cd %_sourcedir; cat %{-f*})}}
%{!-f:%defattr (-,root,root)}
%{!-f:%{kernel_module_directory}/%2-%1}

60753
kernel-obs-build.changes Normal file

File diff suppressed because it is too large Load Diff

183
kernel-obs-build.spec Normal file
View File

@ -0,0 +1,183 @@
#
# spec file for package kernel-obs-build
#
# Copyright (c) 2024 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 6.4.0
%define variant %{nil}
%include %_sourcedir/kernel-spec-macros
Name: kernel-obs-build
BuildRequires: coreutils
BuildRequires: device-mapper
BuildRequires: util-linux
%if 0%{?suse_version}
%if "%{nil}"
%define kernel_flavor %{nil}
%else
%ifarch %ix86
%define kernel_flavor -pae
%else
%ifarch armv7l armv7hl
%define kernel_flavor -lpae
%else
%define kernel_flavor -default
%endif
%endif
%endif
%endif
BuildRequires: kernel%kernel_flavor-srchash-820ec3d69b9d3e6787e13e9a181b4a5d076291bf
%if 0%{?rhel_version}
BuildRequires: kernel
%define kernel_flavor ""
%endif
%if ! 0%{?is_kotd} || %{?is_kotd_qa}%{!?is_kotd_qa:0}
ExclusiveArch: aarch64 ppc64le s390x x86_64
%else
ExclusiveArch: do_not_build
%endif
BuildRequires: dracut
Summary: package kernel and initrd for OBS VM builds
License: GPL-2.0-only
Group: SLES
Version: 6.4.0
%if 0%{?is_kotd}
Release: <RELEASE>.g820ec3d
%else
Release: 0
%endif
%if 0%{?suse_version} > 1550 || 0%{?sle_version} > 150200
BuildRequires: zstd
%endif
%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.
%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 reiserfs 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"
# 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
%files
/.build.cmdline.*
/.build.console.*
/.build.hostarch.*
/.build.initrd.*
/.build.kernel.*
%changelog

183
kernel-obs-build.spec.in Normal file
View File

@ -0,0 +1,183 @@
#
# spec file for package kernel-obs-build
#
# Copyright (c) @YEAR@ 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 @PATCHVERSION@
%define variant @VARIANT@%{nil}
%include %_sourcedir/kernel-spec-macros
Name: kernel-obs-build
BuildRequires: coreutils
BuildRequires: device-mapper
BuildRequires: util-linux
%if 0%{?suse_version}
%if "@OBS_BUILD_VARIANT@"
%define kernel_flavor @OBS_BUILD_VARIANT@
%else
%ifarch %ix86
%define kernel_flavor -pae
%else
%ifarch armv7l armv7hl
%define kernel_flavor -lpae
%else
%define kernel_flavor -default
%endif
%endif
%endif
%endif
BuildRequires: kernel%kernel_flavor-srchash-@COMMIT_FULL@
%if 0%{?rhel_version}
BuildRequires: kernel
%define kernel_flavor ""
%endif
%if ! 0%{?is_kotd} || %{?is_kotd_qa}%{!?is_kotd_qa:0}
ExclusiveArch: @ARCHS@
%else
ExclusiveArch: do_not_build
%endif
BuildRequires: dracut
Summary: package kernel and initrd for OBS VM builds
License: GPL-2.0-only
Group: SLES
Version: @RPMVERSION@
%if 0%{?is_kotd}
Release: <RELEASE>.g@COMMIT@
%else
Release: @RELEASE@
%endif
%if 0%{?suse_version} > 1550 || 0%{?sle_version} > 150200
BuildRequires: zstd
%endif
%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.
%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 reiserfs 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"
# 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
%files
/.build.cmdline.*
/.build.console.*
/.build.hostarch.*
/.build.initrd.*
/.build.kernel.*
%changelog

60753
kernel-obs-qa.changes Normal file

File diff suppressed because it is too large Load Diff

76
kernel-obs-qa.spec Normal file
View File

@ -0,0 +1,76 @@
#
# spec file for package kernel-obs-qa
#
# Copyright (c) 2024 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 6.4.0
%define variant %{nil}
%include %_sourcedir/kernel-spec-macros
Name: kernel-obs-qa
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
BuildRequires: kernel-obs-build
BuildRequires: modutils
%if ! 0%{?is_kotd} || %{?is_kotd_qa}%{!?is_kotd_qa:0}
ExclusiveArch: aarch64 ppc64le s390x x86_64
%else
ExclusiveArch: do_not_build
%endif
Summary: Basic QA tests for the kernel
License: GPL-2.0-only
Group: SLES
Version: 6.4.0
%if 0%{?is_kotd}
Release: <RELEASE>.g820ec3d
%else
Release: 0
%endif
%description
This package is using the kernel compiled within Open Build Service(OBS)
projects and runs basic tests.
%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
%files
/usr/share/%name
%changelog

76
kernel-obs-qa.spec.in Normal file
View File

@ -0,0 +1,76 @@
#
# spec file for package kernel-obs-qa
#
# Copyright (c) @YEAR@ 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 @PATCHVERSION@
%define variant @VARIANT@%{nil}
%include %_sourcedir/kernel-spec-macros
Name: kernel-obs-qa
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
BuildRequires: kernel-obs-build
BuildRequires: modutils
%if ! 0%{?is_kotd} || %{?is_kotd_qa}%{!?is_kotd_qa:0}
ExclusiveArch: @ARCHS@
%else
ExclusiveArch: do_not_build
%endif
Summary: Basic QA tests for the kernel
License: GPL-2.0-only
Group: SLES
Version: @RPMVERSION@
%if 0%{?is_kotd}
Release: <RELEASE>.g@COMMIT@
%else
Release: @RELEASE@
%endif
%description
This package is using the kernel compiled within Open Build Service(OBS)
projects and runs basic tests.
%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
%files
/usr/share/%name
%changelog

60753
kernel-source.changes Normal file

File diff suppressed because it is too large Load Diff

14
kernel-source.rpmlintrc Normal file
View File

@ -0,0 +1,14 @@
# These zero-length files are correct:
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/[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/[1-9].*/source")
# These hidden files are fine:
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")

329
kernel-source.spec Normal file
View File

@ -0,0 +1,329 @@
#
# spec file for package kernel-source
#
# Copyright (c) 2024 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/
#
%define srcversion 6.4
%define patchversion 6.4.0
%define git_commit 820ec3d69b9d3e6787e13e9a181b4a5d076291bf
%define variant %{nil}
%include %_sourcedir/kernel-spec-macros
%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
Name: kernel-source
Version: 6.4.0
%if 0%{?is_kotd}
Release: <RELEASE>.g820ec3d
%else
Release: 0
%endif
Summary: The Linux Kernel Sources
License: GPL-2.0-only
Group: Development/Sources
URL: https://www.kernel.org/
AutoReqProv: off
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
BuildRequires: bash-sh
%endif
BuildRequires: coreutils
BuildRequires: fdupes
BuildRequires: sed
Requires(post): coreutils sed
Source0: https://www.kernel.org/pub/linux/kernel/v6.x/linux-%srcversion.tar.xz
%if "https://www.kernel.org/pub/linux/kernel/v6.x/" != ""
Source1: https://www.kernel.org/pub/linux/kernel/v6.x/linux-%srcversion.tar.sign
Source2: linux.keyring
%endif
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
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
Source58: constraints.in
Source60: config.sh
Source61: compute-PATCHVERSION.sh
Source62: old-flavors
Source63: arch-symbols
Source64: package-descriptions
Source65: kernel-spec-macros
Source67: log.sh
Source68: host-memcpy-hack.h
Source69: try-disable-staging-driver
Source70: kernel-obs-build.spec.in
Source71: kernel-obs-qa.spec.in
Source72: compress-vmlinux.sh
Source73: dtb.spec.in.in
Source74: mkspec-dtb
Source75: release-projects
Source76: check-module-license
Source77: klp-symbols
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
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
BuildArch: noarch
%else
ExclusiveArch: do_not_build
%endif
Prefix: /usr/src
# Source is only complete with devel files.
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
%obsolete_rebuilds %name
%(chmod +x %_sourcedir/{guards,apply-patches,check-for-config-changes,group-source-files.pl,split-modules,modversions,kabi.pl,mkspec,compute-PATCHVERSION.sh,arch-symbols,log.sh,try-disable-staging-driver,compress-vmlinux.sh,mkspec-dtb,check-module-license,klp-symbols,splitflist,mergedep,moddep,modflist,kernel-subpackage-build})
# 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 do_vanilla "%variant" == ""
%description
Linux kernel sources with many fixes and improvements.
%source_timestamp
%package -n kernel-devel%variant
%obsolete_rebuilds kernel-devel%variant
Summary: Development files needed for building kernel modules
Group: Development/Sources
AutoReqProv: off
Provides: kernel-devel%variant = %version-%source_rel
Provides: multiversion(kernel)
Requires: kernel-macros
Requires(post): coreutils
%description -n kernel-devel%variant
Kernel-level headers and Makefiles required for development of
external kernel modules.
%source_timestamp
# 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
%package vanilla
%obsolete_rebuilds %name-vanilla
Summary: Vanilla Linux kernel sources with minor build fixes
Group: Development/Sources
AutoReqProv: off
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
%prep
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 108 -a 109 -a 110 -a 111 -a 113 -a 114 -a 120 -a 121
%build
%install
mkdir -p %{buildroot}/usr/src
pushd %{buildroot}/usr/src
# Unpack the vanilla kernel sources
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
cp -al \
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")
# Hardlink duplicate files automatically (from package fdupes).
%fdupes $PWD
cd ..
%endif
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
# Hardlink duplicate files automatically (from package fdupes).
%fdupes $PWD
cd ..
popd
# Install the documentation and example Kernel Module Package.
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/
%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
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" \
-D "$OLDPWD/devel.files" -N "$OLDPWD/nondevel.files" \
-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_ }' -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
%relink_function
relink linux-%kernelrelease%variant /usr/src/linux%variant
%post -n kernel-devel%variant
%relink_function
relink linux-%kernelrelease%variant /usr/src/linux%variant
%files -f nondevel.files
%files -n kernel-devel%variant -f devel.files
%ghost /usr/src/linux%variant
%doc /usr/share/doc/packages/*
%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
%if %do_vanilla
%files vanilla
/usr/src/linux-%kernelrelease-vanilla
%endif
%changelog

329
kernel-source.spec.in Normal file
View File

@ -0,0 +1,329 @@
#
# spec file for package kernel-source@VARIANT@
#
# Copyright (c) @YEAR@ 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/
#
%define srcversion @SRCVERSION@
%define patchversion @PATCHVERSION@
%define git_commit @COMMIT_FULL@
%define variant @VARIANT@%{nil}
%include %_sourcedir/kernel-spec-macros
%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
Name: kernel-source@VARIANT@
Version: @RPMVERSION@
%if 0%{?is_kotd}
Release: <RELEASE>.g@COMMIT@
%else
Release: @RELEASE@
%endif
Summary: The Linux Kernel Sources
License: GPL-2.0-only
Group: Development/Sources
URL: https://www.kernel.org/
AutoReqProv: off
%if 0%{?suse_version} > 1500 || 0%{?sle_version} > 150300
BuildRequires: bash-sh
%endif
BuildRequires: coreutils
BuildRequires: fdupes
BuildRequires: sed
Requires(post): coreutils sed
Source0: @TARBALL_URL@linux-%srcversion.tar.xz
%if "@TARBALL_URL@" != ""
Source1: @TARBALL_URL@linux-%srcversion.tar.sign
Source2: linux.keyring
%endif
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
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
Source58: constraints.in
Source60: config.sh
Source61: compute-PATCHVERSION.sh
Source62: old-flavors
Source63: arch-symbols
Source64: package-descriptions
Source65: kernel-spec-macros
Source67: log.sh
Source68: host-memcpy-hack.h
Source69: try-disable-staging-driver
Source70: kernel-obs-build.spec.in
Source71: kernel-obs-qa.spec.in
Source72: compress-vmlinux.sh
Source73: dtb.spec.in.in
Source74: mkspec-dtb
Source75: release-projects
Source76: check-module-license
Source77: klp-symbols
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
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
BuildArch: noarch
%else
ExclusiveArch: do_not_build
%endif
Prefix: /usr/src
# Source is only complete with devel files.
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
%obsolete_rebuilds %name
%(chmod +x %_sourcedir/{@SCRIPTS@})
# 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 do_vanilla "%variant" == ""
%description
Linux kernel sources with many fixes and improvements.
%source_timestamp
%package -n kernel-devel%variant
%obsolete_rebuilds kernel-devel%variant
Summary: Development files needed for building kernel modules
Group: Development/Sources
AutoReqProv: off
Provides: kernel-devel%variant = %version-%source_rel
Provides: multiversion(kernel)
Requires: kernel-macros
Requires(post): coreutils
%description -n kernel-devel%variant
Kernel-level headers and Makefiles required for development of
external kernel modules.
%source_timestamp
# 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
%package vanilla
%obsolete_rebuilds %name-vanilla
Summary: Vanilla Linux kernel sources with minor build fixes
Group: Development/Sources
AutoReqProv: off
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
%prep
echo "Symbol(s): %symbols"
# Unpack all sources and patches
%setup -q -c -T @UNPACK_PATCHES@
%build
%install
mkdir -p %{buildroot}/usr/src
pushd %{buildroot}/usr/src
# Unpack the vanilla kernel sources
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
cp -al \
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")
# Hardlink duplicate files automatically (from package fdupes).
%fdupes $PWD
cd ..
%endif
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
# Hardlink duplicate files automatically (from package fdupes).
%fdupes $PWD
cd ..
popd
# Install the documentation and example Kernel Module Package.
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/
%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
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" \
-D "$OLDPWD/devel.files" -N "$OLDPWD/nondevel.files" \
-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_ }' -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
%relink_function
relink linux-%kernelrelease%variant /usr/src/linux%variant
%post -n kernel-devel%variant
%relink_function
relink linux-%kernelrelease%variant /usr/src/linux%variant
%files -f nondevel.files
%files -n kernel-devel%variant -f devel.files
%ghost /usr/src/linux%variant
%doc /usr/share/doc/packages/*
%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
%if %do_vanilla
%files vanilla
/usr/src/linux-%kernelrelease-vanilla
%endif
%changelog

85
kernel-spec-macros Normal file
View File

@ -0,0 +1,85 @@
# This file is included by all the kernel-*.spec files
# Build with bash instead of sh as the shell: this turns on bash
# extensions like <(...).
%define _buildshell /bin/bash
%define using_buildservice 0%{?opensuse_bs}
%if ! 0%{?using_buildservice}
%define using_buildservice 0%(echo %disturl | grep -q '^obs://build\.[^.]*suse\.' && echo 1)
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%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-%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 || :)
# 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 0%{?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

72
kernel-subpackage-build Normal file
View File

@ -0,0 +1,72 @@
#!/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"
dd if=/dev/null bs=1 count=0 status=none seek="$size" of="$RPM_BUILD_ROOT$name"
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

109
kernel-subpackage-spec Normal file
View File

@ -0,0 +1,109 @@
%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
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

60753
kernel-syms.changes Normal file

File diff suppressed because it is too large Load Diff

85
kernel-syms.spec Normal file
View File

@ -0,0 +1,85 @@
#
# spec file for package kernel-syms
#
# Copyright (c) 2024 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/
#
%define git_commit 820ec3d69b9d3e6787e13e9a181b4a5d076291bf
%define variant %{nil}
%include %_sourcedir/kernel-spec-macros
Name: kernel-syms
Summary: Kernel Symbol Versions (modversions)
License: GPL-2.0-only
Group: Development/Sources
Version: 6.4.0
%if %using_buildservice
%if 0%{?is_kotd}
Release: <RELEASE>.g820ec3d
%else
Release: 0
%endif
%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
URL: https://www.kernel.org/
AutoReqProv: off
BuildRequires: coreutils
%ifarch aarch64
Requires: kernel-64kb-devel = %version-%source_rel
%endif
%ifarch aarch64 ppc64le s390x x86_64
Requires: kernel-default-devel = %version-%source_rel
%endif
Requires: pesign-obs-integration
Provides: %name = %version-%source_rel
Provides: %name-srchash-%git_commit
Provides: multiversion(kernel)
Source: README.KSYMS
Requires: kernel-devel%variant = %version-%source_rel
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
ExclusiveArch: aarch64 ppc64le s390x x86_64
%else
ExclusiveArch: do_not_build
%endif
Prefix: /usr/src
# 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
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
%dir %_docdir/%name
%_docdir/%name/README.SUSE
%changelog

80
kernel-syms.spec.in Normal file
View File

@ -0,0 +1,80 @@
#
# spec file for package kernel-syms@VARIANT@
#
# Copyright (c) @YEAR@ 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/
#
%define git_commit @COMMIT_FULL@
%define variant @VARIANT@%{nil}
%include %_sourcedir/kernel-spec-macros
Name: kernel-syms@VARIANT@
Summary: Kernel Symbol Versions (modversions)
License: GPL-2.0-only
Group: Development/Sources
Version: @RPMVERSION@
%if %using_buildservice
%if 0%{?is_kotd}
Release: <RELEASE>.g@COMMIT@
%else
Release: @RELEASE@
%endif
%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
URL: https://www.kernel.org/
AutoReqProv: off
BuildRequires: coreutils
@REQUIRES@
Requires: pesign-obs-integration
Provides: %name = %version-%source_rel
Provides: %name-srchash-%git_commit
Provides: multiversion(kernel)
Source: README.KSYMS
Requires: kernel-devel%variant = %version-%source_rel
%if ! 0%{?is_kotd} || ! %{?is_kotd_qa}%{!?is_kotd_qa:0}
ExclusiveArch: @ARCHS@
%else
ExclusiveArch: do_not_build
%endif
Prefix: /usr/src
# 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
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
%dir %_docdir/%name
%_docdir/%name/README.SUSE
%changelog

60753
kernel-zfcpdump.changes Normal file

File diff suppressed because it is too large Load Diff

2012
kernel-zfcpdump.spec Normal file

File diff suppressed because it is too large Load Diff

72
klp-symbols Normal file
View File

@ -0,0 +1,72 @@
#!/bin/bash
set -e
export LC_COLLATE=C
usage()
{
echo "Tool to generate list of symbols that are used to build kernel livepatches"
echo
echo "Usage: ${0##*/} kernel_build_dir klp_symbols"
echo " kernel_build_dir Directory where to find the built kernel binaries"
echo " klp_symbols Output file with the list of symbols"
}
if test "$1" == "-h" -o "$1" == "--help" -o $# -ne 2 ; then
usage >&2
exit 1
fi
KLP_DATA_VERSION="0.1"
KERNEL_BUILD_DIR="$1"
KLP_SYMBOLS="$2"
VMLINUX="$KERNEL_BUILD_DIR/vmlinux"
MODVER_DIR="$KERNEL_BUILD_DIR/.tmp_versions"
if ! test -f "$VMLINUX" ; then
echo "Error: Cannot open file: $VMLINUX" >&2
exit 1
fi
if ! test -d "$MODVER_DIR" ; then
# kernel >= 5.3 has *.mod in the build tree
mod_cnt=$(find "$KERNEL_BUILD_DIR" -name '*.mod' | wc -l)
if [ $mod_cnt -eq 0 ]; then
echo "Error: Directory does not exist: $MODVER_DIR" >&2
exit 1
fi
MODVER_DIR="$KERNEL_BUILD_DIR"
fi
get_symbols()
{
nm -f posix "$1" | grep -v '\( [UN] \)\|\(\.L\|__crc_\)' | cut -d\ -f1
}
echo "klp-convert-symbol-data.$KLP_DATA_VERSION" > "$KLP_SYMBOLS"
echo "*vmlinux" >> "$KLP_SYMBOLS"
get_symbols "$VMLINUX" >> "$KLP_SYMBOLS"
find "$MODVER_DIR" -iname '*.mod' | sort | while read KMOD ; do
if [ "$MODVER_DIR" = "$KERNEL_BUILD_DIR" ]; then
# kernel >= 5.3, just replace the suffix
KO_FILE="${KMOD%.mod}.ko"
else
# kernel <= 5.2, read .ko path and file from .mod file
KO_FILE="$(head -n1 $KMOD)"
fi
# obtain module name and its object file by processing .ko file name
NO_SUFFIX="$(basename -s .ko $KO_FILE)"
KMOD_NAME="$(echo $NO_SUFFIX | sed 's/-/_/g')"
OBJ_FILE="$(dirname $KO_FILE)/$NO_SUFFIX.o"
# write module name to Symbols file
echo "*$KMOD_NAME" >> "$KLP_SYMBOLS"
# extract symbols from object file and write them to Symbols file
get_symbols "$OBJ_FILE" >> "$KLP_SYMBOLS"
done
exit 0

19
linux-6.4.tar.sign Normal file
View File

@ -0,0 +1,19 @@
-----BEGIN PGP SIGNATURE-----
Comment: This signature is for the .tar version of the archive
Comment: git archive --format tar --prefix=linux-6.4/ v6.4
Comment: git version 2.41.0
iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmSZJtAACgkQONu9yGCS
aT6pJw/+Osrk7UvALCjSPp1LzX4MM1rV27c6McOri/Wq9/25ohOCkq0ieUywPgUJ
RZ6NyxDQWU9DyPIQMWRzjliwtVcN9+Qc0dTXFezBHnQJVfTlDA6Ms0i6T92EQEx0
A+aRo12u4rww1Z44A2aWKtYJTsGGY1hyXhTnWulsQqx1fcDoEv6G1NLdpqvlIKhn
HLYVPcTgFJiHo3dBvhx2/hqAtupIB3EJNpJr9GZlrlX4i2HncfdNcrKVGYuxsXJJ
nkn5EtbhPwOAcHkkmsWa4xAEe5omp938osZ9x20DVVfTEFM/b4BV9lt7Sm5EbHOq
uVRPbih2rCRBOF7hXgDsq4UwfY2CFYPp7B/F54cIjNSh1euHeLoaJb9Fz2PFIgub
yYDWksm80NaIoa3bXx8VG4ZNE64TwVDWfi8cBWSJkp+16nToI9Oj3/VWpHaMm7vN
rojMzgmps4joYflbBfM3hb8HthmnRM38NiUvQug8pmd8Y2nbJxCQH17A1sv3Mpbw
Ke3Qro9Zk4xfZb+GdrSuUW4G4JUbSZKM0JwU3HQZ5hQT4D7h1G0tfrl3/ClJfxal
125ZU7VThBms7Vn1Sf3GAwbD4kvkLuNt3QSbpBFjlJ/9w7SMriWvUvMKXzZ3jUJX
KefEanRsJijRBBWIKGZ8u2Z1dB6B9zLc6/zQORkWou4l3dpuTQo=
=b0YG
-----END PGP SIGNATURE-----

BIN
linux-6.4.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
linux.keyring Normal file

Binary file not shown.

167
log.sh Normal file
View File

@ -0,0 +1,167 @@
#! /bin/bash
# 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

99
macros.kernel-source Normal file
View File

@ -0,0 +1,99 @@
# 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
}
%kernel_module_package_release 1
%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:bc:) \
%{expand:%( \
subpkg=%{-t*}%{!-t:/usr/lib/rpm/kernel-module-subpackage} \
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 \
case " $flavors " in \
(*" $flavor "*) \
[ -n "%{-X}" ] && continue ;; \
(*) \
[ -z "%{-X}" -a -n "$flavors" ] && continue ;; \
esac \
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} -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)}" \
echo "%%global kernel_source() /usr/src/linux-obj/%_target_cpu/%%%%{1}" \
echo "%%global kernel_module_package_moddir() updates" \
\
echo "%package -n %{-n*}%{!-n:%name}-kmp-_dummy_" \
echo "Version: %version" \
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: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:bc:) \
%{expand:%%_kernel_module_package %{-x: }%{!-x:-X} %{-n} %{-v} %{-r} %{-s:-t %{-s*}} %{-f} %{-p} %{-b} %{-c} %*}

28
mergedep Normal file
View 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

587
mkspec Normal file
View File

@ -0,0 +1,587 @@
#!/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");
my %all_archs = parse_config_conf("needs_updating");
my @all_archs;
for my $flavor (keys(%all_archs)) {
push(@all_archs, arch2rpm(@{$all_archs{$flavor}}));
}
@all_archs = sort(uniq(@all_archs));
my $all_archs = join(" ", @all_archs);
# template name -> template body
my %templates = read_spec_templates();
my @kmps = read_kmps();
# config.sh variables
my %vars = parse_config_sh();
my ($srcversion, $variant, $obs_build_variant) =
($vars{'SRCVERSION'}, $vars{'VARIANT'}, $vars{'OBS_BUILD_VARIANT'});
$obs_build_variant = ($obs_build_variant ? $variant : "" );
my $compress_modules = 'none';
my $compress_vmlinux = 'gz';
if (defined($vars{'COMPRESS_MODULES'})) {
$compress_modules = $vars{'COMPRESS_MODULES'};
}
if (defined($vars{'COMPRESS_VMLINUX'})) {
$compress_vmlinux = $vars{'COMPRESS_VMLINUX'};
}
sub detect_false {
my $arg = $_[0];
return "" if not $arg;
return $arg =~ /^(0+|no|none)$/i ? "" : $arg;
}
my $build_dtbs = detect_false $vars{'BUILD_DTBS'};
my $multibuild = detect_false $vars{'MULTIBUILD'};
my $livepatch = detect_false $vars{'LIVEPATCH'};
my $livepatch_rt = detect_false $vars{'LIVEPATCH_RT'};
sub to_bool {
return detect_false($_[0]) ? 1 : 0 ;
}
my $sb_efi_only = to_bool $vars{'SB_EFI_ONLY'};
my $split_base = to_bool $vars{'SPLIT_BASE'};
my $split_optional = to_bool $vars{'SPLIT_OPTIONAL'};
my $supported_modules_check = to_bool $vars{'SUPPORTED_MODULES_CHECK'};
my $build_pdf = to_bool $vars{'BUILD_PDF'};
my $build_html = to_bool $vars{'BUILD_HTML'};
if (!defined ($rpmrelease)) {
$rpmrelease = $vars{'RELEASE'} || 0;
}
# package name -> [summary, description, extra kmp deps]
my %binary_descriptions = parse_descriptions();
# arch -> flavor -> [obsoleted packages]
my %obsolete_packages = parse_old_flavors();
$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;
$rpmrelease =~ s/-/./g;
my $sources = join("\n", $templates{source} =~ /^Source\d+:[^\n]*/msg);
# Do not include the signature and keyring as source in the binary packages
# The sources are not really included anyway, and for non-upstream tarballs these files do not exist
$sources = join("\n", grep { $_ !~ /[.](?:keyring|tar[.]sign)\s*$/ } $sources =~ /^[^\n]*/msg);
# Find all SourceN: foo.tar.(bz2|xz) lines and generate the NoSource:
# lines and the %setup line
my @tarballs = ($sources =~ /^Source(\d+):[^\n]*\.tar\.(?:bz2|xz)/msg);
my $nosource = $sources;
$nosource =~ s/^Source(\d+):.*?$/NoSource: $1/mg;
# 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 = "https://www.kernel.org/pub/linux/kernel/v$1.x/";
$tarball_url = "" if $2; # kernel.org has no tarballs for rc kernels
# rc tarballs only available from git as https://git.kernel.org/torvalds/t/linux-*.gz
} else {
# kernel.org has no tarballs for linux-next or vanilla snapshots
$tarball_url = "";
}
my $commit = get_commit();
my $commit_full = get_commit(1);
my %macros = (
VARIANT => $variant,
OBS_BUILD_VARIANT => $obs_build_variant . "%{nil}",
SRCVERSION => $srcversion,
PATCHVERSION => $patchversion,
RPMVERSION => $rpmversion,
TARBALL_URL => $tarball_url,
RELEASE => $rpmrelease,
COMMIT => $commit,
COMMIT_FULL => $commit_full,
SOURCES => $sources . "\n# These files are found in the kernel-source package:\n" . $nosource,
UNPACK_PATCHES => $unpack_patches,
SCRIPTS => $scripts,
LIVEPATCH => $livepatch,
LIVEPATCH_RT => $livepatch_rt,
SB_EFI_ONLY => $sb_efi_only,
SPLIT_BASE => $split_base,
SPLIT_OPTIONAL => $split_optional,
SUPPORTED_MODULES_CHECK => $supported_modules_check,
BUILD_PDF => $build_pdf,
BUILD_HTML => $build_html,
YEAR => (localtime time)[5] + 1900,
COMPRESS_MODULES => $compress_modules,
COMPRESS_VMLINUX => $compress_vmlinux,
);
# binary spec files
my $kmp_definitions = "";
my @kmp_definitions;
for my $kmp (@kmps) {
my ($summary, $description, $deps);
if (!exists($binary_descriptions{$kmp})) {
print STDERR "warning: no description for $kmp found\n";
($summary = $kmp) =~ s/-kmp$//;
$summary .= " kernel modules";
$description = "$summary.";
$deps = "";
} else {
$summary = $binary_descriptions{$kmp}->[0];
$description = $binary_descriptions{$kmp}->[1];
$deps = $binary_descriptions{$kmp}->[2];
}
push(@kmp_definitions, expand_template("kmp",
KMP_NAME => $kmp,
KMP_SUMMARY => $summary,
KMP_DESCRIPTION => $description,
KMP_DEPS => $deps));
}
$kmp_definitions = join("\n", @kmp_definitions);
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];
}
my %obsolete_macros;
for my $subpac ("", "-base", "-extra", "-devel", "-hmac", "-optional") {
(my $macro = "PROVIDES_OBSOLETES" . uc($subpac)) =~ s/-/_/;
$obsolete_macros{$macro} =
provides_obsoletes($flavor, $subpac, @{$flavor_archs{$flavor}});
}
do_spec('binary', "kernel-$flavor.spec", %macros,
FLAVOR => $flavor,
SUMMARY => $summary,
DESCRIPTION => $description,
ARCHS => join(" ", arch2rpm(@{$flavor_archs{$flavor}})),
COMMON_DEPS => $templates{common_deps},
KMPS => join(" ", @kmps),
KMP_DEFINITIONS => $kmp_definitions,
%obsolete_macros
);
}
# kernel-source.spec
do_spec('source', "kernel-source$variant.spec", %macros);
if ($variant eq "") {
# kernel-docs.spec
do_spec('docs', "kernel-docs$variant.spec", %macros);
}
# kernel-syms.spec
{
my $requires = "";
my %syms_archs;
my $syms_archs;
for my $flavor (sort keys(%syms_flavor_archs)) {
next if $flavor eq "vanilla";
my @archs = arch2rpm(@{$syms_flavor_archs{$flavor}});
$syms_archs{$_} = 1 for @archs;
$requires .= "%ifarch @archs\n";
$requires .= "Requires: kernel-$flavor-devel = \%version-\%source_rel\n";
$requires .= "%endif\n";
}
chomp $requires;
$syms_archs = join(" ", sort(keys(%syms_archs)));
if (keys(%syms_archs)) {
do_spec('syms', "kernel-syms$variant.spec", %macros,
REQUIRES => $requires,
ARCHS => $syms_archs);
}
}
# kernel-obs-*.spec
if (!$variant || $obs_build_variant) {
my @default_archs;
my $flavor = $obs_build_variant;
if ($flavor) {
$flavor =~ s/^-//;
} else {
$flavor = 'default';
}
@default_archs = arch2rpm(@{$flavor_archs{$flavor}});
# No kernel-obs-* for 32bit ppc and x86
@default_archs = grep { $_ ne "ppc" && $_ ne '%ix86' } @default_archs;
my $default_archs = join(" ", @default_archs);
do_spec('obs-build', "kernel-obs-build.spec", %macros,
ARCHS => $default_archs);
do_spec('obs-qa', "kernel-obs-qa.spec", %macros,
ARCHS => $default_archs);
}
# dtb-*.spec
if ((!$variant || $obs_build_variant) && $build_dtbs) {
do_spec('dtb', "dtb.spec.in", %macros);
print "./mkspec-dtb $all_archs\n";
system("./mkspec-dtb $all_archs\n");
unlink("$dir/dtb.spec.in");
if ($?) {
exit(($? >> 8) || ($? & 127 + 128) || 1);
}
}
copy_changes();
# _constraints
{
my @packages = map { "<package>kernel-$_</package>\n<package>kernel-source$variant:kernel-$_</package>" } sort keys(%flavor_archs);
my $packages = join("\n", @packages);
do_spec('constraints', "_constraints",
BINARY_PACKAGES_XML => $packages,
VARIANT => $variant);
}
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 obs-build obs-qa)) {
xopen(my $fh, '<', "$dir/kernel-$template.spec.in");
local $/ = undef;
$res{$template} = <$fh>;
close($fh);
next unless $template eq "binary";
if ($res{$template} =~ /^# BEGIN COMMON DEPS\n?(.*)^# END COMMON DEPS/ms) {
$res{common_deps} = $1;
} else {
print STDERR "warning: Expected # BEGIN COMMON DEPS in kernel-binary.spec.in\n";
$res{common_deps} = "";
}
if ($res{$template} =~ s/^# BEGIN KMP\n?(.*)^# END KMP/\@KMP_DEFINITIONS\@/ms) {
$res{kmp} = $1;
} else {
print STDERR "warning: Expected # BEGIN KMP in kernel-binary.spec.in\n";
$res{kmp} = "";
}
}
{
xopen(my $fh, '<', "$dir/constraints.in");
local $/ = undef;
$res{constraints} = <$fh>;
close($fh);
xopen($fh, '<', "$dir/dtb.spec.in.in");
$res{dtb} = <$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_]+)=(.*)/) {
my ($key, $val) = ($1, $2);
$val =~ s/^"(.*)"$/$1/;
$res{$key} = $val;
}
}
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 == 0) {
$state++;
} elsif ($state == 2) {
$blank .= $_;
}
next;
}
# non-blank line and not === package ===
if ($state == 0) {
chomp;
if (s/^Requires: *//) {
# foo-kmp is a shorthand for another kmp
# from the same specfile
s/-kmp/-kmp-%build_flavor = %version-%release/g;
s/^/Requires: /;
if ($current->[2]) {
$current->[2] .= "\n";
}
$current->[2] .= $_;
} else {
# The Summary: keyword is optional
s/^Summary: *//;
if ($current->[0]) {
print STDERR "warning: multi-line summary\n";
}
$current->[0] = $_;
}
} elsif ($state == 1) {
$current->[1] = $_;
$blank = "";
$state++;
} else {
$current->[1] .= $blank;
$blank = "";
$current->[1] .= $_;
}
}
if ($current) {
chomp $current->[1];
}
close($fh);
return %res;
}
sub read_kmps {
my %res;
open(my $fh, '-|', "$dir/guards", "--list", "--with-guards",
"-c", "$dir/supported.conf") or die "Error running guards: $!\n";
while (<$fh>) {
my @guards = split(' ');
pop(@guards);
for my $g (@guards) {
if ($g =~ /^(?:\+|-!)(.*-kmp)$/) {
$res{$1} = 1;
}
}
}
close($fh) or die "Error running guards: $!\n";
return sort(keys(%res));
}
sub parse_old_flavors{
my %res;
xopen(my $fh, '<', "$dir/old-flavors");
while (<$fh>) {
chomp;
next if /^\s*(#|$)/;
if (!m:^\s*(\w+)/([\w-]+)\s+([\w-]+)\s+([\w.-]+)\s*$:) {
print STDERR "$dir/old-flavors:$.: expected arch/flavor <old flavor> <old version>\n";
next;
}
my ($arch, $flavor, $old_flavor, $old_version) = ($1, $2, $3, $4);
$res{$arch} ||= {};
$res{$arch}{$flavor} ||= [];
push(@{$res{$arch}{$flavor}},
["kernel-$old_flavor", $old_version]);
}
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 $subpac = shift;
my @archs = @_;
my $res = "";
for my $arch (@archs) {
my @packs = @{$obsolete_packages{$arch}{$flavor} || []};
my $printed;
next if (!@packs);
my $rpmarch = arch2rpm($arch);
chomp $rpmarch;
for my $pack (@packs) {
my $name = $pack->[0] . $subpac;
my $version = $pack->[1];
if (!$printed) {
$res .= "\%ifarch $rpmarch\n";
$printed = 1;
}
$res .= "Provides: $name = $version\n";
$res .= "Obsoletes: $name <= $version\n";
}
$res .= "\%endif\n" if $printed;
}
chomp $res;
return $res;
}
sub get_commit {
my ($commit, $fh, $full);
$full = $_[0] // 0;
if (!open($fh, '<', "source-timestamp")) {
print STDERR "warning: source-timestamp: $!\n";
print STDERR "warning: Cannot determine commit id\n";
return "0000000";
}
while (<$fh>) {
if ($full ? /^GIT Revision: ([0-9a-f]{40})/ : /^GIT Revision: ([0-9a-f]{7})/) {
$commit = $1;
}
}
close($fh);
if (!$commit) {
print STDERR "warning: Commit id missing in source-timestamp file\n";
return "0000000";
}
return $commit;
}
sub expand_template {
my $template = shift;
my %macros = @_;
my $text = $templates{$template};
my $prev_text;
do {
$prev_text = $text;
for my $m (keys %macros) {
if ($macros{$m} eq "") {
# Do not generate empty lines
$text =~ s/^\@$m\@\n//mg;
}
$text =~ s/\@$m\@/$macros{$m}/g;
}
} while ($prev_text ne $text);
return $text;
}
sub do_spec {
my $template = shift;
my $specfile = shift;
my %macros = @_;
my $text = expand_template($template, %macros);
print "$specfile\n";
xopen(my $fh, '>', "$dir/$specfile");
print $fh $text;
close($fh);
}
sub copy_changes {
opendir(my $dh, $dir) or die "$dir: $!\n";
xopen(my $fh, '>', "$dir/_multibuild") if $multibuild;
print $fh "<multibuild>\n" if $fh;
foreach my $name (sort readdir $dh) {
next unless $name =~ /\.spec$/;
next if $name eq "kernel-source$variant.spec";
$name =~ s/\.spec$//;
copy("$dir/kernel-source$variant.changes", "$dir/$name.changes");
print $fh "\t<package>$name</package>\n" if $fh;
}
print $fh "</multibuild>\n" if $fh;
close($fh) if $fh;
closedir($dh);
}
sub xopen {
open($_[0], $_[1], $_[2]) or die "$_[2]: $!\n";
}
sub uniq {
my %seen;
return grep { !$seen{$_}++ } @_;
}

219
mkspec-dtb Normal file
View File

@ -0,0 +1,219 @@
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
my $spec_in = "dtb.spec.in";
# DTB packages names, ordered by file names
my @armv7l_package_list = (
['dtb-am335x', 'am335x-*.dts', "TI AM335x based systems"],
['dtb-am3517', 'am3517*.dts', "TI AM3517 based systems"], # exception: am3517_mt_ventoux.dts
['dtb-am57xx', 'am57xx-*.dts', "TI AM57xx based systems"],
['dtb-armada-370', 'armada-370-*.dts', "Armada 370 based systems"],
['dtb-armada-375', 'armada-375-*.dts', "Armada 375 based systems"],
['dtb-armada-385', 'armada-385-*.dts', "Armada 385 based systems"],
['dtb-armada-388', 'armada-388-*.dts', "Armada 388 based systems"],
['dtb-armada-398', 'armada-398-*.dts', "Armada 398 based systems"],
['dtb-armada-xp', 'armada-xp-*.dts', "Armada XP based systems"],
['dtb-bcm2836', 'bcm2836*.dts', "Raspberry Pi 2 Model B"],
['dtb-dove', 'dove-*.dts', "Marvell dove based systems"],
['dtb-exynos4', 'exynos4*.dts', "Samsung Exynos 4 based systems"],
['dtb-exynos5', 'exynos5*.dts', "Samsung Exynos 5 based systems"],
['dtb-imx5', 'imx5*.dts', "Freescale i.MX51 and i.MX53 based systems"],
['dtb-imx6', 'imx6*.dts', "Freescale i.MX6 based systems"],
['dtb-imx7', 'imx7*.dts', "Freescale i.MX7 based systems"],
['dtb-keystone', 'keystone-*.dts', "TI Keystone 2 based systems"],
['dtb-meson6', 'meson6-*.dts', "Amlogic Meson 6 based systems"],
['dtb-meson8', 'meson8-*.dts', "Amlogic Meson 8 based systems"],
['dtb-meson8b', 'meson8b-*.dts', "Amlogic Meson 8b based systems"],
['dtb-mt76', 'mt76*.dts', "MediaTek mt76 based systems"],
['dtb-omap3', 'omap3*.dts', "TI OMAP3 based systems"],
['dtb-omap4', 'omap4*.dts', "TI OMAP4 based systems"],
['dtb-omap5', 'omap5*.dts', "TI OMAP5 based systems"],
['dtb-qcom', 'qcom-*.dts', "Qualcomm Snapdragon based systems"],
['dtb-rk3', 'rk3*.dts', "Rockchip RK3xxx based systems"],
['dtb-socfpga', 'socfpga_*.dts', "Altera SoC FPGA based systems"],
['dtb-ste', 'ste-*.dts', "ST Ericsson based systems"],
['dtb-sun4i', 'sun4i-*.dts', "Allwinner sun4i based systems"],
['dtb-sun5i', 'sun5i-*.dts', "Allwinner sun5i based systems"],
['dtb-sun6i', 'sun6i-*.dts', "Allwinner sun6i based systems"],
['dtb-sun7i', 'sun7i-*.dts', "Allwinner sun7i based systems"],
['dtb-sun8i', 'sun8i-*.dts', "Allwinner sun8i based systems"],
['dtb-sun9i', 'sun9i-*.dts', "Allwinner sun9i based systems"],
['dtb-tegra2', 'tegra20-*.dts', "NVidia Tegra2 based systems"],
['dtb-tegra3', 'tegra30-*.dts', "NVidia Tegra3 based systems"],
['dtb-tegra114', 'tegra114-*.dts', "NVidia Tegra4 based systems"],
['dtb-tegra124', 'tegra124-*.dts', "NVidia Tegra K1 based systems"],
['dtb-vexpress', 'vexpress-*.dts', "ARM Versatile Express machines"],
['dtb-vf500', 'vf500-*.dts', "Freescale Vybrid VF500 based systems"],
['dtb-vf6', 'vf610-*.dts', "Freescale Vybrid VF610 based systems"],
['dtb-xenvm', 'xenvm-*.dts', "Xen virtual machines"],
['dtb-zynq', 'zynq-*.dts', "Xilinx Zynq based systems"],
);
# DTB packages names
my @armv6l_package_list = (
['dtb-bcm2835', 'bcm2835*.dts', "Raspberry Pi 1 (A+, B, B+)"],
);
# DTB packages names
my @aarch64_package_list = (
['dtb-allwinner', 'allwinner/*.dts', "Allwinner based arm64 systems"],
['dtb-altera', 'altera/*.dts', "Altera based arm64 systems"],
['dtb-amazon', 'amazon/*.dts', "Amazon based arm64 systems"],
['dtb-amd', 'amd/*.dts', "AMD based arm64 systems"],
['dtb-amlogic', 'amlogic/*.dts', "Amlogic based arm64 systems"],
['dtb-apm', 'apm/*.dts', "AppliedMicro based arm64 systems"],
['dtb-apple', 'apple/*.dts', "Apple SOC based arm64 systems"],
['dtb-arm', 'arm/*.dts', "ARM Ltd. based arm64 systems"],
['dtb-broadcom', 'broadcom/*.dts', "Broadcom based arm64 systems"],
['dtb-cavium', 'cavium/*.dts', "Cavium based arm64 systems"],
['dtb-exynos', 'exynos/*.dts', "Samsung Exynos based arm64 systems"],
['dtb-freescale', 'freescale/*.dts', "NXP (Freescale) based arm64 systems"],
['dtb-hisilicon', 'hisilicon/*.dts', "HiSilicon based arm64 systems"],
['dtb-lg', 'lg/*.dts', "LG based arm64 systems"],
['dtb-marvell', 'marvell/*.dts', "Marvell based arm64 systems"],
['dtb-mediatek', 'mediatek/*.dts', "MediaTek based arm64 systems"],
['dtb-nvidia', 'nvidia/*.dts', "Nvidia based arm64 systems"],
['dtb-qcom', 'qcom/*.dts', "Qualcomm based arm64 systems"],
['dtb-renesas', 'renesas/*.dts', "Renesas based arm64 systems"],
['dtb-rockchip', 'rockchip/*.dts', "Rockchip based arm64 systems"],
['dtb-socionext', 'socionext/*.dts', "Socionext based arm64 systems"],
['dtb-sprd', 'sprd/*.dts', "Spreadtrum based arm64 systems"],
['dtb-xilinx', 'xilinx/*.dts', "Xilinx based arm64 systems"],
);
# DTB packages names
my @riscv64_package_list = (
['dtb-allwinner', 'allwinner/*.dts', "Allwinner based riscv64 systems"],
['dtb-microchip', 'microchip/*.dts', "Microchip based riscv64 systems"],
['dtb-renesas', 'renesas/*.dts', "Renesas based riscv64 systems"],
['dtb-sifive', 'sifive/*.dts', "SiFive based riscv64 systems"],
['dtb-starfive', 'starfive/*.dts', "StarFive based riscv64 systems"],
);
sub generate_spec($$$)
{
my ($main_package, $exclusive_arch, $package_list) = @_;
print "$main_package.spec\n";
# open .spec and .spec.in files
open (SPEC, ">$main_package.spec") or die "Unable to open $main_package.spec.\n";
open (TEMPLATE, "$spec_in") or die "Unable to open $spec_in.\n";
my $ARCH_RESTRICTIONS = "";
$ARCH_RESTRICTIONS = "ExclusiveArch: $exclusive_arch"
unless ($exclusive_arch eq 'none');
my $subpkg_desc = "";
my $subpkg_post = "";
my $subpkg_files = "";
my $all_supported_dtb = "";
my $DTS_folder = "arch/arm/boot/dts";
if ($exclusive_arch =~ /aarch64/) {
$DTS_folder = "arch/arm64/boot/dts";
} elsif ($exclusive_arch =~ /riscv64/) {
$DTS_folder = "arch/riscv/boot/dts";
}
foreach my $NAME (@$package_list) {
my $PKG_NAME = @{$NAME}[0];
my $SUPPORTED_DTB = @{$NAME}[1];
my $MACHINES = @{$NAME}[2];
$subpkg_desc .=
"%package -n $PKG_NAME\n" .
"Summary: $MACHINES\n" .
"Group: System/Boot\n";
if ($PKG_NAME eq 'dtb-keystone' and $main_package eq 'dtb-armv7l') {
$subpkg_desc .= "Provides: dtb-k2e = %version\n" .
"Provides: dtb-k2l = %version\n";
}
if ($PKG_NAME eq 'dtb-amazon' and $main_package eq 'dtb-aarch64') {
$subpkg_desc .= "Provides: dtb-al = %version\n";
}
if ($PKG_NAME eq 'dtb-apm' and $main_package eq 'dtb-aarch64') {
$subpkg_desc .= "Provides: dtb-apm-mustang = %version\n";
}
if ($PKG_NAME eq 'dtb-arm' and $main_package eq 'dtb-aarch64') {
$subpkg_desc .= "Provides: dtb-foundation-v8 = %version\n" .
"Provides: dtb-rtsm_ve-aemv8a = %version\n";
}
if ($PKG_NAME eq 'dtb-cavium' and $main_package eq 'dtb-aarch64') {
$subpkg_desc .= "Provides: dtb-thunder-88xx = %version\n";
}
if ($PKG_NAME eq 'dtb-hisilicon' and $main_package eq 'dtb-aarch64') {
$subpkg_desc .= "Provides: dtb-hisilicon64 = %version\n";
}
$subpkg_desc .=
"Provides: multiversion(dtb)\n" .
"Requires(post): coreutils\n" .
"\n" .
"%description -n $PKG_NAME\n" .
"Device Tree files for $MACHINES.\n\n";
$subpkg_post .=
"%post -n $PKG_NAME\n" .
"cd /boot\n" .
"# If /boot/dtb is a symlink, remove it, so that we can replace it.\n" .
"[ -d dtb ] && [ -L dtb ] && rm -f dtb\n" .
"# Unless /boot/dtb exists as real directory, create a symlink.\n" .
"[ -d dtb ] || ln -sf dtb-%kernelrelease dtb\n\n";
my $bin_supported_dtb = $SUPPORTED_DTB;
$bin_supported_dtb =~ s/\.dts/\.dtb/g;
my $dtb_subdir = "";
my $path = "";
my @components = split(/\//, $bin_supported_dtb);
pop @components; # filename
foreach my $subdir (@components) {
$path .= "/$subdir";
$dtb_subdir .= "%dir %{dtbdir}$path\n";
}
$subpkg_files .=
"%ifarch aarch64 riscv64\n" .
"%files -n $PKG_NAME -f $PKG_NAME.list\n" .
"%else\n" .
"%files -n $PKG_NAME\n" .
"%endif\n" .
"%defattr(-,root,root)\n" .
"%ghost /boot/dtb\n" .
"%dir %{dtbdir}\n" .
$dtb_subdir .
"%{dtbdir}/$bin_supported_dtb\n" .
"\n";
$all_supported_dtb .= "$SUPPORTED_DTB ";
}
chomp($all_supported_dtb);
# spec file generation
while(<TEMPLATE>){
$_ =~ s/\$NAME/$main_package/g;
$_ =~ s/\$ARCH_RESTRICTIONS/$ARCH_RESTRICTIONS/g;
$_ =~ s/\$DTS_folder/$DTS_folder/g;
$_ =~ s/\$SUBPKG_DESC/$subpkg_desc/g;
$_ =~ s/\$ALL_SUPPORTED_DTB/$all_supported_dtb/g;
$_ =~ s/\$SUBPKG_POST\n?/$subpkg_post/g;
$_ =~ s/\$SUBPKG_FILES\n?/$subpkg_files/g;
print SPEC $_;
}
close(TEMPLATE);
close(SPEC);
}
if ( grep( /armv7/, @ARGV)) {
generate_spec('dtb-armv7l', "armv7l armv7hl", \@armv7l_package_list);
}
if ( grep( /armv6/, @ARGV)) {
generate_spec('dtb-armv6l', "armv6l armv6hl", \@armv6l_package_list);
}
if ( grep( /aarch64/, @ARGV)) {
generate_spec('dtb-aarch64', "aarch64", \@aarch64_package_list);
}
if ( grep( /riscv64/, @ARGV)) {
generate_spec('dtb-riscv64', "riscv64", \@riscv64_package_list);
}

21
moddep Normal file
View 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
View 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

73
modules.fips Normal file
View File

@ -0,0 +1,73 @@
ablk_helper
aes-ce-ccm
aes-neon-bs
aes_s390
aes_ti
af_alg
algif_hash
ansi_cprng
anubis
arc4
authenc
blowfish_common
blowfish_generic
blowfish_x86_64
camellia_generic
camellia_x86_64
cast5_generic
cast6_generic
cast_common
cbc
ccm
cfb
cmac
cryptd
crypto_user
ctr
cts
deflate
des3_ede-x86_64
des_generic
des_s390
drbg
ecb
ecdh_generic
fcrypt
gcm
gf128mul
ghash_generic
ghash_s390
glue_helper
khazad
keywrap
lrw
md4
michael_mic
ofb
pcbc
rmd128
rmd160
rmd256
rmd320
salsa20_generic
salsa20_x86_64
seed
serpent_generic
serpent_sse2_x86_64
sha1_s390
sha256_s390
sha3_generic
sha512_generic
sha512_s390
sha512_ssse3
tcrypt
tea
tgr192
twofish_common
twofish_generic
twofish_x86_64
twofish_x86_64_3way
vmac
wp512
xcbc
xts

158
modversions Normal file
View File

@ -0,0 +1,158 @@
#! /usr/bin/perl -w
use File::Basename;
use File::Path;
use File::Find;
use Getopt::Long;
use strict;
my %symbol_type_name = (
n => 'normal', t => 'typedef', e => 'enum', s => 'struct', u => 'union',
E => 'enum constant'
);
my %definitions;
my %override;
my %override_locally;
my %locally_unknown;
my %locally_defined;
sub expand_types($);
sub expand_types($) {
my ($definition) = @_;
local ($_, $1, $2);
my @defn = split ' ', $definition;
for (@defn[1..$#defn]) {
if (/^(.)#(.*)/) {
#print "<<$defn[0] : $_>>\n";
next if exists $locally_defined{$_};
$locally_defined{$_} = 1;
if ($locally_unknown{$_}) {
print "override " if $override_locally{$_};
print "$_ $symbol_type_name{$1} $2 { UNKNOWN } \n";
} else {
if (!exists $definitions{$_}) {
die "Missing definition of $symbol_type_name{$1} $2\n";
}
expand_types("$_ $definitions{$_}");
}
}
}
print "override " if $override_locally{$defn[0]};
print "$definition\n";
}
sub pack_dump($$) {
my ($dir, $ext) = @_;
my @files;
$ext = ".symtypes" unless defined $ext;
$dir =~ s/\/+$//;
find(sub ($) { /\Q$ext\E$/ && push @files, $File::Find::name}, $dir);
map { s/^\Q$dir\E\/(.*)\Q$ext\E$/$1/ } @files;
foreach my $file (sort @files) {
print "/* $file.o */\n";
local *FD;
open FD, "< $dir/$file$ext"
or die "$dir/$file$ext: $!\n";
while (<FD>) {
chomp;
my $override = "";
if (s/^override //) {
$override = $&;
}
if (/^(\S)#(\S+)\s*(.*)/) {
my $sym = "$1#$2";
my $definition = $3;
if (/^$sym\s+$symbol_type_name{$1}\s+$2\s+{\s+UNKNOWN\s+}\s*$/) {
$_ = $override . substr($sym, 0, 1) . "##" . substr($sym, 2);
} else {
if (exists $definitions{$sym} && $definitions{$sym} eq $definition) {
if (($override ne "") == (exists $override{$sym})) {
next;
}
$_ = "$override$sym";
} else {
$definitions{$sym} = $definition;
if ($override eq "") {
delete $override{$sym};
} else {
$override{$sym} = 1;
$_ = "$override$_";
}
}
}
} elsif ($override) {
$_ = "$override$_";
}
print "$_\n";
}
close FD;
print "\n";
}
}
sub unpack_dump($$) {
my ($dir, $ext) = @_;
$ext = ".symref" unless defined $ext;
while (<STDIN>) {
next if /^$/;
chomp;
if (/^\/\* (.*)\.o \*\//) {
close STDOUT;
mkpath(dirname("$dir/$1$ext"));
open STDOUT, "> $dir/$1$ext"
or die "$dir/$1$ext: $!\n";
%locally_defined = ();
%locally_unknown = ();
%override_locally = %override;
next;
}
my $override = /^override\s/;
s/^override\s//;
if (/^([^ ])#(#?)([^ ]+) *(.*)$/) {
my $sym = "$1#$3";
if ($4 ne "") {
if (/\s+{\s+UNKNOWN\s+}\s*$/) {
$locally_unknown{$sym} = 1;
$override_locally{$sym} = $override;
} else {
$definitions{$sym} = $4;
$locally_unknown{$sym} = 0;
$override{$sym} = $override;
$override_locally{$sym} = $override;
}
} else {
$locally_unknown{$sym} = ($2 ne "");
$override_locally{$sym} = $override;
}
next;
} elsif (/^([^# ]*)/) {
$override_locally{$1} = $override;
}
expand_types($_);
}
}
my ($pack, $unpack, $ext);
GetOptions("pack" => \$pack, "unpack" => \$unpack, "ext:s" => \$ext)
&& ($pack || $unpack) && @ARGV == 1
or die "USAGE:\t$0 [--ext extension] --pack {dir} > file\n" .
"\t$0 [--ext extension] --unpack {dir} < file\n";
pack_dump($ARGV[0], $ext) if $pack;
unpack_dump($ARGV[0], $ext) if $unpack;

3
obsolete-kmps Normal file
View File

@ -0,0 +1,3 @@
# List of KMPs integrated into the kernel
# These KMPs shoud be removed when the kernel is installed
# <basename> <upper bound of shipped versions>

25
old-flavors Normal file
View File

@ -0,0 +1,25 @@
# List of obsolete kernel flavors
# <arch>/<new flavor> <old flavor> <upper bound of shipped versions>
# SLES 11 SP3 / openSUSE 13.1
i386/default trace 3.13
x86_64/default trace 3.13
x86_64/default bigsmp 3.1
s390x/default trace 3.13
# openSUSE 13.2 / Tumbleweed until 2015-10-01
i386/pae desktop 4.3
x86_64/default desktop 4.3
# SLE 12 SP1
i386/pae xen 4.4
i386/pae ec2 4.4
x86_64/default xen 4.4
x86_64/default ec2 4.4
x86_64/rt compute 3.13
x86_64/rt_debug compute_debug 3.13

1
old_changelog.txt Normal file
View File

@ -0,0 +1 @@

148
package-descriptions Normal file
View File

@ -0,0 +1,148 @@
# Descriptions of the binary kernel packages. The format is
#
# === <package name> ===
# Summary: Package summary (single line)
# Requires: additional dependencies for KMPs (single line)
# ...
#
# Long description (multiple
# lines)
#
# Descriptions of the -base and -extra subpackages are derived from the
# main descriptions. The "Summary:" keyword can be omitted
=== 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-kvmsmall ===
The Small Developer Kernel for KVM
This kernel is intended for kernel developers to use in simple virtual
machines. It contains only the device drivers necessary to use a
KVM virtual machine *without* device passthrough enabled. Common
local and network file systems are enabled. All device mapper targets
are enabled. Only the network and graphics drivers for devices that qemu
emulates are enabled. Many subsystems enabled in the default kernel
are entirely disabled. This kernel is meant to be small and to build
very quickly. The configuration may change arbitrarily between builds.
=== kernel-azure ===
Kernel for MS Azure cloud
Kernel for use in the MS Azure cloud and other Hyper-V based virtualization
solutions.
=== 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-vanilla ===
The Standard Kernel - without any SUSE patches
The standard kernel - without any SUSE patches
=== kernel-64kb ===
Kernel with 64kb PAGE_SIZE
This kernel is identical to the default kernel, but is configured with
64kb page size granule. Its main purpose is to serve as compatibility
kernel for systems that were installed when the default kernel was still
configured with 64kb page size granule.
=== kernel-lpae ===
Kernel for LPAE enabled systems
The kernel for all 32-bit ARM platforms that support LPAE. This includes all
Cortex A15 based SoCs, like the Exynos5, OMAP5 or Calxeda ECX-2000.
=== kernel-preempt ===
Kernel with PREEMPT support
The kernel for arm64 and x86_64 architectures that supports CONFIG_PREEMPT. Its
main purpose is to serve workloads with a higher demand on smaller latencies
than the default kernel in average.
=== kernel-syzkaller ===
Kernel used for fuzzing by syzkaller
The syzkaller kernel should be used solely in a virtual machine by
syzkaller only. It supports kernel coverage and enables a lot of slow
debugging options.
=== kernel-zfcpdump ===
The IBM System Z zfcpdump Kernel
The Linux kernel for booting the zfcpdump process on IBM System Z.
This kernel should only be used by the s390-tools package. This kernel
should not be installed as a regular booting kernel.
=== cluster-md-kmp ===
Summary: Clustering support for MD devices
Requires: dlm-kmp
Clustering support for MD devices. This enables locking and
synchronization across multiple systems on the cluster, so all
nodes in the cluster can access the MD devices simultaneously.
=== dlm-kmp ===
DLM kernel modules
DLM stands for Distributed Lock Manager, a means to synchronize access to
shared resources over the cluster.
=== gfs2-kmp ===
Summary: GFS2 kernel modules
Requires: dlm-kmp
GFS2 is Global Filesystem, a shared device filesystem.
=== ocfs2-kmp ===
Summary: OCFS2 kernel modules
Requires: dlm-kmp
OCFS2 is the Oracle Cluster Filesystem, a filesystem for shared devices
accessible simultaneously from multiple nodes of a cluster.
=== kselftests-kmp ===
Kernel sefltests
This package contains kernel modules which are part of the upstream kernel
selftest effort. kselftest is the name of the upstream kernel target to build
and run all selftests. You can also run each test individually from the
respective upstream tools/testing/selftests/ directory, this package is
intended to be used using individial upstream selftest scripts given only
select supported selftest drivers are enabled.
It should always be possible to always run the latest linux-next version of the
selftest scripts and tests against any older kernel selftest driver. Certain
tests facilities may be backported onto older kernels to enable further
testing.
Selftests also provide for a vehicle or proof of concept issues to be
reproduced, verified and corrected.
Selftest drivers are intended to be supported only in testing and QA
environments, they are not intended to be run on production systems.
=== reiserfs-kmp ===
Reiserfs kernel module
The reiserfs file system is no longer supported in SLE15. This package
provides the reiserfs module for the installation system.

BIN
patches.addon.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.apparmor.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.arch.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.drivers.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.drm.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.fixes.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.kabi.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.kernel.org.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.rpmify.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.rt.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
patches.suse.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

19
release-projects Normal file
View File

@ -0,0 +1,19 @@
# This file contains regular expressions that define which projects
# are considered part of an official release channel.
# This will mark the kernel as released when it's built.
SUSE:SLE-.*
SUSE:Maintenance:.*
openSUSE:[0-9].*:Update
openSUSE:[0-9].*:Update:Test
openSUSE:[0-9].*
openSUSE:Leap
openSUSE:Leap:.*
openSUSE:Maintenance
openSUSE:Maintenance:.*
openSUSE:Evergreen:Maintenance
openSUSE:Evergreen:Maintenance:.*
openSUSE:Tumbleweed
openSUSE:Tumbleweed:.*
openSUSE:Factory
openSUSE:Factory:.*
PTF:.*

16844
series.conf Normal file

File diff suppressed because it is too large Load Diff

3
source-timestamp Normal file
View File

@ -0,0 +1,3 @@
2024-02-09 09:19:44 +0000
GIT Revision: 820ec3d69b9d3e6787e13e9a181b4a5d076291bf
GIT Branch: ALP-current

222
split-modules Normal file
View File

@ -0,0 +1,222 @@
#!/bin/bash
#
# given a Module.base and modules.dep, generate list
# of base / supported / unsupported modules
set -e
export LC_COLLATE=C
usage()
{
echo "Usage: ${0##*/} -b Module.base [-d dir] [-i] [-e] [-o outdir]"
echo " -i Ignore supported.conf errors"
echo " -e Create the -extra filelist (otherwise, treat all modules as supported)"
}
options=$(getopt -o b:d:o:ie -- "$@")
if test $? -ne 0; then
usage >&2
exit 1
fi
eval set -- "$options"
opt_builddir=
opt_out=.
opt_dir=.
opt_ignore_errors=false
opt_extra=false
while test $# -gt 0; do
opt=$1
shift
case "$opt" in
-b | -d | -o)
arg=$1
shift
esac
case "$opt" in
-b)
opt_builddir=$arg ;;
-d)
opt_dir=$arg ;;
-o)
opt_out=$arg ;;
-i)
opt_ignore_errors=true ;;
-e)
opt_extra=true ;;
--)
break ;;
*)
echo "Unknown option $opt" >&2
exit 1
esac
done
if test -z "$opt_builddir"; then
usage >&2
exit 1
fi
trap 'rm -rf "$tmp"' EXIT
tmp=$(mktemp -d)
mkdir "$tmp/empty"
find "$opt_dir" -type f \( -name '*.ko' -o -name '*.ko.xz' -o -name '*.ko.gz' -o -name '*.ko.zst' \) -printf '/%P\n' | \
awk -F/ '{ n=$NF; gsub(/-/, "_", n); sub(/\.ko(\.xz|\.gz|\.zst)?$/, "", n); print n " " $0; }' | \
sort >"$tmp/all"
err=false
while read mod path; do
if $opt_extra; then
support=$(/sbin/modinfo -F supported "$opt_dir/$path")
else
support=yes
fi
case "$support" in
yes | external)
echo "$mod"
;;
no)
;;
"")
echo "warning: $mod not listed in supported.conf" >&2
;;
*)
echo "error: invalid support flag for $mod: $support" >&2
err=true
;;
esac
done <"$tmp/all" | sort -u >"$tmp/supp"
if $err; then
exit 1
fi
modules_dep=$(find "$opt_dir" -type f -name modules.dep)
if test -z "$modules_dep"; then
echo "Cannot find modules.dep in $opt_dir" >&2
exit 1
fi
(
echo '%:
@echo $@
ifdef EXPLAIN
@for dep in $^; do echo "$$dep needed by $@"; done >> $(EXPLAIN)
endif
'
sed -r 's:[^ ]*/([^/]*)\.ko(\.xz|\.gz|\.zst)?\>:\1:g; y/-/_/' "$modules_dep"
) >"$tmp/dep"
add_dependent_modules()
{
xargs -r make $MAKE_ARGS EXPLAIN=$1 -rRs -C "$tmp/empty" -f "$tmp/dep" | sort -u
}
# base
if test -f "$opt_builddir/Module.base"; then
sed 'y/-/_/' <"$opt_builddir/Module.base" | add_dependent_modules >"$tmp/base"
else
touch "$tmp/base"
fi
join -j 1 -o 2.2 "$tmp/base" "$tmp/all" >"$opt_out/base-modules"
# base firmware
kver=$(make $MAKE_ARGS -s -C "$opt_builddir" kernelrelease)
fw_dir=/lib/firmware/$kver
test -d $opt_dir/usr$fw_dir && fw_dir=/usr$fw_dir
if test -d "$opt_dir$fw_dir"; then
join <(/sbin/modinfo -F firmware \
$(sed "s:^:$opt_dir:" "$opt_out/base-modules") | sort) \
<(find "$opt_dir$fw_dir" -type f -printf '%P\n' | sort)
fi | sed "s:^:$fw_dir:" >"$opt_out/base-firmware"
# kmps
for f in "$opt_builddir"/Module.*-kmp; do
test -f "$f" || continue
kmp=${f##*/Module.}
sed 'y/-/_/' <"$f" >"$tmp/$kmp"
join -j 1 -o 2.2 "$tmp/$kmp" "$tmp/all" >"$opt_out/$kmp-modules"
cat "$tmp/$kmp"
done | sort -u >"$tmp/kmp-all"
join -v1 "$tmp/supp" "$tmp/kmp-all" >"$tmp/supp-main"
# main
add_dependent_modules "$tmp/supp-explain" <"$tmp/supp-main" >"$tmp/supp-all"
if ! cmp -s "$tmp/supp-main" "$tmp/supp-all"; then
# FIXME: Error message not accurate if a supported KMP module is
# needed by a module in the main package
echo "The following unsupported modules are used by supported modules:" >&2
join -j1 -a2 <(sort "$tmp/supp-explain") \
<(join -v2 "$tmp/supp-main" "$tmp/supp-all") >&2
echo "Please fix supported.conf." >&2
if ! $opt_ignore_errors; then
exit 1
fi
fi
join -j 1 -o 2.2 "$tmp/supp-all" "$tmp/all" >"$opt_out/main-modules"
# unsupported
join -j 1 -v 2 -o 2.2 <(sort -u "$tmp/supp-all" "$tmp/kmp-all") "$tmp/all" | sort -u > "$opt_out/unsupported-modules"
# split again to extra and optional
if $opt_extra && test -f "$opt_builddir/Module.optional"; then
declare -A modmarks wcmarks
wcpaths=()
while read mark path; do
case $path in
*.ko.xz|*.ko.gz|*.ko.zst)
path=${path%.*};;
esac
path=${path%.ko}
mod=${path##*/}
modmarks["$mod"]="$mark"
# paths with wildcards need to be verified sequentially, so we keep
# the paths in the array wcpaths and each mark in wcmarks[]
case "$path" in
*[\*\?\[]*)
wcpaths[${#wcpaths[@]}]="$path"
wcmarks["$path"]="$mark";;
esac
done < "$opt_builddir/Module.optional"
while read xpath; do
path=$xpath
case $path in
*.ko.xz|*.ko.gz|*.ko.zst)
path=${path%.*};;
esac
path=${path%.ko}
mod=${path##*/}
x=${modmarks["$mod"]}
if [ -n "$x" ]; then
test x"$x" = x"-" && echo "$xpath"
continue
fi
# unmatched modules must be handled via wildcard
path=${path#/lib/modules/*/kernel/}
for m in "${wcpaths[@]}"; do
case "$path" in
($m)
test x${wcmarks["$m"]} = x"-" && echo "$xpath"
break;;
esac
done
done < "$opt_out/unsupported-modules" | sort > "$tmp/unsupp-extra"
cat "$tmp/supp-all" "$tmp/kmp-all" "$tmp/unsupp-extra" | \
sed -r 's:[^ ]*/([^/]*)\.ko(\.xz|\.gz|\.zst)?\>:\1:g; y/-/_/' | sort -u > "$tmp/unsupp-extra-all"
add_dependent_modules "$tmp/unsupp-explain" <"$tmp/unsupp-extra-all" >"$tmp/unsupp-extra-dep"
if ! cmp -s "$tmp/unsupp-extra-all" "$tmp/unsupp-extra-dep"; then
echo "The following optional modules are used by extra modules:" >&2
join -j1 -a2 <(sort "$tmp/unsupp-explain") \
<(join -v2 "$tmp/unsupp-extra-all" "$tmp/unsupp-extra-dep") >&2
echo "Please fix supported.conf." >&2
if ! $opt_ignore_errors; then
exit 1
fi
fi
join -j 1 -v 2 "$tmp/unsupp-extra" "$opt_out/unsupported-modules" > "$opt_out/optional-modules"
mv "$tmp/unsupp-extra" "$opt_out/unsupported-modules"
fi
exit 0

16
splitflist Normal file
View File

@ -0,0 +1,16 @@
#!/bin/bash -e
package="$1"
present="$2"
ghost="$3"
missing=""
rpm -ql --noghost "$package" | while read x ; do
[ -e "$x" -o -L "$x" ] && echo "$x" >> "$present" || echo Missing file "$x"
done
rpm -q --qf '[%{FILEFLAGS} %{FILENAMES} 0%{FILEMODES:octal} %{FILESIZES} %{FILEMTIMES} %{FILELINKTOS}\n]' $package | while read -a line; do
[ $[line[0]&64] = 64 ] || continue
echo "${line[@]:1}"
done > "$ghost"

6527
supported.conf Normal file

File diff suppressed because it is too large Load Diff

BIN
sysctl.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,83 @@
#!/bin/bash
#############################################################################
# Copyright (c) 2011 Novell, Inc.
# Copyright (c) 2012-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
# 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 https://www.suse.com/source-code/
#
#############################################################################
# If make fails, check if it happened due to a staging driver and disable it.
# That way, staging does not spoil automatic package building and we also
# do not need to worry about forgetting to reenable manually disabled drivers.
if test -L source; then
source="source"
else
source="."
fi
if test -f ${source}/scripts/kconfig/Makefile && \
grep -q syncconfig ${source}/scripts/kconfig/Makefile; then
syncconfig="syncconfig"
else
syncconfig="silentoldconfig"
fi
makefile="$source/drivers/staging/Makefile"
skipped_options=staging-skipped-options
logfile=$1
if test -z "$logfile"; then
echo "Usage: $0 logfile" >&2
exit 1
fi
if ! test -f "$logfile"; then
echo "$logfile not found" >&2
exit 1
fi
# safety precaution
if test "0$(wc -l "$skipped_options" 2>/dev/null)" -gt 20; then
echo "Possible loop detected in $0, exiting after 20 attempts" >&2
exit 1
fi
# find out if the error happened in drivers/staging
dir=$(sed -rn 's@.*/drivers/staging/([^/]*)/.*: error: .*@\1@p; T; q' "$logfile")
if test -z "$dir"; then
exit 1
else
echo "Build failed due to drivers/staging/$dir"
fi
option=$(sed -n 's/obj-\$(\(.*\))[[:space:]]*+=[[:space:]]*'"$dir"'\//\1/p' "$makefile")
if test -z "$option"; then
echo "Cannot determine config option to skip drivers/staging/$dir" >&2
exit 1
fi
# we need to be carefull not to loop endlessly
if grep -qsFx "$option" "$skipped_options"; then
echo "$option has already been disabled, but drivers/staging/$dir is still failing" >&2
exit 1
fi
echo "Trying to disable $option"
"$source/scripts/config" --disable "$option"
if ! make $syncconfig $MAKE_ARGS || grep "^$option" .config; then
echo "Could not disable $option" >&2
exit 1
fi
echo "$option" >>"$skipped_options"
exit 0