mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-04-13 09:59:31 +00:00
modpost: Allow extended modversions without basic MODVERSIONS
If you know that your kernel modules will only ever be loaded by a newer kernel, you can disable BASIC_MODVERSIONS to save space. This also allows easy creation of test modules to see how tooling will respond to modules that only have the new format. Signed-off-by: Matthew Maurer <mmaurer@google.com> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
This commit is contained in:
parent
fc7d5e3210
commit
e8639b7ef0
3 changed files with 23 additions and 2 deletions
|
@ -217,6 +217,21 @@ config EXTENDED_MODVERSIONS
|
||||||
The most likely reason you would enable this is to enable Rust
|
The most likely reason you would enable this is to enable Rust
|
||||||
support. If unsure, say N.
|
support. If unsure, say N.
|
||||||
|
|
||||||
|
config BASIC_MODVERSIONS
|
||||||
|
bool "Basic Module Versioning Support"
|
||||||
|
depends on MODVERSIONS
|
||||||
|
default y
|
||||||
|
help
|
||||||
|
This enables basic MODVERSIONS support, allowing older tools or
|
||||||
|
kernels to potentially load modules.
|
||||||
|
|
||||||
|
Disabling this may cause older `modprobe` or `kmod` to be unable
|
||||||
|
to read MODVERSIONS information from built modules. With this
|
||||||
|
disabled, older kernels may treat this module as unversioned.
|
||||||
|
|
||||||
|
This is enabled by default when MODVERSIONS are enabled.
|
||||||
|
If unsure, say Y.
|
||||||
|
|
||||||
config MODULE_SRCVERSION_ALL
|
config MODULE_SRCVERSION_ALL
|
||||||
bool "Source checksum for all modules"
|
bool "Source checksum for all modules"
|
||||||
help
|
help
|
||||||
|
|
|
@ -43,6 +43,7 @@ MODPOST = $(objtree)/scripts/mod/modpost
|
||||||
modpost-args = \
|
modpost-args = \
|
||||||
$(if $(CONFIG_MODULES),-M) \
|
$(if $(CONFIG_MODULES),-M) \
|
||||||
$(if $(CONFIG_MODVERSIONS),-m) \
|
$(if $(CONFIG_MODVERSIONS),-m) \
|
||||||
|
$(if $(CONFIG_BASIC_MODVERSIONS),-b) \
|
||||||
$(if $(CONFIG_EXTENDED_MODVERSIONS),-x) \
|
$(if $(CONFIG_EXTENDED_MODVERSIONS),-x) \
|
||||||
$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \
|
$(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \
|
||||||
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
|
$(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
|
||||||
|
|
|
@ -33,6 +33,8 @@ static bool module_enabled;
|
||||||
static bool modversions;
|
static bool modversions;
|
||||||
/* Is CONFIG_MODULE_SRCVERSION_ALL set? */
|
/* Is CONFIG_MODULE_SRCVERSION_ALL set? */
|
||||||
static bool all_versions;
|
static bool all_versions;
|
||||||
|
/* Is CONFIG_BASIC_MODVERSIONS set? */
|
||||||
|
static bool basic_modversions;
|
||||||
/* Is CONFIG_EXTENDED_MODVERSIONS set? */
|
/* Is CONFIG_EXTENDED_MODVERSIONS set? */
|
||||||
static bool extended_modversions;
|
static bool extended_modversions;
|
||||||
/* If we are modposting external module set to 1 */
|
/* If we are modposting external module set to 1 */
|
||||||
|
@ -1857,7 +1859,7 @@ static void add_versions(struct buffer *b, struct module *mod)
|
||||||
{
|
{
|
||||||
struct symbol *s;
|
struct symbol *s;
|
||||||
|
|
||||||
if (!modversions)
|
if (!basic_modversions)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
buf_printf(b, "\n");
|
buf_printf(b, "\n");
|
||||||
|
@ -2177,7 +2179,7 @@ int main(int argc, char **argv)
|
||||||
LIST_HEAD(dump_lists);
|
LIST_HEAD(dump_lists);
|
||||||
struct dump_list *dl, *dl2;
|
struct dump_list *dl, *dl2;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "ei:MmnT:to:au:WwENd:x")) != -1) {
|
while ((opt = getopt(argc, argv, "ei:MmnT:to:au:WwENd:xb")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'e':
|
case 'e':
|
||||||
external_module = true;
|
external_module = true;
|
||||||
|
@ -2226,6 +2228,9 @@ int main(int argc, char **argv)
|
||||||
case 'd':
|
case 'd':
|
||||||
missing_namespace_deps = optarg;
|
missing_namespace_deps = optarg;
|
||||||
break;
|
break;
|
||||||
|
case 'b':
|
||||||
|
basic_modversions = true;
|
||||||
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
extended_modversions = true;
|
extended_modversions = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue