[prev in list] [next in list] [prev in thread] [next in thread]
List: busybox
Subject: [PATCH] modinfo: really attach the patch
From: "Lauri Kasanen" <curaga () operamail ! com>
Date: 2010-06-26 12:05:45
Message-ID: 20100626120545.607F9160220 () c-in3ws--03-05 ! sv2 ! lotusliveops ! com
[Download RAW message or body]
Sorry, slipped my mind :p
--=20
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com
["0001-Newer-depmod-uses-relative-paths-in-modules.dep-upda.patch" (0001-Newer-depmod-uses-relative-paths-in-modules.dep-upda.patch)]
From 59f2d68774cc35a7fe210b053e5595f05a20793f Mon Sep 17 00:00:00 2001
From: Lauri Kasanen <curaga@operamail.com>
Date: Sat, 26 Jun 2010 14:29:58 +0300
Subject: [PATCH] Newer depmod uses relative paths in modules.dep; update modinfo
http://git.kernel.org/?p=utils/kernel/module-init-tools/module-init-tools.git;a=commit;h=83dfe9b5fdeec10af957859f88d9632eddf74de0
Current module-init-tools depmod uses relative paths in modules.dep.
Make modinfo handle that.
---
modutils/modinfo.c | 25 ++++++++++++++++++++-----
1 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/modutils/modinfo.c b/modutils/modinfo.c
index 321ad78..1288169 100644
--- a/modutils/modinfo.c
+++ b/modutils/modinfo.c
@@ -43,7 +43,8 @@ static int display(const char *data, const char *pattern, int flag)
return printf("%s%c", data, (option_mask32 & OPT_0) ? '\0' : '\n');
}
-static void modinfo(const char *path, struct modinfo_env *env)
+static void modinfo(const char *path, const char *version,
+ struct modinfo_env *env)
{
static const char *const shortcuts[] = {
"filename",
@@ -64,8 +65,22 @@ static void modinfo(const char *path, struct modinfo_env *env)
}
len = MAXINT(ssize_t);
the_module = xmalloc_open_zipped_read_close(path, &len);
- if (!the_module)
- return;
+
+ if (!the_module) {
+ if (path[0]!='/') {
+ /* Newer depmod only puts relative paths in modules.dep */
+ path = concat_path_file(
+ concat_path_file(CONFIG_DEFAULT_MODULES_DIR,
+ version), path);
+
+ the_module = xmalloc_open_zipped_read_close(path, &len);
+ if (!the_module)
+ return;
+ } else {
+ return;
+ }
+ }
+
if (field)
tags |= OPT_F;
for (j = 1; (1<<j) & (OPT_TAGS + OPT_F); j++) {
@@ -136,14 +151,14 @@ int modinfo_main(int argc UNUSED_PARAM, char **argv)
filename2modname(tokens[0], name);
for (i = 0; argv[i]; i++) {
if (fnmatch(argv[i], name, 0) == 0) {
- modinfo(tokens[0], &env);
+ modinfo(tokens[0], uts.release, &env);
argv[i] = (char *) "";
}
}
}
for (i = 0; argv[i]; i++) {
if (argv[i][0]) {
- modinfo(argv[i], &env);
+ modinfo(argv[i], uts.release, &env);
}
}
return 0;
--
1.6.6
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic