Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Matthew Maurer and committed by
Masahiro Yamada
e8639b7e fc7d5e32

+23 -2
+15
kernel/module/Kconfig
··· 217 217 The most likely reason you would enable this is to enable Rust 218 218 support. If unsure, say N. 219 219 220 + config BASIC_MODVERSIONS 221 + bool "Basic Module Versioning Support" 222 + depends on MODVERSIONS 223 + default y 224 + help 225 + This enables basic MODVERSIONS support, allowing older tools or 226 + kernels to potentially load modules. 227 + 228 + Disabling this may cause older `modprobe` or `kmod` to be unable 229 + to read MODVERSIONS information from built modules. With this 230 + disabled, older kernels may treat this module as unversioned. 231 + 232 + This is enabled by default when MODVERSIONS are enabled. 233 + If unsure, say Y. 234 + 220 235 config MODULE_SRCVERSION_ALL 221 236 bool "Source checksum for all modules" 222 237 help
+1
scripts/Makefile.modpost
··· 43 43 modpost-args = \ 44 44 $(if $(CONFIG_MODULES),-M) \ 45 45 $(if $(CONFIG_MODVERSIONS),-m) \ 46 + $(if $(CONFIG_BASIC_MODVERSIONS),-b) \ 46 47 $(if $(CONFIG_EXTENDED_MODVERSIONS),-x) \ 47 48 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a) \ 48 49 $(if $(CONFIG_SECTION_MISMATCH_WARN_ONLY),,-E) \
+7 -2
scripts/mod/modpost.c
··· 33 33 static bool modversions; 34 34 /* Is CONFIG_MODULE_SRCVERSION_ALL set? */ 35 35 static bool all_versions; 36 + /* Is CONFIG_BASIC_MODVERSIONS set? */ 37 + static bool basic_modversions; 36 38 /* Is CONFIG_EXTENDED_MODVERSIONS set? */ 37 39 static bool extended_modversions; 38 40 /* If we are modposting external module set to 1 */ ··· 1859 1857 { 1860 1858 struct symbol *s; 1861 1859 1862 - if (!modversions) 1860 + if (!basic_modversions) 1863 1861 return; 1864 1862 1865 1863 buf_printf(b, "\n"); ··· 2179 2177 LIST_HEAD(dump_lists); 2180 2178 struct dump_list *dl, *dl2; 2181 2179 2182 - while ((opt = getopt(argc, argv, "ei:MmnT:to:au:WwENd:x")) != -1) { 2180 + while ((opt = getopt(argc, argv, "ei:MmnT:to:au:WwENd:xb")) != -1) { 2183 2181 switch (opt) { 2184 2182 case 'e': 2185 2183 external_module = true; ··· 2227 2225 break; 2228 2226 case 'd': 2229 2227 missing_namespace_deps = optarg; 2228 + break; 2229 + case 'b': 2230 + basic_modversions = true; 2230 2231 break; 2231 2232 case 'x': 2232 2233 extended_modversions = true;