kernel/0001-modules-add-rhelversion-MODULE_INFO-tag.patch

152 lines
5.1 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Laura Abbott <labbott@redhat.com>
Date: Mon, 7 Jan 2019 21:03:10 +0000
Subject: [PATCH] modules: add rhelversion MODULE_INFO tag
There were several changes in the 5.0-rc1 kernel that required
this patch to be rebased with some context diff.
Patchwork-id: 7379
O-Subject: [kernel team] [RHEL8.0 BZ 1544999 1/2] modules: add rhelversion MODULE_INFO tag
Bugzilla: 1544999
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
RH-Acked-by: Oleg Nesterov <oleg@redhat.com>
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
Bugzilla: http://bugzilla.redhat.com/1544999
kernel-alt commit 9816b4b6ca5d4c0504d8806ce99442c90afbc8e6
Author: Prarit Bhargava <prarit@redhat.com>
Date: Fri Feb 9 18:09:26 2018 -0500
[kernel] modules: add rhelversion MODULE_INFO tag
Message-id: <20180209180926.5955-3-prarit@redhat.com>
Patchwork-id: 205587
O-Subject: [RHEL-ALT-7.5 BZ 1542796 2/2] modules: add rhelversion MODULE_INFO tag
Bugzilla: 1542796
RH-Acked-by: David Arcari <darcari@redhat.com>
RH-Acked-by: Tony Camuso <tcamuso@redhat.com>
RH-Acked-by: Steve Best <sbest@redhat.com>
Bugzilla: http://bugzilla.redhat.com/1542796
rhel7 commit 9af8c3992ce5fff253c49abc0dedb3ec77badba4
Author: Kyle McMartin <kmcmarti@redhat.com>
Date: Fri Sep 12 17:46:12 2014 -0400
[kernel] modules: add rhelversion MODULE_INFO tag
Message-id: <20140912174612.GS29420@redacted.bos.redhat.com>
Patchwork-id: 94052
O-Subject: [RHEL7.1 PATCH 2/6 v4] modules: add rhelversion MODULE_INFO tag
Bugzilla: 1110315
RH-Acked-by: Prarit Bhargava <prarit@redhat.com>
RH-Acked-by: Johannes Weiner <jweiner@redhat.com>
RH-Acked-by: Don Zickus <dzickus@redhat.com>
From: Kyle McMartin <kmcmarti@redhat.com>
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1110315
>From kylem's RHEL8 post:
Let's not lose this ability in RHEL8. Sadly can't be applied to RHEL7
because it breaks KABI due to the struct module change.
Inspired by bits of a147e4729d9920ccae2c717ca65c811cc0f93a1d in RHEL6,
which got lost for RHEL7.0. :/
Kyle is correct and doing this would break RHEL7's KABI. I'm taking this
patch in as a base and the next patch will resolve the KABI issues.
[v2]: dzickus, cleanup add_rhelversion()
[v4]: resubmitted along with 16k stacks change
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Cc: Richard Guy Briggs <rgb@redhat.com>
Cc: Peter Rajnoha <prajnoha@redhat.com>
Cc: Laura Abbott <labbott@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
Upstream Status: RHEL only
Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
Acked-by: Don Zickus <dzickus@redhat.com>
Acked-by: Prarit Bhargava <prarit@redhat.com>
---
include/linux/module.h | 1 +
kernel/module.c | 2 ++
scripts/mod/modpost.c | 8 ++++++++
3 files changed, 11 insertions(+)
diff --git a/include/linux/module.h b/include/linux/module.h
kernel-5.9.0-0.rc1.1 * Mon Aug 17 2020 Fedora Kernel Team <kernel-team@fedoraproject.org> [5.9.0-0.rc1.1] - v5.9-rc1 rebase - Config updates for Fedora ("Justin M. Forbes") - fedora: enable enery model (Peter Robinson) - iio: enable LTR-559 light and proximity sensor (Peter Robinson) - iio: chemical: enable some popular chemical and partical sensors (Peter Robinson) - More mismatches ("Justin M. Forbes") - Fedora config change due to deps ("Justin M. Forbes") - CONFIG_SND_SOC_MAX98390 is now selected by SND_SOC_INTEL_DA7219_MAX98357A_GENERIC ("Justin M. Forbes") - Config change required for build part 2 ("Justin M. Forbes") - Config change required for build ("Justin M. Forbes") - Enable ARM_SMCCC_SOC_ID on all aarch64 kernels (Peter Robinson) - Enable ZSTD compression algorithm on all kernels (Peter Robinson) - Fedora config update ("Justin M. Forbes") - Revert "Merge branch 'make_configs_fix' into 'os-build'" (Justin Forbes) - Use the configs/generic config for SND_HDA_INTEL everywhere (Peter Robinson) - redhat/configs/process_configs.sh: Remove *.config.orig files (Prarit Bhargava) - redhat/configs/process_configs.sh: Add process_configs_known_broken flag (Prarit Bhargava) - redhat/Makefile: Fix '*-configs' targets (Prarit Bhargava) - Updated changelog for the release based on v5.8 (Fedora Kernel Team) - Add ability to sync upstream through Makefile (Don Zickus) - Add master merge check (Don Zickus) - Replace hardcoded values 'os-build' and project id with variables (Don Zickus) - gitattributes: Remove unnecesary export restrictions (Prarit Bhargava) - redhat/Makefile.common: Fix MARKER (Prarit Bhargava) Resolves: rhbz# Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
2020-08-17 16:18:16 +00:00
index e30ed5fa33a7..b960ea38d185 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -371,6 +371,7 @@ struct module {
struct module_attribute *modinfo_attrs;
const char *version;
const char *srcversion;
+ const char *rhelversion;
struct kobject *holders_dir;
/* Exported symbols */
diff --git a/kernel/module.c b/kernel/module.c
kernel-5.9.0-0.rc1.1 * Mon Aug 17 2020 Fedora Kernel Team <kernel-team@fedoraproject.org> [5.9.0-0.rc1.1] - v5.9-rc1 rebase - Config updates for Fedora ("Justin M. Forbes") - fedora: enable enery model (Peter Robinson) - iio: enable LTR-559 light and proximity sensor (Peter Robinson) - iio: chemical: enable some popular chemical and partical sensors (Peter Robinson) - More mismatches ("Justin M. Forbes") - Fedora config change due to deps ("Justin M. Forbes") - CONFIG_SND_SOC_MAX98390 is now selected by SND_SOC_INTEL_DA7219_MAX98357A_GENERIC ("Justin M. Forbes") - Config change required for build part 2 ("Justin M. Forbes") - Config change required for build ("Justin M. Forbes") - Enable ARM_SMCCC_SOC_ID on all aarch64 kernels (Peter Robinson) - Enable ZSTD compression algorithm on all kernels (Peter Robinson) - Fedora config update ("Justin M. Forbes") - Revert "Merge branch 'make_configs_fix' into 'os-build'" (Justin Forbes) - Use the configs/generic config for SND_HDA_INTEL everywhere (Peter Robinson) - redhat/configs/process_configs.sh: Remove *.config.orig files (Prarit Bhargava) - redhat/configs/process_configs.sh: Add process_configs_known_broken flag (Prarit Bhargava) - redhat/Makefile: Fix '*-configs' targets (Prarit Bhargava) - Updated changelog for the release based on v5.8 (Fedora Kernel Team) - Add ability to sync upstream through Makefile (Don Zickus) - Add master merge check (Don Zickus) - Replace hardcoded values 'os-build' and project id with variables (Don Zickus) - gitattributes: Remove unnecesary export restrictions (Prarit Bhargava) - redhat/Makefile.common: Fix MARKER (Prarit Bhargava) Resolves: rhbz# Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
2020-08-17 16:18:16 +00:00
index 1c5cff34d9f2..670ceadd44d2 100644
--- a/kernel/module.c
+++ b/kernel/module.c
kernel-5.9.0-0.rc1.1 * Mon Aug 17 2020 Fedora Kernel Team <kernel-team@fedoraproject.org> [5.9.0-0.rc1.1] - v5.9-rc1 rebase - Config updates for Fedora ("Justin M. Forbes") - fedora: enable enery model (Peter Robinson) - iio: enable LTR-559 light and proximity sensor (Peter Robinson) - iio: chemical: enable some popular chemical and partical sensors (Peter Robinson) - More mismatches ("Justin M. Forbes") - Fedora config change due to deps ("Justin M. Forbes") - CONFIG_SND_SOC_MAX98390 is now selected by SND_SOC_INTEL_DA7219_MAX98357A_GENERIC ("Justin M. Forbes") - Config change required for build part 2 ("Justin M. Forbes") - Config change required for build ("Justin M. Forbes") - Enable ARM_SMCCC_SOC_ID on all aarch64 kernels (Peter Robinson) - Enable ZSTD compression algorithm on all kernels (Peter Robinson) - Fedora config update ("Justin M. Forbes") - Revert "Merge branch 'make_configs_fix' into 'os-build'" (Justin Forbes) - Use the configs/generic config for SND_HDA_INTEL everywhere (Peter Robinson) - redhat/configs/process_configs.sh: Remove *.config.orig files (Prarit Bhargava) - redhat/configs/process_configs.sh: Add process_configs_known_broken flag (Prarit Bhargava) - redhat/Makefile: Fix '*-configs' targets (Prarit Bhargava) - Updated changelog for the release based on v5.8 (Fedora Kernel Team) - Add ability to sync upstream through Makefile (Don Zickus) - Add master merge check (Don Zickus) - Replace hardcoded values 'os-build' and project id with variables (Don Zickus) - gitattributes: Remove unnecesary export restrictions (Prarit Bhargava) - redhat/Makefile.common: Fix MARKER (Prarit Bhargava) Resolves: rhbz# Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
2020-08-17 16:18:16 +00:00
@@ -805,6 +805,7 @@ static struct module_attribute modinfo_##field = { \
MODINFO_ATTR(version);
MODINFO_ATTR(srcversion);
+MODINFO_ATTR(rhelversion);
static char last_unloaded_module[MODULE_NAME_LEN+1];
kernel-5.9.0-0.rc1.1 * Mon Aug 17 2020 Fedora Kernel Team <kernel-team@fedoraproject.org> [5.9.0-0.rc1.1] - v5.9-rc1 rebase - Config updates for Fedora ("Justin M. Forbes") - fedora: enable enery model (Peter Robinson) - iio: enable LTR-559 light and proximity sensor (Peter Robinson) - iio: chemical: enable some popular chemical and partical sensors (Peter Robinson) - More mismatches ("Justin M. Forbes") - Fedora config change due to deps ("Justin M. Forbes") - CONFIG_SND_SOC_MAX98390 is now selected by SND_SOC_INTEL_DA7219_MAX98357A_GENERIC ("Justin M. Forbes") - Config change required for build part 2 ("Justin M. Forbes") - Config change required for build ("Justin M. Forbes") - Enable ARM_SMCCC_SOC_ID on all aarch64 kernels (Peter Robinson) - Enable ZSTD compression algorithm on all kernels (Peter Robinson) - Fedora config update ("Justin M. Forbes") - Revert "Merge branch 'make_configs_fix' into 'os-build'" (Justin Forbes) - Use the configs/generic config for SND_HDA_INTEL everywhere (Peter Robinson) - redhat/configs/process_configs.sh: Remove *.config.orig files (Prarit Bhargava) - redhat/configs/process_configs.sh: Add process_configs_known_broken flag (Prarit Bhargava) - redhat/Makefile: Fix '*-configs' targets (Prarit Bhargava) - Updated changelog for the release based on v5.8 (Fedora Kernel Team) - Add ability to sync upstream through Makefile (Don Zickus) - Add master merge check (Don Zickus) - Replace hardcoded values 'os-build' and project id with variables (Don Zickus) - gitattributes: Remove unnecesary export restrictions (Prarit Bhargava) - redhat/Makefile.common: Fix MARKER (Prarit Bhargava) Resolves: rhbz# Signed-off-by: Justin M. Forbes <jforbes@fedoraproject.org>
2020-08-17 16:18:16 +00:00
@@ -1267,6 +1268,7 @@ static struct module_attribute *modinfo_attrs[] = {
&module_uevent,
&modinfo_version,
&modinfo_srcversion,
+ &modinfo_rhelversion,
&modinfo_initstate,
&modinfo_coresize,
&modinfo_initsize,
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 69341b36f271..dbc63328187c 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -21,6 +21,7 @@
#include <errno.h>
#include "modpost.h"
#include "../../include/linux/license.h"
+#include "../../include/generated/uapi/linux/version.h"
/* Are we using CONFIG_MODVERSIONS? */
static int modversions = 0;
@@ -2393,6 +2394,12 @@ static void write_buf(struct buffer *b, const char *fname)
}
}
+static void add_rhelversion(struct buffer *b, struct module *mod)
+{
+ buf_printf(b, "MODULE_INFO(rhelversion, \"%d.%d\");\n", RHEL_MAJOR,
+ RHEL_MINOR);
+}
+
static void write_if_changed(struct buffer *b, const char *fname)
{
char *tmp;
@@ -2645,6 +2652,7 @@ int main(int argc, char **argv)
add_depends(&buf, mod);
add_moddevtable(&buf, mod);
add_srcversion(&buf, mod);
+ add_rhelversion(&buf, mod);
sprintf(fname, "%s.mod.c", mod->name);
write_if_changed(&buf, fname);
--
2.28.0