linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* modutils 2.4.2, please test asap
@ 2001-01-22 18:24 Keith Owens
  2001-01-22 19:28 ` Keith Owens
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Keith Owens @ 2001-01-22 18:24 UTC (permalink / raw)
  To: linux-hotplug

Please test this modutils patch ASAP, at least one distribution is
waiting to burn their master CD for kernel 2.4.0.  Remove
patch-2.4.0-hotplug from the kernel if you have installed it.

This patch is being released under protest.  It completely drops
support for USB device ids on kernel 2.4.0-prerelease and earlier.
That will break USB support for anybody who installs modutils 2.4.2 and
tries to run a kernel before 2.4.0.

Breaking backwards compatibility goes completely against the grain for
modutils.  It goes to a lot of bother to support users on older kernels
and to ensure that any mix of new modutils and old kernels will work,
even down to kernel 2.0.  But since the USB maintainers are refusing to
support USB on anything older than 2.4.0, I have no choice but to break
backwards compatibility.

diff -Nur modutils-2.4.1/ChangeLog modutils-2.4.2/ChangeLog
--- modutils-2.4.1/ChangeLog	Tue Jan  9 02:16:00 2001
+++ modutils-2.4.2/ChangeLog	Tue Jan 23 05:13:16 2001
@@ -1,3 +1,13 @@
+2001-01-23  Keith Owens  <kaos@ocs.com.au>
+
+	modutils 2.4.2
+
+	* genksym changes: Remove 'attribute' as a C keyword, add 'restrict',
+	  '__restrict', '__restrict__', '_Bool'.  Thanks to Richard Henderson.
+	* Log modprobe commands in /var/log/ksymoops.  This one's for Wichert.
+	* Revert to a single USB table format.  USB maintainers will not support
+	  anybody on 2.4.0-prerelease or earlier.
+
 2001-01-09  Keith Owens  <kaos@ocs.com.au>
 
 	modutils 2.4.1
diff -Nur modutils-2.4.1/depmod/depmod.c modutils-2.4.2/depmod/depmod.c
--- modutils-2.4.1/depmod/depmod.c	Tue Jan  9 01:27:37 2001
+++ modutils-2.4.2/depmod/depmod.c	Tue Jan 23 05:13:16 2001
@@ -23,7 +23,7 @@
  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
-#ident "$Id: depmod.c 1.2 Tue, 09 Jan 2001 01:27:37 +1100 kaos $"
+#ident "$Id: depmod.c 1.3 Tue, 23 Jan 2001 05:13:16 +1100 kaos $"
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -96,6 +96,8 @@
 /* Version 1 table extracted from 2.4.0-test10-pre3 + David Brownell
  * usb-device_id patch 2.
  * Version 2 table extracted from 2.4.0 + Keith Owens 2.4.0-depmod patch.
+ * Update 23/01/2001.  Drop version 2 and old version 1.  New version 1
+ * is now from kernel 2.4.0.
  */
 
 #ifndef __u16
@@ -121,11 +123,23 @@
  * of the structure.  KAO moved it to before driver_info and defined that format
  * as a version 2 table for kernel 2.4.1 and modutils 2.4.1.  USB modules will
  * not be supported in standard kernel 2.4.0, with any version of modutils.
+ *
+ * Update 23/01/2001.  USB maintainers will not support anybody using the USB
+ * table format in 2.4.0-prerelease or earlier.  Without their support, Linus
+ * will not apply my patch to add version numbers to kernel tables.  Without the
+ * version number, depmod cannot distinguish between 2.4.0-prelease or earlier
+ * formats and 2.4.0.  So it has to assume 2.4.0 format for everybody.  This
+ * will break USB for anybody using modutils >= 2.4.2 on kernels before 2.4.0.
  */
 
 unsigned int usb_device_id_ver;
 
 struct usb_device_id {
+	/* This bitmask is used to determine which of the following fields
+	 * are to be used for matching.
+	 */
+	__u16		match_flags;
+
 	/*
 	 * vendor/product codes are checked, if vendor is nonzero
 	 * Range is for device revision (bcdDevice), inclusive;
@@ -151,15 +165,10 @@
 	__u8		bInterfaceSubClass;
 	__u8		bInterfaceProtocol;
 
-	/* This bitmask is used to determine which of the preceding fields
-	 * are to be used for matching.
-	 */
-	__u16		match_flags;	/* New in version 2 */
-
 	/*
 	 * for driver's use; not involved in driver matching.
 	 */
-	unsigned tgt_long		driver_info;
+	unsigned long	driver_info;
 };
 
 /* Supplied by Adam J. Richter, approx 2.4.0-test13, modified by KAO.
@@ -415,7 +424,8 @@
  *	Note: assumes same machine and arch for depmod and module.
  */
 static void extract_version(struct obj_file *f, void *image, unsigned long m_size,
-			    const char *table, unsigned int *version, int max_version)
+			    const char *table, unsigned int *version,
+			    int min_version, int max_version)
 {
 	ElfW(Addr) ref_ver;
 	unsigned tgt_long ver;
@@ -424,20 +434,20 @@
 	strcat(name, table);
 	strcat(name, "_ver");
 	ref_ver = obj_symbol_final_value(f, obj_find_symbol(f, name));
-	/* Kernels before 2.4.1 do not have __module_<table>_ver, default to version 1 */
+	/* Kernels before 2.4.1 do not have __module_<table>_ver, default to min_version */
 	if (ref_ver) {
 		if (!in_range(f, m_size, ref_ver, sizeof(ver)))
 			return;
 		memcpy(&ver, (char *)image + ref_ver - f->baseaddr, sizeof(ver));
 	}
 	else
-		ver = 1;
+		ver = min_version;
 	if (*version && *version != ver) {
 		error("Modules have a mixture of version %d and version %" tgt_long_fmt "d %s tables",
 			*version, ver, table);
 		exit(-1);
 	}
-	if (ver > max_version) {
+	if (ver < min_version || ver > max_version) {
 		error("Module %s has an unknown version (%" tgt_long_fmt "d) %s table%s",
 			f->filename, ver, table, has_kernel_changed);
 		exit(-1);
@@ -468,7 +478,7 @@
 	if (!in_range(f, m_size, ref_ref_pci, sizeof(ref_pci)))
 		return;
 	memcpy(&ref_pci, (char *)image + ref_ref_pci - f->baseaddr, sizeof(ref_pci));
-	extract_version(f, image, m_size, "pci_device", &pci_device_id_ver, 1);
+	extract_version(f, image, m_size, "pci_device", &pci_device_id_ver, 1, 1);
 	if (pci_device_size != sizeof(pci_device)) {
 		error("Unexpected value (%" tgt_long_fmt "d) in '%s' for pci_device_size%s",
 			pci_device_size, f->filename, has_kernel_changed);
@@ -503,7 +513,7 @@
 	if (!in_range(f, m_size, ref_ref_isapnp, sizeof(ref_isapnp)))
 		return;
 	memcpy(&ref_isapnp, (char *)image + ref_ref_isapnp - f->baseaddr, sizeof(ref_isapnp));
-	extract_version(f, image, m_size, "isapnp_device", &isapnp_device_id_ver, 1);
+	extract_version(f, image, m_size, "isapnp_device", &isapnp_device_id_ver, 1, 1);
 	if (isapnp_device_size != sizeof(isapnp_device)) {
 		error("Unexpected value (%" tgt_long_fmt "d) in '%s' for isapnp_device_size%s",
 			isapnp_device_size, f->filename, has_kernel_changed);
@@ -572,7 +582,7 @@
 	if (!in_range(f, m_size, ref_ref_usb, sizeof(ref_usb)))
 		return;
 	memcpy(&ref_usb, (char *)image + ref_ref_usb - f->baseaddr, sizeof(ref_usb));
-	extract_version(f, image, m_size, "usb_device", &usb_device_id_ver, 2);
+	extract_version(f, image, m_size, "usb_device", &usb_device_id_ver, 1, 1);
 	if (usb_device_size != sizeof(usb_device)) {
 		error("Unexpected value (%" tgt_long_fmt "d) in '%s' for usb_device_size%s",
 		usb_device_size, f->filename, has_kernel_changed);
@@ -608,7 +618,7 @@
 	if (!in_range(f, m_size, ref_ref_parport, sizeof(ref_parport)))
 		return;
 	memcpy(&ref_parport, (char *)image + ref_ref_parport - f->baseaddr, sizeof(ref_parport));
-	extract_version(f, image, m_size, "parport_device", &parport_device_id_ver, 1);
+	extract_version(f, image, m_size, "parport_device", &parport_device_id_ver, 1, 1);
 	if (parport_device_size != sizeof(parport_device)) {
 		error("Unexpected value (%" tgt_long_fmt "d) in '%s' for parport_device_size%s",
 			parport_device_size, f->filename, has_kernel_changed);
@@ -1150,8 +1160,8 @@
 
 	ptmod = modules;
 	fprintf(usbmap, "# usb module         ");
-	if (usb_device_id_ver > 1)
-		fprintf(usbmap, "match_flags ");
+	/* Requires all users to be on kernel 2.4.0 or later */
+	fprintf(usbmap, "match_flags ");
 	fprintf(usbmap, "idVendor idProduct bcdDevice_lo bcdDevice_hi"
 		" bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass"
 		" bInterfaceProtocol driver_info\n");
@@ -1162,10 +1172,9 @@
 			continue;
 		for (j = 0; j < ptmod->n_usb_device; j++, usb_device++) {
 			fprintf(usbmap, "%-20s ", shortname(ptmod->name));
-			if (usb_device_id_ver > 1) {
-				fprintf(usbmap, "0x%0*x      ",
+			/* Requires all users to be on kernel 2.4.0 or later */
+			fprintf(usbmap, "0x%0*x      ",
 				(int)(2*sizeof(usb_device->match_flags)), usb_device->match_flags);
-			}
 			fprintf(usbmap, "0x%0*x   0x%0*x    0x%0*x       0x%0*x       "
 				"0x%0*x         0x%0*x            0x%0*x            0x%0*x            0x%0*x               "
 				"0x%0*x               0x%0*" tgt_long_fmt "x\n",
diff -Nur modutils-2.4.1/genksyms/genksyms.c modutils-2.4.2/genksyms/genksyms.c
--- modutils-2.4.1/genksyms/genksyms.c	Fri Jan  5 12:45:19 2001
+++ modutils-2.4.2/genksyms/genksyms.c	Sun Jan 14 23:06:24 2001
@@ -20,7 +20,7 @@
    along with this program; if not, write to the Free Software Foundation,
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#ident "$Id: genksyms.c 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $"
+#ident "$Id: genksyms.c 1.2 Sun, 14 Jan 2001 23:06:24 +1100 kaos $"
 
 #include <stdio.h>
 #include <string.h>
@@ -111,7 +111,7 @@
 }
 
 struct symbol *
-add_symbol(const char *name, enum symbol_type type, struct string_list *defn)
+add_symbol(const char *name, enum symbol_type type, struct string_list *defn, int is_extern)
 {
   unsigned long h = crc32(name) % HASH_BUCKETS;
   struct symbol *sym;
@@ -130,6 +130,7 @@
   sym->type = type;
   sym->defn = defn;
   sym->expansion_trail = NULL;
+  sym->is_extern = is_extern;
 
   sym->hash_next = symtab[h];
   symtab[h] = sym;
@@ -137,6 +138,8 @@
   if (flag_debug)
     {
       fprintf(debugfile, "Defn for %s %s = <", symbol_type_name[type],  name);
+      if (is_extern)
+        fputs("extern ", debugfile);
       print_list(debugfile, defn);
       fputs(">\n", debugfile);
     }
@@ -350,7 +353,7 @@
 	      n->tag = SYM_NORMAL;
 	      n->next = t;
 
-	      subsym = add_symbol(cur->string, cur->tag, n);
+	      subsym = add_symbol(cur->string, cur->tag, n, 0);
 	    }
 	  if (subsym->expansion_trail)
 	    {
diff -Nur modutils-2.4.1/genksyms/genksyms.h modutils-2.4.2/genksyms/genksyms.h
--- modutils-2.4.1/genksyms/genksyms.h	Fri Jan  5 12:45:19 2001
+++ modutils-2.4.2/genksyms/genksyms.h	Sun Jan 14 23:06:24 2001
@@ -24,7 +24,7 @@
 #ifndef MODUTILS_GENKSYMS_H
 #define MODUTILS_GENKSYMS_H 1
 
-#ident "$Id: genksyms.h 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $"
+#ident "$Id: genksyms.h 1.2 Sun, 14 Jan 2001 23:06:24 +1100 kaos $"
 
 #include <stdio.h>
 
@@ -47,6 +47,7 @@
   enum symbol_type type;
   struct string_list *defn;
   struct symbol *expansion_trail;
+  int is_extern;
 };
 
 typedef struct string_list **yystype;
@@ -66,7 +67,7 @@
 
 struct symbol *find_symbol(const char *name, enum symbol_type ns);
 struct symbol *add_symbol(const char *name, enum symbol_type type,
-			   struct string_list *defn);
+			   struct string_list *defn, int is_extern);
 void export_symbol(const char *);
 
 struct string_list *reset_list(void);
diff -Nur modutils-2.4.1/genksyms/keywords.c modutils-2.4.2/genksyms/keywords.c
--- modutils-2.4.1/genksyms/keywords.c	Fri Jan  5 12:45:19 2001
+++ modutils-2.4.2/genksyms/keywords.c	Sun Jan 14 23:06:24 2001
@@ -1,116 +1,137 @@
-/* C code produced by gperf version 2.1 (K&R C version) */
-/* Command-line: gperf -a -C -g -H is_reserved_hash -k 1,3,$ -N is_reserved_word -p -t keywords.gperf  */
-
-
-#ident "$Id: keywords.c 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $"
+/* C code produced by gperf version 2.7 */
+/* Command-line: gperf -a -C -E -g -H is_reserved_hash -k 1,3,$ -N is_reserved_word -p -t genksyms/keywords.gperf  */
+#ident "$Id: keywords.c 1.2 Sun, 14 Jan 2001 23:06:24 +1100 kaos $"
 struct resword { const char *name; int token; };
-
-#define MIN_WORD_LENGTH 3
-#define MAX_WORD_LENGTH 13
-#define MIN_HASH_VALUE 3
-#define MAX_HASH_VALUE 65
-/*
-   35 keywords
-   63 is the maximum key range
-*/
+/* maximum key range = 101, duplicates = 0 */
 
 #ifdef __GNUC__
-inline
+__inline
 #endif
-static int
-is_reserved_hash (register const char *str, register int len)
+static unsigned int
+is_reserved_hash (str, len)
+     register const char *str;
+     register unsigned int len;
 {
-  static const unsigned char hash_table[] +  static const unsigned char asso_values[]      {
-     65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
-     65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
-     65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
-     65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
-     65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
-     65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
-     65, 65, 65, 65, 65, 65, 65, 65, 65,  5,
-     65, 65, 65, 65, 65, 65,  0, 65, 65, 65,
-      0, 65, 65, 65, 65, 65, 65, 65, 65, 65,
-     65, 65, 65, 65, 65,  0, 65,  0, 65, 30,
-     25,  0, 10, 15, 65, 20, 65, 65, 25,  0,
-     15, 20,  5, 65, 10,  0,  0, 25,  5, 65,
-     65, 65, 65, 65, 65, 65, 65, 65,
-  };
-  return len + hash_table[(int)str[2]] + hash_table[(int)str[0]] + hash_table[(int)str[len - 1]];
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105,   5,
+      105, 105, 105, 105, 105, 105,   0, 105, 105, 105,
+        0, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105,   0, 105,   0, 105,  15,
+       25,   0,  35,  30, 105,  20, 105, 105,  40,  30,
+       30,   0,   0, 105,   0,   0,   0,  10,   5, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
+      105, 105, 105, 105, 105, 105
+    };
+  return len + asso_values[(unsigned char)str[2]] + asso_values[(unsigned char)str[0]] + asso_values[(unsigned char)str[len - 1]];
 }
 
 #ifdef __GNUC__
-inline
+__inline
 #endif
 const struct resword *
-is_reserved_word (register const char *str, register int len)
+is_reserved_word (str, len)
+     register const char *str;
+     register unsigned int len;
 {
+  enum
+    {
+      TOTAL_KEYWORDS = 38,
+      MIN_WORD_LENGTH = 3,
+      MAX_WORD_LENGTH = 13,
+      MIN_HASH_VALUE = 4,
+      MAX_HASH_VALUE = 104
+    };
 
-  static const struct resword  wordlist[] +  static const struct resword wordlist[]      {
-      {"",}, {"",}, {"",},
-      {"asm",  ASM_KEYW},
-      {"",},
-      {"__asm",  ASM_KEYW},
-      {"",},
-      {"__asm__",  ASM_KEYW},
-      {"",},
-      {"attribute",  ATTRIBUTE_KEYW},
-      {"__signed__",  SIGNED_KEYW},
-      {"__attribute",  ATTRIBUTE_KEYW},
-      {"",},
-      {"__attribute__",  ATTRIBUTE_KEYW},
-      {"",},
-      {"__volatile",  VOLATILE_KEYW},
-      {"struct",  STRUCT_KEYW},
-      {"__volatile__",  VOLATILE_KEYW},
-      {"EXPORT_SYMBOL",  EXPORT_SYMBOL_KEYW},
-      {"",}, {"",},
-      {"extern",  EXTERN_KEYW},
-      {"typedef",  TYPEDEF_KEYW},
-      {"int",  INT_KEYW},
-      {"auto",  AUTO_KEYW},
-      {"short",  SHORT_KEYW},
-      {"",}, {"",},
-      {"__inline",  INLINE_KEYW},
-      {"enum",  ENUM_KEYW},
-      {"__inline__",  INLINE_KEYW},
-      {"",}, {"",},
-      {"__signed",  SIGNED_KEYW},
-      {"",},
-      {"float",  FLOAT_KEYW},
-      {"static",  STATIC_KEYW},
-      {"__const",  CONST_KEYW},
-      {"volatile",  VOLATILE_KEYW},
-      {"__const__",  CONST_KEYW},
-      {"",}, {"",}, {"",},
-      {"register",  REGISTER_KEYW},
-      {"char",  CHAR_KEYW},
-      {"",},
-      {"signed",  SIGNED_KEYW},
-      {"",}, {"",}, {"",},
-      {"const",  CONST_KEYW},
-      {"inline",  INLINE_KEYW},
-      {"",}, {"",},
-      {"void",  VOID_KEYW},
-      {"",},
-      {"double",  DOUBLE_KEYW},
-      {"",},
-      {"unsigned",  UNSIGNED_KEYW},
-      {"long",  LONG_KEYW},
-      {"",}, {"",}, {"",}, {"",}, {"",},
-      {"union",  UNION_KEYW},
+      {""}, {""}, {""}, {""},
+      {"auto", AUTO_KEYW},
+      {"short", SHORT_KEYW},
+      {"struct", STRUCT_KEYW},
+      {"__asm__", ASM_KEYW},
+      {"restrict", RESTRICT_KEYW},
+      {"_restrict", RESTRICT_KEYW},
+      {"__signed__", SIGNED_KEYW},
+      {"__attribute", ATTRIBUTE_KEYW},
+      {"__restrict__", RESTRICT_KEYW},
+      {"__attribute__", ATTRIBUTE_KEYW},
+      {""},
+      {"__volatile", VOLATILE_KEYW},
+      {""},
+      {"__volatile__", VOLATILE_KEYW},
+      {"EXPORT_SYMBOL", EXPORT_SYMBOL_KEYW},
+      {"char", CHAR_KEYW},
+      {""},
+      {"static", STATIC_KEYW},
+      {"__const", CONST_KEYW},
+      {"int", INT_KEYW},
+      {"__const__", CONST_KEYW},
+      {""}, {""}, {""},
+      {"__inline", INLINE_KEYW},
+      {""},
+      {"__inline__", INLINE_KEYW},
+      {""}, {""},
+      {"__signed", SIGNED_KEYW},
+      {""},
+      {"__asm", ASM_KEYW},
+      {"extern", EXTERN_KEYW},
+      {""},
+      {"register", REGISTER_KEYW},
+      {""},
+      {"float", FLOAT_KEYW},
+      {"double", DOUBLE_KEYW},
+      {"typedef", TYPEDEF_KEYW},
+      {"unsigned", UNSIGNED_KEYW},
+      {"enum", ENUM_KEYW},
+      {"_Bool", BOOL_KEYW},
+      {""}, {""}, {""}, {""},
+      {"const", CONST_KEYW},
+      {""}, {""},
+      {"volatile", VOLATILE_KEYW},
+      {"void", VOID_KEYW},
+      {""}, {""}, {""}, {""}, {""}, {""},
+      {"signed", SIGNED_KEYW},
+      {""},
+      {"asm", ASM_KEYW},
+      {""},
+      {"union", UNION_KEYW},
+      {"inline", INLINE_KEYW},
+      {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+      {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+      {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+      {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
+      {""},
+      {"long", LONG_KEYW}
     };
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
     {
       register int key = is_reserved_hash (str, len);
 
-      if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
+      if (key <= MAX_HASH_VALUE && key >= 0)
         {
           register const char *s = wordlist[key].name;
 
-          if (*s = *str && !strcmp (str + 1, s + 1))
+          if (*str = *s && !strcmp (str + 1, s + 1))
             return &wordlist[key];
         }
     }
diff -Nur modutils-2.4.1/genksyms/keywords.gperf modutils-2.4.2/genksyms/keywords.gperf
--- modutils-2.4.1/genksyms/keywords.gperf	Fri Jan  5 12:45:19 2001
+++ modutils-2.4.2/genksyms/keywords.gperf	Sun Jan 14 23:06:24 2001
@@ -1,5 +1,5 @@
 %{
-#ident "$Id: keywords.gperf 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $"
+#ident "$Id: keywords.gperf 1.2 Sun, 14 Jan 2001 23:06:24 +1100 kaos $"
 %}
 struct resword { const char *name; int token; }
 %%
@@ -16,8 +16,16 @@
 __signed__, SIGNED_KEYW
 __volatile, VOLATILE_KEYW
 __volatile__, VOLATILE_KEYW
+# According to rth, c99 defines _Bool, __restrict, __restrict__, restrict.  KAO
+_Bool, BOOL_KEYW
+_restrict, RESTRICT_KEYW
+__restrict__, RESTRICT_KEYW
+restrict, RESTRICT_KEYW
 asm, ASM_KEYW
-attribute, ATTRIBUTE_KEYW
+# attribute commented out in modutils 2.4.2.  People are using 'attribute' as a
+# field name which breaks the genksyms parser.  It is not a gcc keyword anyway.
+# KAO.
+#   attribute, ATTRIBUTE_KEYW
 auto, AUTO_KEYW
 char, CHAR_KEYW
 const, CONST_KEYW
diff -Nur modutils-2.4.1/genksyms/parse.y modutils-2.4.2/genksyms/parse.y
--- modutils-2.4.1/genksyms/parse.y	Fri Jan  5 12:45:19 2001
+++ modutils-2.4.2/genksyms/parse.y	Sun Jan 14 23:06:24 2001
@@ -22,12 +22,13 @@
 
 
 %{
-#ident "$Id: parse.y 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $"
+#ident "$Id: parse.y 1.2 Sun, 14 Jan 2001 23:06:24 +1100 kaos $"
 
 #include <assert.h>
 #include "genksyms.h"
 
 static int is_typedef;
+static int is_extern;
 static char *current_name;
 static struct string_list *decl_spec;
 
@@ -54,6 +55,7 @@
 %token ASM_KEYW
 %token ATTRIBUTE_KEYW
 %token AUTO_KEYW
+%token BOOL_KEYW
 %token CHAR_KEYW
 %token CONST_KEYW
 %token DOUBLE_KEYW
@@ -64,6 +66,7 @@
 %token INT_KEYW
 %token LONG_KEYW
 %token REGISTER_KEYW
+%token RESTRICT_KEYW
 %token SHORT_KEYW
 %token SIGNED_KEYW
 %token STATIC_KEYW
@@ -100,7 +103,7 @@
 	;
 
 declaration:
-	{ is_typedef = 0; current_name = NULL; decl_spec = NULL; }
+	{ is_typedef = 0; is_extern = 0; current_name = NULL; decl_spec = NULL; }
 	declaration1
 	{ free_list(*$2, NULL); *$2 = NULL; }
 	;
@@ -123,7 +126,7 @@
 		    (*$3)->next = NULL;
 		    add_symbol(current_name,
 			       is_typedef ? SYM_TYPEDEF : SYM_NORMAL,
-			       decl);
+			       decl, is_extern);
 		    current_name = NULL;
 		  }
 		  $$ = $3;
@@ -140,7 +143,7 @@
 		{ struct string_list *decl = *$1;
 		  *$1 = NULL;
 		  add_symbol(current_name,
-			     is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl);
+			     is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
 		  current_name = NULL;
 		  $$ = $1;
 		}
@@ -150,7 +153,7 @@
 		  free_list(*$2, NULL);
 		  *$2 = decl_spec;
 		  add_symbol(current_name,
-			     is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl);
+			     is_typedef ? SYM_TYPEDEF : SYM_NORMAL, decl, is_extern);
 		  current_name = NULL;
 		  $$ = $3;
 		}
@@ -183,12 +186,16 @@
 	;
 
 storage_class_specifier:
-	AUTO_KEYW | REGISTER_KEYW | STATIC_KEYW | EXTERN_KEYW | INLINE_KEYW
+	AUTO_KEYW
+	| REGISTER_KEYW
+	| STATIC_KEYW
+	| EXTERN_KEYW	{ is_extern = 1; $$ = $1 }
+	| INLINE_KEYW	{ is_extern = 0; $$ = $1 }
 	;
 
 type_specifier:
 	simple_type_specifier
-	| cva_qualifier
+	| cvar_qualifier
 
 	/* References to s/u/e's defined elsewhere.  Rearrange things
 	   so that it is easier to expand the definition fully later.  */
@@ -204,21 +211,21 @@
 		{ struct string_list *s = *$3, *i = *$2, *r;
 		  r = copy_node(i); r->tag = SYM_STRUCT;
 		  r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL;
-		  add_symbol(i->string, SYM_STRUCT, s);
+		  add_symbol(i->string, SYM_STRUCT, s, is_extern);
 		  $$ = $3;
 		}
 	| UNION_KEYW IDENT class_body
 		{ struct string_list *s = *$3, *i = *$2, *r;
 		  r = copy_node(i); r->tag = SYM_UNION;
 		  r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL;
-		  add_symbol(i->string, SYM_UNION, s);
+		  add_symbol(i->string, SYM_UNION, s, is_extern);
 		  $$ = $3;
 		}
 	| ENUM_KEYW IDENT BRACE_PHRASE
 		{ struct string_list *s = *$3, *i = *$2, *r;
 		  r = copy_node(i); r->tag = SYM_ENUM;
 		  r->next = (*$1)->next; *$3 = r; (*$1)->next = NULL;
-		  add_symbol(i->string, SYM_ENUM, s);
+		  add_symbol(i->string, SYM_ENUM, s, is_extern);
 		  $$ = $3;
 		}
 
@@ -238,26 +245,32 @@
 	| FLOAT_KEYW
 	| DOUBLE_KEYW
 	| VOID_KEYW
+	| BOOL_KEYW
 	| TYPE			{ (*$1)->tag = SYM_TYPEDEF; $$ = $1; }
 	;
 
 ptr_operator:
-	'*' cva_qualifier_seq_opt
+	'*' cvar_qualifier_seq_opt
 		{ $$ = $2 ? $2 : $1; }
 	;
 
-cva_qualifier_seq_opt:
+cvar_qualifier_seq_opt:
 	/* empty */					{ $$ = NULL; }
-	| cva_qualifier_seq
+	| cvar_qualifier_seq
 	;
 
-cva_qualifier_seq:
-	cva_qualifier
-	| cva_qualifier_seq cva_qualifier		{ $$ = $2; }
+cvar_qualifier_seq:
+	cvar_qualifier
+	| cvar_qualifier_seq cvar_qualifier		{ $$ = $2; }
 	;
 
-cva_qualifier:
+cvar_qualifier:
 	CONST_KEYW | VOLATILE_KEYW | ATTRIBUTE_PHRASE
+	| RESTRICT_KEYW
+		{ /* restrict has no effect in prototypes so ignore it */
+		  remove_node($1);
+		  $$ = $1;
+		}
 	;
 
 declarator:
@@ -369,7 +382,7 @@
 	decl_specifier_seq_opt declarator BRACE_PHRASE
 		{ struct string_list *decl = *$2;
 		  *$2 = NULL;
-		  add_symbol(current_name, SYM_NORMAL, decl);
+		  add_symbol(current_name, SYM_NORMAL, decl, is_extern);
 		  $$ = $3;
 		}
 	;
diff -Nur modutils-2.4.1/include/util.h modutils-2.4.2/include/util.h
--- modutils-2.4.1/include/util.h	Fri Jan  5 12:45:19 2001
+++ modutils-2.4.2/include/util.h	Fri Jan 19 17:26:33 2001
@@ -23,7 +23,7 @@
 #ifndef MODUTILS_UTIL_H
 #define MODUTILS_UTIL_H 1
 
-#ident "$Id: util.h 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $"
+#ident "$Id: util.h 1.2 Fri, 19 Jan 2001 17:26:33 +1100 kaos $"
 
 #include <stdio.h>
 #include <sys/stat.h>
@@ -76,6 +76,7 @@
 #define ME_ALL			(ME_GLOB|ME_SHELL_COMMAND|ME_BUILTIN_COMMAND)
 
 extern void snap_shot(const char *module_name, int number);
+extern void snap_shot_log(const char *fmt,...);
 
 #ifdef CONFIG_USE_ZLIB
 int gzf_open(const char *name, int mode);
diff -Nur modutils-2.4.1/include/version.h modutils-2.4.2/include/version.h
--- modutils-2.4.1/include/version.h	Fri Jan  5 16:07:52 2001
+++ modutils-2.4.2/include/version.h	Fri Jan 12 21:28:45 2001
@@ -1 +1 @@
-#define MODUTILS_VERSION "2.4.1"
+#define MODUTILS_VERSION "2.4.2"
diff -Nur modutils-2.4.1/insmod/modprobe.c modutils-2.4.2/insmod/modprobe.c
--- modutils-2.4.1/insmod/modprobe.c	Fri Jan  5 12:45:19 2001
+++ modutils-2.4.2/insmod/modprobe.c	Fri Jan 19 17:26:33 2001
@@ -1503,6 +1503,17 @@
 		{"help", 0, 0, 'h'},
 		{0, 0, 0, 0}
 	};
+	int i, l = 0;
+	char *command;
+
+	for (i = 0; i < argc; ++i)
+		l += strlen(argv[i]) + 1;
+	command = alloca(l);
+	*command = '\0';
+	for (i = 0; i < argc; ++i) {
+		strcat(command, argv[i]);
+		strcat(command, " ");
+	}
 
 	error_file = "modprobe";
 
@@ -1644,6 +1655,8 @@
 	if (showconfig)
 		config_show();
 	else if (remove) {
+		if (runit)
+			snap_shot_log("start %ssafemode=%d", command, safemode);
 		if (argc > 0) {
 			int errs;
 			for (errs = 0; argc > 0; ++argv, --argc) {
@@ -1667,8 +1680,11 @@
 			struct module_stat *m;
 			int i;
 
-			if (!get_kernel_info(K_INFO | K_REFS))
+			if (!get_kernel_info(K_INFO | K_REFS)) {
+				if (runit)
+					snap_shot_log("get_kernel_info failed");
 				return 1;
+			}
 			for (m = module_stat, i = 0; i < n_module_stat; ++i, ++m) {
 				if ((m->flags & NEW_MOD_AUTOCLEAN) &&
 				    ((m->flags & NEW_MOD_VISITED) = 0) &&
@@ -1684,10 +1700,16 @@
 			 */
 			verbose("# autoclean\n");
 			if (runit && delete_module(NULL)) {
+				int save_errno = errno;
 				perror("rmmod");
+				errno = save_errno;
+				if (runit)
+					snap_shot_log("delete_module(NULL) failed %m");
 				return 1;
 			}
 		}
+		if (runit)
+			snap_shot_log("rmmod returned %d", ret);
 	} else if (list) {
 		if (argc > 0)
 			for (; argc > 0 && ret = 0; ++argv, --argc) {
@@ -1696,11 +1718,15 @@
 		else
 			modprobe_printlist("*", type);
 	} else { /* probe module list */
+		if (runit)
+			snap_shot_log("start %ssafemode=%d", command, safemode);
 		if (argc > 0) {
 			ret = modprobe_fromlist(argc, argv, type, loadall);
 		}
 		else
 			modprobe_nothing("load");
+		if (runit)
+			snap_shot_log("probe ended");
 	}
 
 	return ret;
diff -Nur modutils-2.4.1/man/modprobe.8 modutils-2.4.2/man/modprobe.8
--- modutils-2.4.1/man/modprobe.8	Fri Jan  5 12:45:19 2001
+++ modutils-2.4.2/man/modprobe.8	Fri Jan 19 17:26:33 2001
@@ -2,7 +2,7 @@
 .\" Copyright (c) 1995, 1999 Bjorn Ekwall (bj0rn@blox.se)
 .\" This program is distributed according to the Gnu General Public License.
 .\" See the file COPYING in the base distribution directory
-.\" $Id: modprobe.8 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $
+.\" $Id: modprobe.8 1.2 Fri, 19 Jan 2001 17:26:33 +1100 kaos $
 .\"
 .TH MODPROBE 8 "March 15, 1999" Linux "Linux Module Support"
 .SH NAME
@@ -275,6 +275,14 @@
 This detects modprobe execution from the kernel on kernels 2.2 though
 2.4.0-test11, even if uid = euid, which it does on the earlier
 kernels.
+.SH "LOGGING COMMANDS"
+If directory /var/log/ksymoops exists and modprobe is run with an
+option that could load or a delete a module then modprobe will log its
+command and return status in /var/log/ksymoops/`date\ +%Y%m%d.log`.
+There is no switch to disable this automatic logging, if you do not
+want it to occur, do not create /var/log/ksymoops.  If that directory
+exists, it should be owned by root and be mode 644 or 600 and you
+should run script insmod_ksymoops_clean every day or so.
 .SH REQUIRED UTILITIES
 depmod(8),
 insmod(8)
diff -Nur modutils-2.4.1/modutils.spec modutils-2.4.2/modutils.spec
--- modutils-2.4.1/modutils.spec	Fri Jan  5 16:07:52 2001
+++ modutils-2.4.2/modutils.spec	Fri Jan 12 21:28:45 2001
@@ -1,6 +1,6 @@
 Summary: Module utilities
 Name: modutils
-Version: 2.4.1
+Version: 2.4.2
 Release: 1
 Copyright: GPL
 Group: Utilities/System
diff -Nur modutils-2.4.1/util/snap_shot.c modutils-2.4.2/util/snap_shot.c
--- modutils-2.4.1/util/snap_shot.c	Fri Jan  5 12:45:19 2001
+++ modutils-2.4.2/util/snap_shot.c	Fri Jan 19 17:26:33 2001
@@ -20,10 +20,11 @@
    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
   */
 
-#ident "$Id: snap_shot.c 1.1 Fri, 05 Jan 2001 12:45:19 +1100 kaos $"
+#ident "$Id: snap_shot.c 1.2 Fri, 19 Jan 2001 17:26:33 +1100 kaos $"
 
 #include <errno.h>
 #include <stdio.h>
+#include <stdarg.h>
 #include <time.h>
 #include <unistd.h>
 #include <string.h>
@@ -33,13 +34,14 @@
 #include "modstat.h"
 #include "util.h"
 
+static char snap_dir[] = "/var/log/ksymoops";
+
 /* If snap_dir exists, take a snap shot of ksyms and modules to snap_dir.
  * Prefix the files with the equivalent of
  * date +%Y%m%d%T%M%S | sed -e 's/://g'
  */
 void snap_shot(const char *module_names, int n_module_names)
 {
-	static char snap_dir[] = "/var/log/ksymoops";
 	char file[] = "ccyymmddhhmmss.modules", buffer[4096];
 	static char *infile[] = { "/proc/ksyms", "/proc/modules" };
 	static char *suffix[] = {       "ksyms",       "modules" };
@@ -108,4 +110,45 @@
 		fclose(in);
 		fclose(out);
 	}
+}
+
+/* If snap_dir exists, log a message to snap_dir.  The log file is called the
+ * equivalent of date +%Y%m%d | sed -e 's/://g'.  Each line is prefixed with
+ * timestamp down to seconds and followed by a newline.
+ */
+void snap_shot_log(const char *fmt,...)
+{
+	char date[] = "ccyymmdd", file[] = "ccyymmdd.log", stamp[] = "ccyymmdd hhmmss";
+	struct tm *local;
+	time_t t;
+	FILE *log;
+	va_list args;
+	int save_errno = errno;
+
+	if (chdir(snap_dir))
+		return;
+	t = time(NULL);
+	local = localtime(&t);
+	snprintf(date, sizeof(date), "%04d%02d%02d",
+			local->tm_year+1900,
+			local->tm_mon + 1,
+			local->tm_mday);
+	snprintf(file, sizeof(file), "%s.log", date);
+	log = fopen(file, "a");
+	if (!log) {
+		error("cannot create %s/%s %m", snap_dir, file);
+		return;
+	}
+	snprintf(stamp, sizeof(stamp), "%s %02d%02d%02d",
+		date,
+		local->tm_hour,
+		local->tm_min,
+		local->tm_sec);
+	fprintf(log, "%s ", stamp);
+	va_start(args, fmt);
+	errno = save_errno;	/* fmt may use %m */
+	vfprintf(log, fmt, args);
+	va_end(args);
+	fprintf(log, "\n");
+	fclose(log);
 }


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
@ 2001-01-22 19:28 ` Keith Owens
  2001-01-22 19:37 ` Miles Lane
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Keith Owens @ 2001-01-22 19:28 UTC (permalink / raw)
  To: linux-hotplug

On Mon, 22 Jan 2001 11:37:47 -0800, 
Miles Lane <miles@megapathdsl.net> wrote:
>Hey.  Let's be fair here.  Linus rejected your patch for reasons that
>had absolutely nothing to do with USB backport support issues.

On the contrary.  Linus rejected the patch because

  "I'd much rather just have the 2.4.0 behaviour, and no versioning.
  Tell people that 2.4.0-test kernels won't work. They'll notice on
  their own."

and

  "The fact that such modutils binaries won't work with pre-2.4.0
  kernels is not even on my radar screen, quite frankly.  There isn't
  even an installed base of people using it, and I don't think anybody
  of the developers using it are still using pre-kernels. In short, I
  see absolutely no reason for even trying to maintain any backwards
  compatibility in this area.".

Because the USB maintainers did not want to support backwards
compatibility, Linus saw no need for the patch.  Which is fine, if you
are happy to break backwards compatibility.  It should be obvious that
I disagree strongly with this attitude.


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
  2001-01-22 19:28 ` Keith Owens
@ 2001-01-22 19:37 ` Miles Lane
  2001-01-22 19:58 ` Stephen J. Gowdy
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Miles Lane @ 2001-01-22 19:37 UTC (permalink / raw)
  To: linux-hotplug

Keith Owens wrote:

> Please test this modutils patch ASAP, at least one distribution is
> waiting to burn their master CD for kernel 2.4.0.  Remove
> patch-2.4.0-hotplug from the kernel if you have installed it.
> 
> This patch is being released under protest.  It completely drops
> support for USB device ids on kernel 2.4.0-prerelease and earlier.
> That will break USB support for anybody who installs modutils 2.4.2 and
> tries to run a kernel before 2.4.0.
> 
> Breaking backwards compatibility goes completely against the grain for
> modutils.  It goes to a lot of bother to support users on older kernels
> and to ensure that any mix of new modutils and old kernels will work,
> even down to kernel 2.0.  But since the USB maintainers are refusing to
> support USB on anything older than 2.4.0, I have no choice but to break
> backwards compatibility.

Hey.  Let's be fair here.  Linus rejected your patch for reasons that
had absolutely nothing to do with USB backport support issues.
Rather, the kernel version tracking was rejected because Linus wants
that functionality added in 2.5 in a careful manner.  I'm not saying
your patch wasn't perfect and thoughtful.  I thought your patch looked
great, but I don't control kernel checkins.

Regarding the USB backport support, the usbd and kernel policy stuff
that David Brownell and others develops works great for that environment.
There are several important functional holes in the backport.  One of them
being in the USB Storage area.  If I understand this correctly, these are
holes that are intrinsic to the older kernel and are not easily worked
around.  All that to say that noone using a 2.2 kernel is going to be
in USB nirvana anyhow, though it works quite well.
Be assured, I'll be delighted when Linus accepts your patch and
modutils can support kernel version tracking so that modutils can
better support and handle ABI changes.  We are all just rolling with
Linus.  He is calling the shots, here.

I appreciate you getting this functional change into 2.4.2 so that
USB users in the 2.4.0 series can use hotplugging.  I'll test your patch
immediately.

Best wishes,

	Miles


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
  2001-01-22 19:28 ` Keith Owens
  2001-01-22 19:37 ` Miles Lane
@ 2001-01-22 19:58 ` Stephen J. Gowdy
  2001-01-22 20:05 ` Miles Lane
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Stephen J. Gowdy @ 2001-01-22 19:58 UTC (permalink / raw)
  To: linux-hotplug

But "pre-2.4.0" (I read between the lines) didn't include 2.2.x in this
context.

On Tue, 23 Jan 2001, Keith Owens wrote:

> On Mon, 22 Jan 2001 11:37:47 -0800, 
> Miles Lane <miles@megapathdsl.net> wrote:
> >Hey.  Let's be fair here.  Linus rejected your patch for reasons that
> >had absolutely nothing to do with USB backport support issues.
> 
> On the contrary.  Linus rejected the patch because
> 
>   "I'd much rather just have the 2.4.0 behaviour, and no versioning.
>   Tell people that 2.4.0-test kernels won't work. They'll notice on
>   their own."
> 
> and
> 
>   "The fact that such modutils binaries won't work with pre-2.4.0
>   kernels is not even on my radar screen, quite frankly.  There isn't
>   even an installed base of people using it, and I don't think anybody
>   of the developers using it are still using pre-kernels. In short, I
>   see absolutely no reason for even trying to maintain any backwards
>   compatibility in this area.".
> 
> Because the USB maintainers did not want to support backwards
> compatibility, Linus saw no need for the patch.  Which is fine, if you
> are happy to break backwards compatibility.  It should be obvious that
> I disagree strongly with this attitude.
> 
> 
> _______________________________________________
> Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
> Linux-hotplug-devel@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
> 

-- 
 /------------------------------+-=-=-=-=-+-------------------------\
|Stephen J. Gowdy               |A4000/040| Mail Stop 50A-2160, LBL, |
|http://www.ph.ed.ac.uk/~gowdy/ | 1GB   HD| 1 Cyclotron Rd, Berkeley,|
|                               |20MB  RAM| CA 94720, USA            |
|InterNet: SGowdy@lbl.gov       |3.4xCDROM| Tel: +1 510 495 2796     |
 \------------------------------+-=-=-=-=-+-------------------------/


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (2 preceding siblings ...)
  2001-01-22 19:58 ` Stephen J. Gowdy
@ 2001-01-22 20:05 ` Miles Lane
  2001-01-22 20:16 ` Johannes Erdfelt
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Miles Lane @ 2001-01-22 20:05 UTC (permalink / raw)
  To: linux-hotplug

Keith Owens wrote:

<snip>
>   "The fact that such modutils binaries won't work with pre-2.4.0
>   kernels is not even on my radar screen, quite frankly.  There isn't
>   even an installed base of people using it, and I don't think anybody
>   of the developers using it are still using pre-kernels. In short, I
>   see absolutely no reason for even trying to maintain any backwards
>   compatibility in this area.".
> 
> Because the USB maintainers did not want to support backwards
> compatibility, Linus saw no need for the patch.  Which is fine, if you
> are happy to break backwards compatibility.  It should be obvious that
> I disagree strongly with this attitude.

Thanks for clarifying that.  I hadn't quite connected all the dots.

I see why you are concerned.

Isn't it true that the /sbin/hotplug support code simply doesn't
exist in older kernels?  I am not sure that making /sbin/hotplug
work on older kernels is possible, no matter how much USB developers
might want to make it work.  If it is true that backporting
/sbin/hotplug support can't be done, than the current usbd/policy
approach is filling an important need.  Another point to consider
is that if we decided to somehow backport /sbin/hotplug support,
we'd need to migrate the installed based from the policy script
approach.  That doesn't seem like totally awesome user support
to me.

Anyhow, enough said.  I'll test your patch.

Sorry this hasn't worked out as you would have liked.

	Miles


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (3 preceding siblings ...)
  2001-01-22 20:05 ` Miles Lane
@ 2001-01-22 20:16 ` Johannes Erdfelt
  2001-01-22 20:30 ` David Brownell
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Johannes Erdfelt @ 2001-01-22 20:16 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Jan 23, 2001, Keith Owens <kaos@ocs.com.au> wrote:
> On Mon, 22 Jan 2001 11:37:47 -0800, 
> Miles Lane <miles@megapathdsl.net> wrote:
> >Hey.  Let's be fair here.  Linus rejected your patch for reasons that
> >had absolutely nothing to do with USB backport support issues.
> 
> On the contrary.  Linus rejected the patch because
> 
>   "I'd much rather just have the 2.4.0 behaviour, and no versioning.
>   Tell people that 2.4.0-test kernels won't work. They'll notice on
>   their own."
> 
> and
> 
>   "The fact that such modutils binaries won't work with pre-2.4.0
>   kernels is not even on my radar screen, quite frankly.  There isn't
>   even an installed base of people using it, and I don't think anybody
>   of the developers using it are still using pre-kernels. In short, I
>   see absolutely no reason for even trying to maintain any backwards
>   compatibility in this area.".
> 
> Because the USB maintainers did not want to support backwards
> compatibility, Linus saw no need for the patch.  Which is fine, if you
> are happy to break backwards compatibility.  It should be obvious that
> I disagree strongly with this attitude.

Just to clarify, I see no reason for supporting backwards compatibility
with development kernels. I completely agree with Linus wrt to this
decision.

As for 2.2 kernels, that's a different matter. It's essentially a fork
the 2.4 code which has been tracking changes and backporting them as
necessary.

Hotplugging is another whole ball of wax in 2.2.

JE


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (4 preceding siblings ...)
  2001-01-22 20:16 ` Johannes Erdfelt
@ 2001-01-22 20:30 ` David Brownell
  2001-01-22 21:40 ` Keith Owens
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: David Brownell @ 2001-01-22 20:30 UTC (permalink / raw)
  To: linux-hotplug

Thanks for the modutils update, Keith.  Too bad this has been
such a mess to get straight -- that 2.4.0final patch caught
most folk by surprise!


> > Because the USB maintainers did not want to support backwards
> > compatibility, Linus saw no need for the patch.  Which is fine, if you
> > are happy to break backwards compatibility.  It should be obvious that
> > I disagree strongly with this attitude.

Put it differently:  If you want to use 2.4.0-test (and prerelease)
kernels, use the 2.3.* modutils.

As it stands, we saw a bug report this morning about how 2.4 modutils
broke hotplugging with 2.2 kernels, since it created unusable (empty)
"usbmap" files ... you're not as backwards-compatible as you may
think you are!

I think it's reasonable not to want to support 2.4-test kernels;
anyone trying to use one of them has no reason to expect support.


> Isn't it true that the /sbin/hotplug support code simply doesn't
> exist in older kernels?

No; it's in the 2.2 backport (thanks to Greg) and current hotplug
scripts should work on 2.2 kernels too.  If (!) people don't try to
use the 2.4 modutils ... the empty/unusable "usbmap" breaks things.
One more point on the "no *_device_id => no mapfile" side.  That
can be kluged around in usermode, but it's an incompatibility.

- Dave



_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (5 preceding siblings ...)
  2001-01-22 20:30 ` David Brownell
@ 2001-01-22 21:40 ` Keith Owens
  2001-01-22 22:29 ` Johannes Erdfelt
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Keith Owens @ 2001-01-22 21:40 UTC (permalink / raw)
  To: linux-hotplug

On Mon, 22 Jan 2001 12:30:02 -0800, 
David Brownell <david-b@pacbell.net> wrote:
>As it stands, we saw a bug report this morning about how 2.4 modutils
>broke hotplugging with 2.2 kernels, since it created unusable (empty)
>"usbmap" files ... you're not as backwards-compatible as you may
>think you are!

Switching between kernels is not supposed to require changes to user
space utilities.  Now you have to use modutils 2.3 on 2.2 kernels and
modutils 2.4 on 2.4 kernels, that will really annoy people flipping
from one kernel to the other.  If somebody would tell me about these
things then I could fix them!  I even asked about 2.2 support for USB
earlier in the week and got no replies.  Where is the 2.2 backport for
USB?


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (6 preceding siblings ...)
  2001-01-22 21:40 ` Keith Owens
@ 2001-01-22 22:29 ` Johannes Erdfelt
  2001-01-22 22:51 ` Keith Owens
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Johannes Erdfelt @ 2001-01-22 22:29 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Jan 23, 2001, Keith Owens <kaos@ocs.com.au> wrote:
> On Mon, 22 Jan 2001 12:30:02 -0800, 
> David Brownell <david-b@pacbell.net> wrote:
> >As it stands, we saw a bug report this morning about how 2.4 modutils
> >broke hotplugging with 2.2 kernels, since it created unusable (empty)
> >"usbmap" files ... you're not as backwards-compatible as you may
> >think you are!
> 
> Switching between kernels is not supposed to require changes to user
> space utilities.  Now you have to use modutils 2.3 on 2.2 kernels and
> modutils 2.4 on 2.4 kernels, that will really annoy people flipping
> from one kernel to the other.  If somebody would tell me about these
> things then I could fix them!  I even asked about 2.2 support for USB
> earlier in the week and got no replies.  Where is the 2.2 backport for
> USB?

It was integrated into the main kernel tree somewhere in the 2.2.18 pre
patches.

JE


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (7 preceding siblings ...)
  2001-01-22 22:29 ` Johannes Erdfelt
@ 2001-01-22 22:51 ` Keith Owens
  2001-01-22 23:09 ` Greg KH
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Keith Owens @ 2001-01-22 22:51 UTC (permalink / raw)
  To: linux-hotplug

On Mon, 22 Jan 2001 12:30:02 -0800, 
David Brownell <david-b@pacbell.net> wrote:
>As it stands, we saw a bug report this morning about how 2.4 modutils
>broke hotplugging with 2.2 kernels, since it created unusable (empty)
>"usbmap" files ... you're not as backwards-compatible as you may
>think you are!

Having found the 2.2 backport, it is obvious that it does not use _any_
modutils support.  So an empty usbmap is perfectly correct and is
backwards compatible.  No modules have MODULE_DEVICE_TABLE(usb) so the
usbmap file is empty.  Where's your problem?


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (8 preceding siblings ...)
  2001-01-22 22:51 ` Keith Owens
@ 2001-01-22 23:09 ` Greg KH
  2001-01-22 23:21 ` David Brownell
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Greg KH @ 2001-01-22 23:09 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Jan 23, 2001 at 08:40:36AM +1100, Keith Owens wrote:
> On Mon, 22 Jan 2001 12:30:02 -0800, 
> David Brownell <david-b@pacbell.net> wrote:
> >As it stands, we saw a bug report this morning about how 2.4 modutils
> >broke hotplugging with 2.2 kernels, since it created unusable (empty)
> >"usbmap" files ... you're not as backwards-compatible as you may
> >think you are!
> 
> Switching between kernels is not supposed to require changes to user
> space utilities.  Now you have to use modutils 2.3 on 2.2 kernels and
> modutils 2.4 on 2.4 kernels, that will really annoy people flipping
> from one kernel to the other.  If somebody would tell me about these
> things then I could fix them!  I even asked about 2.2 support for USB
> earlier in the week and got no replies.  Where is the 2.2 backport for
> USB?

It's in the 2.2.18 kernel proper now.  And there are updates in the
2.2.19-pre series.

But you are correct, there is no module table support yet.

If I do get hotplug support working in 2.2.x with the modtables stuff, I
will use the same format that 2.4.x has, so no change will be needed for
modutils (you will not have to switch modutils between kernel versions)
and you will not have to upgrade if you do not want to have the hotplug
stuff work as well as it could.

Also, I sent the following message both to you and the list last week
when you asked about USB hotplug support in 2.2.x:

--------------------------------------------------------

On Sun, Jan 21, 2001 at 05:16:58PM +1100, Keith Owens wrote:
> Some people have mentioned usb hotplug support on 2.2 kernels, as an
> add on patch.  Does it use depmod or does it use a separate hand built
> table?  If it uses depmod, what does struct usb_device_id look like?

I had talked about doing the backport patch if others thought it would
be a good idea, but hadn't gotten to it yet.  I don't know of any
existing patches that do this (if there are, could someone point me to
them?)

I was thinking of using depmod, but due to the latest "mess" with the
structures, I hadn't decided what the usb_device_id format would look
like.  I am leaning toward whatever 2.4.x looks like, to try to preserve
compatibility as much as I can.
 
I also was/am going to test the crap out of it with older versions of
modutils, so as not to require any upgrades if the user didn't want to
have hotplug support (one of the 2.2.x requirements).

Does that all sound ok?

thanks,

greg k-h

-- 
greg@(kroah|wirex).com

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (9 preceding siblings ...)
  2001-01-22 23:09 ` Greg KH
@ 2001-01-22 23:21 ` David Brownell
  2001-01-22 23:38 ` Miles Lane
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: David Brownell @ 2001-01-22 23:21 UTC (permalink / raw)
  To: linux-hotplug

Ah, but the hotplug utilities use it.

A pure 2.2 system (kernel + modutils) has no "modules.*map" files.
A pure 2.4 system (ditto) does have them.

But 2.2.18 kernel + 2.4 modutils will generate "modules.*map" files,
which is not compatible with the previous behavior of 2.2 modutils
with such kernels.

I forget (haven't used 2.2 in a long time) -- does 2.4 modutils
keep to the 2.2 style module tree on 2.2 kernels, or does it change
that around too?

- Dave


----- Original Message ----- 
From: Keith Owens <kaos@ocs.com.au>
To: David Brownell <david-b@pacbell.net>
Cc: <linux-hotplug-devel@lists.sourceforge.net>
Sent: Monday, January 22, 2001 2:51 PM
Subject: Re: modutils 2.4.2, please test asap


> On Mon, 22 Jan 2001 12:30:02 -0800, 
> David Brownell <david-b@pacbell.net> wrote:
> >As it stands, we saw a bug report this morning about how 2.4 modutils
> >broke hotplugging with 2.2 kernels, since it created unusable (empty)
> >"usbmap" files ... you're not as backwards-compatible as you may
> >think you are!
> 
> Having found the 2.2 backport, it is obvious that it does not use _any_
> modutils support.  So an empty usbmap is perfectly correct and is
> backwards compatible.  No modules have MODULE_DEVICE_TABLE(usb) so the
> usbmap file is empty.  Where's your problem?
> 


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (10 preceding siblings ...)
  2001-01-22 23:21 ` David Brownell
@ 2001-01-22 23:38 ` Miles Lane
  2001-01-22 23:42 ` Keith Owens
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 16+ messages in thread
From: Miles Lane @ 2001-01-22 23:38 UTC (permalink / raw)
  To: linux-hotplug


Hi Keith,

Your patch is working great for me.
I have tested a USB Mouse, a USB port aggregator
(3 USB, 1 Parallel, 1 Serial) and my USB Storage
device (a Castlewood ORB drive).  They all hotplugged
beautifully.

I have been running up against USB bugs, but your
2.4.2 modutils is working like a charm.

Thanks again,

	Miles


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (11 preceding siblings ...)
  2001-01-22 23:38 ` Miles Lane
@ 2001-01-22 23:42 ` Keith Owens
  2001-01-23  2:52 ` David Brownell
  2001-01-23  3:25 ` Keith Owens
  14 siblings, 0 replies; 16+ messages in thread
From: Keith Owens @ 2001-01-22 23:42 UTC (permalink / raw)
  To: linux-hotplug

On Mon, 22 Jan 2001 15:21:33 -0800, 
David Brownell <david-b@pacbell.net> wrote:
>Ah, but the hotplug utilities use it.
>
>A pure 2.2 system (kernel + modutils) has no "modules.*map" files.
>A pure 2.4 system (ditto) does have them.
>
>But 2.2.18 kernel + 2.4 modutils will generate "modules.*map" files,
>which is not compatible with the previous behavior of 2.2 modutils
>with such kernels.

Tricky.  Something has to know whether to use modules.usbmap or not on
2.2.  This is one occasion when _not_ creating a file might be the
correct approach.  If I change modutils 2.4.2 to unlink existing map
files and only create a new map file if at least one module contains
that map, will that fix the 2.2 problem?

What, if anything, will break if maps files are not always created?

>I forget (haven't used 2.2 in a long time) -- does 2.4 modutils
>keep to the 2.2 style module tree on 2.2 kernels, or does it change
>that around too?

Modutils 2.4 handles both directory styles under /lib/modules/<version>,
for backwards compatibility.  It is the kernel Makefile which sets the
directory style for /lib/modules and there are no plans to backport the
2.4 style to 2.2.  AC will not take a 2.2 kernel patch that forces
users to upgrade their user space utilities.


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (12 preceding siblings ...)
  2001-01-22 23:42 ` Keith Owens
@ 2001-01-23  2:52 ` David Brownell
  2001-01-23  3:25 ` Keith Owens
  14 siblings, 0 replies; 16+ messages in thread
From: David Brownell @ 2001-01-23  2:52 UTC (permalink / raw)
  To: linux-hotplug

> From: Keith Owens <kaos@ocs.com.au>
> Sent: Monday, January 22, 2001 3:42 PM
>
> On Mon, 22 Jan 2001 15:21:33 -0800, 
> David Brownell <david-b@pacbell.net> wrote:
> >Ah, but the hotplug utilities use it.
> >
> >A pure 2.2 system (kernel + modutils) has no "modules.*map" files.
> >A pure 2.4 system (ditto) does have them.
> >
> >But 2.2.18 kernel + 2.4 modutils will generate "modules.*map" files,
> >which is not compatible with the previous behavior of 2.2 modutils
> >with such kernels.
> 
> Tricky.  Something has to know whether to use modules.usbmap or not on
> 2.2.  This is one occasion when _not_ creating a file might be the
> correct approach. 

It'd certainly be more convenient for 2.2 based systems.


>     If I change modutils 2.4.2 to unlink existing map
> files and only create a new map file if at least one module contains
> that map, will that fix the 2.2 problem?

Yes.  Though given what you say below, I wonderif a better fix would
be to never create "modules.usbmap" if there are 2.2 style /lib/modules/
directories.  (That is, make the backwards compatibility mode cover
all the features that changed.)


> What, if anything, will break if maps files are not always created?

Likely nothing will break, but the 2.4 systems might get a bit confused
(falling back to usb.distmap)which _might_ cause something to break.
I'll have to think about it.

- Dave


> >I forget (haven't used 2.2 in a long time) -- does 2.4 modutils
> >keep to the 2.2 style module tree on 2.2 kernels, or does it change
> >that around too?
> 
> Modutils 2.4 handles both directory styles under /lib/modules/<version>,
> for backwards compatibility.  It is the kernel Makefile which sets the
> directory style for /lib/modules and there are no plans to backport the
> 2.4 style to 2.2.  AC will not take a 2.2 kernel patch that forces
> users to upgrade their user space utilities.
> 


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: modutils 2.4.2, please test asap
  2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
                   ` (13 preceding siblings ...)
  2001-01-23  2:52 ` David Brownell
@ 2001-01-23  3:25 ` Keith Owens
  14 siblings, 0 replies; 16+ messages in thread
From: Keith Owens @ 2001-01-23  3:25 UTC (permalink / raw)
  To: linux-hotplug

On Mon, 22 Jan 2001 18:52:13 -0800, 
David Brownell <david-b@pacbell.net> wrote:
>Yes.  Though given what you say below, I wonderif a better fix would
>be to never create "modules.usbmap" if there are 2.2 style /lib/modules/
>directories.  (That is, make the backwards compatibility mode cover
>all the features that changed.)

Not reliable enough.  Some installers still create 2.2 style libraries
even on 2.4.  Modutils handles both styles, giving preference to
modules stored in the 2.4 style, but it reads all modules under
/lib/modules/<version>.


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2001-01-23  3:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-01-22 18:24 modutils 2.4.2, please test asap Keith Owens
2001-01-22 19:28 ` Keith Owens
2001-01-22 19:37 ` Miles Lane
2001-01-22 19:58 ` Stephen J. Gowdy
2001-01-22 20:05 ` Miles Lane
2001-01-22 20:16 ` Johannes Erdfelt
2001-01-22 20:30 ` David Brownell
2001-01-22 21:40 ` Keith Owens
2001-01-22 22:29 ` Johannes Erdfelt
2001-01-22 22:51 ` Keith Owens
2001-01-22 23:09 ` Greg KH
2001-01-22 23:21 ` David Brownell
2001-01-22 23:38 ` Miles Lane
2001-01-22 23:42 ` Keith Owens
2001-01-23  2:52 ` David Brownell
2001-01-23  3:25 ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).