svn commit: trunk/busybox/modutils

vda at busybox.net vda at busybox.net
Thu Aug 16 10:40:07 UTC 2007


Author: vda
Date: 2007-08-16 03:40:06 -0700 (Thu, 16 Aug 2007)
New Revision: 19527

Log:
modprobe: add scanning of /lib/modules/`uname -r`/modules.symbols
  (by Yann E. MORIN)



Modified:
   trunk/busybox/modutils/modprobe.c


Changeset:
Modified: trunk/busybox/modutils/modprobe.c
===================================================================
--- trunk/busybox/modutils/modprobe.c	2007-08-16 10:37:49 UTC (rev 19526)
+++ trunk/busybox/modutils/modprobe.c	2007-08-16 10:40:06 UTC (rev 19527)
@@ -504,7 +504,7 @@
 
 	/* Only 2.6 has a modules.alias file */
 	if (ENABLE_FEATURE_2_6_MODULES) {
-		/* Parse kernel-declared aliases */
+		/* Parse kernel-declared module aliases */
 		filename = xasprintf("/lib/modules/%s/modules.alias", un.release);
 		fd = open(filename, O_RDONLY);
 		if (fd < 0) {
@@ -518,6 +518,21 @@
 			include_conf(&first, &current, buffer, sizeof(buffer), fd);
 			close(fd);
 		}
+
+		/* Parse kernel-declared symbol aliases */
+		filename = xasprintf("/lib/modules/%s/modules.symbols", un.release);
+		fd = open(filename, O_RDONLY);
+		if (fd < 0) {
+			/* Ok, that didn't work.  Fall back to looking in /lib/modules */
+			fd = open("/lib/modules/modules.symbols", O_RDONLY);
+		}
+		if (ENABLE_FEATURE_CLEAN_UP)
+			free(filename);
+
+		if (fd >= 0) {
+			include_conf(&first, &current, buffer, sizeof(buffer), fd);
+			close(fd);
+		}
 	}
 
 	return first;




More information about the busybox-cvs mailing list