[OpenAFS-devel] Building cvs head on Linux 2.6

chas williams (contractor) chas@cmf.nrl.navy.mil
Sun, 30 May 2004 13:01:40 -0400


not quite.  you get redefinition of __this_module when compiling
osi_module.c.  you could conditionalize this to KERNEL_VERSION > 2.6.5
but its probably better to adopt jeff's patch which uses the linux kernel
build environment as a long term solution.

In message <sjm4qpxsx6c.fsf@dogbert.ihtfp.org>,Derek Atkins writes:
>Does it still build a working module for older versions of 2.6?
>
>-derek
>
>"chas williams (contractor)" <chas@cmf.nrl.navy.mil> writes:
>
>> In message <200405301253.i4UCrMw1022786@ginger.cmf.nrl.navy.mil>,"chas willi
>ams
>>  (contractor)" writes:
>> as ticket #4767.  you could try that or the following might be things
>> to load.
>>
>> i actually screwed this patch up a bit.  it should be KBUILD_BASENAME
>> not DKBUILD_BASENAME.  with this and the _count fix, i can build a working
>> module for 2.6.7-rc2.
>>
>> 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	30 May 2004 12:51:52 -0000
>> @@ -43,6 +43,20 @@
>>  
>>  MODULE_INFO(vermagic, VERMAGIC_STRING);
>>  
>> +struct module __this_module
>> +__attribute__((section(".gnu.linkonce.this_module"))) = {
>> + .name = __stringify(KBUILD_BASENAME),
>> + .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
>>
>>
>
>-- 
>       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>       Member, MIT Student Information Processing Board  (SIPB)
>       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>       warlord@MIT.EDU                        PGP key available
>