mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: Sam Ravnborg <sam@ravnborg.org>, Andrew Morton <akpm@osdl.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [FIX] Replace hard-coded MODVERDIR in modpost
Date: Thu, 16 Sep 2004 16:15:25 +0200	[thread overview]
Message-ID: <1095344125.5552.28.camel@winden.suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 1319 bytes --]

Hello,

when building external modules, MODVERDIR is relative to the
external module instead of in the kernel source tree. Use the
MODVERDIR environment variable instead of the hard-coded path
in modpost.


Index: linux-2.6.8/scripts/mod/sumversion.c
===================================================================
--- linux-2.6.8.orig/scripts/mod/sumversion.c
+++ linux-2.6.8/scripts/mod/sumversion.c
@@ -416,7 +416,8 @@ static int get_version(const char *modna
 	struct md4_ctx md;
 	char *sources, *end, *fname;
 	const char *basename;
-	char filelist[sizeof(".tmp_versions/%s.mod") + strlen(modname)];
+	char filelist[strlen(getenv("MODVERDIR")) + strlen("/") +
+		      strlen(modname) - strlen(".o") + strlen(".mod") + 1 ];
 
 	/* Source files for module are in .tmp_versions/modname.mod,
 	   after the first line. */
@@ -424,9 +425,8 @@ static int get_version(const char *modna
 		basename = strrchr(modname, '/') + 1;
 	else
 		basename = modname;
-	sprintf(filelist, ".tmp_versions/%s", basename);
-	/* Truncate .o, add .mod */
-	strcpy(filelist + strlen(filelist)-2, ".mod");
+	sprintf(filelist, "%s/%.*s.mod", getenv("MODVERDIR"),
+		(int) strlen(basename) - 2, basename);
 
 	file = grab_file(filelist, &len);
 	if (!file) {


Cheers,
-- 
Andreas Gruenbacher <agruen@suse.de>
SUSE Labs, SUSE LINUX AG


[-- Attachment #2: sumversion.diff --]
[-- Type: text/x-patch, Size: 1363 bytes --]

Date: Thu, 16 Sep 2004 16:08:38 +0200
From: Andreas Gruenbacher <agruen@suse.de>
Subject: Fix .tmp_versions for external modules

When building external modules, MODVERDIR is relative to the
external module instead of in the kernel source tree. Use the
MODVERDIR environment variable instead of the hard-coded path
in modpost.

Index: linux-2.6.8/scripts/mod/sumversion.c
===================================================================
--- linux-2.6.8.orig/scripts/mod/sumversion.c
+++ linux-2.6.8/scripts/mod/sumversion.c
@@ -416,7 +416,8 @@ static int get_version(const char *modna
 	struct md4_ctx md;
 	char *sources, *end, *fname;
 	const char *basename;
-	char filelist[sizeof(".tmp_versions/%s.mod") + strlen(modname)];
+	char filelist[strlen(getenv("MODVERDIR")) + strlen("/") +
+		      strlen(modname) - strlen(".o") + strlen(".mod") + 1 ];
 
 	/* Source files for module are in .tmp_versions/modname.mod,
 	   after the first line. */
@@ -424,9 +425,8 @@ static int get_version(const char *modna
 		basename = strrchr(modname, '/') + 1;
 	else
 		basename = modname;
-	sprintf(filelist, ".tmp_versions/%s", basename);
-	/* Truncate .o, add .mod */
-	strcpy(filelist + strlen(filelist)-2, ".mod");
+	sprintf(filelist, "%s/%.*s.mod", getenv("MODVERDIR"),
+		(int) strlen(basename) - 2, basename);
 
 	file = grab_file(filelist, &len);
 	if (!file) {

                 reply	other threads:[~2004-09-16 14:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1095344125.5552.28.camel@winden.suse.de \
    --to=agruen@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sam@ravnborg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome