Re: 'insmod error Invalid module format' upon an improper kernel source tree hierarchy?



On Sep 26, 8:58 pm, "lovecreatesbea...@xxxxxxxxx"
<lovecreatesbea...@xxxxxxxxx> wrote:
Hello experts,

I fail again at catching the concept of Linux 'kernel source tree' and
compiling a 'hello world' module successfully. Can you please help me
again? Thank you for your time.

I'm running a debian-40r1 (kernel 2.6.18) and got a copy of kernel
source linux-2.6.22.6.tar.bz2 from kernel.org. The version numbers of
the running kernel and the kernel source aren't exact the same, and
I'm aware of the minor difference. Will this be a problem if I don't
boot with the newly compiled kernel of 2.6.22.6.

After built the kernel source and a `hello world' module, I really
encountered a problem of `error inserting 'hellomod.ko': -1 Invalid
module format' when executed insmod.

The followings are main steps of kernel source building:

1. untar kernel source linux-2.6.22.6.tar.bz2 in my home directory.
And nothing added at /usr/src/linux. Will this be a problem?

2. su root -c 'make defconfig'

3. su root -c 'make'

4. su root -c 'make modules_install install'

Now the object files of the kernel source are all generated, those
object files are what customized kernel module programming needed, so
I just stopped here.

Do the above steps build a kernel source tree hierarchy properly,
since I didn't do the following steps '5*'.

[
5* I didn't do 'make bzImage' and didn't add corresponding entries
for the newly built kernel in GRUB or LILO.
]

hi.
if you build your kernel module using kernel sources 2.6.22.x, you
should to compile this kernel and boot using it.
but i don't really understand why did you get kernel sources from
kernel.org if debian contains linux-source-2.6.x package that has just
the same version as your debian kernel image. so if you compile your
module using kernel sources from debian package it will work properly.

.



Relevant Pages

  • How to compile in Debian?
    ... from /usr/src where to the kernel source too, ... Well, I am a newbie in Debian, and I am translating the little I know about ... I would appreciate any help you can give me to compile my drivers. ...
    (Debian-User)
  • Re: VIA Velocity 6120 driver
    ... here are the errors I get when I compile the driver (I am running ... sounds like you've got a kernel source problem or a gcc versioning ...
    (comp.os.linux.hardware)
  • Re: FreeBSD 5.1 PowerPak Installation problem
    ... I have just compiled the kernel source and installed it. ... FreeBSD 5.1 PowerPak Installation problem ... Compile your kernel with debug symbols, ...
    (freebsd-questions)
  • Re: Running low on disk space in Gentoo...
    ... > So I have to manually delete stuff from the programs I unmerge? ... When you compile the kernel other files (object files and the .config file ... Some external drivers need the kernel source and need it to be in a certain ... Yes but the latest one will be re-emerged if you don't mask them. ...
    (alt.os.linux)
  • questions about fc3
    ... What I need to know though are some basic questions. ... First of all if I want to recompile the kernel where do i find the kernel source and how do I lay it out? ... Secondly I am totally blind and just need to confirm is Brltty included in the packages of which I can update too or do I need to install the src.rpm from mielke.cc? ... Thirdly I will want to use Speakup a screen review program but I am wondering if it is okay to compile it after putting Brltty in because I don't have a serial port for a hardware synthesizer so I am going to want software speech. ...
    (alt.os.linux.redhat)