linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts/Makefile.modpost: error in finding modules from .mod files.
@ 2012-08-29  6:23 이건호
  0 siblings, 0 replies; 3+ messages in thread
From: 이건호 @ 2012-08-29  6:23 UTC (permalink / raw)
  To: 'Michal Marek'; +Cc: linux-kbuild, linux-kernel

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@lge.com <gunho@swc-osl.(none)>
---
 scripts/Makefile.modinst |    2 +-
 scripts/Makefile.modpost |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index efa5d94..3d13d3a 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -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)
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 08dce14..a1cb022 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -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
-- 
1.6.3.3



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scripts/Makefile.modpost: error in finding modules from .mod files.
  2012-08-29 13:58 이건호
@ 2012-08-31 15:47 ` Michal Marek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Marek @ 2012-08-31 15:47 UTC (permalink / raw)
  To: 이건호; +Cc: linux-kbuild, linux-kernel

On Wed, Aug 29, 2012 at 10:58:12PM +0900, 이건호 wrote:
> 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>

Good catch, applied to kbuild.git#kbuild. BTW, your mailer (gmail?)
broke the log lines into two. I fixed it manually, but it makes the
recipient's life easier if you send your patches either using
git-send-email or a mailer that does not mangle the message (see
Documentation/email-clients.txt).

Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] scripts/Makefile.modpost: error in finding modules from .mod files.
@ 2012-08-29 13:58 이건호
  2012-08-31 15:47 ` Michal Marek
  0 siblings, 1 reply; 3+ messages in thread
From: 이건호 @ 2012-08-29 13:58 UTC (permalink / raw)
  To: Michal Marek; +Cc: linux-kbuild, linux-kernel

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>
---
 scripts/Makefile.modinst |    2 +-
 scripts/Makefile.modpost |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/Makefile.modinst b/scripts/Makefile.modinst
index efa5d94..3d13d3a 100644
--- a/scripts/Makefile.modinst
+++ b/scripts/Makefile.modinst
@@ -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)
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 08dce14..a1cb022 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -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
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-31 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-29  6:23 [PATCH] scripts/Makefile.modpost: error in finding modules from .mod files 이건호
2012-08-29 13:58 이건호
2012-08-31 15:47 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).