Skip to content

Commit ef591a5

Browse files
이건호michal42
authored andcommitted
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. Signed-off-by: Gunho Lee <gunho.lee@lge.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
1 parent 70cfe02 commit ef591a5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/Makefile.modinst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include scripts/Kbuild.include
99

1010
#
1111

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

1515
PHONY += $(modules)

‎scripts/Makefile.modpost‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ kernelsymfile := $(objtree)/Module.symvers
6060
modulesymfile := $(firstword $(KBUILD_EXTMOD))/Module.symvers
6161

6262
# Step 1), find all modules listed in $(MODVERDIR)/
63-
__modules := $(sort $(shell grep -h '\.ko' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
63+
__modules := $(sort $(shell grep -h '\.ko$$' /dev/null $(wildcard $(MODVERDIR)/*.mod)))
6464
modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o)))
6565

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

0 commit comments

Comments
 (0)