Skip to content

Commit

Permalink
scripts/Makefile.modpost: error in finding modules from .mod files.
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Gunho Lee <gunho.lee@lge.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>
  • Loading branch information
이건호 authored and Michal Marek committed Aug 31, 2012
1 parent 70cfe02 commit ef591a5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/Makefile.modinst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scripts/Makefile.modpost
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ef591a5

Please sign in to comment.