Skip to contentSkip to conversation

scripts/Makefile.modpost: error in finding modules from .mod files.

PATCH New 이건호 1 participant 1 message Aug 29, 2012 Kbuild

lore
Share & tools
lore

이건호

author
#0 lore raw

PATCH 1/1 scripts/Makefile.modpost: error in finding modules from .mod files.

This error may happen when the user's id or path includes .ko string. For example, user's id is xxx.ko and building test.ko module, the test.mod file lists ko name and all object files.
/home/xxx.ko/kernel_dev/device/drivers/test.ko /home/xxx.ko/kernel_dev/device/drivers/test_main.o
/home/xxx.ko/kernel_dev/device/drivers/test_io.o ...
Current Makefile.modpost and Makefile.modinst find and list up not only test.ko but also other object files.
because all of object file's path includes .ko string.
This is a patch to fix it.

---
 scripts/Makefile.modinst |    2 +-
 scripts/Makefile.modpost |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
scripts/Makefile.modinst +0 -1
index efa5d94..3d13d3a 100644
@@ -9,7 +9,7 @@ include scripts/Kbuild.include
 
 #
 
-__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard

$(MODVERDIR)/*.mod)))
+__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))

PHONY += $(modules)

scripts/Makefile.modpost +0 -1
index 08dce14..a1cb022 100644
@@ -60,7 +60,7 @@ kernelsymfile := $(objtree)/Module.symvers
 modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
 
 # Step 1), find all modules listed in $(MODVERDIR)/
-__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard

$(MODVERDIR)/*.mod)))
+__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))

# Stop after building .o files if NOFINAL is set. Makes compile tests
quicker

Signature · 1 line
1.6.3.3