diff mbox series

[v1,1/6] module: Have kernel/module/ dedicated to CONFIG_MODULES

Message ID fae2502b6492059cfd9bbf2c3b5a00e8048f5b90.1645526008.git.christophe.leroy@csgroup.eu (mailing list archive)
State Superseded
Headers show
Series Miscellaneous cleanups | expand

Commit Message

Christophe Leroy Feb. 22, 2022, 10:38 a.m. UTC
Move signature.c back into kernel/ because it is used by
more than modules.

Then build kernel/module/ only when CONFIG_MODULES is selected.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
Ideally this patch should be squashed in Aaron's series patch 1
---
 kernel/Makefile                                   | 3 ++-
 kernel/module/Makefile                            | 5 +----
 kernel/{module/signature.c => module_signature.c} | 0
 3 files changed, 3 insertions(+), 5 deletions(-)
 rename kernel/{module/signature.c => module_signature.c} (100%)
diff mbox series

Patch

diff --git a/kernel/Makefile b/kernel/Makefile
index 04cb6932c0d3..717075b65deb 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -52,7 +52,7 @@  obj-y += rcu/
 obj-y += livepatch/
 obj-y += dma/
 obj-y += entry/
-obj-y += module/
+obj-$(CONFIG_MODULES) += module/
 
 obj-$(CONFIG_KCMP) += kcmp.o
 obj-$(CONFIG_FREEZER) += freezer.o
@@ -66,6 +66,7 @@  ifneq ($(CONFIG_SMP),y)
 obj-y += up.o
 endif
 obj-$(CONFIG_UID16) += uid16.o
+obj-$(CONFIG_MODULE_SIG_FORMAT) += module_signature.o
 obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
 obj-$(CONFIG_CRASH_CORE) += crash_core.o
diff --git a/kernel/module/Makefile b/kernel/module/Makefile
index b57953bd47eb..5fe90d246fcc 100644
--- a/kernel/module/Makefile
+++ b/kernel/module/Makefile
@@ -7,12 +7,10 @@ 
 # and produce insane amounts of uninteresting coverage.
 KCOV_INSTRUMENT_main.o := n
 
-obj-$(CONFIG_MODULES) += main.o
+obj-y += main.o
 obj-$(CONFIG_MODULE_DECOMPRESS) += decompress.o
 obj-$(CONFIG_MODULE_SIG) += signing.o
-obj-$(CONFIG_MODULE_SIG_FORMAT) += signature.o
 obj-$(CONFIG_LIVEPATCH) += livepatch.o
-ifdef CONFIG_MODULES
 obj-$(CONFIG_MODULES_TREE_LOOKUP) += tree_lookup.o
 obj-$(CONFIG_STRICT_MODULE_RWX) += strict_rwx.o
 obj-$(CONFIG_DEBUG_KMEMLEAK) += debug_kmemleak.o
@@ -20,4 +18,3 @@  obj-$(CONFIG_KALLSYMS) += kallsyms.o
 obj-$(CONFIG_PROC_FS) += procfs.o
 obj-$(CONFIG_SYSFS) += sysfs.o
 obj-$(CONFIG_MODVERSIONS) += version.o
-endif
diff --git a/kernel/module/signature.c b/kernel/module_signature.c
similarity index 100%
rename from kernel/module/signature.c
rename to kernel/module_signature.c