public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.6.4-rc2: scripts/modpost.c
@ 2004-03-04 11:37 Daniel Mack
  2004-03-04 11:54 ` Andrew Morton
  2004-03-11  0:40 ` Rusty Russell
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Mack @ 2004-03-04 11:37 UTC (permalink / raw)
  To: lkml

(This is is a repost - now with a patch for 2.6.4-rc2).

Hi,

as I found out, it's impossible to use the build-chain tool scripts/modpost
of the 2.6 kernel series to externally build modules from a directory that
contains the character sequence '.o'. Weird things happen if you try to do
so.

With a directory structure like on my system here, building the current DVB
driver in '/home/daniel/cvs.linuxtv.org/dvb-kernel/build-2.6i/' generates a 
file called '/home/daniel/cvs.linuxtv.mod.c' since modpost cuts every 
filename string at the first occurence of '.o', not only the 'trailing .o',
as the comment says.

Here's the patch for 2.6.4-rc2:


--- linux-2.6.4-rc2.orig/scripts/modpost.c      2004-03-04 11:40:21.000000000 +0100
+++ linux-2.6.4-rc2/scripts/modpost.c   2004-03-04 11:23:08.000000000 +0100
@@ -63,16 +63,16 @@
 new_module(char *modname)
 {
        struct module *mod;
-       char *p;
+       int len;
 
        mod = NOFAIL(malloc(sizeof(*mod)));
        memset(mod, 0, sizeof(*mod));
        mod->name = NOFAIL(strdup(modname));
 
        /* strip trailing .o */
-       p = strstr(mod->name, ".o");
-       if (p)
-               *p = 0;
+       len = strlen(mod->name);
+       if (len > 2 && mod->name[len-2] == '.' && mod->name[len-1] == 'o')
+               mod->name[len-2] = 0;
 
        /* add to list */
        mod->next = modules;



Daniel


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <20040304172923.6045760e.rddunlap@osdl.org>]

end of thread, other threads:[~2004-03-11  5:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-04 11:37 [PATCH] 2.6.4-rc2: scripts/modpost.c Daniel Mack
2004-03-04 11:54 ` Andrew Morton
2004-03-04 13:01   ` Daniel Mack
2004-03-11  0:40 ` Rusty Russell
2004-03-11  5:53   ` Sam Ravnborg
     [not found] <20040304172923.6045760e.rddunlap@osdl.org>
2004-03-05  5:24 ` Randy.Dunlap
2004-03-05  6:16   ` Tony Breeds
2004-03-05 12:36   ` Daniel Mack

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox