[PATCH 10/14] depmod: store module_dir without trailing slash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This matches the way it may be written in alternatives files.

Signed-off-by: Keegan McAllister <keegan@xxxxxxxxxxx>
---
 depmod.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/depmod.c b/depmod.c
index 14da871..beb65d8 100644
--- a/depmod.c
+++ b/depmod.c
@@ -35,7 +35,7 @@
 #include "testing.h"
 
 #ifndef MODULE_DIR
-#define MODULE_DIR "/lib/modules/"
+#define MODULE_DIR "/lib/modules"
 #endif
 
 #ifndef MODULE_BUILTIN_KEY
@@ -1232,7 +1232,7 @@ static int parse_config_file(const char *filename,
 							     0, *search);
 					continue;
 				}
-				nofail_asprintf(&dirname, "%s%s%s/%s", basedir,
+				nofail_asprintf(&dirname, "%s%s/%s/%s", basedir,
 					module_dir, kernelversion, search_path);
 				len = strlen(dirname);
 				*search = add_search(dirname, len, *search);
@@ -1247,7 +1247,7 @@ static int parse_config_file(const char *filename,
 			if (!regex_match(kernelversion, (const char *)version))
 				continue;
 
-			nofail_asprintf(&pathname, "%s%s%s/%s/%s.ko", basedir,
+			nofail_asprintf(&pathname, "%s%s/%s/%s/%s.ko", basedir,
 				module_dir, kernelversion, subdir, modname);
 
 			*overrides = add_override(pathname, *overrides);
@@ -1473,7 +1473,7 @@ static void do_alternative(struct config_alternative *alt,
 
 	clear_symbolhash();
 
-	nofail_asprintf(&dirname, "%s%s%s", basedir, alt->module_dir, version);
+	nofail_asprintf(&dirname, "%s%s/%s", basedir, alt->module_dir, version);
 
 	if (maybe_all) {
 		if (!doing_stdout && !depfile_out_of_date(dirname))
@@ -1491,7 +1491,7 @@ static void do_alternative(struct config_alternative *alt,
 		char *dirname;
 		size_t len;
 
-		nofail_asprintf(&dirname, "%s%s%s/updates", basedir,
+		nofail_asprintf(&dirname, "%s%s/%s/updates", basedir,
 				alt->module_dir, version);
 		len = strlen(dirname);
 		search = add_search(dirname, len, search);
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-modules" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux