[CentOS] C7 Kernel module compilation

Mon Aug 5 15:41:48 UTC 2019
Alessandro Baggi <alessandro.baggi at gmail.com>

Il 05/08/19 17:30, Akemi Yagi ha scritto:
> On Mon, Aug 5, 2019 at 6:46 AM Alessandro Baggi
> <alessandro.baggi at gmail.com> wrote:
>>
>> Hey there,
>> I'm trying to compile a single module following this guide:
>>
>> https://wiki.centos.org/HowTos/BuildingKernelModules#head-d2e4c05886f94c701e4ae74387d41d8c40c25d01
>>
>> and
>>
>> https://wiki.centos.org/HowTos/I_need_the_Kernel_Source
>>
>> I tried to compile a module for novuton led controller supplied by
>> thirdparty and I got several error.
>>
>> To check if this is the wrong procedure I tried to compile cifs module
>> as listed in howto but when loading with modprobe I get "Exec format
>> error", and from dmesg "cifs: no symbol version for module_layout
>> ", the same errors when compiling novuton module and I don't know why I
>> get this error.
> 
> When following the instructions in BuildingKernelModules, which kernel
> version did you use? Also, after the "depmod -a" step, what is the
> output from:
> 
> $ modinfo cifs | grep filename
> 
>> I noticed that modules in centos are compressed in .xz but after running
>> make M=fs/cifs I got only a .ko kernel module and then I run xz to
>> compress the new module.
> 
> Compressing modules is optional. Uncompressed form is functionally the
> same (of course it saves some disk space).
> 
>> Can someone help me please?
>>
>> Thanks in advance.
> 
> Akemi
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> https://lists.centos.org/mailman/listinfo/centos
> 

Hi Akemi,
thank you for your answer.

Kernel version used is 3.10.0-957.27.2.el7.x86_64

[root at c7-test SPECS]# modinfo cifs | grep filename
filename:       /lib/modules/3.10.0-957.27.2.el7.x86_64/extra/cifs.ko