diff -Nur modutils-2.4.11/ChangeLog modutils-2.4.12/ChangeLog --- modutils-2.4.11/ChangeLog Sun Nov 11 16:17:58 2001 +++ modutils-2.4.12/ChangeLog Tue Nov 20 14:09:11 2001 @@ -1,3 +1,12 @@ +2001-11-20 Keith Owens + + modutils 2.4.12 + + * More verbose hints for unresolved symbols in non-GPL modules. + * Remove spurious #endif from elf_ppc64.h. + * Use #define for taint flags, add taint flag for non-SMP capable cpus. + * Do not check if the module is already loaded when -n is specified. + 2001-11-15 Keith Owens modutils 2.4.11 diff -Nur modutils-2.4.11/include/elf_ppc64.h modutils-2.4.12/include/elf_ppc64.h --- modutils-2.4.11/include/elf_ppc64.h Sun Nov 11 16:27:41 2001 +++ modutils-2.4.12/include/elf_ppc64.h Sat Nov 17 22:16:57 2001 @@ -85,5 +85,3 @@ #define R_PPC64_GNU_VTINHERIT R_PPC_GNU_VTINHERIT #define R_PPC64_GNU_VTENTRY R_PPC_GNU_VTENTRY #endif /* R_PPC64_ADDR64 */ - -#endif diff -Nur modutils-2.4.11/include/module.h modutils-2.4.12/include/module.h --- modutils-2.4.11/include/module.h Fri Jan 5 12:45:19 2001 +++ modutils-2.4.12/include/module.h Sat Nov 17 22:41:24 2001 @@ -23,7 +23,7 @@ #ifndef MODUTILS_MODULE_H #define MODUTILS_MODULE_H 1 -#ident "$Id: module.h 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $" +#ident "$Id: module.h 1.2 Sat, 17 Nov 2001 22:41:24 +1100 kaos $" /* This file contains the structures used by the 2.0 and 2.1 kernels. We do not use the kernel headers directly because we do not wish @@ -206,5 +206,14 @@ * expansion is not allowed on that name. */ extern unsigned int safemode; + +/*======================================================================*/ +/* Tainted kernel information. This must match include/linux/kernel.h */ +/* and kernel/panic.c. */ + +#define TAINT_FILENAME "/proc/sys/kernel/tainted" +#define TAINT_PROPRIETORY_MODULE (1<<0) +#define TAINT_FORCED_MODULE (1<<1) +#define TAINT_UNSAFE_SMP (1<<2) #endif /* module.h */ diff -Nur modutils-2.4.11/include/version.h modutils-2.4.12/include/version.h --- modutils-2.4.11/include/version.h Thu Oct 4 16:33:23 2001 +++ modutils-2.4.12/include/version.h Sun Nov 11 17:11:58 2001 @@ -1 +1 @@ -#define MODUTILS_VERSION "2.4.11" +#define MODUTILS_VERSION "2.4.12" diff -Nur modutils-2.4.11/insmod/insmod.c modutils-2.4.12/insmod/insmod.c --- modutils-2.4.11/insmod/insmod.c Sun Nov 11 15:54:54 2001 +++ modutils-2.4.12/insmod/insmod.c Tue Nov 20 14:09:11 2001 @@ -58,7 +58,7 @@ Keith Owens September 2001. */ -#ident "$Id: insmod.c 1.4.1.5 Sun, 11 Nov 2001 15:54:54 +1100 kaos $" +#ident "$Id: insmod.c 1.4.1.8 Tue, 20 Nov 2001 14:09:11 +1100 kaos $" #include #include @@ -94,6 +94,7 @@ static int n_ext_modules_used; static int m_has_modinfo; +static int gplonly_seen; extern int insmod_main(int argc, char **argv); extern int insmod_main_32(int argc, char **argv); @@ -255,6 +256,7 @@ * their references. */ if (strncmp((char *)s->name, "GPLONLY_", 8) == 0) { + gplonly_seen = 1; if (gpl) ((char *)s->name) += 8; else @@ -1413,7 +1415,7 @@ /* Check if loading this module will taint the kernel. */ static void check_tainted_module(struct obj_file *f, int noload) { - static const char tainted_file[] = "/proc/sys/kernel/tainted"; + static const char tainted_file[] = TAINT_FILENAME; int fd, kernel_has_tainted; const char *ptr; @@ -1434,22 +1436,22 @@ case 0: break; case 1: - set_tainted(f, fd, kernel_has_tainted, noload, 1, "no license", ""); + set_tainted(f, fd, kernel_has_tainted, noload, TAINT_PROPRIETORY_MODULE, "no license", ""); break; case 2: /* The module has a non-GPL license so we pretend that the * kernel always has a taint flag to get a warning even on * kernels without the proc flag. */ - set_tainted(f, fd, 1, noload, 1, "non-GPL license - ", ptr); + set_tainted(f, fd, 1, noload, TAINT_PROPRIETORY_MODULE, "non-GPL license - ", ptr); break; default: - set_tainted(f, fd, 1, noload, 1, "Unexpected return from obj_gpl_license", ""); + set_tainted(f, fd, 1, noload, TAINT_PROPRIETORY_MODULE, "Unexpected return from obj_gpl_license", ""); break; } if (flag_force_load) - set_tainted(f, fd, 1, noload, 2, "forced load", ""); + set_tainted(f, fd, 1, noload, TAINT_FORCED_MODULE, "forced load", ""); if (fd >= 0) close(fd); } @@ -1703,7 +1705,7 @@ */ set_ncv_prefix(NULL); - for (i = 0; i < n_module_stat; ++i) { + for (i = 0; !noload && i < n_module_stat; ++i) { if (strcmp(module_stat[i].name, m_name) == 0) { error("a module named %s already exists", m_name); goto out; @@ -1771,8 +1773,20 @@ arch_create_got(f); /* DEPMOD */ if (!obj_check_undefineds(f, quiet)) { /* DEPMOD, obj_clear_undefineds */ - if (!gpl && !quiet) - error("Note: modules without a GPL compatible license cannot use GPLONLY_ symbols"); + if (!gpl && !quiet) { + if (gplonly_seen) + error("\n" + "Hint: You are trying to load a module without a GPL compatible license\n" + " and it has unresolved symbols. The module may be trying to access\n" + " GPLONLY symbols but the problem is more likely to be a coding or\n" + " user error. Contact the module supplier for assistance, only they\n" + " can help you.\n"); + else + error("\n" + "Hint: You are trying to load a module without a GPL compatible license\n" + " and it has unresolved symbols. Contact the module supplier for\n" + " assistance, only they can help you.\n"); + } goto out; } obj_allocate_commons(f); /* DEPMOD */ diff -Nur modutils-2.4.11/insmod/lsmod.c modutils-2.4.12/insmod/lsmod.c --- modutils-2.4.11/insmod/lsmod.c Thu Oct 4 16:33:23 2001 +++ modutils-2.4.12/insmod/lsmod.c Sat Nov 17 22:41:24 2001 @@ -21,7 +21,7 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ident "$Id: lsmod.c 1.2 Thu, 04 Oct 2001 16:33:23 +1000 kaos $" +#ident "$Id: lsmod.c 1.3 Sat, 17 Nov 2001 22:41:24 +1100 kaos $" #include #include @@ -80,7 +80,7 @@ return 1; } - if ((f = fopen("/proc/sys/kernel/tainted", "r"))) { + if ((f = fopen(TAINT_FILENAME, "r"))) { fscanf(f, "%d", &tainted); fclose(f); } @@ -89,9 +89,10 @@ printf("Module Size Used by "); if (f) { if (tainted) { - printf("Tainted: %c%c", - tainted & 1 ? 'P' : 'G', - tainted & 2 ? 'F' : ' '); + printf("Tainted: %c%c%c", + tainted & TAINT_PROPRIETORY_MODULE ? 'P' : 'G', + tainted & TAINT_FORCED_MODULE ? 'F' : ' ', + tainted & TAINT_UNSAFE_SMP ? 'S' : ' '); } else printf("Not tainted"); diff -Nur modutils-2.4.11/insmod/modprobe.c modutils-2.4.12/insmod/modprobe.c --- modutils-2.4.11/insmod/modprobe.c Mon Feb 26 12:07:17 2001 +++ modutils-2.4.12/insmod/modprobe.c Tue Nov 20 14:09:11 2001 @@ -977,7 +977,7 @@ /* Something new for us to do? Or is the module already installed... */ if (desc == NULL || strcmp(desc->objkey, "null") == 0 || - lookup_key(in_kernel, desc->kname) != NULL) + runit && lookup_key(in_kernel, desc->kname) != NULL) return 0; /* else */ diff -Nur modutils-2.4.11/modutils.spec modutils-2.4.12/modutils.spec --- modutils-2.4.11/modutils.spec Thu Oct 4 16:32:39 2001 +++ modutils-2.4.12/modutils.spec Sun Nov 11 17:11:58 2001 @@ -1,6 +1,6 @@ Summary: Module utilities Name: modutils -Version: 2.4.11 +Version: 2.4.12 Release: 1 Copyright: GPL Group: Utilities/System