rpms/module-init-tools/devel modprobe-dist-alsa.conf, NONE, 1.1 module-init-tools-3.11.1-multi_moddirs.patch, NONE, 1.1 .cvsignore, 1.23, 1.24 module-init-tools.spec, 1.91, 1.92 sources, 1.25, 1.26 module-init-tools-3.10-multi_moddirs.patch, 1.1, NONE

Jon Masters jcm at fedoraproject.org
Wed Oct 21 04:44:45 UTC 2009


Author: jcm

Update of /cvs/pkgs/rpms/module-init-tools/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv16176

Modified Files:
	.cvsignore module-init-tools.spec sources 
Added Files:
	modprobe-dist-alsa.conf 
	module-init-tools-3.11.1-multi_moddirs.patch 
Removed Files:
	module-init-tools-3.10-multi_moddirs.patch 
Log Message:
Bump to the latest upstream release, and include a fix for sequencer support.



--- NEW FILE modprobe-dist-alsa.conf ---
# ALSA Sound Support
#
# We want to ensure that snd-seq is always loaded for those who want to use
# the sequencer interface, but we can't do this automatically through udev
# at the moment...so we have this rule (just for the moment).
#
# Remove the following line if you don't want the sequencer.

install snd-pcm /sbin/modprobe --ignore-install snd-pcm && /sbin/modprobe snd-seq

module-init-tools-3.11.1-multi_moddirs.patch:
 depmod.c             |  208 +++++++++++++++++++++++++++++++++++++++++++++------
 doc/depmod.conf.sgml |   20 ++++
 2 files changed, 204 insertions(+), 24 deletions(-)

--- NEW FILE module-init-tools-3.11.1-multi_moddirs.patch ---
diff -urNp module-init-tools-3.11.1/depmod.c module-init-tools-3.11.1_new/depmod.c
--- module-init-tools-3.11.1/depmod.c	2009-10-13 11:56:44.000000000 +0100
+++ module-init-tools-3.11.1_new/depmod.c	2009-10-21 05:41:27.728874140 +0100
@@ -36,6 +36,10 @@
 #define MODULE_DIR "/lib/modules/"
 #endif
 
+#ifndef CURRENT_KERNEL_KEY
+#define CURRENT_KERNEL_KEY "current-kernel"
+#endif
+
 #ifndef MODULE_BUILTIN_KEY
 #define MODULE_BUILTIN_KEY "built-in"
 #endif
@@ -49,6 +53,16 @@ struct module_overrides
 	char *modfile;
 };
 
+struct module_path
+{
+	/* Next path */
+	struct module_path *next;
+
+	/* module path */
+	char *path;
+	size_t len;
+};
+
 struct module_search
 {
 	/* Next search */
@@ -621,21 +635,28 @@ static struct module *grab_dir(const cha
 	return next;
 }
 
-static struct module *grab_basedir(const char *dirname,
+static struct module *grab_basedir(struct module_path *modpaths,
 				   struct module_search *search,
 				   struct module_overrides *overrides)
 {
 	DIR *dir;
 	struct module *list;
+	struct module_path *mod_path;
 
-	dir = opendir(dirname);
-	if (!dir) {
-		warn("Couldn't open directory %s: %s\n",
-		     dirname, strerror(errno));
-		return NULL;
+	for (mod_path = modpaths; mod_path != NULL;
+	     mod_path = mod_path->next) {
+	
+		dir = opendir(mod_path->path);
+		if (!dir) {
+			warn("Couldn't open directory %s: %s\n",
+		    	 mod_path->path, strerror(errno));
+			continue;
+		} else {
+			list = grab_dir(mod_path->path, dir, list, do_module,
+					search, overrides);
+			closedir(dir);
+		}
 	}
-	list = grab_dir(dirname, dir, NULL, do_module, search, overrides);
-	closedir(dir);
 
 	return list;
 }
@@ -1030,6 +1051,22 @@ static char *strsep_skipspace(char **str
 	return strsep(string, delim);
 }
 
+static struct module_path *add_path(const char *path,
+				    size_t len,
+				    struct module_path *paths)
+{
+
+	struct module_path *new;
+	
+	new = NOFAIL(malloc(sizeof(*new)));
+	new->path = NOFAIL(strdup(path));
+	new->len = len;
+	new->next = paths;
+
+	return new;
+	
+}
+
 static struct module_search *add_search(const char *search_path,
 					size_t len,
 					struct module_search *search)
@@ -1046,6 +1083,42 @@ static struct module_search *add_search(
 	
 }
 
+static struct module_search *add_search_tail(const char *search_path,
+					     size_t len,
+					     struct module_search *search)
+{
+
+	struct module_search *new;
+	struct module_search *last;
+
+	new = NOFAIL(malloc(sizeof(*new)));
+	new->search_path = NOFAIL(strdup(search_path));
+	new->len = len;
+	new->next = NULL;
+
+	if (!search) {
+		search = new;
+	} else {
+		for (last = search; (last != NULL) && (last->next != NULL);
+	     	     last = last->next);
+		last->next = new;
+	}
+
+	return search;
+}
+
+struct module_search *free_search(struct module_search *search)
+{
+	if (search) {
+		free_search(search->next);
+		free(search->search_path);
+		free(search);
+		search = NULL;
+	}
+
+	return NULL;
+}
+
 static struct module_overrides *add_override(const char *modfile,
 					     struct module_overrides *overrides)
 {
@@ -1063,12 +1136,14 @@ static struct module_overrides *add_over
 static int parse_config_scan(const char *filename,
 			     const char *basedir,
 			     const char *kernelversion,
+			     struct module_path **modpaths,
 			     struct module_search **search,
 			     struct module_overrides **overrides);
 
 static int parse_config_file(const char *filename,
 			     const char *basedir,
 			     const char *kernelversion,
+			     struct module_path **modpaths,
 			     struct module_search **search,
 			     struct module_overrides **overrides)
 {
@@ -1095,7 +1170,30 @@ static int parse_config_file(const char 
 			continue;
 		}
 
-		if (streq(cmd, "search")) {
+		if (streq(cmd, "path")) {
+			char *mod_path, *sstr;
+
+			while ((mod_path = strsep_skipspace(&ptr, "\t "))) {
+
+				if ((sstr = strstr(mod_path,
+						 CURRENT_KERNEL_KEY))) {
+					char *new_path;
+
+					sstr[0] = '\0';
+					nofail_asprintf(&new_path, "%s%s%s",
+					     mod_path,
+					     kernelversion,
+					     &sstr[strlen(CURRENT_KERNEL_KEY)]);
+					*modpaths = add_path(new_path,
+							     strlen(new_path),
+							     *modpaths);
+				} else {
+					*modpaths = add_path(mod_path,
+							     strlen(mod_path),
+							     *modpaths);
+				}
+			}
+		} else if (streq(cmd, "search")) {
 			char *search_path;
 			
 			while ((search_path = strsep_skipspace(&ptr, "\t "))) {
@@ -1108,8 +1206,8 @@ static int parse_config_file(const char 
 							     0, *search);
 					continue;
 				}
-				nofail_asprintf(&dirname, "%s%s%s/%s", basedir,
-					MODULE_DIR, kernelversion, search_path);
+				nofail_asprintf(&dirname, "%s",
+						search_path);
 				len = strlen(dirname);
 				*search = add_search(dirname, len, *search);
 				free(dirname);
@@ -1142,9 +1240,12 @@ static int parse_config_file(const char 
 					warn("\"include /etc/depmod.d\" is "
 					     "the default, ignored\n");
 				} else {
-					if (!parse_config_scan(newfilename, basedir,
+					if (!parse_config_scan(newfilename,
+							       basedir,
 							       kernelversion,
-							       search, overrides))
+							       modpaths,
+							       search,
+							       overrides))
 					warn("Failed to open included"
 					     " config file %s: %s\n",
 					     newfilename, strerror(errno));
@@ -1176,6 +1277,7 @@ static int parse_config_file(const char 
 static int parse_config_scan(const char *filename,
 			     const char *basedir,
 			     const char *kernelversion,
+			     struct module_path **modpaths,
 			     struct module_search **search,
 			     struct module_overrides **overrides)
 {
@@ -1223,7 +1325,7 @@ static int parse_config_scan(const char 
 
 			nofail_asprintf(&cfgfile, "%s/%s", filename, fe->name);
 			if (!parse_config_file(cfgfile, basedir, kernelversion,
-					       search, overrides))
+					       modpaths, search, overrides))
 				warn("Failed to open config file "
 				     "%s: %s\n", fe->name, strerror(errno));
 			free(cfgfile);
@@ -1233,8 +1335,8 @@ static int parse_config_scan(const char 
 
 		ret = 1;
 	} else {
-		if (parse_config_file(filename, basedir, kernelversion, search,
-				      overrides))
+		if (parse_config_file(filename, basedir, kernelversion,
+				      modpaths, search, overrides))
 			ret = 1;
 	}
 
@@ -1244,12 +1346,13 @@ static int parse_config_scan(const char 
 static void parse_toplevel_config(const char *filename,
 				  const char *basedir,
 				  const char *kernelversion,
+				  struct module_path **modpaths,
 				  struct module_search **search,
 				  struct module_overrides **overrides)
 {
 	if (filename) {
-		if (!parse_config_scan(filename, basedir, kernelversion, search,
-				 overrides))
+		if (!parse_config_scan(filename, basedir, kernelversion,
+				       modpaths, search, overrides))
 			fatal("Failed to open config file %s: %s\n",
 			      filename, strerror(errno));
 		return;
@@ -1257,19 +1360,59 @@ static void parse_toplevel_config(const 
 
 	/* deprecated config file */
 	if (parse_config_file("/etc/depmod.conf", basedir, kernelversion,
-			      search, overrides) > 0)
+			      modpaths, search, overrides) > 0)
 		warn("Deprecated config file /etc/depmod.conf, "
 		      "all config files belong into /etc/depmod.d/.\n");
 
 	/* default config */
 	parse_config_scan("/etc/depmod.d", basedir, kernelversion,
-			  search, overrides);
+			  modpaths, search, overrides);
+}
+
+static struct module_search *expand_search_paths(struct module_search *search,
+					  struct module_path *modpaths)
+{
+	struct module_path *mod_path;
+	struct module_search *new_search, *tmp_search;
+	char *new_path;
+	ssize_t len;
+	int done_builtin = 0;
+
+	for (tmp_search = search; tmp_search != NULL;
+	     tmp_search = tmp_search->next) {
+		for (mod_path = modpaths; mod_path != NULL;
+		     mod_path = mod_path->next) {
+			
+			if (streq(tmp_search->search_path,
+				  MODULE_BUILTIN_KEY)) {
+				if (!done_builtin) {
+				done_builtin = 1;
+				new_search = add_search_tail(MODULE_BUILTIN_KEY,
+							     0, new_search);
+				}
+			} else {
+				nofail_asprintf(&new_path, "%s/%s",
+						mod_path->path,
+						tmp_search->search_path);
+				len = strlen(new_path);
+				new_search = add_search_tail(new_path, len,
+							     new_search);
+				free(new_path);
+			}
+		}
+	}
+
+	/* free old list */
+	search = free_search(search);
+
+	return new_search;
 }
 
 /* Local to main, but not freed on exit.  Keep valgrind quiet. */
 struct module *list = NULL;
 struct module_search *search = NULL;
 struct module_overrides *overrides = NULL;
+struct module_path *modpaths = NULL;
 
 int main(int argc, char *argv[])
 {
@@ -1375,7 +1518,22 @@ int main(int argc, char *argv[])
 		all = 1;
 	}
 
-	parse_toplevel_config(config, basedir, version, &search, &overrides);
+	parse_toplevel_config(config, basedir, version,
+			      &modpaths, &search, &overrides);
+
+	/* For backward compatibility add the current kernel to the head of
+         * the path list here. But only if no "path" option specified.
+         */
+	if (!modpaths) {
+		char *mod_path;
+		size_t len;
+
+		nofail_asprintf(&mod_path, "%s%s%s", basedir,
+				MODULE_DIR, version);
+		
+		len = strlen(mod_path);
+		modpaths = add_path(mod_path, len, modpaths);
+	}
 
 	/* For backward compatibility add "updates" to the head of the search
 	 * list here. But only if there was no "search" option specified.
@@ -1384,11 +1542,13 @@ int main(int argc, char *argv[])
 		char *dirname;
 		size_t len;
 
-		nofail_asprintf(&dirname, "%s%s%s/updates", basedir,
-				MODULE_DIR, version);
+		nofail_asprintf(&dirname, "updates");
 		len = strlen(dirname);
 		search = add_search(dirname, len, search);
 	}
+
+	search = expand_search_paths(search, modpaths);
+
 	if (!all) {
 		/* Do command line args. */
 		for (opt = optind; opt < argc; opt++) {
@@ -1407,7 +1567,7 @@ int main(int argc, char *argv[])
 			list = new;
 		}
 	} else {
-		list = grab_basedir(dirname,search,overrides);
+		list = grab_basedir(modpaths,search,overrides);
 	}
 	list = sort_modules(dirname,list);
 	list = parse_modules(list);
diff -urNp module-init-tools-3.11.1/doc/depmod.conf.sgml module-init-tools-3.11.1_new/doc/depmod.conf.sgml
--- module-init-tools-3.11.1/doc/depmod.conf.sgml	2009-10-13 11:56:44.000000000 +0100
+++ module-init-tools-3.11.1_new/doc/depmod.conf.sgml	2009-10-21 05:41:27.728874140 +0100
@@ -51,6 +51,26 @@
     <title>COMMANDS</title>
     <variablelist>
       <varlistentry>
+        <term>path <replaceable>subdirectory...</replaceable>
+        </term>
+        <listitem>
+          <para>
+            This allows you to specify additional directories (other than
+            the default of /lib/modules) that will be searched and indexed
+            for available modules by <command>depmod</command>. This option
+            can be used in combination with the <command>search</command>
+            option (which configures behavior within a given directory
+            specified using the <command>path</command> option).
+          </para>
+          <para>
+            By default, <command>depmod</command> will search the standard
+            system /lib/modules/kernelversion directory for modules, but
+            you can use this option to have it index additional directories
+            that may be on an entirely different filesystem.
+          </para>
+        </listitem>
+      </varlistentry>
+      <varlistentry>
         <term>search <replaceable>subdirectory...</replaceable>
         </term>
 	<listitem>


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/module-init-tools/devel/.cvsignore,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -p -r1.23 -r1.24
--- .cvsignore	1 Oct 2009 23:39:45 -0000	1.23
+++ .cvsignore	21 Oct 2009 04:44:44 -0000	1.24
@@ -1,2 +1,2 @@
-module-init-tools-3.10.tar.bz2
-module-init-tools-3.10.tar.bz2.sign
+module-init-tools-3.11.1.tar.bz2
+module-init-tools-3.11.1.tar.bz2.sign


Index: module-init-tools.spec
===================================================================
RCS file: /cvs/pkgs/rpms/module-init-tools/devel/module-init-tools.spec,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -p -r1.91 -r1.92
--- module-init-tools.spec	1 Oct 2009 23:39:46 -0000	1.91
+++ module-init-tools.spec	21 Oct 2009 04:44:44 -0000	1.92
@@ -1,6 +1,6 @@
 Summary: Kernel module management utilities.
 Name: module-init-tools
-Version: 3.10
+Version: 3.11.1
 #define PreRelease
 Release: 1%{?dist}
 License: GPLv2+
@@ -13,7 +13,8 @@ Source2: modprobe-dist.conf
 Source3: weak-modules
 Source4: depmod-dist.conf
 Source5: modprobe-dist-oss.conf
-Patch0: module-init-tools-3.10-multi_moddirs.patch
+Source6: modprobe-dist-alsa.conf
+Patch0: module-init-tools-3.11.1-multi_moddirs.patch
 Exclusiveos: Linux
 Prereq: /sbin/chkconfig sh-utils
 Obsoletes: modutils-devel modutils
@@ -53,6 +54,7 @@ mkdir -p $RPM_BUILD_ROOT/etc
 mkdir -p $RPM_BUILD_ROOT/etc/modprobe.d
 install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/etc/modprobe.d/dist.conf
 install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/etc/modprobe.d/dist-oss.conf
+install -m 644 %{SOURCE6} $RPM_BUILD_ROOT/etc/modprobe.d/dist-alsa.conf
 install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/sbin/weak-modules
 
 mkdir -p $RPM_BUILD_ROOT/etc/depmod.d
@@ -87,6 +89,10 @@ fi
 %ghost %config(noreplace) %verify(not md5 size mtime) /etc/modprobe.d/local.conf
 
 %changelog
+* Wed Oct 21 2009 Jon Masters <jcm at jonmasters.org> - 3.11.1-1
+- Rebuild with latest upstream. Add a patch for sequencer handling.
+- Resolves: #505421.
+
 * Thu Oct  1 2009 Jon Masters <jcm at jonmasters.org> - 3.10-1
 - Rebuild with latest upstream. Add a patch for "path" options.
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/module-init-tools/devel/sources,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -p -r1.25 -r1.26
--- sources	1 Oct 2009 23:39:46 -0000	1.25
+++ sources	21 Oct 2009 04:44:44 -0000	1.26
@@ -1,2 +1,2 @@
-fcde0344ad07c4ae2ae6b40918fd092d  module-init-tools-3.10.tar.bz2
-973178e2969ac5354196bd5c2ff68ebe  module-init-tools-3.10.tar.bz2.sign
+28dfcb9e24cdbeb12b99ac1eb8af7dea  module-init-tools-3.11.1.tar.bz2
+e926497dbec91b7cc39bb89f75f90352  module-init-tools-3.11.1.tar.bz2.sign


--- module-init-tools-3.10-multi_moddirs.patch DELETED ---




More information about the fedora-extras-commits mailing list