Hi,

I'm forwarding this to upstream. Sorry for not doing it directly on
submit.


Dear upstream authors,

it would be ncie if you could consider the patch below for inclusion
or suggest an alternative fix to get symlinks working.

MfG
        Goswin

----------------------------------------------------------------------
Package: module-init-tools
Version: 3.2-pre1-2
Severity: normal
Tags: patch

Hi,

I'm trying to get lustrefs working nicely but modprobe refuses to load
the modules so the normal lustre scripts fail. I think the reason is
that depmod refuses to follow any links when searching for
modules. The lustre modules are linked into the module dir and as they
are rather large I prefer to have them not on / so I don't like to
change that.

The attached patch follows symlinks except the build and source links
in the base directory.

MfG
        Goswin

-- System Information:
Debian Release: 3.1
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.16-rc4-xen
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages module-init-tools depends on:
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an

-- no debconf information

----------------------------------------------------------------------

diff -Nurd module-init-tools-3.2.2.orig/depmod.c 
module-init-tools-3.2.2/depmod.c
--- module-init-tools-3.2.2.orig/depmod.c       2006-03-22 19:57:17.000000000 
+0100
+++ module-init-tools-3.2.2/depmod.c    2006-03-22 20:24:54.000000000 +0100
@@ -529,7 +529,7 @@
 }
 
 static struct module *grab_dir(const char *dirname,
-                              DIR *dir,
+                              DIR *dir, int follow,
                               struct module *next,
                               do_module_t do_mod)
 {
@@ -545,14 +545,13 @@
                        char subdir[strlen(dirname) + 1
                                   + strlen(dirent->d_name) + 1];
                        sprintf(subdir, "%s/%s", dirname, dirent->d_name);
-                       /* Don't follow links, eg. build/ */
-                       if (readlink(subdir, &dummy, 1) < 0) {
-                               sub = opendir(subdir);
-                               if (sub) {
-                                       next = grab_dir(subdir, sub, next,
-                                                       do_mod);
-                                       closedir(sub);
-                               }
+                       /* Don't follow toplevel links build and source */
+                       if (follow && streq(dirent->d_name, "build")) continue;
+                       if (follow && streq(dirent->d_name, "source")) continue;
+                       sub = opendir(subdir);
+                       if (sub) {
+                               next = grab_dir(subdir, sub, 0, next, do_mod);
+                               closedir(sub);
                        }
                }
        }
@@ -573,13 +572,13 @@
                     dirname, strerror(errno));
                return NULL;
        }
-       list = grab_dir(dirname, dir, NULL, do_normal_module);
+       list = grab_dir(dirname, dir, 1, NULL, do_normal_module);
        closedir(dir);
 
        sprintf(updatedir, "%s/updates", dirname);
        dir = opendir(updatedir);
        if (dir) {
-               list = grab_dir(updatedir, dir, list, do_update_module);
+           list = grab_dir(updatedir, dir, 1, list, do_update_module);
                closedir(dir);
        }
        return list;


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to