Compare commits
No commits in common. "c8" and "a9-ppc64le" have entirely different histories.
c8
...
a9-ppc64le
18
.gitignore
vendored
18
.gitignore
vendored
@ -1,12 +1,10 @@
|
||||
SOURCES/centossecureboot201.cer
|
||||
SOURCES/centossecurebootca2.cer
|
||||
SOURCES/kernel-abi-stablelists-4.18.0-553.tar.bz2
|
||||
SOURCES/kernel-kabi-dw-4.18.0-553.tar.bz2
|
||||
SOURCES/linux-4.18.0-553.155.1.el8_10.tar.xz
|
||||
SOURCES/redhatsecureboot302.cer
|
||||
SOURCES/redhatsecureboot303.cer
|
||||
SOURCES/redhatsecureboot501.cer
|
||||
SOURCES/redhatsecurebootca3.cer
|
||||
SOURCES/redhatsecurebootca7.cer
|
||||
SOURCES/kernel-abi-stablelists-5.14.0-362.18.1.el9_3.tar.bz2
|
||||
SOURCES/kernel-kabi-dw-5.14.0-362.18.1.el9_3.tar.bz2
|
||||
SOURCES/linux-5.14.0-362.18.1.el9_3.tar.xz
|
||||
SOURCES/rheldup3.x509
|
||||
SOURCES/rhelima.x509
|
||||
SOURCES/rhelima_centos.x509
|
||||
SOURCES/rhelimaca1.x509
|
||||
SOURCES/rhelkpatch1.x509
|
||||
SOURCES/uki-sb-cert-x86_64-centos.crt
|
||||
SOURCES/uki-sb-cert-x86_64-rhel.crt
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
2ba40bf9138b48311e5aa1b737b7f0a8ad66066f SOURCES/centossecureboot201.cer
|
||||
bfdb3d7cffc43f579655af5155d50c08671d95e5 SOURCES/centossecurebootca2.cer
|
||||
cc86b8122fcfe213a1ce01a2279d5a8dc21398c0 SOURCES/kernel-abi-stablelists-4.18.0-553.tar.bz2
|
||||
f7646a5ec3491a825102a79ec06f6664b7c8a9df SOURCES/kernel-kabi-dw-4.18.0-553.tar.bz2
|
||||
4450e9b893bd77d9c264074cbaa7f3fb26364cc2 SOURCES/linux-4.18.0-553.155.1.el8_10.tar.xz
|
||||
13e5cd3f856b472fde80a4deb75f4c18dfb5b255 SOURCES/redhatsecureboot302.cer
|
||||
e89890ca0ded2f9058651cc5fa838b78db2e6cc2 SOURCES/redhatsecureboot303.cer
|
||||
ba0b760e594ff668ee72ae348adf3e49b97f75fb SOURCES/redhatsecureboot501.cer
|
||||
cf9230e69000076727e5b784ec871d22716dc5da SOURCES/redhatsecurebootca3.cer
|
||||
905d91a282727c7f5ad433a49ac42a0772311c6a SOURCES/redhatsecurebootca7.cer
|
||||
f823c58b7a797113dec1a2863f3efb9b13a5db01 SOURCES/kernel-abi-stablelists-5.14.0-362.18.1.el9_3.tar.bz2
|
||||
b1d3fe4cf0e3d6db2cb96fc8dc3ccf21cf29b12d SOURCES/kernel-kabi-dw-5.14.0-362.18.1.el9_3.tar.bz2
|
||||
4c7324ab3eed522ca5d7e0fcee0bfa891ef73328 SOURCES/linux-5.14.0-362.18.1.el9_3.tar.xz
|
||||
95b9b811c7b0a6c98b2eafc4e7d6d24f2cb63289 SOURCES/rheldup3.x509
|
||||
99e571f9de4188f3b5fdf1f84ff73f6cc4bb6a0e SOURCES/rhelima.x509
|
||||
61d5a223ff0c79189505abae77e0087c4b2d2b47 SOURCES/rhelima_centos.x509
|
||||
f882610d2554fef65703e5d3c342f005af0390ad SOURCES/rhelimaca1.x509
|
||||
d90885108d225a234a5a9d054fc80893a5bd54d0 SOURCES/rhelkpatch1.x509
|
||||
20224d67a583b98009a1c1632bb4b639b0e8be6a SOURCES/uki-sb-cert-x86_64-centos.crt
|
||||
1d51d3a037ad287095b0a13c4deeb1252d8ff0cc SOURCES/uki-sb-cert-x86_64-rhel.crt
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
From 5c3f4066462a5f6cac04d3dd81c9f551fabbc6c7 Mon Sep 17 00:00:00 2001
|
||||
From: Keith Busch <kbusch@kernel.org>
|
||||
Date: Thu, 12 Oct 2023 11:13:51 -0700
|
||||
Subject: [PATCH] nvme-pci: add BOGUS_NID for Intel 0a54 device
|
||||
|
||||
These ones claim cmic and nmic capable, so need special consideration to ignore
|
||||
their duplicate identifiers.
|
||||
|
||||
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217981
|
||||
Reported-by: welsh@cassens.com
|
||||
Signed-off-by: Keith Busch <kbusch@kernel.org>
|
||||
---
|
||||
drivers/nvme/host/pci.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
|
||||
index 347cb5daebc3..3f0c9ee09a12 100644
|
||||
--- a/drivers/nvme/host/pci.c
|
||||
+++ b/drivers/nvme/host/pci.c
|
||||
@@ -3329,7 +3329,8 @@ static const struct pci_device_id nvme_id_table[] = {
|
||||
{ PCI_VDEVICE(INTEL, 0x0a54), /* Intel P4500/P4600 */
|
||||
.driver_data = NVME_QUIRK_STRIPE_SIZE |
|
||||
NVME_QUIRK_DEALLOCATE_ZEROES |
|
||||
- NVME_QUIRK_IGNORE_DEV_SUBNQN, },
|
||||
+ NVME_QUIRK_IGNORE_DEV_SUBNQN |
|
||||
+ NVME_QUIRK_BOGUS_NID, },
|
||||
{ PCI_VDEVICE(INTEL, 0x0a55), /* Dell Express Flash P4600 */
|
||||
.driver_data = NVME_QUIRK_STRIPE_SIZE |
|
||||
NVME_QUIRK_DEALLOCATE_ZEROES, },
|
||||
--
|
||||
2.27.0
|
||||
|
||||
67
SOURCES/Makefile.rhelver
Normal file
67
SOURCES/Makefile.rhelver
Normal file
@ -0,0 +1,67 @@
|
||||
RHEL_MAJOR = 9
|
||||
RHEL_MINOR = 3
|
||||
|
||||
#
|
||||
# RHEL_RELEASE
|
||||
# -------------
|
||||
#
|
||||
# Represents build number in 'release' part of RPM's name-version-release.
|
||||
# name is <package_name>, e.g. kernel
|
||||
# version is upstream kernel version this kernel is based on, e.g. 4.18.0
|
||||
# release is <RHEL_RELEASE>.<dist_tag>[<buildid>], e.g. 100.el8
|
||||
#
|
||||
# Use this spot to avoid future merge conflicts.
|
||||
# Do not trim this comment.
|
||||
RHEL_RELEASE = 362.18.1
|
||||
|
||||
#
|
||||
# ZSTREAM
|
||||
# -------
|
||||
#
|
||||
# This variable controls whether we use zstream numbering or not for the
|
||||
# package release. The zstream release keeps the build number of the last
|
||||
# build done for ystream for the Beta milestone, and increments a second
|
||||
# number for each build. The third number is used for branched builds
|
||||
# (eg.: for builds with security fixes or hot fixes done outside of the
|
||||
# batch release process).
|
||||
#
|
||||
# For example, with ZSTREAM unset or set to "no", all builds will contain
|
||||
# a release with only the build number, eg.: kernel-<kernel version>-X.el*,
|
||||
# where X is the build number. With ZSTREAM set to "yes", we will have
|
||||
# builds with kernel-<kernel version>-X.Y.Z.el*, where X is the last
|
||||
# RHEL_RELEASE number before ZSTREAM flag was set to yes, Y will now be the
|
||||
# build number and Z will always be 1 except if you're doing a branched build
|
||||
# (when you give RHDISTGIT_BRANCH on the command line, in which case the Z
|
||||
# number will be incremented instead of the Y).
|
||||
#
|
||||
ZSTREAM ?= yes
|
||||
|
||||
#
|
||||
# Early y+1 numbering
|
||||
# --------------------
|
||||
#
|
||||
# In early y+1 process, RHEL_RELEASE consists of 2 numbers: x.y
|
||||
# First is RHEL_RELEASE inherited/merged from y as-is, second number
|
||||
# is incremented with each build starting from 1. After merge from y,
|
||||
# it resets back to 1. This way y+1 nvr reflects status of last merge.
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# rhel8.0 rhel-8.1
|
||||
# kernel-4.18.0-58.el8 --> kernel-4.18.0-58.1.el8
|
||||
# kernel-4.18.0-58.2.el8
|
||||
# kernel-4.18.0-59.el8 kernel-4.18.0-59.1.el8
|
||||
# kernel-4.18.0-60.el8
|
||||
# kernel-4.18.0-61.el8 --> kernel-4.18.0-61.1.el8
|
||||
#
|
||||
#
|
||||
# Use this spot to avoid future merge conflicts.
|
||||
# Do not trim this comment.
|
||||
EARLY_YSTREAM ?= no
|
||||
EARLY_YBUILD:=
|
||||
EARLY_YRELEASE:=
|
||||
ifneq ("$(ZSTREAM)", "yes")
|
||||
ifeq ("$(EARLY_YSTREAM)","yes")
|
||||
RHEL_RELEASE:=$(RHEL_RELEASE).$(EARLY_YRELEASE)
|
||||
endif
|
||||
endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
25
SOURCES/README.rst
Normal file
25
SOURCES/README.rst
Normal file
@ -0,0 +1,25 @@
|
||||
===================
|
||||
The Kernel dist-git
|
||||
===================
|
||||
|
||||
The kernel is maintained in a `source tree`_ rather than directly in dist-git.
|
||||
The specfile is maintained as a `template`_ in the source tree along with a set
|
||||
of build scripts to generate configurations, (S)RPMs, and to populate the
|
||||
dist-git repository.
|
||||
|
||||
The `documentation`_ for the source tree covers how to contribute and maintain
|
||||
the tree.
|
||||
|
||||
If you're looking for the downstream patch set it's available in the source
|
||||
tree with "git log master..ark-patches" or
|
||||
`online`_.
|
||||
|
||||
Each release in dist-git is tagged in the source repository so you can easily
|
||||
check out the source tree for a build. The tags are in the format
|
||||
name-version-release, but note release doesn't contain the dist tag since the
|
||||
source can be built in different build roots (Fedora, CentOS, etc.)
|
||||
|
||||
.. _source tree: https://gitlab.com/cki-project/kernel-ark.git
|
||||
.. _template: https://gitlab.com/cki-project/kernel-ark/-/blob/os-build/redhat/kernel.spec.template
|
||||
.. _documentation: https://gitlab.com/cki-project/kernel-ark/-/wikis/home
|
||||
.. _online: https://gitlab.com/cki-project/kernel-ark/-/commits/ark-patches
|
||||
@ -0,0 +1,12 @@
|
||||
diff -aruN linux-5.14.0-362.8.1.el9_3/arch/powerpc/kvm/book3s_64_vio_hv.c linux-5.14.0-362.8.1.el9_3.alma/arch/powerpc/kvm/book3s_64_vio_hv.c
|
||||
--- linux-5.14.0-362.8.1.el9_3/arch/powerpc/kvm/book3s_64_vio_hv.c 2023-11-07 20:57:43
|
||||
+++ linux-5.14.0-362.8.1.el9_3.alma/arch/powerpc/kvm/book3s_64_vio_hv.c 2023-12-07 17:59:41
|
||||
@@ -488,7 +488,7 @@
|
||||
/*
|
||||
* used to check for invalidations in progress
|
||||
*/
|
||||
- mmu_seq = kvm->mmu_notifier_seq;
|
||||
+ mmu_seq = kvm->mmu_invalidate_seq;
|
||||
smp_rmb();
|
||||
|
||||
stt = kvmppc_find_table(vcpu->kvm, liobn);
|
||||
BIN
SOURCES/almalinuxdup1.x509
Normal file
BIN
SOURCES/almalinuxdup1.x509
Normal file
Binary file not shown.
BIN
SOURCES/almalinuxima.x509
Normal file
BIN
SOURCES/almalinuxima.x509
Normal file
Binary file not shown.
BIN
SOURCES/almalinuximaca1.x509
Normal file
BIN
SOURCES/almalinuximaca1.x509
Normal file
Binary file not shown.
BIN
SOURCES/almalinuxkpatch1.x509
Normal file
BIN
SOURCES/almalinuxkpatch1.x509
Normal file
Binary file not shown.
@ -41,7 +41,8 @@ def load_symvers(symvers, filename):
|
||||
break
|
||||
if in_line == "\n":
|
||||
continue
|
||||
checksum, symbol, directory, type = in_line.split()
|
||||
checksum, symbol, directory, type, *ns = in_line.split()
|
||||
ns = ns[0] if ns else None
|
||||
|
||||
symvers[symbol] = in_line[0:-1]
|
||||
|
||||
@ -57,7 +58,8 @@ def load_kabi(kabi, filename):
|
||||
break
|
||||
if in_line == "\n":
|
||||
continue
|
||||
checksum, symbol, directory, type = in_line.split()
|
||||
checksum, symbol, directory, type, *ns = in_line.split()
|
||||
ns = ns[0] if ns else None
|
||||
|
||||
kabi[symbol] = in_line[0:-1]
|
||||
|
||||
@ -69,11 +71,14 @@ def check_kabi(symvers, kabi):
|
||||
warn = 0
|
||||
changed_symbols = []
|
||||
moved_symbols = []
|
||||
ns_symbols = []
|
||||
|
||||
for symbol in kabi:
|
||||
abi_hash, abi_sym, abi_dir, abi_type = kabi[symbol].split()
|
||||
abi_hash, abi_sym, abi_dir, abi_type, *abi_ns = kabi[symbol].split()
|
||||
abi_ns = abi_ns[0] if abi_ns else None
|
||||
if symbol in symvers:
|
||||
sym_hash, sym_sym, sym_dir, sym_type = symvers[symbol].split()
|
||||
sym_hash, sym_sym, sym_dir, sym_type, *sym_ns = symvers[symbol].split()
|
||||
sym_ns = sym_ns[0] if sym_ns else None
|
||||
if abi_hash != sym_hash:
|
||||
fail = 1
|
||||
changed_symbols.append(symbol)
|
||||
@ -81,6 +86,10 @@ def check_kabi(symvers, kabi):
|
||||
if abi_dir != sym_dir:
|
||||
warn = 1
|
||||
moved_symbols.append(symbol)
|
||||
|
||||
if abi_ns != sym_ns:
|
||||
warn = 1
|
||||
ns_symbols.append(symbol)
|
||||
else:
|
||||
fail = 1
|
||||
changed_symbols.append(symbol)
|
||||
@ -96,13 +105,21 @@ def check_kabi(symvers, kabi):
|
||||
|
||||
if warn:
|
||||
print("*** WARNING - ABI SYMBOLS MOVED ***")
|
||||
print("")
|
||||
print("The following symbols moved (typically caused by moving a symbol from being")
|
||||
print("provided by the kernel vmlinux out to a loadable module):")
|
||||
print("")
|
||||
for symbol in moved_symbols:
|
||||
print(symbol)
|
||||
print("")
|
||||
if moved_symbols:
|
||||
print("")
|
||||
print("The following symbols moved (typically caused by moving a symbol from being")
|
||||
print("provided by the kernel vmlinux out to a loadable module):")
|
||||
print("")
|
||||
for symbol in moved_symbols:
|
||||
print(symbol)
|
||||
print("")
|
||||
if ns_symbols:
|
||||
print("")
|
||||
print("The following symbols changed symbol namespaces:")
|
||||
print("")
|
||||
for symbol in ns_symbols:
|
||||
print(symbol)
|
||||
print("")
|
||||
|
||||
"""Halt the build, if we got errors and/or warnings. In either case,
|
||||
double-checkig is required to avoid introducing / concealing
|
||||
|
||||
38
SOURCES/dracut-virt.conf
Normal file
38
SOURCES/dracut-virt.conf
Normal file
@ -0,0 +1,38 @@
|
||||
# generic + compressed please
|
||||
hostonly="no"
|
||||
compress="xz"
|
||||
|
||||
# VMs can't update microcode anyway
|
||||
early_microcode="no"
|
||||
|
||||
# modules: basics
|
||||
dracutmodules+=" base systemd systemd-initrd dracut-systemd dbus dbus-broker usrmount shutdown "
|
||||
|
||||
# modules: storage support
|
||||
dracutmodules+=" dm lvm rootfs-block fs-lib "
|
||||
|
||||
# modules: tpm and crypto
|
||||
dracutmodules+=" crypt crypt-loop tpm2-tss "
|
||||
|
||||
# WALinuxagent-cvm with CVM specific udev rules
|
||||
dracutmodules+=" walinuxagentcvm "
|
||||
|
||||
# drivers: virtual buses, pci
|
||||
drivers+=" virtio-pci virtio-mmio " # qemu-kvm
|
||||
drivers+=" hv-vmbus pci-hyperv " # hyperv
|
||||
drivers+=" xen-pcifront " # xen
|
||||
|
||||
# drivers: storage
|
||||
drivers+=" ahci nvme sd_mod sr_mod " # generic
|
||||
drivers+=" virtio-blk virtio-scsi " # qemu-kvm
|
||||
drivers+=" hv-storvsc " # hyperv
|
||||
drivers+=" xen-blkfront " # xen
|
||||
|
||||
# root encryption
|
||||
drivers+=" dm_crypt "
|
||||
|
||||
# filesystems
|
||||
filesystems+=" vfat ext4 xfs overlay "
|
||||
|
||||
# systemd-pcrphase
|
||||
install_items+=" /lib/systemd/system/systemd-pcrphase-initrd.service /usr/lib/systemd/systemd-pcrphase /usr/lib/systemd/system/initrd.target.wants/systemd-pcrphase-initrd.service "
|
||||
190
SOURCES/eaaaed137eccb9e8f3a88f6297e214f53885196f.patch
Normal file
190
SOURCES/eaaaed137eccb9e8f3a88f6297e214f53885196f.patch
Normal file
@ -0,0 +1,190 @@
|
||||
From eaaaed137eccb9e8f3a88f6297e214f53885196f Mon Sep 17 00:00:00 2001
|
||||
From: Sean Christopherson <seanjc@google.com>
|
||||
Date: Mon, 6 Dec 2021 20:54:14 +0100
|
||||
Subject: [PATCH] KVM: PPC: Avoid referencing userspace memory region in
|
||||
memslot updates
|
||||
|
||||
For PPC HV, get the number of pages directly from the new memslot instead
|
||||
of computing the same from the userspace memory region, and explicitly
|
||||
check for !DELETE instead of inferring the same when toggling mmio_update.
|
||||
The motivation for these changes is to avoid referencing the @mem param
|
||||
so that it can be dropped in a future commit.
|
||||
|
||||
No functional change intended.
|
||||
|
||||
Signed-off-by: Sean Christopherson <seanjc@google.com>
|
||||
Signed-off-by: Maciej S. Szmigiero <maciej.szmigiero@oracle.com>
|
||||
Message-Id: <1e97fb5198be25f98ef82e63a8d770c682264cc9.1638817639.git.maciej.szmigiero@oracle.com>
|
||||
---
|
||||
arch/powerpc/include/asm/kvm_ppc.h | 4 ----
|
||||
arch/powerpc/kvm/book3s.c | 6 ++----
|
||||
arch/powerpc/kvm/book3s_hv.c | 12 +++---------
|
||||
arch/powerpc/kvm/book3s_pr.c | 2 --
|
||||
arch/powerpc/kvm/booke.c | 2 --
|
||||
arch/powerpc/kvm/powerpc.c | 4 ++--
|
||||
6 files changed, 7 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h
|
||||
index b01760dd1374df..935c58dc38c493 100644
|
||||
--- a/arch/powerpc/include/asm/kvm_ppc.h
|
||||
+++ b/arch/powerpc/include/asm/kvm_ppc.h
|
||||
@@ -200,12 +200,10 @@ extern void kvmppc_core_destroy_vm(struct kvm *kvm);
|
||||
extern void kvmppc_core_free_memslot(struct kvm *kvm,
|
||||
struct kvm_memory_slot *slot);
|
||||
extern int kvmppc_core_prepare_memory_region(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
const struct kvm_memory_slot *old,
|
||||
struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change);
|
||||
extern void kvmppc_core_commit_memory_region(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
struct kvm_memory_slot *old,
|
||||
const struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change);
|
||||
@@ -275,12 +273,10 @@ struct kvmppc_ops {
|
||||
int (*get_dirty_log)(struct kvm *kvm, struct kvm_dirty_log *log);
|
||||
void (*flush_memslot)(struct kvm *kvm, struct kvm_memory_slot *memslot);
|
||||
int (*prepare_memory_region)(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
const struct kvm_memory_slot *old,
|
||||
struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change);
|
||||
void (*commit_memory_region)(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
struct kvm_memory_slot *old,
|
||||
const struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change);
|
||||
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
|
||||
index 8250e8308674c7..6d525285dbe8f2 100644
|
||||
--- a/arch/powerpc/kvm/book3s.c
|
||||
+++ b/arch/powerpc/kvm/book3s.c
|
||||
@@ -847,21 +847,19 @@ void kvmppc_core_flush_memslot(struct kvm *kvm, struct kvm_memory_slot *memslot)
|
||||
}
|
||||
|
||||
int kvmppc_core_prepare_memory_region(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
const struct kvm_memory_slot *old,
|
||||
struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
{
|
||||
- return kvm->arch.kvm_ops->prepare_memory_region(kvm, mem, old, new, change);
|
||||
+ return kvm->arch.kvm_ops->prepare_memory_region(kvm, old, new, change);
|
||||
}
|
||||
|
||||
void kvmppc_core_commit_memory_region(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
struct kvm_memory_slot *old,
|
||||
const struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
{
|
||||
- kvm->arch.kvm_ops->commit_memory_region(kvm, mem, old, new, change);
|
||||
+ kvm->arch.kvm_ops->commit_memory_region(kvm, old, new, change);
|
||||
}
|
||||
|
||||
bool kvm_unmap_gfn_range(struct kvm *kvm, struct kvm_gfn_range *range)
|
||||
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
|
||||
index d7594d49d288a3..2b59ecc5f8c698 100644
|
||||
--- a/arch/powerpc/kvm/book3s_hv.c
|
||||
+++ b/arch/powerpc/kvm/book3s_hv.c
|
||||
@@ -4854,15 +4854,12 @@ static void kvmppc_core_free_memslot_hv(struct kvm_memory_slot *slot)
|
||||
}
|
||||
|
||||
static int kvmppc_core_prepare_memory_region_hv(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
const struct kvm_memory_slot *old,
|
||||
struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
{
|
||||
- unsigned long npages = mem->memory_size >> PAGE_SHIFT;
|
||||
-
|
||||
if (change == KVM_MR_CREATE) {
|
||||
- new->arch.rmap = vzalloc(array_size(npages,
|
||||
+ new->arch.rmap = vzalloc(array_size(new->npages,
|
||||
sizeof(*new->arch.rmap)));
|
||||
if (!new->arch.rmap)
|
||||
return -ENOMEM;
|
||||
@@ -4874,20 +4871,17 @@ static int kvmppc_core_prepare_memory_region_hv(struct kvm *kvm,
|
||||
}
|
||||
|
||||
static void kvmppc_core_commit_memory_region_hv(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
struct kvm_memory_slot *old,
|
||||
const struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
{
|
||||
- unsigned long npages = mem->memory_size >> PAGE_SHIFT;
|
||||
-
|
||||
/*
|
||||
- * If we are making a new memslot, it might make
|
||||
+ * If we are creating or modifying a memslot, it might make
|
||||
* some address that was previously cached as emulated
|
||||
* MMIO be no longer emulated MMIO, so invalidate
|
||||
* all the caches of emulated MMIO translations.
|
||||
*/
|
||||
- if (npages)
|
||||
+ if (change != KVM_MR_DELETE)
|
||||
atomic64_inc(&kvm->arch.mmio_update);
|
||||
|
||||
/*
|
||||
diff --git a/arch/powerpc/kvm/book3s_pr.c b/arch/powerpc/kvm/book3s_pr.c
|
||||
index ffb559cf25f435..30426e8c8cf66b 100644
|
||||
--- a/arch/powerpc/kvm/book3s_pr.c
|
||||
+++ b/arch/powerpc/kvm/book3s_pr.c
|
||||
@@ -1899,7 +1899,6 @@ static void kvmppc_core_flush_memslot_pr(struct kvm *kvm,
|
||||
}
|
||||
|
||||
static int kvmppc_core_prepare_memory_region_pr(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
const struct kvm_memory_slot *old,
|
||||
struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
@@ -1908,7 +1907,6 @@ static int kvmppc_core_prepare_memory_region_pr(struct kvm *kvm,
|
||||
}
|
||||
|
||||
static void kvmppc_core_commit_memory_region_pr(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
struct kvm_memory_slot *old,
|
||||
const struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
|
||||
index 93c2ac2bee0913..53b4c9597c303e 100644
|
||||
--- a/arch/powerpc/kvm/booke.c
|
||||
+++ b/arch/powerpc/kvm/booke.c
|
||||
@@ -1821,7 +1821,6 @@ void kvmppc_core_free_memslot(struct kvm *kvm, struct kvm_memory_slot *slot)
|
||||
}
|
||||
|
||||
int kvmppc_core_prepare_memory_region(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
const struct kvm_memory_slot *old,
|
||||
struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
@@ -1830,7 +1829,6 @@ int kvmppc_core_prepare_memory_region(struct kvm *kvm,
|
||||
}
|
||||
|
||||
void kvmppc_core_commit_memory_region(struct kvm *kvm,
|
||||
- const struct kvm_userspace_memory_region *mem,
|
||||
struct kvm_memory_slot *old,
|
||||
const struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
|
||||
index e875874cf8367d..575140ecb23c82 100644
|
||||
--- a/arch/powerpc/kvm/powerpc.c
|
||||
+++ b/arch/powerpc/kvm/powerpc.c
|
||||
@@ -703,7 +703,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm,
|
||||
struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
{
|
||||
- return kvmppc_core_prepare_memory_region(kvm, mem, old, new, change);
|
||||
+ return kvmppc_core_prepare_memory_region(kvm, old, new, change);
|
||||
}
|
||||
|
||||
void kvm_arch_commit_memory_region(struct kvm *kvm,
|
||||
@@ -712,7 +712,7 @@ void kvm_arch_commit_memory_region(struct kvm *kvm,
|
||||
const struct kvm_memory_slot *new,
|
||||
enum kvm_mr_change change)
|
||||
{
|
||||
- kvmppc_core_commit_memory_region(kvm, mem, old, new, change);
|
||||
+ kvmppc_core_commit_memory_region(kvm, old, new, change);
|
||||
}
|
||||
|
||||
void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
|
||||
@ -15,4 +15,4 @@ ethdrvs="3com adaptec arc alteon atheros broadcom cadence calxeda chelsio cisco
|
||||
|
||||
drmdrvs="amd arm bridge ast exynos hisilicon i2c imx mgag200 meson msm nouveau panel radeon rockchip tegra sun4i tinydrm vc4"
|
||||
|
||||
singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject target_core_user sbp_target cxgbit iw_cxgb3 iw_cxgb4 cxgb3i cxgb3i cxgb3i_ddp cxgb4i chcr"
|
||||
singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject target_core_user sbp_target cxgbit iw_cxgb3 iw_cxgb4 cxgb3i cxgb3i cxgb3i_ddp cxgb4i chcr chtls"
|
||||
0
SOURCES/filter-armv7hl.sh.rhel
Normal file
0
SOURCES/filter-armv7hl.sh.rhel
Normal file
@ -13,8 +13,11 @@
|
||||
# subsys should be in kernel-modules on all arches, please change the defaults
|
||||
# listed here.
|
||||
|
||||
# Overrides is individual modules which need to remain in kernel-core due to deps.
|
||||
overrides="cec"
|
||||
|
||||
# Set the default dirs/modules to filter out
|
||||
driverdirs="atm auxdisplay bcma bluetooth firewire fmc iio infiniband isdn leds media memstick mfd mmc mtd nfc ntb pcmcia platform power ssb staging tty uio uwb w1 virt"
|
||||
driverdirs="atm auxdisplay bcma bluetooth firewire fmc iio infiniband isdn leds media memstick mfd mmc mtd nfc ntb pcmcia platform power ssb staging tty uio uwb w1"
|
||||
|
||||
chardrvs="mwave pcmcia"
|
||||
|
||||
@ -22,6 +25,8 @@ netdrvs="appletalk can dsa hamradio ieee802154 irda ppp slip usb wireless"
|
||||
|
||||
ethdrvs="3com adaptec alteon amd aquantia atheros broadcom cadence calxeda chelsio cisco dec dlink emulex icplus marvell neterion nvidia oki-semi packetengines qlogic rdc renesas sfc silan sis smsc stmicro sun tehuti ti wiznet xircom"
|
||||
|
||||
cryptdrvs="bcm caam cavium chelsio hisilicon marvell qat"
|
||||
|
||||
inputdrvs="gameport tablet touchscreen"
|
||||
|
||||
scsidrvs="aacraid aic7xxx aic94xx be2iscsi bfa bnx2i bnx2fc csiostor cxgbi esas2r fcoe fnic hisi_sas isci libsas lpfc megaraid mpt2sas mpt3sas mvsas pm8001 qla2xxx qla4xxx sym53c8xx_2 ufs qedf"
|
||||
@ -34,7 +39,7 @@ netprots="6lowpan appletalk atm ax25 batman-adv bluetooth can dccp dsa ieee80215
|
||||
|
||||
drmdrvs="amd ast gma500 i2c i915 mgag200 nouveau radeon via "
|
||||
|
||||
singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject hid-sensor-hub target_core_user sbp_target cxgbit iw_cxgb3 iw_cxgb4 cxgb3i cxgb3i cxgb3i_ddp cxgb4i chcr parport_serial ism xt_u32 act_ct"
|
||||
singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject hid-sensor-hub target_core_user sbp_target cxgbit iw_cxgb3 iw_cxgb4 cxgb3i cxgb3i cxgb3i_ddp cxgb4i chcr chtls parport_serial ism regmap-sdw regmap-sdw-mbq arizona-micsupp hid-asus nct6775 ntc_thermistor video"
|
||||
|
||||
# Grab the arch-specific filter list overrides
|
||||
source ./filter-$2.sh
|
||||
@ -88,7 +93,7 @@ done
|
||||
# Filter the char drivers
|
||||
for char in ${chardrvs}
|
||||
do
|
||||
filter_dir $1 drivers/char/${input}
|
||||
filter_dir $1 drivers/char/${char}
|
||||
done
|
||||
|
||||
# Filter the ethernet drivers
|
||||
@ -97,6 +102,12 @@ do
|
||||
filter_dir $1 drivers/net/ethernet/${eth}
|
||||
done
|
||||
|
||||
# Filter the crypto drivers
|
||||
for crypt in ${cryptdrvs}
|
||||
do
|
||||
filter_dir $1 drivers/crypto/${crypt}
|
||||
done
|
||||
|
||||
# SCSI
|
||||
for scsi in ${scsidrvs}
|
||||
do
|
||||
@ -135,9 +146,7 @@ done
|
||||
|
||||
# Just kill sound.
|
||||
filter_dir $1 kernel/sound
|
||||
filter_ko $1 drivers/base/regmap/regmap-sdw
|
||||
filter_ko $1 drivers/base/regmap/regmap-sdw-mbq
|
||||
filter_dir $1 drivers/soundwire
|
||||
filter_dir $1 kernel/drivers/soundwire
|
||||
|
||||
# Now go through and filter any single .ko files that might have deps on the
|
||||
# things we filtered above
|
||||
@ -146,6 +155,20 @@ do
|
||||
filter_ko $1 ${mod}
|
||||
done
|
||||
|
||||
# Now process the override list to bring those modules back into core
|
||||
for mod in ${overrides}
|
||||
do
|
||||
grep -v -e "/${mod}.ko" k-d.list > k-d.list.tmp
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo "Couldn't save ${mod}.ko Skipping."
|
||||
else
|
||||
grep -e "/${mod}.ko" k-d.list >> $filelist
|
||||
mv k-d.list.tmp k-d.list
|
||||
fi
|
||||
|
||||
done
|
||||
|
||||
# Go through our generated drivers list and remove the .ko files. We'll
|
||||
# restore them later.
|
||||
for mod in `cat k-d.list`
|
||||
@ -11,4 +11,4 @@
|
||||
|
||||
driverdirs="atm auxdisplay bcma bluetooth firewire fmc infiniband isdn leds media memstick message mmc mtd mwave nfc ntb pcmcia platform power ssb staging tty uio uwb w1"
|
||||
|
||||
singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject target_core_user sbp_target cxgbit iw_cxgb3 iw_cxgb4 cxgb3i cxgb3i cxgb3i_ddp cxgb4i chcr"
|
||||
singlemods="ntb_netdev iscsi_ibft iscsi_boot_sysfs megaraid pmcraid qedi qla1280 9pnet_rdma rpcrdma nvmet-rdma nvme-rdma hid-picolcd hid-prodikeys hwa-hc hwpoison-inject target_core_user sbp_target cxgbit iw_cxgb3 iw_cxgb4 cxgb3i cxgb3i cxgb3i_ddp cxgb4i chcr chtls"
|
||||
@ -1,17 +1,9 @@
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-8
|
||||
- rhel-9
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: kernel-qe.kernel-ci.kernel-aarch64.tier1.functional}
|
||||
- !PassingTestCaseRule {test_case_name: kernel-qe.kernel-ci.kernel-ppc64le.tier1.functional}
|
||||
- !PassingTestCaseRule {test_case_name: kernel-qe.kernel-ci.kernel-s390x.tier1.functional}
|
||||
- !PassingTestCaseRule {test_case_name: kernel-qe.kernel-ci.kernel-x86_64.tier1.functional}
|
||||
excluded_packages: [kernel-rt]
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-8
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: kernel-qe.kernel-ci.kernel-rt-x86_64.tier1.functional}
|
||||
packages: [kernel-rt]
|
||||
- !PassingTestCaseRule {test_case_name: cki.tier1-aarch64.functional}
|
||||
- !PassingTestCaseRule {test_case_name: cki.tier1-ppc64le.functional}
|
||||
- !PassingTestCaseRule {test_case_name: cki.tier1-s390x.functional}
|
||||
- !PassingTestCaseRule {test_case_name: cki.tier1-x86_64.functional}
|
||||
|
||||
@ -1,6 +1,36 @@
|
||||
#!/bin/sh
|
||||
|
||||
for i in ${NAME}-*.config; do
|
||||
NEW=${NAME}-${VERSION}-`echo $i | cut -d - -f2-`
|
||||
mv ${i} ${NEW}
|
||||
# Adjusts the configuration options to build the variants correctly
|
||||
|
||||
test -n "$RHTEST" && exit 0
|
||||
|
||||
DEBUGBUILDSENABLED=$1
|
||||
if [ -z "$DEBUGBUILDSENABLED" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$FLAVOR" ]; then
|
||||
FLAVOR=rhel
|
||||
fi
|
||||
|
||||
if [ "$FLAVOR" = "fedora" ]; then
|
||||
SECONDARY=rhel
|
||||
else
|
||||
SECONDARY=fedora
|
||||
fi
|
||||
|
||||
for i in kernel-*-"$FLAVOR".config; do
|
||||
NEW=kernel-"$SPECVERSION"-$(echo "$i" | cut -d - -f2- | sed s/-"$FLAVOR"//)
|
||||
#echo $NEW
|
||||
mv "$i" "$NEW"
|
||||
done
|
||||
|
||||
rm -f kernel-*-"$SECONDARY".config
|
||||
|
||||
if [ "$DEBUGBUILDSENABLED" -eq 0 ]; then
|
||||
for i in kernel-*debug*.config; do
|
||||
base=$(echo "$i" | sed -r s/-?debug//g)
|
||||
NEW=kernel-$(echo "$base" | cut -d - -f2-)
|
||||
mv "$i" "$NEW"
|
||||
done
|
||||
fi
|
||||
|
||||
@ -1,31 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
. /etc/os-release
|
||||
|
||||
kernelver=$1 && shift
|
||||
rootfs=$1 && shift
|
||||
variant=$1 && shift
|
||||
|
||||
output="${rootfs}/lib/modules/${kernelver}/bls.conf"
|
||||
date=$(date -u +%Y%m%d%H%M%S)
|
||||
|
||||
if [ "${variant:-5}" = "debug" ]; then
|
||||
debugname=" with debugging"
|
||||
debugid="-debug"
|
||||
else
|
||||
debugname=""
|
||||
debugid=""
|
||||
fi
|
||||
|
||||
cat >${output} <<EOF
|
||||
title ${NAME} (${kernelver}) ${VERSION}${debugname}
|
||||
version ${kernelver}${debugid}
|
||||
linux ${bootprefix}/vmlinuz-${kernelver}
|
||||
initrd ${bootprefix}/initramfs-${kernelver}.img
|
||||
options \$kernelopts
|
||||
id ${ID}-${date}-${kernelver}${debugid}
|
||||
grub_users \$grub_users
|
||||
grub_arg --unrestricted
|
||||
grub_class kernel${variant}
|
||||
EOF
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
7036
SOURCES/kernel-aarch64-debug-rhel.config
Normal file
7036
SOURCES/kernel-aarch64-debug-rhel.config
Normal file
File diff suppressed because it is too large
Load Diff
7012
SOURCES/kernel-aarch64-rhel.config
Normal file
7012
SOURCES/kernel-aarch64-rhel.config
Normal file
File diff suppressed because it is too large
Load Diff
7212
SOURCES/kernel-aarch64-rt-debug-rhel.config
Normal file
7212
SOURCES/kernel-aarch64-rt-debug-rhel.config
Normal file
File diff suppressed because it is too large
Load Diff
7188
SOURCES/kernel-aarch64-rt-rhel.config
Normal file
7188
SOURCES/kernel-aarch64-rt-rhel.config
Normal file
File diff suppressed because it is too large
Load Diff
2
SOURCES/kernel-local
Normal file
2
SOURCES/kernel-local
Normal file
@ -0,0 +1,2 @@
|
||||
# This file is intentionally left empty in the stock kernel. Its a nicety
|
||||
# added for those wanting to do custom rebuilds with altered config opts.
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
6945
SOURCES/kernel-x86_64-rt-debug-rhel.config
Normal file
6945
SOURCES/kernel-x86_64-rt-debug-rhel.config
Normal file
File diff suppressed because it is too large
Load Diff
6922
SOURCES/kernel-x86_64-rt-rhel.config
Normal file
6922
SOURCES/kernel-x86_64-rt-rhel.config
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,2 +0,0 @@
|
||||
sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
|
||||
kernel.@SBAT_SUFFIX,1,Red Hat,kernel-core,@KVER,mailto:secalert@redhat.com
|
||||
874
SOURCES/kmap.py
874
SOURCES/kmap.py
@ -1,874 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
kmap.py - Kernel Source-to-Binary Mapping Tool
|
||||
|
||||
DESCRIPTION
|
||||
This tool parses Linux kernel build artifacts (.cmd files, archives) to
|
||||
create a JSON mapping of which source files contribute to which kernel
|
||||
binaries (modules and vmlinux). It supports merging data from multiple
|
||||
kernel build variants (e.g., stock, debug, rt) into a single output
|
||||
file using variant indices to track per-variant mappings.
|
||||
|
||||
Supported RHEL versions: 7, 8, 9, upstream
|
||||
|
||||
FEATURES
|
||||
- Parses .cmd files generated by kbuild to extract compilation commands
|
||||
- Supports C (gcc/clang) and Rust (rustc) source files
|
||||
- Handles built-in objects via built-in.o.cmd (RHEL 7), built-in.a
|
||||
(RHEL 8/9), or vmlinux.a (upstream)
|
||||
- Merges multiple kernel variants into single output with variant indices
|
||||
- Maps modules to their containing RPM packages
|
||||
|
||||
OUTPUT FORMAT
|
||||
The output is a JSON file with the following structure:
|
||||
|
||||
{
|
||||
"variants": ["stock", "rt", ...],
|
||||
"source-map": {
|
||||
"obj-src": {<object>: {<source>: [<variant_indices>]}},
|
||||
"src-obj": {<source>: {<object>: [<variant_indices>]}}
|
||||
},
|
||||
"module-map": {
|
||||
"module-rpm": {<module>: {<rpm_name>: [<variant_indices>]}},
|
||||
"rpm-modules": {<rpm_name>: {<module>: [<variant_indices>]}}
|
||||
}
|
||||
}
|
||||
|
||||
PARSING THE OUTPUT
|
||||
import json
|
||||
|
||||
with open('kernel-map.json') as f:
|
||||
data = json.load(f)
|
||||
|
||||
variants = data['variants']
|
||||
obj_src = data['source-map']['obj-src']
|
||||
src_obj = data['source-map']['src-obj']
|
||||
module_rpm = data['module-map']['module-rpm']
|
||||
rpm_modules = data['module-map']['rpm-modules']
|
||||
|
||||
# Get sources for vmlinux in variant "stock" (index 0)
|
||||
vmlinux_sources = [src for src, indices in obj_src['vmlinux'].items()
|
||||
if 0 in indices]
|
||||
|
||||
# Find which object a source contributes to
|
||||
fork_objects = [obj for obj, indices in src_obj['kernel/fork.c'].items()
|
||||
if 0 in indices]
|
||||
|
||||
# Get RPM for a module
|
||||
def get_rpm(module, variant_idx):
|
||||
for rpm, indices in module_rpm.get(module, {}).items():
|
||||
if variant_idx in indices:
|
||||
return rpm
|
||||
return None
|
||||
|
||||
USAGE
|
||||
# Single variant
|
||||
./kmap.py -d /build/stock -r upstream -v stock -o /output
|
||||
|
||||
# Merge multiple variants
|
||||
./kmap.py -d /build/stock -r upstream -v stock -o /output
|
||||
./kmap.py -d /build/debug -r upstream -v debug -o /output -i kernel-map.json
|
||||
./kmap.py -d /build/rt -r upstream -v rt -o /output -i kernel-map.json
|
||||
|
||||
# With module-to-RPM mapping
|
||||
./kmap.py -d /build -r upstream -v stock -o /output \\
|
||||
--vmlinux-rpm kernel-core-5.14.0.rpm \\
|
||||
--module-list kernel-modules-5.14.0.rpm:modules.list
|
||||
|
||||
CREDITS
|
||||
Inspired by gen_compile_commands.py and Joe Lawrence.
|
||||
Time measurement option added for Jan Stancek.
|
||||
"""
|
||||
|
||||
import re
|
||||
import os
|
||||
import pathlib
|
||||
import json
|
||||
import argparse
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Constants
|
||||
# =============================================================================
|
||||
|
||||
VMLINUX = 'vmlinux'
|
||||
KERNEL_PREFIX = 'kernel/'
|
||||
|
||||
# Supported compilers and linkers
|
||||
COMPILERS = ('gcc', 'clang')
|
||||
LINKER = 'ld'
|
||||
RUST_COMPILER = 'rustc'
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Regex Patterns
|
||||
#
|
||||
# These patterns parse the kernel build .cmd files to extract:
|
||||
# - What compiler/linker was used
|
||||
# - What source files were compiled
|
||||
# - What object files were linked
|
||||
# =============================================================================
|
||||
|
||||
# Pattern for .ko.cmd files (module linking)
|
||||
# Matches: cmd_path/to/module.ko := ld <params> -o <ko_name> <input_files>
|
||||
# Note: upstream kernels use 'savedcmd_' prefix instead of 'cmd_'
|
||||
_KO_CMD_PATTERN = (
|
||||
r'^(saved)?cmd_[^ ]*\.ko\s*:=\s*ld\s+'
|
||||
r'(?P<params>.*) -o (?P<ko_name>\S+) (?P<input_files>[^;]+?)\s*(?:;|$)'
|
||||
)
|
||||
|
||||
# Pattern for .o.cmd files (object compilation)
|
||||
# Matches multiple formats:
|
||||
# - C/asm: cmd_*.o := gcc/clang <params> -o <output> <input>
|
||||
# - Rust: cmd_*.o := rustc <params> --emit=obj=<output> <input.rs>
|
||||
# - Rust source mapping: source_*.o := <file.rs>
|
||||
_O_CMD_PATTERN = (
|
||||
r'^(saved)?(?:cmd_|source_)[^ ]*\.o\s+:=\s+'
|
||||
r'(?:'
|
||||
r'(?P<prefix>(?:\S+=\S+\s+)*)?'
|
||||
r'(?P<command>gcc|clang|ld|rustc)\s+'
|
||||
r'(?P<params>.*?)'
|
||||
r'(?:'
|
||||
r'\s+-o\s+(?P<obj_out>\S+)\s+(?P<input_files>[^;]+?)'
|
||||
r'|'
|
||||
r'\s+--emit=obj=(?P<rust_obj_out>\S+).*?\s+(?P<rust_input_file>\S+\.rs)'
|
||||
r')'
|
||||
r'|'
|
||||
r'(?P<source_file>\S+\.rs)'
|
||||
r')\s*(?:;|$)'
|
||||
)
|
||||
|
||||
ko_matcher = re.compile(_KO_CMD_PATTERN)
|
||||
o_matcher = re.compile(_O_CMD_PATTERN)
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Utility Functions
|
||||
# =============================================================================
|
||||
|
||||
def parse_args():
|
||||
"""
|
||||
Parse command line arguments
|
||||
"""
|
||||
parser = argparse.ArgumentParser(
|
||||
prog='Kernel Build Mapper',
|
||||
description='Scrape Linux Kernel .cmd files to map contribution '
|
||||
'of individual source files to kernel binaries.',
|
||||
)
|
||||
|
||||
parser.add_argument('-d', '--directory',
|
||||
help='Directory with kernel build artifacts.',
|
||||
default='',
|
||||
type=str)
|
||||
|
||||
parser.add_argument('-o', '--outputdir',
|
||||
help='Directory where to put generated files.',
|
||||
default='',
|
||||
type=str)
|
||||
|
||||
parser.add_argument('-p', '--prefix',
|
||||
help='Name prefix to the generated files.',
|
||||
default='',
|
||||
type=str)
|
||||
|
||||
parser.add_argument('-r', '--rhel',
|
||||
help='Specify to what version of RHEL artifacts belong (upstream for RHEL 10+/kernel-ark)',
|
||||
choices=['7', '8', '9', 'upstream'],
|
||||
required=True)
|
||||
|
||||
parser.add_argument('-m', '--no-modules',
|
||||
help='*SKIP* collecting information about modules',
|
||||
action='store_true')
|
||||
|
||||
parser.add_argument('-b', '--no-builtin',
|
||||
help='*SKIP* collecting information about built-in',
|
||||
action='store_true')
|
||||
|
||||
parser.add_argument('-t', '--time',
|
||||
help='Print elapsed time at the end',
|
||||
action='store_true')
|
||||
|
||||
parser.add_argument('-v', '--variant',
|
||||
help='Name of this kernel variant (e.g., stock, debug, rt)',
|
||||
required=True,
|
||||
type=str)
|
||||
|
||||
parser.add_argument('-i', '--input',
|
||||
help='Existing JSON file to merge with (from previous variant runs)',
|
||||
default='',
|
||||
type=str)
|
||||
|
||||
parser.add_argument('--module-list',
|
||||
help='Module list in format <rpm-name>:<path> (can be specified multiple times)',
|
||||
action='append',
|
||||
default=[],
|
||||
metavar='RPM:PATH')
|
||||
|
||||
parser.add_argument('--vmlinux-rpm',
|
||||
help='RPM package name for vmlinux (e.g., "kernel-5.14.0.rpm")',
|
||||
default='',
|
||||
type=str)
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def load_file(filename, build_dir=''):
|
||||
"""
|
||||
Load a text file and return non-empty lines as a list
|
||||
"""
|
||||
full_path = os.path.join(build_dir, filename)
|
||||
|
||||
try:
|
||||
with open(full_path, 'rt', encoding='utf-8') as file:
|
||||
return [line.rstrip() for line in file if line.rstrip()]
|
||||
except FileNotFoundError:
|
||||
print(f'File "{full_path}" not found.')
|
||||
return []
|
||||
|
||||
|
||||
def name_to_cmd(filename, suffix):
|
||||
"""
|
||||
Convert object filename to corresponding .cmd script filename
|
||||
|
||||
Example: kernel/fork.o -> kernel/.fork.o.cmd
|
||||
"""
|
||||
path, _ = os.path.splitext(filename)
|
||||
dirname = os.path.dirname(path)
|
||||
basename = os.path.basename(path)
|
||||
|
||||
return os.path.join(dirname, '.' + basename + suffix)
|
||||
|
||||
|
||||
def strip_path_prefixes(path, build_dir):
|
||||
"""
|
||||
Normalize path by removing build directory prefix and other artifacts
|
||||
"""
|
||||
path = pathlib.Path(path)
|
||||
|
||||
if build_dir:
|
||||
try:
|
||||
return str(path.resolve().relative_to(pathlib.Path(build_dir).resolve()))
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if path.is_absolute():
|
||||
path = pathlib.Path(*path.parts[1:])
|
||||
|
||||
while path.parts and path.parts[0] == 'repos':
|
||||
path = pathlib.Path(*path.parts[1:])
|
||||
|
||||
return str(path)
|
||||
|
||||
|
||||
def is_external_source(path):
|
||||
"""
|
||||
Check if path should be excluded from source mapping
|
||||
|
||||
Filters out:
|
||||
- Rust toolchain sources (not part of kernel source)
|
||||
- Generated assembly files (e.g., initramfs_data.S)
|
||||
"""
|
||||
if 'rustlib' in path:
|
||||
return True
|
||||
if path.endswith('_data.S'):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def is_mod_file_reference(ld_input):
|
||||
"""
|
||||
Check if linker input is a .mod file reference (RHEL 9+ module linking)
|
||||
|
||||
In RHEL 9+, module linking uses @path/to/module.mod files that contain
|
||||
the list of object files to link.
|
||||
"""
|
||||
files = ld_input.split()
|
||||
return len(files) == 1 and files[0].startswith('@') and files[0].endswith('.mod')
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# SourceMap Class
|
||||
# =============================================================================
|
||||
|
||||
class SourceMap:
|
||||
"""
|
||||
Collects and manages kernel source-to-binary mappings.
|
||||
|
||||
This class parses kernel build artifacts (.cmd files, archives) to determine
|
||||
which source files contribute to which kernel binaries (modules and vmlinux).
|
||||
|
||||
Data structures:
|
||||
obj_to_src: {object_name: {source_file: [variant_indices]}}
|
||||
src_to_obj: {source_file: {object_name: [variant_indices]}}
|
||||
module_rpm: {module_name: {rpm_name: [variant_indices]}}
|
||||
rpm_to_modules: {rpm_name: {module_name: [variant_indices]}}
|
||||
|
||||
Variant indices correspond to positions in the 'variants' list.
|
||||
"""
|
||||
|
||||
# Dispatch table for RHEL-specific builtin collection methods
|
||||
BUILTIN_COLLECTORS = {
|
||||
'7': '_collect_builtin_rhel7',
|
||||
'8': '_collect_builtin_archive',
|
||||
'9': '_collect_builtin_archive',
|
||||
'upstream': '_collect_builtin_vmlinux_archive',
|
||||
}
|
||||
|
||||
def __init__(self, build_dir='', output_dir='', outprefix='', rhel='7', variant=''):
|
||||
# Source mappings
|
||||
self.obj_to_src = {}
|
||||
self.src_to_obj = {}
|
||||
# Module-to-RPM mappings
|
||||
self.module_rpm = {}
|
||||
self.rpm_to_modules = {}
|
||||
|
||||
# Configuration
|
||||
self.build_dir = build_dir
|
||||
self.output_dir = output_dir
|
||||
self.outprefix = outprefix
|
||||
self.rhel = rhel
|
||||
|
||||
# Module list
|
||||
self.modlist = set()
|
||||
|
||||
# Variant tracking for multi-variant merging
|
||||
self.variants = []
|
||||
self.variant = variant
|
||||
self.variant_idx = 0
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Variant Management
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def load_existing(self, filename):
|
||||
"""
|
||||
Load existing merged data from previous variant runs
|
||||
"""
|
||||
if not filename:
|
||||
return
|
||||
|
||||
full_path = os.path.join(self.output_dir, filename) if self.output_dir else filename
|
||||
|
||||
if not os.path.exists(full_path):
|
||||
return
|
||||
|
||||
with open(full_path, 'rt', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
|
||||
self.variants = data.get('variants', [])
|
||||
|
||||
module_map = data.get('module-map', {})
|
||||
self.module_rpm = module_map.get('module-rpm', {})
|
||||
self.rpm_to_modules = module_map.get('rpm-modules', {})
|
||||
|
||||
source_map = data.get('source-map', {})
|
||||
self.obj_to_src = source_map.get('obj-src', {})
|
||||
self.src_to_obj = source_map.get('src-obj', {})
|
||||
|
||||
def add_variant(self):
|
||||
"""
|
||||
Register current variant and store its index
|
||||
"""
|
||||
if self.variant in self.variants:
|
||||
self.variant_idx = self.variants.index(self.variant)
|
||||
else:
|
||||
self.variant_idx = len(self.variants)
|
||||
self.variants.append(self.variant)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Source Merging Helpers
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def _merge_sources(self, target, source):
|
||||
"""
|
||||
Merge source dict into target dict by combining variant index lists
|
||||
"""
|
||||
for src, indices in source.items():
|
||||
if src not in target:
|
||||
target[src] = []
|
||||
for idx in indices:
|
||||
if idx not in target[src]:
|
||||
target[src].append(idx)
|
||||
|
||||
def _add_source(self, sources, source_path):
|
||||
"""
|
||||
Add a source file to the sources dict with current variant index
|
||||
|
||||
Returns True if source was added, False if filtered out
|
||||
"""
|
||||
source_path = os.path.normpath(source_path)
|
||||
source_path = strip_path_prefixes(source_path, self.build_dir)
|
||||
|
||||
if is_external_source(source_path):
|
||||
return False
|
||||
|
||||
sources[source_path] = [self.variant_idx]
|
||||
return True
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# .cmd File Parsing
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def _parse_ko_cmd(self, ko_name):
|
||||
"""
|
||||
Parse .ko.cmd file to find the primary object file linked into the module
|
||||
"""
|
||||
ko_script = name_to_cmd(ko_name, '.ko.cmd')
|
||||
lines = load_file(ko_script, build_dir=self.build_dir)
|
||||
|
||||
for line in lines:
|
||||
result = ko_matcher.match(line)
|
||||
if result:
|
||||
input_files = result.group('input_files').split()
|
||||
return input_files[0]
|
||||
|
||||
return None
|
||||
|
||||
def _parse_o_cmd(self, o_name, translate=True):
|
||||
"""
|
||||
Parse .o.cmd file to extract source files that contribute to the object
|
||||
|
||||
Handles:
|
||||
- C/assembly compilation (gcc, clang)
|
||||
- Linking (ld) - recursively parses linked objects
|
||||
- Rust compilation (rustc)
|
||||
- Rust source file mappings
|
||||
|
||||
Args:
|
||||
o_name: Object file name or .cmd file path
|
||||
translate: If True, convert object name to .cmd path (e.g., kernel/fork.o
|
||||
becomes kernel/.fork.o.cmd). If False, use o_name as-is.
|
||||
This parameter exists to handle different kbuild behaviors
|
||||
across RHEL versions - some code paths may already have .cmd
|
||||
paths while others have object names that need translation.
|
||||
"""
|
||||
sources = {}
|
||||
|
||||
o_script = name_to_cmd(o_name, '.o.cmd') if translate else o_name
|
||||
lines = load_file(o_script, build_dir=self.build_dir)
|
||||
|
||||
for line in lines:
|
||||
result = o_matcher.match(line)
|
||||
if not result:
|
||||
continue
|
||||
|
||||
command = result.group('command')
|
||||
|
||||
if command in COMPILERS:
|
||||
self._handle_compiler(result, sources)
|
||||
break
|
||||
|
||||
elif command == LINKER:
|
||||
self._handle_linker(result, sources)
|
||||
break
|
||||
|
||||
elif command == RUST_COMPILER:
|
||||
self._handle_rustc(result, sources)
|
||||
break
|
||||
|
||||
else:
|
||||
self._handle_rust_source_mapping(result, sources)
|
||||
break
|
||||
|
||||
return sources
|
||||
|
||||
def _handle_compiler(self, match_result, sources):
|
||||
"""
|
||||
Handle gcc/clang compilation - extract the input source file
|
||||
"""
|
||||
obj_input = match_result.group('input_files')
|
||||
if obj_input:
|
||||
self._add_source(sources, obj_input)
|
||||
|
||||
def _handle_linker(self, match_result, sources):
|
||||
"""
|
||||
Handle ld linking - recursively parse linked objects
|
||||
"""
|
||||
obj_input = match_result.group('input_files')
|
||||
if not obj_input:
|
||||
return
|
||||
|
||||
if is_mod_file_reference(obj_input):
|
||||
self._merge_sources(sources, self._parse_mod_cmd(obj_input))
|
||||
else:
|
||||
for obj_file in obj_input.split():
|
||||
self._merge_sources(sources, self._parse_o_cmd(obj_file))
|
||||
|
||||
def _handle_rustc(self, match_result, sources):
|
||||
"""
|
||||
Handle rustc compilation - extract the Rust source file
|
||||
"""
|
||||
rust_input = match_result.group('rust_input_file')
|
||||
if rust_input:
|
||||
self._add_source(sources, rust_input)
|
||||
|
||||
def _handle_rust_source_mapping(self, match_result, sources):
|
||||
"""
|
||||
Handle Rust source file mapping (source_*.o := *.rs)
|
||||
"""
|
||||
source_file = match_result.group('source_file')
|
||||
if source_file and source_file.endswith('.rs'):
|
||||
self._add_source(sources, source_file)
|
||||
|
||||
def _parse_mod_cmd(self, mod_name):
|
||||
"""
|
||||
Parse .mod file used by RHEL 9+ for linking modules
|
||||
|
||||
These files contain a list of object files to link into the module.
|
||||
"""
|
||||
sources = {}
|
||||
mod_name = mod_name.strip('@')
|
||||
lines = load_file(mod_name, build_dir=self.build_dir)
|
||||
|
||||
for line in lines:
|
||||
self._merge_sources(sources, self._parse_o_cmd(line))
|
||||
|
||||
return sources
|
||||
|
||||
def _parse_a_cmd(self, a_name):
|
||||
"""
|
||||
Parse archive .cmd file (RHEL 7 built-in.o.cmd files)
|
||||
"""
|
||||
sources = {}
|
||||
lines = load_file(a_name, build_dir=self.build_dir)
|
||||
|
||||
for line in lines:
|
||||
result = o_matcher.match(line)
|
||||
if not result:
|
||||
continue
|
||||
|
||||
ar_input = result.group('input_files')
|
||||
for filename in ar_input.rsplit():
|
||||
if filename.endswith('.o'):
|
||||
self._merge_sources(sources, self._parse_o_cmd(filename))
|
||||
elif filename.endswith('.a'):
|
||||
self._merge_sources(sources, self._parse_a_cmd(filename))
|
||||
|
||||
return sources
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Module Collection
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def _load_module_list(self, modorder='modules.order'):
|
||||
"""
|
||||
Load modules.order file and normalize paths
|
||||
|
||||
RHEL 7, 8: modules.order has 'kernel/' prefix that needs to be stripped
|
||||
RHEL 9, upstream: modules.order paths are used as-is
|
||||
"""
|
||||
lines = load_file(modorder, build_dir=self.build_dir)
|
||||
|
||||
if not lines:
|
||||
print(f'Warning: modules.order is empty or not found')
|
||||
self.modlist = set()
|
||||
return
|
||||
|
||||
if self.rhel in ['9', 'upstream']:
|
||||
self.modlist = set(lines)
|
||||
else:
|
||||
# RHEL 7, 8: strip fake 'kernel/' prefix added by kbuild
|
||||
self.modlist = {
|
||||
path[len(KERNEL_PREFIX):] if path.startswith(KERNEL_PREFIX) else path
|
||||
for path in lines
|
||||
}
|
||||
|
||||
def _parse_module_objects(self):
|
||||
"""
|
||||
Parse all module .cmd files and extract source mappings.
|
||||
|
||||
Note on RHEL version differences:
|
||||
- RHEL 7/8/9: modules.order contains .ko paths (e.g., fs/exfat/exfat.ko)
|
||||
- upstream: modules.order contains .o paths (e.g., fs/exfat/exfat.o)
|
||||
|
||||
The normalization below ensures consistent .ko keys in output regardless
|
||||
of the modules.order format.
|
||||
"""
|
||||
for kobj in self.modlist:
|
||||
# Normalize to .ko - upstream has .o paths in modules.order
|
||||
if self.rhel == 'upstream' and kobj.endswith('.o'):
|
||||
module_name = kobj[:-2] + '.ko'
|
||||
else:
|
||||
module_name = kobj
|
||||
|
||||
obj_name = self._parse_ko_cmd(module_name)
|
||||
if obj_name is None:
|
||||
print(f'Warning: Could not parse .ko.cmd for "{module_name}", skipping.')
|
||||
continue
|
||||
|
||||
obj_source = self._parse_o_cmd(obj_name)
|
||||
if module_name not in self.obj_to_src:
|
||||
self.obj_to_src[module_name] = {}
|
||||
self._merge_sources(self.obj_to_src[module_name], obj_source)
|
||||
|
||||
def collect_modules(self, no_modules=False, modorder='modules.order'):
|
||||
"""
|
||||
Collect source files for kernel modules
|
||||
"""
|
||||
if no_modules:
|
||||
return
|
||||
|
||||
self._load_module_list(modorder)
|
||||
self._parse_module_objects()
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Builtin Collection (RHEL version-specific)
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def _collect_builtin_rhel7(self):
|
||||
"""
|
||||
Collect built-in objects for RHEL 7 using *built-in.o.cmd files
|
||||
"""
|
||||
pattern = '*built-in.o.cmd'
|
||||
cmd_list = {
|
||||
strip_path_prefixes(path, self.build_dir)
|
||||
for path in pathlib.Path(self.build_dir).rglob(pattern)
|
||||
}
|
||||
|
||||
for entry in cmd_list:
|
||||
sources = self._parse_a_cmd(entry)
|
||||
self._merge_sources(self.obj_to_src[VMLINUX], sources)
|
||||
|
||||
def _collect_builtin_archive(self):
|
||||
"""
|
||||
Collect built-in objects for RHEL 8/9 using *built-in.a archives
|
||||
"""
|
||||
pattern = '*built-in.a'
|
||||
archive_list = {
|
||||
strip_path_prefixes(path, self.build_dir)
|
||||
for path in pathlib.Path(self.build_dir).rglob(pattern)
|
||||
}
|
||||
|
||||
for entry in archive_list:
|
||||
path = os.path.join(self.build_dir, entry)
|
||||
objects = subprocess.check_output(['ar', 't', path]).decode().split()
|
||||
|
||||
for obj in objects:
|
||||
obj_path = strip_path_prefixes(obj, build_dir=self.build_dir)
|
||||
sources = self._parse_o_cmd(obj_path)
|
||||
self._merge_sources(self.obj_to_src[VMLINUX], sources)
|
||||
|
||||
def _collect_builtin_vmlinux_archive(self):
|
||||
"""
|
||||
Collect built-in objects for upstream kernels using single vmlinux.a archive
|
||||
"""
|
||||
path = os.path.join(self.build_dir, 'vmlinux.a')
|
||||
objects = subprocess.check_output(['ar', 't', path]).decode().split()
|
||||
|
||||
for obj in objects:
|
||||
obj_path = strip_path_prefixes(obj, build_dir=self.build_dir)
|
||||
sources = self._parse_o_cmd(obj_path)
|
||||
self._merge_sources(self.obj_to_src[VMLINUX], sources)
|
||||
|
||||
def collect_builtin(self, no_builtin=False):
|
||||
"""
|
||||
Collect source files for vmlinux built-in objects
|
||||
|
||||
Uses RHEL version-specific collection method via dispatch table.
|
||||
"""
|
||||
if VMLINUX not in self.obj_to_src:
|
||||
self.obj_to_src[VMLINUX] = {}
|
||||
|
||||
if no_builtin:
|
||||
return
|
||||
|
||||
collector_name = self.BUILTIN_COLLECTORS.get(self.rhel, '_collect_builtin_archive')
|
||||
collector = getattr(self, collector_name)
|
||||
collector()
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Module-to-RPM Mapping
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def _parse_module_list_file(self, filename, rpm_name):
|
||||
"""
|
||||
Parse a module list file and add entries to module_rpm mapping
|
||||
|
||||
Handles various formats:
|
||||
- Absolute paths: /lib/modules/5.14.0/kernel/drivers/net/e1000.ko.xz
|
||||
- Relative paths: kernel/drivers/net/e1000.ko
|
||||
- Skips RPM spec directives (%dir, %defattr, etc.)
|
||||
|
||||
Args:
|
||||
filename: Path to the module list file
|
||||
rpm_name: Literal RPM package name (e.g., "kernel-modules-5.14.0.rpm")
|
||||
"""
|
||||
if not filename or not os.path.exists(filename):
|
||||
return
|
||||
|
||||
with open(filename, 'rt', encoding='utf-8') as f:
|
||||
for line in f:
|
||||
line = line.strip()
|
||||
|
||||
# Skip empty lines, comments, and RPM spec directives
|
||||
if not line or line.startswith('#') or line.startswith('%'):
|
||||
continue
|
||||
|
||||
# Skip non-module files
|
||||
if '.ko' not in line:
|
||||
continue
|
||||
|
||||
# Extract module name from path
|
||||
module = os.path.basename(line)
|
||||
# Remove .ko and any compression suffix
|
||||
module = re.sub(r'\.ko(\.[^.]+)?$', '', module)
|
||||
|
||||
if not module:
|
||||
continue
|
||||
|
||||
if module not in self.module_rpm:
|
||||
self.module_rpm[module] = {}
|
||||
|
||||
if rpm_name not in self.module_rpm[module]:
|
||||
self.module_rpm[module][rpm_name] = []
|
||||
if self.variant_idx not in self.module_rpm[module][rpm_name]:
|
||||
self.module_rpm[module][rpm_name].append(self.variant_idx)
|
||||
|
||||
def collect_module_rpm(self, module_lists, vmlinux_rpm=''):
|
||||
"""
|
||||
Collect module-to-RPM name mappings from module list files
|
||||
|
||||
Args:
|
||||
module_lists: List of "rpm_name:path" strings
|
||||
vmlinux_rpm: RPM package name for vmlinux
|
||||
"""
|
||||
if not module_lists and not vmlinux_rpm:
|
||||
return
|
||||
|
||||
# Add vmlinux to specified RPM
|
||||
if vmlinux_rpm:
|
||||
if VMLINUX not in self.module_rpm:
|
||||
self.module_rpm[VMLINUX] = {}
|
||||
if vmlinux_rpm not in self.module_rpm[VMLINUX]:
|
||||
self.module_rpm[VMLINUX][vmlinux_rpm] = []
|
||||
if self.variant_idx not in self.module_rpm[VMLINUX][vmlinux_rpm]:
|
||||
self.module_rpm[VMLINUX][vmlinux_rpm].append(self.variant_idx)
|
||||
|
||||
# Process module list files
|
||||
for entry in module_lists:
|
||||
if ':' not in entry:
|
||||
print(f'Warning: Invalid --module-list format "{entry}", expected RPM:PATH')
|
||||
continue
|
||||
|
||||
rpm_name, path = entry.split(':', 1)
|
||||
self._parse_module_list_file(path, rpm_name)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Output
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def _build_reverse_map(self):
|
||||
"""
|
||||
Create reverse mapping (source -> {obj: [indices]}) from obj_to_src
|
||||
"""
|
||||
for obj, sources in self.obj_to_src.items():
|
||||
for source, indices in sources.items():
|
||||
if source not in self.src_to_obj:
|
||||
self.src_to_obj[source] = {}
|
||||
if obj not in self.src_to_obj[source]:
|
||||
self.src_to_obj[source][obj] = []
|
||||
for idx in indices:
|
||||
if idx not in self.src_to_obj[source][obj]:
|
||||
self.src_to_obj[source][obj].append(idx)
|
||||
|
||||
def _build_rpm_reverse_map(self):
|
||||
"""
|
||||
Create reverse mapping (rpm -> {module: [indices]}) from module_rpm
|
||||
"""
|
||||
for module, rpms in self.module_rpm.items():
|
||||
for rpm, indices in rpms.items():
|
||||
if rpm not in self.rpm_to_modules:
|
||||
self.rpm_to_modules[rpm] = {}
|
||||
if module not in self.rpm_to_modules[rpm]:
|
||||
self.rpm_to_modules[rpm][module] = []
|
||||
for idx in indices:
|
||||
if idx not in self.rpm_to_modules[rpm][module]:
|
||||
self.rpm_to_modules[rpm][module].append(idx)
|
||||
|
||||
def save_data(self):
|
||||
"""
|
||||
Save collected data to JSON file
|
||||
|
||||
Output structure:
|
||||
- variants: list of variant names
|
||||
- source-map: source file mappings
|
||||
- obj-src: object/module -> {source: [variant_indices]}
|
||||
- src-obj: source -> {object/module: [variant_indices]}
|
||||
- module-map: module to RPM mappings
|
||||
- module-rpm: module name -> {rpm-name: [variant_indices]}
|
||||
- rpm-modules: rpm-name -> {module name: [variant_indices]}
|
||||
|
||||
Variant indices correspond to positions in the 'variants' list.
|
||||
"""
|
||||
output = {
|
||||
'variants': self.variants,
|
||||
'source-map': {
|
||||
'obj-src': self.obj_to_src,
|
||||
'src-obj': self.src_to_obj
|
||||
},
|
||||
'module-map': {
|
||||
'module-rpm': self.module_rpm,
|
||||
'rpm-modules': self.rpm_to_modules
|
||||
}
|
||||
}
|
||||
|
||||
filename = self.outprefix + 'kernel-map.json'
|
||||
with open(os.path.join(self.output_dir, filename), 'wt', encoding='utf-8') as f:
|
||||
json.dump(output, f, indent=2, sort_keys=True)
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# Main Entry Point
|
||||
# -------------------------------------------------------------------------
|
||||
|
||||
def collect_data(self, no_modules=False, no_builtin=False, modorder='modules.order',
|
||||
input_file='', module_lists=None, vmlinux_rpm=''):
|
||||
"""
|
||||
Main entry point - collect all data and save to JSON
|
||||
"""
|
||||
self.load_existing(input_file)
|
||||
self.add_variant()
|
||||
self.collect_modules(no_modules, modorder)
|
||||
self.collect_builtin(no_builtin)
|
||||
self.collect_module_rpm(module_lists or [], vmlinux_rpm)
|
||||
self._build_reverse_map()
|
||||
self._build_rpm_reverse_map()
|
||||
self.save_data()
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# Main
|
||||
# =============================================================================
|
||||
|
||||
def main():
|
||||
"""
|
||||
Main entry point
|
||||
"""
|
||||
args = parse_args()
|
||||
|
||||
start = time.monotonic()
|
||||
|
||||
source_map = SourceMap(
|
||||
build_dir=args.directory,
|
||||
output_dir=args.outputdir,
|
||||
outprefix=args.prefix,
|
||||
rhel=args.rhel,
|
||||
variant=args.variant)
|
||||
|
||||
source_map.collect_data(
|
||||
no_modules=args.no_modules,
|
||||
no_builtin=args.no_builtin,
|
||||
input_file=args.input,
|
||||
module_lists=args.module_list,
|
||||
vmlinux_rpm=args.vmlinux_rpm)
|
||||
|
||||
if args.time:
|
||||
elapsed = time.monotonic() - start
|
||||
minutes, seconds = divmod(int(elapsed), 60)
|
||||
print(f'Elapsed time: {minutes:02d}:{seconds:02d}')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
72
SOURCES/merge.pl
Executable file
72
SOURCES/merge.pl
Executable file
@ -0,0 +1,72 @@
|
||||
#! /usr/bin/perl
|
||||
|
||||
my @args=@ARGV;
|
||||
my %configvalues;
|
||||
my @configoptions;
|
||||
my $configcounter = 0;
|
||||
|
||||
# optionally print out the architecture as the first line of our output
|
||||
my $arch = $args[2];
|
||||
if (defined $arch) {
|
||||
print "# $arch\n";
|
||||
}
|
||||
|
||||
# first, read the override file
|
||||
|
||||
open (FILE,"$args[0]") || die "Could not open $args[0]";
|
||||
while (<FILE>) {
|
||||
my $str = $_;
|
||||
my $configname;
|
||||
|
||||
if (/\# ([\w]+) is not set/) {
|
||||
$configname = $1;
|
||||
} elsif (/^\#/) {
|
||||
# fall through on comments like 'avoid CONFIG_FOO=y'
|
||||
;
|
||||
} elsif (/([\w]+)=/) {
|
||||
$configname = $1;
|
||||
}
|
||||
|
||||
if (defined($configname) && !exists($configvalues{$configname})) {
|
||||
$configvalues{$configname} = $str;
|
||||
$configoptions[$configcounter] = $configname;
|
||||
$configcounter ++;
|
||||
}
|
||||
};
|
||||
|
||||
# now, read and output the entire configfile, except for the overridden
|
||||
# parts... for those the new value is printed.
|
||||
|
||||
open (FILE2,"$args[1]") || die "Could not open $args[1]";
|
||||
while (<FILE2>) {
|
||||
my $configname;
|
||||
|
||||
if (/\# ([\w]+) is not set/) {
|
||||
$configname = $1;
|
||||
} elsif (/^\#/) {
|
||||
# fall through on comments like 'avoid CONFIG_FOO=y'
|
||||
;
|
||||
} elsif (/([\w]+)=/) {
|
||||
$configname = $1;
|
||||
}
|
||||
|
||||
if (defined($configname) && exists($configvalues{$configname})) {
|
||||
print "$configvalues{$configname}";
|
||||
delete($configvalues{$configname});
|
||||
} else {
|
||||
print "$_";
|
||||
}
|
||||
}
|
||||
|
||||
# now print the new values from the overridden configfile
|
||||
my $counter = 0;
|
||||
|
||||
while ($counter < $configcounter) {
|
||||
my $configname = $configoptions[$counter];
|
||||
if (exists($configvalues{$configname})) {
|
||||
print "$configvalues{$configname}";
|
||||
}
|
||||
$counter++;
|
||||
}
|
||||
|
||||
1;
|
||||
@ -1,4 +1,5 @@
|
||||
#! /bin/bash
|
||||
# shellcheck disable=SC2164
|
||||
|
||||
RpmDir=$1
|
||||
ModDir=$2
|
||||
@ -24,9 +25,9 @@ __EOF__
|
||||
|
||||
check_blacklist()
|
||||
{
|
||||
mod=$(find $RpmDir/$ModDir -name "$1")
|
||||
mod=$(find "$RpmDir/$ModDir" -name "$1")
|
||||
[ ! "$mod" ] && return 0
|
||||
if modinfo $mod | grep -q '^alias:\s\+net-'; then
|
||||
if modinfo "$mod" | grep -q '^alias:\s\+net-'; then
|
||||
mod="${1##*/}"
|
||||
mod="${mod%.ko*}"
|
||||
echo "$mod has an alias that allows auto-loading. Blacklisting."
|
||||
@ -37,7 +38,7 @@ check_blacklist()
|
||||
find_depends()
|
||||
{
|
||||
dep=$1
|
||||
depends=`modinfo $dep | sed -n -e "/^depends/ s/^depends:[ \t]*//p"`
|
||||
depends=$(modinfo "$dep" | sed -n -e "/^depends/ s/^depends:[ \t]*//p")
|
||||
[ -z "$depends" ] && exit
|
||||
for mod in ${depends//,/ }
|
||||
do
|
||||
@ -45,14 +46,14 @@ find_depends()
|
||||
[ -z "$match" ] && continue
|
||||
# check if the module we are looking at is in mod-* too.
|
||||
# if so we do not need to mark the dep as required.
|
||||
mod2=${dep##*/} # same as `basename $dep`, but faster
|
||||
mod2=${dep##*/} # same as $(basename $dep), but faster
|
||||
match2=$(grep "^$mod2" "$ListName")
|
||||
if [ -n "$match2" ]
|
||||
then
|
||||
#echo $mod2 >> notreq.list
|
||||
continue
|
||||
fi
|
||||
echo $mod.ko >> req.list
|
||||
echo "$mod".ko >> req.list
|
||||
done
|
||||
}
|
||||
|
||||
@ -60,11 +61,11 @@ foreachp()
|
||||
{
|
||||
P=$(nproc)
|
||||
bgcount=0
|
||||
while read mod; do
|
||||
while read -r mod; do
|
||||
$1 "$mod" &
|
||||
|
||||
bgcount=$((bgcount + 1))
|
||||
if [ $bgcount -eq $P ]; then
|
||||
if [ $bgcount -eq "$P" ]; then
|
||||
wait -n
|
||||
bgcount=$((bgcount - 1))
|
||||
fi
|
||||
@ -76,12 +77,12 @@ foreachp()
|
||||
# Destination was specified on the command line
|
||||
test -n "$4" && echo "$0: Override Destination $Dest has been specified."
|
||||
|
||||
pushd $Dir
|
||||
pushd "$Dir"
|
||||
|
||||
OverrideDir=$(basename $List)
|
||||
OverrideDir=$(basename "$List")
|
||||
OverrideDir=${OverrideDir%.*}
|
||||
OverrideDir=${OverrideDir#*-}
|
||||
mkdir -p $OverrideDir
|
||||
mkdir -p "$OverrideDir"
|
||||
|
||||
rm -rf modnames
|
||||
find . -name "*.ko" -type f > modnames
|
||||
@ -94,7 +95,8 @@ cp "$List" .
|
||||
|
||||
# This variable needs to be exported because it is used in sub-script
|
||||
# executed by xargs
|
||||
export ListName=$(basename "$List")
|
||||
ListName=$(basename "$List")
|
||||
export ListName
|
||||
|
||||
foreachp find_depends < modnames
|
||||
|
||||
@ -102,25 +104,25 @@ sort -u req.list > req2.list
|
||||
sort -u "$ListName" > modules2.list
|
||||
join -v 1 modules2.list req2.list > modules3.list
|
||||
|
||||
for mod in $(cat modules3.list)
|
||||
while IFS= read -r mod
|
||||
do
|
||||
# get the path for the module
|
||||
modpath=`grep /$mod modnames`
|
||||
[ -z "$modpath" ] && continue
|
||||
echo $modpath >> dep.list
|
||||
done
|
||||
# get the path for the module
|
||||
modpath=$(grep /"$mod" modnames)
|
||||
[ -z "$modpath" ] && continue
|
||||
echo "$modpath" >> dep.list
|
||||
done < modules3.list
|
||||
|
||||
sort -u dep.list > dep2.list
|
||||
|
||||
if [ -n "$Dest" ]; then
|
||||
# now move the modules into the $Dest directory
|
||||
for mod in `cat dep2.list`
|
||||
do
|
||||
newpath=`dirname $mod | sed -e "s/kernel\\//$Dest\//"`
|
||||
mkdir -p $newpath
|
||||
mv $mod $newpath
|
||||
echo $mod | sed -e "s/kernel\\//$Dest\//" | sed -e "s|^.|${ModDir}|g" >> $RpmDir/$ListName
|
||||
done
|
||||
# now move the modules into the $Dest directory
|
||||
while IFS= read -r mod
|
||||
do
|
||||
newpath=$(dirname "$mod" | sed -e "s/kernel\\//$Dest\//")
|
||||
mkdir -p "$newpath"
|
||||
mv "$mod" "$newpath"
|
||||
echo "$mod" | sed -e "s/kernel\\//$Dest\//" | sed -e "s|^.|${ModDir}|g" >> "$RpmDir"/"$ListName"
|
||||
done < dep2.list
|
||||
fi
|
||||
|
||||
popd
|
||||
@ -130,23 +132,33 @@ popd
|
||||
# target doesn't try to sign a non-existent file. This is kinda ugly, but
|
||||
# so are the modules-* packages.
|
||||
|
||||
for mod in `cat ${Dir}/dep2.list`
|
||||
while IFS= read -r mod
|
||||
do
|
||||
modfile=`basename $mod | sed -e 's/.ko/.mod/'`
|
||||
rm .tmp_versions/$modfile
|
||||
done
|
||||
modfile=$(basename "$mod" | sed -e 's/.ko/.mod/')
|
||||
rm .tmp_versions/"$modfile"
|
||||
done < "$Dir"/dep2.list
|
||||
|
||||
if [ ! -n "$Dest" ]; then
|
||||
sed -e "s|^.|${ModDir}|g" ${Dir}/dep2.list > $RpmDir/$ListName
|
||||
if [ -z "$Dest" ]; then
|
||||
sed -e "s|^.|${ModDir}|g" "$Dir"/dep2.list > "$RpmDir/$ListName"
|
||||
echo "./$RpmDir/$ListName created."
|
||||
[ -d "$RpmDir/etc/modprobe.d/" ] || mkdir -p "$RpmDir/etc/modprobe.d/"
|
||||
foreachp check_blacklist < $List
|
||||
foreachp check_blacklist < "$List"
|
||||
fi
|
||||
|
||||
# Many BIOS-es export a PNP-id which causes the floppy driver to autoload
|
||||
# even though most modern systems don't have a 3.5" floppy driver anymore
|
||||
# this replaces the old die_floppy_die.patch which removed the PNP-id from
|
||||
# the module
|
||||
|
||||
floppylist=("$RpmDir"/"$ModDir"/kernel/drivers/block/floppy.ko*)
|
||||
if [[ -n ${floppylist[0]} && -f ${floppylist[0]} ]]; then
|
||||
blacklist "floppy"
|
||||
fi
|
||||
|
||||
# avoid an empty kernel-extra package
|
||||
echo "$ModDir/$OverrideDir" >> $RpmDir/$ListName
|
||||
echo "$ModDir/$OverrideDir" >> "$RpmDir/$ListName"
|
||||
|
||||
pushd $Dir
|
||||
pushd "$Dir"
|
||||
rm modnames dep.list dep2.list req.list req2.list
|
||||
rm "$ListName" modules2.list modules3.list
|
||||
popd
|
||||
@ -2,8 +2,6 @@
|
||||
a3d.ko
|
||||
act200l-sir.ko
|
||||
actisys-sir.ko
|
||||
act_mpls.ko
|
||||
act_ct.ko
|
||||
adi.ko
|
||||
aer_inject.ko
|
||||
af_802154.ko
|
||||
@ -17,7 +15,6 @@ avm_cs.ko
|
||||
avmfritz.ko
|
||||
ax25.ko
|
||||
b1.ko
|
||||
bareudp.ko
|
||||
bas_gigaset.ko
|
||||
batman-adv.ko
|
||||
baycom_par.ko
|
||||
@ -72,7 +69,6 @@ iforce.ko
|
||||
interact.ko
|
||||
ipddp.ko
|
||||
ipx.ko
|
||||
ip_vs_mh.ko
|
||||
isdn.ko
|
||||
joydump.ko
|
||||
kingsun-sir.ko
|
||||
@ -83,6 +79,7 @@ l2tp_core.ko
|
||||
l2tp_debugfs.ko
|
||||
l2tp_eth.ko
|
||||
l2tp_ip.ko
|
||||
l2tp_ip6.ko
|
||||
l2tp_netlink.ko
|
||||
l2tp_ppp.ko
|
||||
lec.ko
|
||||
@ -124,11 +121,9 @@ rds_tcp.ko
|
||||
rose.ko
|
||||
sch_atm.ko
|
||||
sch_cbq.ko
|
||||
sch_cbs.ko
|
||||
sch_choke.ko
|
||||
sch_drr.ko
|
||||
sch_dsmark.ko
|
||||
sch_ets.ko
|
||||
sch_gred.ko
|
||||
sch_mqprio.ko
|
||||
sch_multiq.ko
|
||||
@ -139,6 +134,7 @@ sch_sfb.ko
|
||||
sch_teql.ko
|
||||
sctp.ko
|
||||
sctp_diag.ko
|
||||
sctp_probe.ko
|
||||
sidewinder.ko
|
||||
sja1000.ko
|
||||
sja1000_platform.ko
|
||||
@ -192,7 +188,6 @@ wanrouter.ko
|
||||
warrior.ko
|
||||
whci.ko
|
||||
wire.ko
|
||||
xpad.ko
|
||||
xt_u32.ko
|
||||
wwan_hwsim.ko
|
||||
yam.ko
|
||||
zhenhua.ko
|
||||
@ -13,34 +13,17 @@ qos-test
|
||||
resource_kunit
|
||||
soc-topology-test
|
||||
soc-utils-test
|
||||
stackinit_kunit
|
||||
string-stream-test
|
||||
test_linear_ranges
|
||||
test_bits
|
||||
test_kasan
|
||||
time_test
|
||||
fat_test
|
||||
lib_test
|
||||
rational-test
|
||||
test_list_sort
|
||||
slub_kunit
|
||||
memcpy_kunit
|
||||
time_test
|
||||
drm_format_helper_test
|
||||
drm_damage_helper_test
|
||||
drm_cmdline_parser_test
|
||||
drm_kunit_helpers
|
||||
drm_rect_test
|
||||
drm_format_test
|
||||
drm_plane_helper_test
|
||||
drm_dp_mst_helper_test
|
||||
drm_framebuffer_test
|
||||
drm_buddy_test
|
||||
drm_mm_test
|
||||
drm_connector_test
|
||||
drm_managed_test
|
||||
drm_modes_test
|
||||
drm_probe_helper_test
|
||||
lib_test
|
||||
dev_addr_lists_test
|
||||
rational-test
|
||||
kfence_test
|
||||
test_hash
|
||||
locktorture
|
||||
mac80211_hwsim
|
||||
@ -49,8 +32,6 @@ pktgen
|
||||
rcutorture
|
||||
rocker
|
||||
scftorture
|
||||
torture
|
||||
test_bpf
|
||||
test_klp_atomic_replace
|
||||
test_klp_callbacks_demo
|
||||
test_klp_callbacks_demo2
|
||||
@ -61,6 +42,38 @@ test_klp_shadow_vars
|
||||
test_klp_state
|
||||
test_klp_state2
|
||||
test_klp_state3
|
||||
torture
|
||||
refscale
|
||||
rcuscale
|
||||
memcpy_kunit
|
||||
dev_addr_lists_test
|
||||
test_bpf
|
||||
stackinit_kunit
|
||||
overflow_kunit
|
||||
clk-gate_test
|
||||
clk_test
|
||||
mtty
|
||||
test_hmm
|
||||
test_vmalloc
|
||||
mtty
|
||||
test_sort
|
||||
cpumask_kunit
|
||||
iio-test-format
|
||||
iio-test-rescale
|
||||
cros_kunit
|
||||
cpumask_kunit
|
||||
drm_buddy_test
|
||||
drm_cmdline_parser_test
|
||||
drm_damage_helper_test
|
||||
drm_dp_mst_helper_test
|
||||
drm_format_helper_test
|
||||
drm_format_test
|
||||
drm_framebuffer_test
|
||||
drm_kunit_helpers
|
||||
drm_mm_test
|
||||
drm_plane_helper_test
|
||||
drm_rect_test
|
||||
gss_krb5_test
|
||||
drm_connector_test
|
||||
drm_managed_test
|
||||
drm_modes_test
|
||||
drm_probe_helper_test
|
||||
|
||||
5
SOURCES/mod-kvm.list
Normal file
5
SOURCES/mod-kvm.list
Normal file
@ -0,0 +1,5 @@
|
||||
kvm-amd
|
||||
kvm-intel
|
||||
kvm
|
||||
kvmgt
|
||||
ptp_kvm
|
||||
3
SOURCES/mod-partner.list
Normal file
3
SOURCES/mod-partner.list
Normal file
@ -0,0 +1,3 @@
|
||||
afs
|
||||
rxperf
|
||||
rxrpc
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
# The modules_sign target checks for corresponding .o files for every .ko that
|
||||
# is signed. This doesn't work for package builds which re-use the same build
|
||||
# directory for every flavour, and the .config may change between flavours.
|
||||
# directory for every variant, and the .config may change between variants.
|
||||
# So instead of using this script to just sign lib/modules/$KernelVer/extra,
|
||||
# sign all .ko in the buildroot.
|
||||
|
||||
@ -13,9 +13,9 @@ MODSECKEY=$1
|
||||
MODPUBKEY=$2
|
||||
moddir=$3
|
||||
|
||||
modules=`find $moddir -type f -name '*.ko'`
|
||||
modules=$(find "$moddir" -type f -name '*.ko')
|
||||
|
||||
NPROC=`nproc`
|
||||
NPROC=$(nproc)
|
||||
[ -z "$NPROC" ] && NPROC=1
|
||||
|
||||
# NB: this loop runs 2000+ iterations. Try to be fast.
|
||||
@ -27,7 +27,7 @@ done
|
||||
" DUMMYARG0 # xargs appends ARG1 ARG2..., which go into $mod in for loop.
|
||||
|
||||
RANDOMMOD=$(echo "$modules" | sort -R | head -n 1)
|
||||
if [ "~Module signature appended~" != "$(tail -c 28 $RANDOMMOD)" ]; then
|
||||
if [ "~Module signature appended~" != "$(tail -c 28 "$RANDOMMOD")" ]; then
|
||||
echo "*****************************"
|
||||
echo "*** Modules are unsigned! ***"
|
||||
echo "*****************************"
|
||||
|
||||
@ -23,4 +23,4 @@ test "$procgroup" = 1 && exec xargs -r xz
|
||||
# xz has some startup cost. If files are really small,
|
||||
# this cost might be significant. To combat this,
|
||||
# process several files (in sequence) by each xz process via -n 16:
|
||||
exec xargs -r -n 16 -P $procgroup xz
|
||||
exec xargs -r -n 16 -P "$procgroup" xz
|
||||
|
||||
5
SOURCES/partial-kgcov-snip.config
Normal file
5
SOURCES/partial-kgcov-snip.config
Normal file
@ -0,0 +1,5 @@
|
||||
# kgcov
|
||||
CONFIG_GCOV_KERNEL=y
|
||||
CONFIG_GCOV_PROFILE_ALL=y
|
||||
# CONFIG_GCOV_PROFILE_FTRACE is not set
|
||||
# CONFIG_OPEN_DICE is not set
|
||||
0
SOURCES/patch-5.14-redhat.patch
Normal file
0
SOURCES/patch-5.14-redhat.patch
Normal file
@ -3,14 +3,27 @@
|
||||
# This script takes the merged config files and processes them through oldconfig
|
||||
# and listnewconfig
|
||||
#
|
||||
# Globally disable suggestion of appending '|| exit' or '|| return' to cd/pushd/popd commands
|
||||
# shellcheck disable=SC2164
|
||||
|
||||
test -n "$RHTEST" && exit 0
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "process_configs.sh [ -n|-c|-t ] package_name kernel_version [cross_opts]"
|
||||
echo " -n: error on unset config options"
|
||||
# alphabetical order please
|
||||
echo "process_configs.sh [ options ] package_name kernel_version"
|
||||
echo " -a: report all errors, equivalent to [-c -n -w -i]"
|
||||
echo " -c: error on mismatched config options"
|
||||
echo " -i: continue on error"
|
||||
echo " -n: error on unset config options"
|
||||
echo " -t: test run, do not overwrite original config"
|
||||
echo " -w: error on misconfigured config options"
|
||||
echo " -z: commit new configs to pending directory"
|
||||
echo ""
|
||||
echo " A special CONFIG file tag, process_configs_known_broken can be added as a"
|
||||
echo " comment to any CONFIG file. This tag indicates that there is no way to "
|
||||
echo " fix a CONFIG's entry. This tag should only be used in extreme cases"
|
||||
echo " and is not to be used as a workaround to solve CONFIG problems."
|
||||
exit 1
|
||||
}
|
||||
|
||||
@ -20,18 +33,27 @@ die()
|
||||
exit 1
|
||||
}
|
||||
|
||||
get_cross_compile()
|
||||
{
|
||||
arch=$1
|
||||
if [[ "$CC_IS_CLANG" -eq 1 ]]; then
|
||||
echo "$arch"
|
||||
else
|
||||
echo "scripts/dummy-tools/"
|
||||
fi
|
||||
}
|
||||
|
||||
# stupid function to find top of tree to do kernel make configs
|
||||
switch_to_toplevel()
|
||||
{
|
||||
path="$(pwd)"
|
||||
while test -n "$path"
|
||||
do
|
||||
test -d $path/firmware && \
|
||||
test -e $path/MAINTAINERS && \
|
||||
test -d $path/drivers && \
|
||||
test -e "$path"/MAINTAINERS && \
|
||||
test -d "$path"/drivers && \
|
||||
break
|
||||
|
||||
path="$(dirname $path)"
|
||||
path=$(dirname "$path")
|
||||
done
|
||||
|
||||
test -n "$path" || die "Can't find toplevel"
|
||||
@ -40,6 +62,9 @@ switch_to_toplevel()
|
||||
|
||||
checkoptions()
|
||||
{
|
||||
count=$3
|
||||
variant=$4
|
||||
|
||||
/usr/bin/awk '
|
||||
|
||||
/is not set/ {
|
||||
@ -62,114 +87,318 @@ checkoptions()
|
||||
print "Found "a[1]"="a[2]" after generation, had " a[1]"="configs[a[1]]" in Source tree";
|
||||
}
|
||||
}
|
||||
' $1 $2 > .mismatches
|
||||
' "$1" "$2" > .mismatches"${count}"
|
||||
|
||||
if test -s .mismatches
|
||||
checkoptions_error=false
|
||||
if test -s .mismatches"${count}"
|
||||
then
|
||||
echo "Error: Mismatches found in configuration files"
|
||||
cat .mismatches
|
||||
exit 1
|
||||
while read -r LINE
|
||||
do
|
||||
if find "${REDHAT}"/configs -name "$(echo "$LINE" | awk -F "=" ' { print $1 } ' | awk ' { print $2 }')" -print0 | xargs -0 grep ^ | grep -q "process_configs_known_broken"; then
|
||||
# This is a known broken config.
|
||||
# See script help warning.
|
||||
checkoptions_error=false
|
||||
else
|
||||
checkoptions_error=true
|
||||
break
|
||||
fi
|
||||
done < .mismatches"${count}"
|
||||
|
||||
! $checkoptions_error && return
|
||||
|
||||
sed -i "1s/^/Error: Mismatches found in configuration files for ${arch} ${variant}\n/" .mismatches"${count}"
|
||||
else
|
||||
rm -f .mismatches"${count}"
|
||||
fi
|
||||
}
|
||||
|
||||
parsenewconfigs()
|
||||
{
|
||||
tmpdir=$(mktemp -d)
|
||||
|
||||
# This awk script reads the output of make listnewconfig
|
||||
# and puts it into CONFIG_FOO files. Using the output of
|
||||
# listnewconfig is much easier to ensure we get the default
|
||||
# output.
|
||||
/usr/bin/awk -v BASE="$tmpdir" '
|
||||
/is not set/ {
|
||||
split ($0, a, "#");
|
||||
split(a[2], b);
|
||||
OUT_FILE=BASE"/"b[1];
|
||||
print $0 >> OUT_FILE;
|
||||
}
|
||||
|
||||
/=/ {
|
||||
split ($0, a, "=");
|
||||
OUT_FILE=BASE"/"a[1];
|
||||
if (a[2] == "n")
|
||||
print "# " a[1] " is not set" >> OUT_FILE;
|
||||
else
|
||||
print $0 >> OUT_FILE;
|
||||
}
|
||||
|
||||
' .newoptions
|
||||
|
||||
# This awk script parses the output of helpnewconfig.
|
||||
# Each option is separated between ----- markers
|
||||
# The goal is to put all the help text as a comment in
|
||||
# each CONFIG_FOO file. Because of how awk works
|
||||
# there's a lot of moving files around and catting to
|
||||
# get what we need.
|
||||
/usr/bin/awk -v BASE="$tmpdir" '
|
||||
BEGIN { inpatch=0;
|
||||
outfile="none";
|
||||
symbol="none"; }
|
||||
/^Symbol: .*$/ {
|
||||
split($0, a, " ");
|
||||
symbol="CONFIG_"a[2];
|
||||
outfile=BASE "/fake_"symbol
|
||||
}
|
||||
/-----/ {
|
||||
if (inpatch == 0) {
|
||||
inpatch = 1;
|
||||
}
|
||||
else {
|
||||
if (symbol != "none") {
|
||||
system("cat " outfile " " BASE "/" symbol " > " BASE "/tmpf");
|
||||
system("mv " BASE "/tmpf " BASE "/" symbol);
|
||||
symbol="none"
|
||||
}
|
||||
outfile="none"
|
||||
inpatch = 0;
|
||||
}
|
||||
}
|
||||
!/-----/ {
|
||||
if (inpatch == 1 && outfile != "none") {
|
||||
print "# "$0 >> outfile;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
' .helpnewconfig
|
||||
|
||||
pushd "$tmpdir" &> /dev/null
|
||||
rm fake_*
|
||||
popd &> /dev/null
|
||||
for f in "$tmpdir"/*; do
|
||||
[[ -e "$f" ]] || break
|
||||
cp "$f" "$SCRIPT_DIR/pending$FLAVOR/generic/"
|
||||
done
|
||||
|
||||
rm -rf "$tmpdir"
|
||||
}
|
||||
|
||||
function commit_new_configs()
|
||||
{
|
||||
# assume we are in $source_tree/configs, need to get to top level
|
||||
pushd "$(switch_to_toplevel)" &>/dev/null
|
||||
|
||||
for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}"*.config
|
||||
do
|
||||
arch=$(head -1 "$cfg" | cut -b 3-)
|
||||
cfgtmp="${cfg}.tmp"
|
||||
cfgorig="${cfg}.orig"
|
||||
cat "$cfg" > "$cfgorig"
|
||||
|
||||
if [ "$arch" = "EMPTY" ]
|
||||
then
|
||||
# This arch is intentionally left blank
|
||||
continue
|
||||
fi
|
||||
echo -n "Checking for new configs in $cfg ... "
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
make ${MAKEOPTS} ARCH="$arch" CROSS_COMPILE="$(get_cross_compile "$arch")" KCONFIG_CONFIG="$cfgorig" listnewconfig >& .listnewconfig
|
||||
grep -E 'CONFIG_' .listnewconfig > .newoptions
|
||||
if test -s .newoptions
|
||||
then
|
||||
# shellcheck disable=SC2086
|
||||
make ${MAKEOPTS} ARCH="$arch" CROSS_COMPILE="$(get_cross_compile "$arch")" KCONFIG_CONFIG="$cfgorig" helpnewconfig >& .helpnewconfig
|
||||
parsenewconfigs
|
||||
fi
|
||||
rm .newoptions
|
||||
echo "done"
|
||||
done
|
||||
|
||||
git add "$SCRIPT_DIR/pending$FLAVOR"
|
||||
git commit -m "[redhat] AUTOMATIC: New configs"
|
||||
}
|
||||
|
||||
function process_config()
|
||||
{
|
||||
local cfg
|
||||
local arch
|
||||
local cfgtmp
|
||||
local cfgorig
|
||||
local count
|
||||
local variant
|
||||
|
||||
cfg=$1
|
||||
count=$2
|
||||
|
||||
arch=$(head -1 "$cfg" | cut -b 3-)
|
||||
|
||||
if [ "$arch" = "EMPTY" ]
|
||||
then
|
||||
# This arch is intentionally left blank
|
||||
return
|
||||
fi
|
||||
|
||||
variant=$(basename "$cfg" | cut -d"-" -f3- | cut -d"." -f1)
|
||||
|
||||
cfgtmp="${cfg}.tmp"
|
||||
cfgorig="${cfg}.orig"
|
||||
cat "$cfg" > "$cfgorig"
|
||||
|
||||
echo "Processing $cfg ... "
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
make ${MAKEOPTS} ARCH="$arch" CROSS_COMPILE="$(get_cross_compile "$arch")" KCONFIG_CONFIG="$cfgorig" listnewconfig >& .listnewconfig"${count}"
|
||||
grep -E 'CONFIG_' .listnewconfig"${count}" > .newoptions"${count}"
|
||||
if test -n "$NEWOPTIONS" && test -s .newoptions"${count}"
|
||||
then
|
||||
echo "Found unset config items in ${arch} ${variant}, please set them to an appropriate value" >> .errors"${count}"
|
||||
cat .newoptions"${count}" >> .errors"${count}"
|
||||
rm .newoptions"${count}"
|
||||
RETURNCODE=1
|
||||
fi
|
||||
rm -f .newoptions"${count}"
|
||||
|
||||
grep -E 'config.*warning' .listnewconfig"${count}" > .warnings"${count}"
|
||||
if test -n "$CHECKWARNINGS" && test -s .warnings"${count}"
|
||||
then
|
||||
echo "Found misconfigured config items in ${arch} ${variant}, please set them to an appropriate value" >> .errors"${count}"
|
||||
cat .warnings"${count}" >> .errors"${count}"
|
||||
fi
|
||||
rm .warnings"${count}"
|
||||
|
||||
rm .listnewconfig"${count}"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
make ${MAKEOPTS} ARCH="$arch" CROSS_COMPILE="$(get_cross_compile "$arch")" KCONFIG_CONFIG="$cfgorig" olddefconfig > /dev/null || exit 1
|
||||
echo "# $arch" > "$cfgtmp"
|
||||
cat "$cfgorig" >> "$cfgtmp"
|
||||
if test -n "$CHECKOPTIONS"
|
||||
then
|
||||
checkoptions "$cfg" "$cfgtmp" "$count" "$variant"
|
||||
fi
|
||||
# if test run, don't overwrite original
|
||||
if test -n "$TESTRUN"
|
||||
then
|
||||
rm -f "$cfgtmp"
|
||||
else
|
||||
mv "$cfgtmp" "$cfg"
|
||||
fi
|
||||
rm -f "$cfgorig"
|
||||
echo "Processing $cfg complete"
|
||||
}
|
||||
|
||||
function process_configs()
|
||||
{
|
||||
# assume we are in $source_tree/configs, need to get to top level
|
||||
pushd $(switch_to_toplevel) &>/dev/null
|
||||
pushd "$(switch_to_toplevel)" &>/dev/null
|
||||
|
||||
for cfg in $SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}*.config
|
||||
# The next line is throwaway code for transition to parallel
|
||||
# processing. Leaving this line in place is harmless, but it can be
|
||||
# removed the next time anyone updates this function.
|
||||
[ -f .mismatches ] && rm -f .mismatches
|
||||
|
||||
count=0
|
||||
for cfg in "$SCRIPT_DIR/${PACKAGE_NAME}${KVERREL}"*.config
|
||||
do
|
||||
arch=$(head -1 $cfg | cut -b 3-)
|
||||
cfgtmp="${cfg}.tmp"
|
||||
cfgorig="${cfg}.orig"
|
||||
cat $cfg > $cfgorig
|
||||
|
||||
echo -n "Processing $cfg ... "
|
||||
|
||||
make ARCH=$arch ${CROSSOPTS} KCONFIG_CONFIG=$cfgorig listnewconfig >& .listnewconfig
|
||||
grep -E 'CONFIG_' .listnewconfig > .newoptions
|
||||
if test -n "$NEWOPTIONS" && test -s .newoptions
|
||||
then
|
||||
echo "Found unset config items, please set them to an appropriate value"
|
||||
cat .newoptions
|
||||
rm .newoptions
|
||||
exit 1
|
||||
if [ "$count" -eq 0 ]; then
|
||||
# do the first one by itself so that tools are built
|
||||
process_config "$cfg" "$count"
|
||||
fi
|
||||
rm .newoptions
|
||||
|
||||
grep -E 'config.*warning' .listnewconfig > .warnings
|
||||
if test -n "$CHECKWARNINGS" && test -s .warnings
|
||||
then
|
||||
echo "Found misconfigured config items, please set them to an appropriate value"
|
||||
cat .warnings
|
||||
rm .warnings
|
||||
exit 1
|
||||
fi
|
||||
rm .warnings
|
||||
|
||||
rm .listnewconfig
|
||||
|
||||
make ARCH=$arch ${CROSSOPTS} KCONFIG_CONFIG=$cfgorig oldnoconfig > /dev/null || exit 1
|
||||
echo "# $arch" > ${cfgtmp}
|
||||
cat "${cfgorig}" >> ${cfgtmp}
|
||||
if test -n "$CHECKOPTIONS"
|
||||
then
|
||||
checkoptions $cfg $cfgtmp
|
||||
fi
|
||||
# if test run, don't overwrite original
|
||||
if test -n "$TESTRUN"
|
||||
then
|
||||
rm ${cfgtmp}
|
||||
else
|
||||
mv ${cfgtmp} ${cfg}
|
||||
fi
|
||||
rm ${cfgorig}
|
||||
echo "done"
|
||||
process_config "$cfg" "$count" &
|
||||
waitpids[${count}]=$!
|
||||
((count++))
|
||||
while [ "$(jobs | grep -c Running)" -ge "$RHJOBS" ]; do :; done
|
||||
done
|
||||
for pid in ${waitpids[*]}; do
|
||||
wait ${pid}
|
||||
done
|
||||
|
||||
rm "$SCRIPT_DIR"/*.config*.old
|
||||
|
||||
if ls .errors* 1> /dev/null 2>&1; then
|
||||
RETURNCODE=1
|
||||
cat .errors*
|
||||
rm .errors* -f
|
||||
fi
|
||||
if ls .mismatches* 1> /dev/null 2>&1; then
|
||||
RETURNCODE=1
|
||||
cat .mismatches*
|
||||
rm .mismatches* -f
|
||||
fi
|
||||
|
||||
popd > /dev/null
|
||||
|
||||
echo "Processed config files are in $SCRIPT_DIR"
|
||||
[ $RETURNCODE -eq 0 ] && echo "Processed config files are in $SCRIPT_DIR"
|
||||
}
|
||||
|
||||
NEWOPTIONS=""
|
||||
CHECKOPTIONS=""
|
||||
CHECKWARNINGS=""
|
||||
NEWOPTIONS=""
|
||||
TESTRUN=""
|
||||
CHECKWARNINGS=""
|
||||
MAKEOPTS=""
|
||||
CC_IS_CLANG=0
|
||||
|
||||
RETURNCODE=0
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
case $key in
|
||||
-a)
|
||||
CHECKOPTIONS="x"
|
||||
NEWOPTIONS="x"
|
||||
CHECKWARNINGS="x"
|
||||
;;
|
||||
-c)
|
||||
CHECKOPTIONS="x"
|
||||
;;
|
||||
-h)
|
||||
usage
|
||||
;;
|
||||
-n)
|
||||
NEWOPTIONS="x"
|
||||
;;
|
||||
-c)
|
||||
CHECKOPTIONS="x"
|
||||
;;
|
||||
-t)
|
||||
TESTRUN="x"
|
||||
;;
|
||||
-w)
|
||||
CHECKWARNINGS="x"
|
||||
;;
|
||||
-z)
|
||||
COMMITNEWCONFIGS="x"
|
||||
;;
|
||||
-m)
|
||||
shift
|
||||
if [ "$1" = "CC=clang" ] || [ "$1" = "LLVM=1" ]; then
|
||||
CC_IS_CLANG=1
|
||||
fi
|
||||
MAKEOPTS="$MAKEOPTS $1"
|
||||
;;
|
||||
*)
|
||||
break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
PACKAGE_NAME="${1:-kernel}" # defines the package name used
|
||||
KVERREL="$(test -n "$2" && echo "-$2" || echo "")"
|
||||
CROSSOPTS="$3"
|
||||
SCRIPT="$(readlink -f $0)"
|
||||
OUTPUT_DIR="$PWD"
|
||||
SCRIPT_DIR="$(dirname $SCRIPT)"
|
||||
KVERREL="$(test -n "$1" && echo "-$1" || echo "")"
|
||||
FLAVOR="$(test -n "$2" && echo "-$2" || echo "-rhel")"
|
||||
# shellcheck disable=SC2015
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
SCRIPT_DIR=$(dirname "$SCRIPT")
|
||||
|
||||
# to handle this script being a symlink
|
||||
cd $SCRIPT_DIR
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
process_configs
|
||||
if test -n "$COMMITNEWCONFIGS"; then
|
||||
commit_new_configs
|
||||
else
|
||||
process_configs
|
||||
fi
|
||||
|
||||
exit $RETURNCODE
|
||||
|
||||
@ -3,19 +3,11 @@
|
||||
---
|
||||
inspections:
|
||||
abidiff: off
|
||||
addedfiles: off
|
||||
badfuncs: off
|
||||
changedfiles: off
|
||||
kmidiff: off
|
||||
kmod: off
|
||||
manpage: off
|
||||
movedfiles: off
|
||||
permissions: off
|
||||
removedfiles: off
|
||||
rpmdeps: off
|
||||
upstream: off
|
||||
subpackages: off
|
||||
|
||||
elf:
|
||||
badfuncs:
|
||||
ignore:
|
||||
- /usr/libexec/ksamples/*
|
||||
- /usr/libexec/kselftests/*
|
||||
@ -24,15 +16,30 @@ emptyrpm:
|
||||
expected_empty:
|
||||
- kernel
|
||||
- kernel-debug
|
||||
- kernel-debug-devel-matched
|
||||
- kernel-devel-matched
|
||||
- kernel-lpae
|
||||
- kernel-zfcpdump
|
||||
- kernel-zfcpdump-devel-matched
|
||||
- kernel-zfcpdump-modules
|
||||
- kernel-rt
|
||||
- kernel-rt-debug
|
||||
|
||||
patches:
|
||||
ignore_list:
|
||||
- linux-kernel-test.patch
|
||||
- patch-5.14-redhat.patch
|
||||
- patch-%{patchversion}-redhat.patch
|
||||
|
||||
types:
|
||||
runpath:
|
||||
ignore:
|
||||
- /usr/src/kernel/*
|
||||
- /usr/libexec/kselftests/bpf/urandom_read
|
||||
- /usr/libexec/kselftests/bpf/no_alu32/urandom_read
|
||||
|
||||
debuginfo:
|
||||
ignore:
|
||||
- /usr/libexec/kselftests/bpf/*
|
||||
- /usr/lib/debug/usr/libexec/perf-core/tests/shell/coresight/*
|
||||
|
||||
elf:
|
||||
ignore:
|
||||
- /usr/libexec/perf-core/tests/shell/coresight/*
|
||||
- /usr/lib/debug/usr/libexec/perf-core/tests/shell/coresight/*
|
||||
|
||||
@ -1,41 +0,0 @@
|
||||
#include <generated/autoconf.h>
|
||||
#include <generated/asm-offsets.h>
|
||||
#include <linux/rh_kabi.h>
|
||||
int main(void)
|
||||
{
|
||||
RH_KABI_ASSERT_EQ_CONST(728, MM_CONTEXT_ID); /* offsetof(struct mm_struct, context.id.counter) */
|
||||
RH_KABI_ASSERT_EQ_CONST(320, S_FRAME_SIZE); /* sizeof(struct pt_regs) */
|
||||
RH_KABI_ASSERT_EQ_CONST(240, S_LR); /* offsetof(struct pt_regs, regs[30]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(288, S_ORIG_ADDR_LIMIT); /* offsetof(struct pt_regs, orig_addr_limit) */
|
||||
RH_KABI_ASSERT_EQ_CONST(256, S_PC); /* offsetof(struct pt_regs, pc) */
|
||||
RH_KABI_ASSERT_EQ_CONST(296, S_PMR_SAVE); /* offsetof(struct pt_regs, pmr_save) */
|
||||
RH_KABI_ASSERT_EQ_CONST(264, S_PSTATE); /* offsetof(struct pt_regs, pstate) */
|
||||
RH_KABI_ASSERT_EQ_CONST(248, S_SP); /* offsetof(struct pt_regs, sp) */
|
||||
RH_KABI_ASSERT_EQ_CONST(304, S_STACKFRAME); /* offsetof(struct pt_regs, stackframe) */
|
||||
RH_KABI_ASSERT_EQ_CONST(280, S_SYSCALLNO); /* offsetof(struct pt_regs, syscallno) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, S_X0); /* offsetof(struct pt_regs, regs[0]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(80, S_X10); /* offsetof(struct pt_regs, regs[10]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(96, S_X12); /* offsetof(struct pt_regs, regs[12]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(112, S_X14); /* offsetof(struct pt_regs, regs[14]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(128, S_X16); /* offsetof(struct pt_regs, regs[16]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(144, S_X18); /* offsetof(struct pt_regs, regs[18]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(160, S_X20); /* offsetof(struct pt_regs, regs[20]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(16, S_X2); /* offsetof(struct pt_regs, regs[2]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(176, S_X22); /* offsetof(struct pt_regs, regs[22]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(192, S_X24); /* offsetof(struct pt_regs, regs[24]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(208, S_X26); /* offsetof(struct pt_regs, regs[26]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(224, S_X28); /* offsetof(struct pt_regs, regs[28]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(32, S_X4); /* offsetof(struct pt_regs, regs[4]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(48, S_X6); /* offsetof(struct pt_regs, regs[6]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(64, S_X8); /* offsetof(struct pt_regs, regs[8]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(3344, THREAD_CPU_CONTEXT); /* offsetof(struct task_struct, thread.cpu_context) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1688, TSK_ACTIVE_MM); /* offsetof(struct task_struct, active_mm) */
|
||||
RH_KABI_ASSERT_EQ_CONST(32, TSK_STACK); /* offsetof(struct task_struct, stack) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1864, TSK_STACK_CANARY); /* offsetof(struct task_struct, stack_canary) */
|
||||
RH_KABI_ASSERT_EQ_CONST(8, TSK_TI_ADDR_LIMIT); /* offsetof(struct task_struct, thread_info.addr_limit) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, TSK_TI_FLAGS); /* offsetof(struct task_struct, thread_info.flags) */
|
||||
RH_KABI_ASSERT_EQ_CONST(16, TSK_TI_PREEMPT); /* offsetof(struct task_struct, thread_info.preempt_count) */
|
||||
RH_KABI_ASSERT_EQ_CONST(80, VMA_VM_FLAGS); /* offsetof(struct vm_area_struct, vm_flags) */
|
||||
RH_KABI_ASSERT_EQ_CONST(64, VMA_VM_MM); /* offsetof(struct vm_area_struct, vm_mm) */
|
||||
return 0;
|
||||
}
|
||||
@ -1,79 +0,0 @@
|
||||
#include <generated/autoconf.h>
|
||||
#include <generated/asm-offsets.h>
|
||||
#include <linux/rh_kabi.h>
|
||||
int main(void)
|
||||
{
|
||||
RH_KABI_ASSERT_EQ_CONST(24, BUG_ENTRY_SIZE); /* sizeof(struct bug_entry) */
|
||||
RH_KABI_ASSERT_EQ_CONST(416, _CCR); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, ccr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(392, _CTR); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, ctr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(440, _DAR); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, dar) */
|
||||
RH_KABI_ASSERT_EQ_CONST(448, _DSISR); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, dsisr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(512, FPSTATE_FPSCR); /* offsetof(struct thread_fp_state, fpscr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(112, GPR0); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[0]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(192, GPR10); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[10]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(200, GPR11); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[11]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(120, GPR1); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[1]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(208, GPR12); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[12]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(216, GPR13); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[13]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(128, GPR2); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[2]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(136, GPR3); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[3]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(144, GPR4); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[4]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(152, GPR5); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[5]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(160, GPR6); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[6]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(168, GPR7); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[7]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(176, GPR8); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[8]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(184, GPR9); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, gpr[9]) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, KSP); /* offsetof(struct thread_struct, ksp) */
|
||||
RH_KABI_ASSERT_EQ_CONST(8, KSP_VSID); /* offsetof(struct thread_struct, ksp_vsid) */
|
||||
RH_KABI_ASSERT_EQ_CONST(400, _LINK); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, link) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1488, MM); /* offsetof(struct task_struct, mm) */
|
||||
RH_KABI_ASSERT_EQ_CONST(920, MMCONTEXTID); /* offsetof(struct mm_struct, context.id) */
|
||||
RH_KABI_ASSERT_EQ_CONST(376, _MSR); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, msr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(368, _NIP); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, nip) */
|
||||
RH_KABI_ASSERT_EQ_CONST(384, ORIG_GPR3); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, orig_gpr3) */
|
||||
RH_KABI_ASSERT_EQ_CONST(3328, PACA_CANARY); /* offsetof(struct paca_struct, canary) */
|
||||
RH_KABI_ASSERT_EQ_CONST(464, _PPR); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, ppr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1240, PT_CKPT_REGS); /* offsetof(struct thread_struct, ckpt_regs) */
|
||||
RH_KABI_ASSERT_EQ_CONST(16, PT_REGS); /* offsetof(struct thread_struct, regs) */
|
||||
RH_KABI_ASSERT_EQ_CONST(456, RESULT); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, result) */
|
||||
RH_KABI_ASSERT_EQ_CONST(424, SOFTE); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, softe) */
|
||||
RH_KABI_ASSERT_EQ_CONST(480, SWITCH_FRAME_SIZE); /* STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1768, TASK_CANARY); /* offsetof(struct task_struct, stack_canary) */
|
||||
RH_KABI_ASSERT_EQ_CONST(3168, THREAD); /* offsetof(struct task_struct, thread) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1632, THREAD_CKFPSTATE); /* offsetof(struct thread_struct, ckfp_state.fpr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(2688, THREAD_CKVRSAVE); /* offsetof(struct thread_struct, ckvrsave) */
|
||||
RH_KABI_ASSERT_EQ_CONST(2160, THREAD_CKVRSTATE); /* offsetof(struct thread_struct, ckvr_state.vr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(568, THREAD_FPEXC_MODE); /* offsetof(struct thread_struct, fpexc_mode) */
|
||||
RH_KABI_ASSERT_EQ_CONST(560, THREAD_FPSAVEAREA); /* offsetof(struct thread_struct, fp_save_area) */
|
||||
RH_KABI_ASSERT_EQ_CONST(32, THREAD_FPSTATE); /* offsetof(struct thread_struct, fp_state.fpr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(648, THREAD_LOAD_FP); /* offsetof(struct thread_struct, load_fp) */
|
||||
RH_KABI_ASSERT_EQ_CONST(649, THREAD_LOAD_VEC); /* offsetof(struct thread_struct, load_vec) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1624, THREAD_TM_DSCR); /* offsetof(struct thread_struct, tm_dscr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1616, THREAD_TM_PPR); /* offsetof(struct thread_struct, tm_ppr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1608, THREAD_TM_TAR); /* offsetof(struct thread_struct, tm_tar) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1224, THREAD_TM_TEXASR); /* offsetof(struct thread_struct, tm_texasr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1216, THREAD_TM_TFHAR); /* offsetof(struct thread_struct, tm_tfhar) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1232, THREAD_TM_TFIAR); /* offsetof(struct thread_struct, tm_tfiar) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1200, THREAD_USED_VR); /* offsetof(struct thread_struct, used_vr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1204, THREAD_USED_VSR); /* offsetof(struct thread_struct, used_vsr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1192, THREAD_VRSAVE); /* offsetof(struct thread_struct, vrsave) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1184, THREAD_VRSAVEAREA); /* offsetof(struct thread_struct, vr_save_area) */
|
||||
RH_KABI_ASSERT_EQ_CONST(656, THREAD_VRSTATE); /* offsetof(struct thread_struct, vr_state.vr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(8, TI_CPU); /* offsetof(struct thread_info, cpu) */
|
||||
RH_KABI_ASSERT_EQ_CONST(128, TI_FLAGS); /* offsetof(struct thread_info, flags) */
|
||||
RH_KABI_ASSERT_EQ_CONST(24, TI_livepatch_sp); /* offsetof(struct thread_info, livepatch_sp) */
|
||||
RH_KABI_ASSERT_EQ_CONST(16, TI_LOCAL_FLAGS); /* offsetof(struct thread_info, local_flags) */
|
||||
RH_KABI_ASSERT_EQ_CONST(12, TI_PREEMPT); /* offsetof(struct thread_info, preempt_count) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, TI_TASK); /* offsetof(struct thread_info, task) */
|
||||
RH_KABI_ASSERT_EQ_CONST(496, TM_FRAME_SIZE); /* STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16 */
|
||||
RH_KABI_ASSERT_EQ_CONST(432, _TRAP); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, trap) */
|
||||
RH_KABI_ASSERT_EQ_CONST(4, TSPC32_TV_NSEC); /* offsetof(struct compat_timespec, tv_nsec) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, TSPC32_TV_SEC); /* offsetof(struct compat_timespec, tv_sec) */
|
||||
RH_KABI_ASSERT_EQ_CONST(8, TSPC64_TV_NSEC); /* offsetof(struct timespec, tv_nsec) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, TSPC64_TV_SEC); /* offsetof(struct timespec, tv_sec) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, TVAL64_TV_SEC); /* offsetof(struct timeval, tv_sec) */
|
||||
RH_KABI_ASSERT_EQ_CONST(8, TVAL64_TV_USEC); /* offsetof(struct timeval, tv_usec) */
|
||||
RH_KABI_ASSERT_EQ_CONST(512, VRSTATE_VSCR); /* offsetof(struct thread_vr_state, vscr) */
|
||||
RH_KABI_ASSERT_EQ_CONST(408, _XER); /* STACK_FRAME_OVERHEAD + offsetof(struct pt_regs, xer) */
|
||||
return 0;
|
||||
}
|
||||
@ -1,29 +0,0 @@
|
||||
#include <generated/autoconf.h>
|
||||
#include <generated/asm-offsets.h>
|
||||
#include <linux/rh_kabi.h>
|
||||
int main(void)
|
||||
{
|
||||
RH_KABI_ASSERT_EQ_CONST(0, __PT_ARGS); /* offsetof(struct pt_regs, args) */
|
||||
RH_KABI_ASSERT_EQ_CONST(176, __PT_FLAGS); /* offsetof(struct pt_regs, flags) */
|
||||
RH_KABI_ASSERT_EQ_CONST(24, __PT_GPRS); /* offsetof(struct pt_regs, gprs) */
|
||||
RH_KABI_ASSERT_EQ_CONST(160, __PT_INT_CODE); /* offsetof(struct pt_regs, int_code) */
|
||||
RH_KABI_ASSERT_EQ_CONST(164, __PT_INT_PARM); /* offsetof(struct pt_regs, int_parm) */
|
||||
RH_KABI_ASSERT_EQ_CONST(168, __PT_INT_PARM_LONG); /* offsetof(struct pt_regs, int_parm_long) */
|
||||
RH_KABI_ASSERT_EQ_CONST(152, __PT_ORIG_GPR2); /* offsetof(struct pt_regs, orig_gpr2) */
|
||||
RH_KABI_ASSERT_EQ_CONST(8, __PT_PSW); /* offsetof(struct pt_regs, psw) */
|
||||
RH_KABI_ASSERT_EQ_CONST(184, __PT_SIZE); /* sizeof(struct pt_regs) */
|
||||
RH_KABI_ASSERT_EQ_CONST(1984, __TASK_pid); /* offsetof(struct task_struct, pid) */
|
||||
RH_KABI_ASSERT_EQ_CONST(16, __TASK_stack); /* offsetof(struct task_struct, stack) */
|
||||
RH_KABI_ASSERT_EQ_CONST(3256, __TASK_thread); /* offsetof(struct task_struct, thread) */
|
||||
RH_KABI_ASSERT_EQ_CONST(560, __THREAD_FPU_fpc); /* offsetof(struct thread_struct, fpu.fpc) */
|
||||
RH_KABI_ASSERT_EQ_CONST(568, __THREAD_FPU_regs); /* offsetof(struct thread_struct, fpu.regs) */
|
||||
RH_KABI_ASSERT_EQ_CONST(64, __THREAD_ksp); /* offsetof(struct thread_struct, ksp) */
|
||||
RH_KABI_ASSERT_EQ_CONST(216, __THREAD_last_break); /* offsetof(struct thread_struct, last_break) */
|
||||
RH_KABI_ASSERT_EQ_CONST(184, __THREAD_per_address); /* offsetof(struct thread_struct, per_event.address) */
|
||||
RH_KABI_ASSERT_EQ_CONST(176, __THREAD_per_cause); /* offsetof(struct thread_struct, per_event.cause) */
|
||||
RH_KABI_ASSERT_EQ_CONST(192, __THREAD_per_paid); /* offsetof(struct thread_struct, per_event.paid) */
|
||||
RH_KABI_ASSERT_EQ_CONST(112, __THREAD_sysc_table); /* offsetof(struct thread_struct, sys_call_table) */
|
||||
RH_KABI_ASSERT_EQ_CONST(272, __THREAD_trap_tdb); /* offsetof(struct thread_struct, trap_tdb) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, __TI_flags); /* offsetof(struct task_struct, thread_info.flags) */
|
||||
return 0;
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
#include <generated/autoconf.h>
|
||||
#include <generated/asm-offsets.h>
|
||||
#include <linux/rh_kabi.h>
|
||||
int main(void)
|
||||
{
|
||||
RH_KABI_ASSERT_EQ_CONST(64, crypto_tfm_ctx_offset); /* offsetof(struct crypto_tfm, __crt_ctx) */
|
||||
RH_KABI_ASSERT_EQ_CONST(24, PARAVIRT_PATCH_pv_cpu_ops); /* offsetof(struct paravirt_patch_template, pv_cpu_ops) */
|
||||
RH_KABI_ASSERT_EQ_CONST(296, PARAVIRT_PATCH_pv_irq_ops); /* offsetof(struct paravirt_patch_template, pv_irq_ops) */
|
||||
RH_KABI_ASSERT_EQ_CONST(32, pt_regs_bp); /* offsetof(struct pt_regs, bp) */
|
||||
RH_KABI_ASSERT_EQ_CONST(40, pt_regs_bx); /* offsetof(struct pt_regs, bx) */
|
||||
RH_KABI_ASSERT_EQ_CONST(88, pt_regs_cx); /* offsetof(struct pt_regs, cx) */
|
||||
RH_KABI_ASSERT_EQ_CONST(112, pt_regs_di); /* offsetof(struct pt_regs, di) */
|
||||
RH_KABI_ASSERT_EQ_CONST(96, pt_regs_dx); /* offsetof(struct pt_regs, dx) */
|
||||
RH_KABI_ASSERT_EQ_CONST(144, pt_regs_flags); /* offsetof(struct pt_regs, flags) */
|
||||
RH_KABI_ASSERT_EQ_CONST(56, pt_regs_r10); /* offsetof(struct pt_regs, r10) */
|
||||
RH_KABI_ASSERT_EQ_CONST(48, pt_regs_r11); /* offsetof(struct pt_regs, r11) */
|
||||
RH_KABI_ASSERT_EQ_CONST(24, pt_regs_r12); /* offsetof(struct pt_regs, r12) */
|
||||
RH_KABI_ASSERT_EQ_CONST(16, pt_regs_r13); /* offsetof(struct pt_regs, r13) */
|
||||
RH_KABI_ASSERT_EQ_CONST(8, pt_regs_r14); /* offsetof(struct pt_regs, r14) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, pt_regs_r15); /* offsetof(struct pt_regs, r15) */
|
||||
RH_KABI_ASSERT_EQ_CONST(72, pt_regs_r8); /* offsetof(struct pt_regs, r8) */
|
||||
RH_KABI_ASSERT_EQ_CONST(64, pt_regs_r9); /* offsetof(struct pt_regs, r9) */
|
||||
RH_KABI_ASSERT_EQ_CONST(104, pt_regs_si); /* offsetof(struct pt_regs, si) */
|
||||
RH_KABI_ASSERT_EQ_CONST(168, PTREGS_SIZE); /* sizeof(struct pt_regs) */
|
||||
RH_KABI_ASSERT_EQ_CONST(152, pt_regs_sp); /* offsetof(struct pt_regs, sp) */
|
||||
RH_KABI_ASSERT_EQ_CONST(240, PV_CPU_iret); /* offsetof(struct pv_cpu_ops, iret) */
|
||||
RH_KABI_ASSERT_EQ_CONST(248, PV_CPU_swapgs); /* offsetof(struct pv_cpu_ops, swapgs) */
|
||||
RH_KABI_ASSERT_EQ_CONST(232, PV_CPU_usergs_sysret64); /* offsetof(struct pv_cpu_ops, usergs_sysret64) */
|
||||
RH_KABI_ASSERT_EQ_CONST(16, PV_IRQ_irq_disable); /* offsetof(struct pv_irq_ops, irq_disable) */
|
||||
RH_KABI_ASSERT_EQ_CONST(24, PV_IRQ_irq_enable); /* offsetof(struct pv_irq_ops, irq_enable) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, PV_MMU_read_cr2); /* offsetof(struct pv_mmu_ops, read_cr2) */
|
||||
RH_KABI_ASSERT_EQ_CONST(5144, TASK_addr_limit); /* offsetof(struct task_struct, thread.addr_limit) */
|
||||
RH_KABI_ASSERT_EQ_CONST(2312, TASK_stack_canary); /* offsetof(struct task_struct, stack_canary) */
|
||||
RH_KABI_ASSERT_EQ_CONST(5016, TASK_threadsp); /* offsetof(struct task_struct, thread.sp) */
|
||||
RH_KABI_ASSERT_EQ_CONST(0, TASK_TI_flags); /* offsetof(struct task_struct, thread_info.flags) */
|
||||
return 0;
|
||||
}
|
||||
BIN
SOURCES/uki-sb-cert-x86_64-almalinux.crt
Normal file
BIN
SOURCES/uki-sb-cert-x86_64-almalinux.crt
Normal file
Binary file not shown.
12
SOURCES/update_scripts.sh
Executable file
12
SOURCES/update_scripts.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$1" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TARGET="$1"
|
||||
|
||||
for i in "$RPM_SOURCE_DIR"/*."$TARGET"; do
|
||||
NEW=${i%.$TARGET}
|
||||
cp "$i" "$(basename "$NEW")"
|
||||
done
|
||||
@ -5,9 +5,9 @@ prompt = no
|
||||
x509_extensions = myexts
|
||||
|
||||
[ req_distinguished_name ]
|
||||
O = Red Hat
|
||||
CN = Red Hat Enterprise Linux kernel signing key
|
||||
emailAddress = secalert@redhat.com
|
||||
O = AlmaLinux
|
||||
CN = AlmaLinux kernel signing key
|
||||
emailAddress = security@almalinux.org
|
||||
|
||||
[ myexts ]
|
||||
basicConstraints=critical,CA:FALSE
|
||||
16
SOURCES/x509.genkey.rhel
Normal file
16
SOURCES/x509.genkey.rhel
Normal file
@ -0,0 +1,16 @@
|
||||
[ req ]
|
||||
default_bits = 3072
|
||||
distinguished_name = req_distinguished_name
|
||||
prompt = no
|
||||
x509_extensions = myexts
|
||||
|
||||
[ req_distinguished_name ]
|
||||
O = AlmaLinux
|
||||
CN = AlmaLinux kernel signing key
|
||||
emailAddress = security@almalinux.org
|
||||
|
||||
[ myexts ]
|
||||
basicConstraints=critical,CA:FALSE
|
||||
keyUsage=digitalSignature
|
||||
subjectKeyIdentifier=hash
|
||||
authorityKeyIdentifier=keyid
|
||||
194562
SPECS/kernel.spec
194562
SPECS/kernel.spec
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user