Hello community, here is the log from the commit of package module-init-tools checked in at Sat Aug 2 05:00:37 CEST 2008. -------- --- module-init-tools/module-init-tools.changes 2008-07-23 10:58:12.000000000 +0200 +++ module-init-tools/module-init-tools.changes 2008-07-24 11:52:14.000000000 +0200 @@ -1,0 +2,10 @@ +Thu Jul 24 11:48:11 CEST 2008 - mmarek@suse.cz + +- better handling of unsupported modules (fate##305100) + * applies also to modules explicitely requested, not only aliases + * controlled by a new variable "allow_unsupported_modules" set in + /etc/modprobe.d/unsupported-modules + * commandline option --allow-unsupported-modules to override the + setting + +------------------------------------------------------------------- Old: ---- mit-blacklist-warning.patch mit-include-modulesdir.patch mit-skip-unsupported-stub.patch mit-unsupported-blacklist.patch unsupported.blacklist New: ---- mit-unsupported-modules.patch unsupported-modules ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ module-init-tools.spec ++++++ --- /var/tmp/diff_new_pack.w21267/_old 2008-08-02 04:53:39.000000000 +0200 +++ /var/tmp/diff_new_pack.w21267/_new 2008-08-02 04:53:39.000000000 +0200 @@ -14,7 +14,7 @@ Name: module-init-tools BuildRequires: zlib-devel Version: 3.4 -Release: 21 +Release: 25 License: GPL v2 or later Group: System/Kernel # for grepping /etc/SUSE-release @@ -37,7 +37,7 @@ Source4: weak-modules Source5: modprobe.conf.tar.gz Source6: depmod.conf -Source8: unsupported.blacklist +Source8: unsupported-modules Patch1: module-init-tools-config_filter.diff # XXX: do we still need this one? Patch2: module-init-tools-insmod-zlib.diff @@ -45,11 +45,8 @@ Patch4: module-init-tools-modprobe-fastgetline.diff Patch5: module-init-tools-eintr.diff Patch6: module-init-tools-options-priority.diff -Patch8: mit-blacklist-warning.patch -Patch9: mit-unsupported-blacklist.patch -Patch10: mit-include-modulesdir.patch -Patch11: mit-skip-unsupported-stub.patch -Patch12: mit-zlibsupport-use-mmap.patch +Patch7: mit-unsupported-modules.patch +Patch8: mit-zlibsupport-use-mmap.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -76,11 +73,8 @@ %patch4 %patch5 %patch6 +%patch7 %patch8 -%patch9 -%patch10 -%patch11 -%patch12 %build autoreconf --force --install @@ -107,7 +101,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 %_sourcedir/unsupported-modules $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 @@ -119,34 +113,26 @@ 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="" +# configure handling of unsupported modules +# default is to allow them +allow=1 # if the obsolete LOAD_UNSUPPORTED_MODULES_AUTOMATICALLY variable is set to -# yes, unblacklist +# no, don't allow (this was used in SLES 9 and 10) if test -e /etc/sysconfig/hardware/config; then . /etc/sysconfig/hardware/config - if test "x$LOAD_UNSUPPORTED_MODULES_AUTOMATICALLY" = "xyes"; then - unblacklist=yes + if test "x$LOAD_UNSUPPORTED_MODULES_AUTOMATICALLY" = "xno"; then + allow=0 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 +# if this is a _new_ SLES install, don't allow unsupported modules +if test "$1" = 1 && grep -qs "Enterprise Server" /etc/SuSE-release; then + allow=0 fi -if test "x$unblacklist" = "xyes"; then - sed -i 's/^include modules\.unsupported\.blacklist/## &/' \ - /etc/modprobe.d/unsupported.blacklist +if test "$allow" = "0"; then + sed -ri 's/^( *allow_unsupported_modules *) 1/\1 0/' \ + /etc/modprobe.d/unsupported-modules fi %files @@ -154,7 +140,7 @@ %config /etc/modprobe.conf %config /etc/depmod.conf %dir /etc/depmod.d -%config(noreplace) /etc/modprobe.d/unsupported.blacklist +%config(noreplace) /etc/modprobe.d/unsupported-modules %config(noreplace) /etc/modprobe.conf.local %doc AUTHORS COPYING ChangeLog FAQ NEWS README TODO %doc README.SUSE @@ -165,6 +151,13 @@ /etc/modprobe.d %changelog +* Thu Jul 24 2008 mmarek@suse.cz +- better handling of unsupported modules (fate##305100) + * applies also to modules explicitely requested, not only aliases + * controlled by a new variable "allow_unsupported_modules" set in + /etc/modprobe.d/unsupported-modules + * commandline option --allow-unsupported-modules to override the + setting * Wed Jul 23 2008 agraf@suse.de - add alias to autoload acpiphp in QEMU/KVM, so hotplugging works * Tue May 06 2008 jdelvare@suse.de ++++++ mit-unsupported-modules.patch ++++++ --- modprobe.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) --- 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; +/* Allow loading of unsupported modules? */ +static int allow_unsupported = 1; + static void message(const char *prefix, const char *fmt, va_list *arglist) { char *buf, *buf2; @@ -652,6 +655,23 @@ static void clear_magic(struct module *m } } +static int module_supported(void *mod, unsigned long len) +{ + const char *p; + unsigned long modlen; + + /* Grab from new-style .modinfo section. */ + for (p = get_section(mod, len, ".modinfo", &modlen); + p; + p = next_string(p, &modlen)) { + if (strcmp(p, "supported=yes") == 0 || + strcmp(p, "supported=external") == 0) { + return 1; + } + } + return 0; +} + struct module_options { struct module_options *next; @@ -922,6 +942,12 @@ static void insmod(struct list_head *lis goto out_unlock; } + /* Supported? */ + if (!allow_unsupported && !module_supported(map, len)) { + error("module '%s' is unsupported\n", mod->filename); + goto out; + } + /* Rename it? */ if (newname) rename_module(mod, map, len, newname); @@ -1293,6 +1319,18 @@ static int read_config_file(const char * *commands = add_command(underscores(modname), ptr, *commands); } + } else if (strcmp(cmd, "allow_unsupported_modules") == 0) { + const char *option = strsep_skipspace(&ptr, "\t "); + if (!option) + grammar(cmd, filename, linenum); + else if (strcmp(option, "yes") == 0 || + strcmp(option, "1") == 0) + allow_unsupported = 1; + else if (strcmp(option, "no") == 0 || + strcmp(option, "0") == 0) + allow_unsupported = 0; + else + grammar(cmd, filename, linenum); } else grammar(cmd, filename, linenum); @@ -1512,6 +1550,7 @@ static struct option options[] = { { "ve { "first-time", 0, NULL, 3 }, { "use-blacklist", 0, NULL, 'b' }, { "dump-modversions", 0, NULL, 4 }, + { "allow-unsupported-modules", 0, NULL, 128 }, { NULL, 0, NULL, 0 } }; #define MODPROBE_DEVFSD_CONF "/etc/modprobe.devfs" @@ -1550,6 +1589,7 @@ int main(int argc, char *argv[]) int first_time = 0; int use_blacklist = 0; int dump_modver = 0; + int force_allow_unsupported = 0; unsigned int i, num_modules; char *type = NULL; const char *config = NULL; @@ -1672,6 +1712,9 @@ int main(int argc, char *argv[]) case 4: dump_modver = 1; break; + case 128: + force_allow_unsupported = 1; + break; default: print_usage(argv[0]); } @@ -1748,6 +1791,16 @@ int main(int argc, char *argv[]) /* Returns the resolved alias, options */ read_toplevel_config(config, modulearg, 0, remove, &modoptions, &commands, &aliases, &blacklist); + if (force_allow_unsupported) + allow_unsupported = 1; + /* Be nice to people running non-suse kernels and allow + * unsupported modules */ + if (!allow_unsupported) { + struct stat sb; + if (stat("/proc/sys/kernel/", &sb) == 0 && + stat("/proc/sys/kernel/unsupported", &sb) == -1) + allow_unsupported = 1; + } /* No luck? Try symbol names, if starts with symbol:. */ if (!aliases ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org