Table fix for module-init-tools

Table fix for module-init-tools

Post by Rusty Russel » Tue, 03 Dec 2002 03:40:10



Linus, please apply,

        This patch allows the new depmod to generate the USB & PCI
hotplug tables.  Greg Banks and I are (slowly) working on a better
solution, but allows the old-style "modules.pcimap" etc. to be
generated in the short term.

Rusty.

Name: Module Table Support for module-init-tools depmod
Author: Rusty Russell
Status: Tested on 2.5.50

D: This patch adds a "__mod_XXX_table" symbol which is an alias to the
D: module table, rather than a pointer.  This makes it relatively
D: trivial to extract the table.  Previously, it required a pointer
D: dereference, which means the relocations must be applied, which is
D: why the old depmod needs so much of modutils (ie. it basically
D: links the whole module in order to find the table).
D:
D: The old depmod can still be invoked using "-F System.map" to
D: generate the tables (there'll be lots of other warnings, and it
D: will generate a completely bogus modules.dep, but the tables should
D: be OK.)

diff -urNp --exclude TAGS -X /home/rusty/current-dontdiff --minimal linux-2.5.50/include/linux/module.h working-2.5.50-table/include/linux/module.h
--- linux-2.5.50/include/linux/module.h Mon Nov 25 08:44:18 2002

 #include <linux/cache.h>
 #include <linux/kmod.h>
 #include <linux/elf.h>
+#include <linux/stringify.h>

 #include <asm/module.h>

 #ifdef MODULE

-#define MODULE_GENERIC_TABLE(gtype,name)       \
-static const unsigned long __module_##gtype##_size \
-  __attribute__ ((unused)) = sizeof(struct gtype##_id); \
-static const struct gtype##_id * __module_##gtype##_table \
-  __attribute__ ((unused)) = name
+/* For replacement modutils, use an alias not a pointer. */
+#define MODULE_GENERIC_TABLE(gtype,name)                       \
+static const unsigned long __module_##gtype##_size             \
+  __attribute__ ((unused)) = sizeof(struct gtype##_id);                \
+static const struct gtype##_id * __module_##gtype##_table      \
+  __attribute__ ((unused)) = name;                             \
+extern const struct gtype##_id __mod_##gtype##_table           \
+  __attribute__ ((unused, alias(__stringify(name))))

 /* This is magically filled in by the linker, but THIS_MODULE must be
    a constant so it works in initializers. */

--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

1. fix module-init-tools ver_linux problem.

Patch from Steven Cole to fix up ver_linux output on a system
with no module-init-tools, just modutils.

As noted in bugzilla #267 and at
http://marc.theaimsgroup.com/?l=linux-kernel&m=104492524815220&w=2

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/scripts/ver_linux linux-2.5/scripts/ver_linux
--- bk-linus/scripts/ver_linux  2003-04-10 06:01:44.000000000 +0100

 mount --version | awk -F\- '{print "mount                 ", $NF}'

-depmod -V  2>&1 | awk 'NR==1 {print "module-init-tools     ",$NF}'
+depmod -V  2>&1 | grep version | awk 'NR==1 {print "module-init-tools     ",$NF}'

 tune2fs 2>&1 | grep "^tune2fs" | sed 's/,//' |  awk \
 'NR==1 {print "e2fsprogs             ", $2}'
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. diald configuration

3. module-init-tools 0.9.3, rmmod modules with '-'

4. getche UNIX alternative ?

5. Patch?: module-init-tools/modprobe.c - use modules.dep

6. reverse resolving dynamic DNS names?

7. module-init-tools and chained aliases

8. several questions

9. module-init-tools 0.9.5

10. module-init-tools 0.9.6

11. module-init-tools 0.9.3

12. 2.5 module-init-tools/mk_initrd problems

13. module-init-tools 0.9-alpha