diff -Nur modutils-2.4.15/ChangeLog modutils-2.4.16/ChangeLog --- modutils-2.4.15/ChangeLog Sun Mar 24 16:03:00 2002 +++ modutils-2.4.16/ChangeLog Sun Apr 28 19:39:21 2002 @@ -1,3 +1,17 @@ +2002-04-28 Keith Owens + + modutils 2.4.16 + + * Print 'Module loaded, with warnings' for people who cannot tell the + difference between warnings and errors. + * Tell the user where to find more information about tainted modules. + * Add configure option TAINT_URL, default http://www.tux.org/lkml/#s1-18. + * Workaround for ppc64 symbols that contain _R in the name. Guy Streeter. + * Add alias char-major-200 vxspec. Tigran Aivazian. + * Add "look in syslog or dmesg output" to hints for failing modules. + Suggested by Georg Acher. + * Environment variable UNAME_MACHINE overides the value of uname machine. + 2002-03-20 Keith Owens modutils 2.4.15 diff -Nur modutils-2.4.15/INSTALL modutils-2.4.16/INSTALL --- modutils-2.4.15/INSTALL Sun Nov 11 16:27:41 2001 +++ modutils-2.4.16/INSTALL Sun Apr 28 17:28:59 2002 @@ -26,7 +26,7 @@ You can compile modutils on one system to run on another. The Makefiles generated by configure contain several variables which can be tweaked for unusual compilation environments, including cross compilation. Do not edit the -generated Makefiles, set the variables the environment before invoking +generated Makefiles, set the variables in the environment before invoking configure. The default is to compile for the current system type using standard utilities and flags. If you change any of these values after running configure, you should erase config.cache before running configure again. @@ -48,6 +48,13 @@ "-Wno-uninitialized". MKDIR The command to create a directory, including all its parents. Default is "mkdir -p". +TAINT_URL The URL to read for more information about tainted modules. The + default is 'http://www.tux.org/lkml/\#s1-18'. If the URL + contains # it must be escaped with \ to get past make. The URL + must be enclosed in single quotes and must not contain quotes + (' or ""), unless you want to fight your way through multiple + layers of quoting rules. An example, + TAINT_URL='http://www.some_vendor.com/linux/support/\#taint' configure takes ten modutils specific options, as well as the standard configure options. diff -Nur modutils-2.4.15/Makefile.common.in modutils-2.4.16/Makefile.common.in --- modutils-2.4.15/Makefile.common.in Sun May 6 14:45:38 2001 +++ modutils-2.4.16/Makefile.common.in Sun Apr 28 17:28:59 2002 @@ -19,6 +19,7 @@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ MKDIR = @MKDIR@ +TAINT_URL = @TAINT_URL@ PARSERCFLAGS = @PARSERCFLAGS@ RANLIB = @RANLIB@ STRIP = @STRIP@ diff -Nur modutils-2.4.15/configure modutils-2.4.16/configure --- modutils-2.4.15/configure Sun Nov 11 16:20:25 2001 +++ modutils-2.4.16/configure Sun Apr 28 17:28:59 2002 @@ -1328,13 +1328,19 @@ fi +# If the user did not specify TAINT_URL, use http://www.tux.org/lkml/#s1-18. +if test "$TAINT_URL" = ""; then + TAINT_URL="http://www.tux.org/lkml/\#s1-18" +fi + + echo $ac_n "checking for wordexp""... $ac_c" 1>&6 -echo "configure:1333: checking for wordexp" >&5 +echo "configure:1339: checking for wordexp" >&5 if eval "test \"`echo '$''{'ac_cv_func_wordexp'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_wordexp=yes" else @@ -1380,12 +1386,12 @@ echo $ac_n "checking for glob""... $ac_c" 1>&6 -echo "configure:1384: checking for glob" >&5 +echo "configure:1390: checking for glob" >&5 if eval "test \"`echo '$''{'ac_cv_func_glob'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_glob=yes" else @@ -1432,13 +1438,13 @@ if test "$ARCH" = "alpha"; then echo $ac_n "checking for broken alpha assembler""... $ac_c" 1>&6 -echo "configure:1436: checking for broken alpha assembler" >&5 +echo "configure:1442: checking for broken alpha assembler" >&5 cat > conftest.c <&5; (eval $ac_compile) 2>&5; }; then + if { (eval echo configure:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ac_broken_gas=no if objdump -r conftest.o | grep 'LITERAL.*y.*4$' > /dev/null; then cat >> confdefs.h <<\EOF @@ -1645,6 +1651,7 @@ s%@AR@%$AR%g s%@PARSERCFLAGS@%$PARSERCFLAGS%g s%@MKDIR@%$MKDIR%g +s%@TAINT_URL@%$TAINT_URL%g s%@HAVE_WORDEXP@%$HAVE_WORDEXP%g s%@HAVE_GLOB@%$HAVE_GLOB%g diff -Nur modutils-2.4.15/configure.in modutils-2.4.16/configure.in --- modutils-2.4.15/configure.in Fri Mar 1 11:39:06 2002 +++ modutils-2.4.16/configure.in Sun Apr 28 17:28:59 2002 @@ -282,6 +282,12 @@ fi AC_SUBST(MKDIR) +# If the user did not specify TAINT_URL, use http://www.tux.org/lkml/#s1-18. +if test "$TAINT_URL" = ""; then + TAINT_URL="http://www.tux.org/lkml/\#s1-18" +fi +AC_SUBST(TAINT_URL) + AC_CHECK_FUNC(wordexp, HAVE_WORDEXP="-DHAVE_WORDEXP=1", HAVE_WORDEXP="") AC_SUBST(HAVE_WORDEXP) diff -Nur modutils-2.4.15/depmod/depmod.c modutils-2.4.16/depmod/depmod.c --- modutils-2.4.15/depmod/depmod.c Fri Mar 1 11:39:06 2002 +++ modutils-2.4.16/depmod/depmod.c Sun Apr 28 17:53:35 2002 @@ -302,6 +302,7 @@ /* Compute the hash without the trailing genksym suffix if required */ if (ignore_suffix && (pt_R = strstr(name, "_R"))) { + while ((p = strstr(pt_R+2, "_R"))) pt_R = p; l = strlen(pt_R); if (l >= 10) { /* May be _R.*xxxxxxxx */ (void)strtoul(pt_R+l-8, &p, 16); diff -Nur modutils-2.4.15/include/version.h modutils-2.4.16/include/version.h --- modutils-2.4.15/include/version.h Fri Mar 1 11:40:09 2002 +++ modutils-2.4.16/include/version.h Thu Apr 4 16:39:13 2002 @@ -1 +1 @@ -#define MODUTILS_VERSION "2.4.15" +#define MODUTILS_VERSION "2.4.16" diff -Nur modutils-2.4.15/insmod/Makefile.in modutils-2.4.16/insmod/Makefile.in --- modutils-2.4.15/insmod/Makefile.in Fri Mar 1 11:39:06 2002 +++ modutils-2.4.16/insmod/Makefile.in Sun Apr 28 19:39:21 2002 @@ -3,7 +3,7 @@ include ../Makefile.common DEFSNOARCH := -I$(srcdir)/../include -D_GNU_SOURCE @DEFS@ $(EXTRA_DEFS) -DEFS := -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH) +DEFS := -DELF_MACHINE_H='"elf_$(ARCH).h"' -DARCH_$(ARCH) -DTAINT_URL='"$(TAINT_URL)"' PROGS := insmod modprobe rmmod lsmod ksyms kallsyms modinfo @@ -55,6 +55,7 @@ DEFSNOARCH += -DCOMMON_3264 DEFS += -DONLY_32 DEFS64 += -DONLY_64 +DEFS64 += -DTAINT_URL='"$(TAINT_URL)"' endif INSMODOBJS += $(addsuffix .o, $(COMB)) diff -Nur modutils-2.4.15/insmod/insmod.c modutils-2.4.16/insmod/insmod.c --- modutils-2.4.15/insmod/insmod.c Fri Mar 1 11:39:06 2002 +++ modutils-2.4.16/insmod/insmod.c Sun Apr 28 18:00:14 2002 @@ -93,6 +93,7 @@ static int n_ext_modules_used; static int m_has_modinfo; static int gplonly_seen; +static int warnings; extern int insmod_main(int argc, char **argv); extern int insmod_main_32(int argc, char **argv); @@ -1202,7 +1203,8 @@ if (ret) { error("init_module: %m"); lprintf("Hint: insmod errors can be caused by incorrect module parameters, " - "including invalid IO or IRQ parameters"); + "including invalid IO or IRQ parameters.\n" + " You may find more information in syslog or the output from dmesg"); } } @@ -1331,6 +1333,7 @@ * most error conditions. Make these all errors in 2.5. */ lprintf("Warning: %s symbol for parameter %s not found", error_file, key); + ++warnings; return(1); } @@ -1345,6 +1348,7 @@ if (max < min) { lprintf("Warning: %s parameter %s has max < min!", error_file, key); + ++warnings; return(1); } @@ -1352,6 +1356,7 @@ case 'c': if (!isdigit(p[1])) { lprintf("%s parameter %s has no size after 'c'!", error_file, key); + ++warnings; return(1); } while (isdigit(p[1])) @@ -1365,9 +1370,11 @@ break; case '\0': lprintf("%s parameter %s has no format character!", error_file, key); + ++warnings; return(1); default: lprintf("%s parameter %s has unknown format character '%c'", error_file, key, *p); + ++warnings; return(1); } switch (*++p) { @@ -1382,6 +1389,7 @@ break; default: lprintf("%s parameter %s has unknown format modifier '%c'", error_file, key, *p); + ++warnings; return(1); } return(0); @@ -1435,10 +1443,16 @@ { char buf[80]; int oldval; + static int first = 1; if (fd < 0 && !kernel_has_tainted) return; /* New modutils on old kernel */ - fprintf(stderr, "Warning: loading %s will taint the kernel: %s%s\n", + lprintf("Warning: loading %s will taint the kernel: %s%s", f->filename, text1, text2); + ++warnings; + if (first) { + lprintf(" See %s for information about tainted modules", TAINT_URL); + first = 0; + } if (fd >= 0 && !noload) { read(fd, buf, sizeof(buf)-1); buf[sizeof(buf)-1] = '\0'; @@ -1683,8 +1697,10 @@ (!persistdir || !*persistdir)) { free(persist_name); persist_name = NULL; - if (flag_verbose) + if (flag_verbose) { lprintf("insmod: -e \"\" ignored, no persistdir"); + ++warnings; + } } if (m_name == NULL) { @@ -1769,6 +1785,7 @@ "\t%s was compiled for kernel version %s\n" "\twhile this kernel is version %s", filename, m_strversion, k_strversion); + ++warnings; } else { if (!quiet) error("kernel-module version mismatch\n" @@ -2059,6 +2076,8 @@ delete_module(m_name); goto out; } + if (warnings && !noload) + lprintf("Module %s loaded, with warnings", m_name); exit_status = 0; out: diff -Nur modutils-2.4.15/insmod/rmmod.c modutils-2.4.16/insmod/rmmod.c --- modutils-2.4.15/insmod/rmmod.c Fri Mar 1 11:39:06 2002 +++ modutils-2.4.16/insmod/rmmod.c Sun Apr 28 19:39:21 2002 @@ -320,7 +320,7 @@ { FILE *fr, *fw; int i, fd, len; - char *newname = NULL, *newdir = NULL, *p, *name, *value; + char *newname = NULL, *newdir = NULL, *p, *name, *value, *uname_m; char line[4096]; /* Grossly oversized for any reasonable text */ struct utsname uts; time_t clock; @@ -362,6 +362,13 @@ if (uname(&uts)) { error("uname failed: %m"); goto err2; + } + if ((uname_m = getenv("UNAME_MACHINE"))) { + int l = strlen(uname_m); + if (l >= sizeof(uts.machine)) + l = sizeof(uts.machine)-1; + memcpy(uts.machine, uname_m, l); + uts.machine[l] = '\0'; } fr = fopen(persist_name, "r"); diff -Nur modutils-2.4.15/man/depmod.8 modutils-2.4.16/man/depmod.8 --- modutils-2.4.15/man/depmod.8 Thu Jan 31 23:17:09 2002 +++ modutils-2.4.16/man/depmod.8 Sun Apr 28 19:39:21 2002 @@ -166,6 +166,18 @@ .I /etc/conf.modules (deprecated)). .TP +When environment variable +.B UNAME_MACHINE +is set, modutils will use its value instead of the machine field from +the uname() syscall. +This is mainly of use when you are compiling 64 bit modules in 32 bit +user space or vice versa, set +.B UNAME_MACHINE +to the type of the modules being built. +Current modutils does not support full cross build mode for modules, it +is limited to choosing between 32 and 64 bit versions of the host +architecture. +.TP \fB\-F kernelsyms\fR,\fB\-\-filesyms \fIkernelsyms When building dependency files for a different kernel than the currently running kernel, it is important that diff -Nur modutils-2.4.15/man/insmod.8 modutils-2.4.16/man/insmod.8 --- modutils-2.4.15/man/insmod.8 Thu Jan 31 23:17:09 2002 +++ modutils-2.4.16/man/insmod.8 Sun Apr 28 19:39:21 2002 @@ -30,6 +30,18 @@ different configuration file from the default \fI/etc/modules.conf\fR (or \fI/etc/conf.modules\fR (deprecated)). This environment variable will override all the definitions above. +.PP +When environment variable +.B UNAME_MACHINE +is set, modutils will use its value instead of the machine field from +the uname() syscall. +This is mainly of use when you are compiling 64 bit modules in 32 bit +user space or vice versa, set +.B UNAME_MACHINE +to the type of the modules. +Current modutils does not support full cross build mode for modules, it +is limited to choosing between 32 and 64 bit versions of the host +architecture. .SS OPTIONS .TP \fB\-e\fR \fIpersist_name\fR, \fB\-\-persist\fR=\fIpersist_name\fR diff -Nur modutils-2.4.15/man/modprobe.8 modutils-2.4.16/man/modprobe.8 --- modutils-2.4.15/man/modprobe.8 Fri Mar 1 11:39:06 2002 +++ modutils-2.4.16/man/modprobe.8 Sun Apr 28 19:39:21 2002 @@ -40,6 +40,18 @@ The environment variable \fBMODULECONF\fR can also be used to select (and override) a different configuration file from the default /etc/modules.conf (or \fI/etc/conf.modules\fR (deprecated)). +.PP +When environment variable +.B UNAME_MACHINE +is set, modutils will use its value instead of the machine field from +the uname() syscall. +This is mainly of use when you are compiling 64 bit modules in 32 bit +user space or vice versa, set +.B UNAME_MACHINE +to the type of the modules. +Current modutils does not support full cross build mode for modules, it +is limited to choosing between 32 and 64 bit versions of the host +architecture. .TP .BR \-d ", " \-\-debug Show information about the internal representation of the stack of modules. diff -Nur modutils-2.4.15/modutils.spec modutils-2.4.16/modutils.spec --- modutils-2.4.15/modutils.spec Fri Mar 1 11:40:09 2002 +++ modutils-2.4.16/modutils.spec Thu Apr 4 16:39:13 2002 @@ -1,6 +1,6 @@ Summary: Module utilities Name: modutils -Version: 2.4.15 +Version: 2.4.16 Release: 1 Copyright: GPL Group: Utilities/System diff -Nur modutils-2.4.15/util/alias.h modutils-2.4.16/util/alias.h --- modutils-2.4.15/util/alias.h Sun Mar 24 15:07:04 2002 +++ modutils-2.4.16/util/alias.h Sun Apr 28 18:00:14 2002 @@ -141,6 +141,7 @@ "char-major-108 ppp_generic", "char-major-109 lvm-mod", "char-major-161 ircomm-tty", + "char-major-200 vxspec", "dos msdos", "dummy0 dummy", diff -Nur modutils-2.4.15/util/arch64.c modutils-2.4.16/util/arch64.c --- modutils-2.4.15/util/arch64.c Fri Mar 1 11:39:06 2002 +++ modutils-2.4.16/util/arch64.c Sun Apr 28 19:39:21 2002 @@ -28,6 +28,16 @@ /* Indicate if the current machine uses 64 bit architecture */ int arch64(void) { - struct utsname u; - return(!uname(&u) && strstr(u.machine, "64")); + struct utsname uts; + char *uname_m; + if (uname(&uts)) + return(0); + if ((uname_m = getenv("UNAME_MACHINE"))) { + int l = strlen(uname_m); + if (l >= sizeof(uts.machine)) + l = sizeof(uts.machine)-1; + memcpy(uts.machine, uname_m, l); + uts.machine[l] = '\0'; + } + return(strstr(uts.machine, "64") != NULL); }