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



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.
]

.



Relevant Pages

  • Re: intel modem install
    ... bash shell to run install scripts ... KERNEL SOURCE HEADERS FOR THE KERNEL YOU ARE RUNNING ... login as ROOT ... In Mandrake teh kernel source is on Disk 3. ...
    (comp.os.linux.setup)
  • Re: insmod error Invalid module format upon an improper kernel source tree hierarchy?
    ... I fail again at catching the concept of Linux 'kernel source tree' and ... compiling a 'hello world' module successfully. ... su root -c 'make defconfig' ... Do the above steps build a kernel source tree hierarchy properly, ...
    (comp.os.linux.development.system)
  • Re: vmware-any-any79 problem!
    ... Mazuego adjusted his/her tin foil beanie and asbestos underwear to ... Cd as root to /usr/src/linux ... this is the kernel source folder here you issue the first command mjt ...
    (alt.os.linux.suse)
  • Re: Up to HERE with Nvidia #1
    ... This is the root cause of your problems. ... Center and get to the software install section (don't remember the ... run YOU to make sure the kernel source ...
    (alt.os.linux.suse)
  • Re: SuSE 10 - Trying to get 3D Support with a Diamond Viper V770
    ... Ref my last post. ... I forgot to mention that having installed and updated the kernel source, ... then as root in the directory /usr/src/linux type ... Prev by Date: ...
    (alt.os.linux.suse)