[OpenAFS-devel] Generating a Linux 2.6-style .ko
chas williams (contractor)
chas@cmf.nrl.navy.mil
Thu, 27 May 2004 13:49:14 -0400
In message <Pine.LNX.4.60.0405271323320.22258@napoleon>,Asheesh Laroia writes:
>Kernel source: 2.6.6 from Debian (kernel-source-2.6.6)
2.6.6 has changed a few things. try applying this to the afs sources
and see if you can load the .o into your kernel (normally this bit of
code is generated by a script in the kernel build tree. if this changes
much it might be necessary to call that script).
.ko is just a name.
Index: src/afs/LINUX/osi_module.c
===================================================================
RCS file: /cvs/openafs/src/afs/LINUX/osi_module.c,v
retrieving revision 1.49
diff -u -u -r1.49 osi_module.c
--- src/afs/LINUX/osi_module.c 15 May 2004 06:43:12 -0000 1.49
+++ src/afs/LINUX/osi_module.c 20 May 2004 20:44:56 -0000
@@ -43,6 +43,20 @@
MODULE_INFO(vermagic, VERMAGIC_STRING);
+struct module __this_module
+__attribute__((section(".gnu.linkonce.this_module"))) = {
+ .name = __stringify(KBUILD_MODNAME),
+ .init = init_module,
+#ifdef CONFIG_MODULE_UNLOAD
+ .exit = cleanup_module,
+#endif
+};
+
+static const char __module_depends[]
+__attribute_used__
+__attribute__((section(".modinfo"))) =
+"depends=";
+
#endif
#ifdef AFS_SPARC64_LINUX24_ENV