
Hello community, here is the log from the commit of package module-init-tools checked in at Mon Jul 16 17:35:35 CEST 2007. -------- --- module-init-tools/module-init-tools.changes 2007-06-29 12:42:56.000000000 +0200 +++ /mounts/work_src_done/STABLE/module-init-tools/module-init-tools.changes 2007-07-13 13:59:28.000000000 +0200 @@ -1,0 +2,20 @@ +Wed Jul 11 19:27:18 CEST 2007 - mmarek@suse.cz + +- reworked handling of unsupported modules + * extend the blacklist keyword to be able to specify a warning + (mit-blacklist-warning.patch) + * depmod generates /lib/modules/.../modules.unsupported.blacklist + with 'blacklist $module unsupported' entries + (mit-unsupported-blacklist.patch) + * loading of unsupported modules configured in + /etc/modprobe.d/unsupported.blacklist by + 'include modules.unsupported.blacklist' command + (mit-include-modulesdir.patch) + * --skip-unsupported preserved for now as a nop for easier + upgrades + (mit-skip-unsupported-stub.patch) + * read the obsolete LOAD_UNSUPPORTED_MODULES_AUTOMATICALLY + sysconfig variable in %%post and edit the new setting + accordingly + +------------------------------------------------------------------- Old: ---- module-init-tools-blacklist-warn.diff module-init-tools-skip-unsupported.diff module-init-tools-use_blacklist.diff New: ---- mit-blacklist-warning.patch mit-include-modulesdir.patch mit-skip-unsupported-stub.patch mit-unsupported-blacklist.patch unsupported.blacklist ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ module-init-tools.spec ++++++ --- /var/tmp/diff_new_pack.t23121/_old 2007-07-16 17:35:25.000000000 +0200 +++ /var/tmp/diff_new_pack.t23121/_new 2007-07-16 17:35:25.000000000 +0200 @@ -14,9 +14,9 @@ BuildRequires: zlib-devel # it's 3.3-pre11 actually Version: 3.2.99.pre11 -Release: 3 +Release: 6 %define ver 3.3-pre11 -License: GNU General Public License (GPL) +License: GPL v2 or later Group: System/Kernel # for getopt needed by the weak-modules script Requires: util-linux @@ -35,18 +35,19 @@ Source5: modprobe.conf.tar.gz Source6: depmod.conf Source7: removed-in-10.3 +Source8: unsupported.blacklist Patch1: module-init-tools-config_filter.diff # XXX: do we still need this one? -Patch3: module-init-tools-insmod-zlib.diff -Patch4: module-init-tools-dump-modversions.diff -Patch5: module-init-tools-modprobe-fastgetline.diff -Patch10: module-init-tools-eintr.diff -# XXX: ditto -Patch11: module-init-tools-use_blacklist.diff -Patch12: module-init-tools-skip-unsupported.diff -Patch13: module-init-tools-blacklist-warn.diff -Patch15: module-init-tools-options-priority.diff -Patch16: insmod-segfault.diff +Patch2: module-init-tools-insmod-zlib.diff +Patch3: module-init-tools-dump-modversions.diff +Patch4: module-init-tools-modprobe-fastgetline.diff +Patch5: module-init-tools-eintr.diff +Patch6: module-init-tools-options-priority.diff +Patch7: insmod-segfault.diff +Patch8: mit-blacklist-warning.patch +Patch9: mit-unsupported-blacklist.patch +Patch10: mit-include-modulesdir.patch +Patch11: mit-skip-unsupported-stub.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -68,15 +69,16 @@ %prep %setup -q -a1 -a5 -n %name-%ver %patch1 +%patch2 %patch3 %patch4 %patch5 +%patch6 +%patch7 +%patch8 +%patch9 %patch10 %patch11 -%patch12 -%patch13 -%patch15 -%patch16 %build autoreconf --force --install @@ -103,6 +105,7 @@ fi cat modprobe.conf.last >> modprobe.conf install -d -m 755 $RPM_BUILD_ROOT/etc/modprobe.d +install -m644 %_sourcedir/unsupported.blacklist $RPM_BUILD_ROOT/etc/modprobe.d install -m644 modprobe.conf $RPM_BUILD_ROOT/etc/modprobe.conf install -m644 modprobe.conf.local $RPM_BUILD_ROOT/etc/modprobe.conf.local install -d -m 755 $RPM_BUILD_ROOT/etc/depmod.d @@ -113,11 +116,43 @@ %clean rm -rf $RPM_BUILD_ROOT +%post +# when updating from and older version, make sure +# modules.unsupported.blacklist is here to avoid warnings from modprobe +uname_r=`uname -r` +if test -e "/lib/modules/$uname_r/modules.dep" -a \ + ! -e "/lib/modules/$uname_r/modules.unsupported.blacklist"; then + depmod +fi +# default is to blacklist +unblacklist="" +# if the obsolete LOAD_UNSUPPORTED_MODULES_AUTOMATICALLY variable is set to +# yes, unblacklist +if test -e /etc/sysconfig/hardware/config; then + . /etc/sysconfig/hardware/config + if test "x$LOAD_UNSUPPORTED_MODULES_AUTOMATICALLY" = "xyes"; then + unblacklist=yes + fi + # obsolete + rm /etc/sysconfig/hardware/config +fi +# if this is _new install_ and we are not SLES, unblacklist +if test "$1" = 1; then + if ! grep -qs "Enterprise Server" /etc/SuSE-release; then + unblacklist=yes + fi +fi +if test "x$unblacklist" = "xyes"; then + sed -i 's/^include modules\.unsupported\.blacklist/## &/' \ + /etc/modprobe.d/unsupported.blacklist +fi + %files %defattr(-,root,root) %config /etc/modprobe.conf %config /etc/depmod.conf %dir /etc/depmod.d +%config(noreplace) /etc/modprobe.d/unsupported.blacklist %config(noreplace) /etc/modprobe.conf.local %doc AUTHORS COPYING ChangeLog FAQ NEWS README TODO %doc README.SUSE removed-in-10.3 @@ -128,6 +163,23 @@ /etc/modprobe.d %changelog +* Wed Jul 11 2007 - mmarek@suse.cz +- reworked handling of unsupported modules + * extend the blacklist keyword to be able to specify a warning + (mit-blacklist-warning.patch) + * depmod generates /lib/modules/.../modules.unsupported.blacklist + with 'blacklist $module unsupported' entries + (mit-unsupported-blacklist.patch) + * loading of unsupported modules configured in + /etc/modprobe.d/unsupported.blacklist by + 'include modules.unsupported.blacklist' command + (mit-include-modulesdir.patch) + * --skip-unsupported preserved for now as a nop for easier + upgrades + (mit-skip-unsupported-stub.patch) + * read the obsolete LOAD_UNSUPPORTED_MODULES_AUTOMATICALLY + sysconfig variable in %%post and edit the new setting + accordingly * Fri Jun 29 2007 - mmarek@suse.cz - fixed a segfault in insmod [#287493] * Thu Jun 21 2007 - mmarek@suse.cz ++++++ mit-blacklist-warning.patch ++++++ --- modprobe.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) --- modprobe.c.orig +++ modprobe.c @@ -676,6 +676,7 @@ struct module_blacklist { struct module_blacklist *next; char *modulename; + char *warning; }; /* Link in a new option line from the config file. */ @@ -726,12 +727,14 @@ add_alias(const char *modname, struct mo /* Link in a new blacklist line from the config file. */ static struct module_blacklist * -add_blacklist(const char *modname, struct module_blacklist *blacklist) +add_blacklist(const char *modname, const char *warning, + struct module_blacklist *blacklist) { struct module_blacklist *new; new = NOFAIL(malloc(sizeof(*new))); new->modulename = NOFAIL(strdup(modname)); + new->warning = warning ? NOFAIL(strdup(warning)) : NULL; new->next = blacklist; return new; } @@ -741,8 +744,12 @@ static int find_blacklist(const char *modname, const struct module_blacklist *blacklist) { while (blacklist) { - if (strcmp(blacklist->modulename, modname) == 0) + if (strcmp(blacklist->modulename, modname) == 0) { + if (blacklist->warning) + warn("module '%s' is %s\n", modname, + blacklist->warning); return 1; + } blacklist = blacklist->next; } return 0; @@ -1280,8 +1287,10 @@ static int read_config_file(const char * if (!modname) grammar(cmd, filename, linenum); else if (!removing) { + if (ptr) + ptr += strspn(ptr, "\t "); *blacklist = add_blacklist(underscores(modname), - *blacklist); + ptr, *blacklist); } } else if (strcmp(cmd, "remove") == 0) { modname = strsep_skipspace(&ptr, "\t "); ++++++ mit-include-modulesdir.patch ++++++ --- modprobe.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) --- modprobe.c.orig +++ modprobe.c @@ -65,6 +65,9 @@ typedef void (*errfn_t)(const char *fmt, /* Do we use syslog or stderr for messages? */ static int log; +/* /lib/modules/`uname -r` */ +static char *dirname; + static void message(const char *prefix, const char *fmt, va_list *arglist) { char *buf, *buf2; @@ -1251,18 +1254,28 @@ static int read_config_file(const char * if (!newfilename) grammar(cmd, filename, linenum); else { - if (!read_config(newfilename, name, + char *filename = newfilename; + if (*filename != '/') { + filename = NOFAIL(malloc( + strlen(dirname) + + strlen(newfilename) + 2)); + sprintf(filename, "%s/%s", dirname, + newfilename); + } + if (!read_config(filename, name, dump_only, removing, options, commands, &newalias, blacklist)) warn("Failed to open included" " config file %s: %s\n", - newfilename, strerror(errno)); + filename, strerror(errno)); /* Files included override aliases, etc that was already set ... */ if (newalias) *aliases = newalias; + if (filename != newfilename) + free(filename); } } else if (strcmp(cmd, "options") == 0) { modname = strsep_skipspace(&ptr, "\t "); @@ -1559,7 +1572,7 @@ int main(int argc, char *argv[]) unsigned int i, num_modules; char *type = NULL; const char *config = NULL; - char *dirname, *optstring; + char *optstring; char *newname = NULL; char *aliasfilename, *symfilename; errfn_t error = fatal; ++++++ mit-skip-unsupported-stub.patch ++++++ --- modprobe.c | 4 ++++ 1 file changed, 4 insertions(+) --- modprobe.c.orig +++ modprobe.c @@ -1531,6 +1531,7 @@ static struct option options[] = { { "ve { "first-time", 0, NULL, 3 }, { "use-blacklist", 0, NULL, 'b' }, { "dump-modversions", 0, NULL, 4 }, + { "skip-unsupported", 2, NULL, 5 }, { NULL, 0, NULL, 0 } }; #define MODPROBE_DEVFSD_CONF "/etc/modprobe.devfs" @@ -1687,6 +1688,9 @@ int main(int argc, char *argv[]) case 4: dump_modver = 1; break; + case 5: + warn("the --skip-unsupported option is no longer available"); + break; default: print_usage(argv[0]); } ++++++ mit-unsupported-blacklist.patch ++++++ --- depmod.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) --- depmod.c.orig +++ depmod.c @@ -779,6 +779,33 @@ static void output_aliases(struct module } } +static void output_unsupported_blacklist(struct module *modules, FILE *out) +{ + struct module *i; + const char *p; + unsigned long size; + + fprintf(out, "# Blacklist of modules without the supported flag.\n"); + for (i = modules; i; i = i->next) { + char modname[strlen(i->pathname)+1]; + int supported = 0; + + filename2modname(modname, i->pathname); + + /* Grab form new-style .modinfo section. */ + for (p = i->ops->get_modinfo(i, &size); p; + p = next_string(p, &size)) { + if (strcmp(p, "supported=yes") == 0 || + strcmp(p, "supported=external") == 0) { + supported = 1; + break; + } + } + if (!supported) + fprintf(out, "blacklist %s unsupported\n", modname); + } +} + struct depfile { char *name; void (*func)(struct module *, FILE *); @@ -796,6 +823,7 @@ static struct depfile depfiles[] = { { "modules.seriomap", output_serio_table }, { "modules.alias", output_aliases }, { "modules.symbols", output_symbols }, + { "modules.unsupported.blacklist", output_unsupported_blacklist }, }; /* If we can't figure it out, it's safe to say "true". */ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org