diff -Nur modutils-2.4.17/ChangeLog modutils-2.4.18/ChangeLog --- modutils-2.4.17/ChangeLog Sun Jul 21 19:19:32 2002 +++ modutils-2.4.18/ChangeLog Mon Jul 22 17:19:46 2002 @@ -1,3 +1,11 @@ +2002-07-22 Keith Owens + + modutils 2.4.18 + + * Optionally only check the numeric part of the kernel and module + version, insmod -N. This option is always set for kernel >= 2.5, it + defaults to off for earlier kernels. + 2002-07-21 Keith Owens modutils 2.4.17 @@ -55,14 +63,14 @@ modutils 2.4.13 * ppc64 changes by Alan Modra. - insmod/insmod.c (add_symbols_from): Add function descriptor syms for - ppc64. + insmod/insmod.c (add_symbols_from): Add function descriptor syms for + ppc64. (create_module_ksymtab): Tweak module base for ppc64. obj/obj_ppc64.c (arch_new_file): Update comment. (ppc64_process_syms): Look for kernel and module base addresses. (arch_create_got): Accept more relocs. - (apply_addr16_lo, apply_addr16_lo_ds, apply_addr16_hi, - apply_addr16_ha, apply_toc16): New. + (apply_addr16_lo, apply_addr16_lo_ds, apply_addr16_hi, + apply_addr16_ha, apply_toc16): New. (apply_toc16_ds): Use apply_addr16_lo_ds. (arch_apply_relocation): Perform more relocs. * Add --quick to depmod (equivalent to -A). diff -Nur modutils-2.4.17/include/version.h modutils-2.4.18/include/version.h --- modutils-2.4.17/include/version.h Sun Jul 21 16:59:27 2002 +++ modutils-2.4.18/include/version.h Mon Jul 22 17:16:14 2002 @@ -1 +1 @@ -#define MODUTILS_VERSION "2.4.17" +#define MODUTILS_VERSION "2.4.18" diff -Nur modutils-2.4.17/insmod/insmod.c modutils-2.4.18/insmod/insmod.c --- modutils-2.4.17/insmod/insmod.c Sun Jul 21 17:28:37 2002 +++ modutils-2.4.18/insmod/insmod.c Mon Jul 22 17:19:46 2002 @@ -89,6 +89,7 @@ static int flag_export = 1; static int flag_load_map = 0; static int flag_ksymoops = 1; +static int flag_numeric_only = 0; static int n_ext_modules_used; static int m_has_modinfo; @@ -106,6 +107,15 @@ /*======================================================================*/ +/* Only use the numeric part of the version string? */ + +static void use_numeric_only(int major, int minor, char *str) +{ + if (((major << 8) + minor) >= 0x0205 /* kernel 2.5 */ + || flag_numeric_only) + *str = '\0'; +} + /* Get the kernel version in the canonical integer form. */ static int get_kernel_version(char str[STRVERSIONLEN]) @@ -113,8 +123,9 @@ char *p, *q; int a, b, c; - strncpy(str, uts_info.release, STRVERSIONLEN); - p = uts_info.release; + strncpy(str, uts_info.release, STRVERSIONLEN-1); + str[STRVERSIONLEN-1] = '\0'; + p = str; a = strtoul(p, &p, 10); if (*p != '.') @@ -125,6 +136,7 @@ c = strtoul(p + 1, &q, 10); if (p + 1 == q) return -1; + use_numeric_only(a, b, q); return a << 16 | b << 8 | c; } @@ -628,7 +640,9 @@ } else m_has_modinfo = 1; - strncpy(str, p, STRVERSIONLEN); + strncpy(str, p, STRVERSIONLEN-1); + str[STRVERSIONLEN-1] = '\0'; + p = str; a = strtoul(p, &p, 10); if (*p != '.') @@ -639,6 +653,7 @@ c = strtoul(p + 1, &q, 10); if (p + 1 == q) return -1; + use_numeric_only(a, b, q); return a << 16 | b << 8 | c; } @@ -1509,7 +1524,7 @@ void insmod_usage(void) { fputs("Usage:\n" - "insmod [-fhkLmnpqrsSvVxXyY] [-e persist_name] [-o module_name] [-O blob_name] [-P prefix] module [ symbol=value ... ]\n" + "insmod [-fhkLmnpqrsSvVxXyYN] [-e persist_name] [-o module_name] [-O blob_name] [-P prefix] module [ symbol=value ... ]\n" "\n" " module Name of a loadable kernel module ('.o' can be omitted)\n" " -f, --force Force loading under wrong kernel version\n" @@ -1529,6 +1544,7 @@ " -X, --export Do export externs (default)\n" " -y, --noksymoops Do not add ksymoops symbols\n" " -Y, --ksymoops Do add ksymoops symbols (default)\n" + " -N, --numeric-only Only check the numeric part of the kernel version\n" " -e persist_name\n" " --persist=persist_name Filename to hold any persistent data from the module\n" " -o NAME, --name=NAME Set internal module name to NAME\n" @@ -1573,6 +1589,7 @@ {"noksymoops", 0, 0, 'y'}, {"ksymoops", 0, 0, 'Y'}, {"persist", 1, 0, 'e'}, + {"numeric-only", 1, 0, 'N'}, {"name", 1, 0, 'o'}, {"blob", 1, 0, 'O'}, {"prefix", 1, 0, 'P'}, @@ -1606,7 +1623,7 @@ errors = optind = 0; /* Process the command line. */ - while ((o = getopt_long(argc, argv, "fhkLmnpqrsSvVxXyYe:o:O:P:R:", + while ((o = getopt_long(argc, argv, "fhkLmnpqrsSvVxXyYNe:o:O:P:R:", &long_opts[0], NULL)) != EOF) switch (o) { case 'f': /* force loading */ @@ -1659,6 +1676,9 @@ break; case 'Y': /* do define ksymoops symbols */ flag_ksymoops = 1; + break; + case 'N': /* only check numeric part of kernel version */ + flag_numeric_only = 1; break; case 'e': /* persistent data filename */ diff -Nur modutils-2.4.17/man/insmod.8 modutils-2.4.18/man/insmod.8 --- modutils-2.4.17/man/insmod.8 Sun Apr 28 19:39:21 2002 +++ modutils-2.4.18/man/insmod.8 Mon Jul 22 17:19:46 2002 @@ -8,7 +8,7 @@ .hy 0 .SH SYNOPSIS .B insmod -[\-fhkLmnpqrsSvVxXyY] [\-e\ \fIpersist_name\fR] [\-o\ \fImodule_name\fR] +[\-fhkLmnpqrsSvVxXyYN] [\-e\ \fIpersist_name\fR] [\-o\ \fImodule_name\fR] [\-O\ \fIblob_name\fR] [\-P\ \fIprefix\fR] \fImodule\fR [\ \fBsymbol\fR=\fIvalue\fR\ ...\ ] .SH DESCRIPTION @@ -174,6 +174,13 @@ its minimum size, take the default and get more accurate Oops debugging. \fBksymoops\fR symbols are required to save persistent module data. +.TP +.BR \-N ", " \-\-numeric-only +Only check the numeric part of the module version against the kernel +version, i.e. ignore EXTRAVERSION when deciding if a module belongs to +a kernel. +This flag is automatically set for kernel 2.5 onwards, it is optional +for earlier kernels. .SS MODULE PARAMETERS Some modules accept load-time parameters to customize their operation. These parameters are often I/O port and IRQ numbers that vary from diff -Nur modutils-2.4.17/modutils.spec modutils-2.4.18/modutils.spec --- modutils-2.4.17/modutils.spec Sun Jul 21 16:59:27 2002 +++ modutils-2.4.18/modutils.spec Mon Jul 22 17:16:14 2002 @@ -1,6 +1,6 @@ Summary: Module utilities Name: modutils -Version: 2.4.17 +Version: 2.4.18 Release: 1 Copyright: GPL Group: Utilities/System