Rick, first a question, then hopefully a solution.  Is the version of
cpint higher/newer than the one on linuxvm.org, 2.5.3?  If so, I'll have
to bug Neale about sending me the software, or putting it up on Sine
Nomine's site so I can point to it.

I was able to reproduce your problem on the git390 system at Marist.  I
discovered that I needed to have matching levels of kernel-s390x,
kernel-source, and kernel-syms packages.  Make sure /usr/src/linux-obj
points to the correct /usr/src/linux-2.6.5-#.###-obj directory.

Once I did that, either
make -C /lib/modules/`uname -r`/build M=`pwd`
Or 
make -C /usr/src/linux-obj/s390/s390x M=$(pwd)
Worked for me.

I noticed one oddity.  When I insmodded the new module, this showed up
in the kernel ring buffer:
cpint_mod: disagrees about version of symbol struct_module

Not sure if I should be worried about it or not.  The hcp command still
seems to work anyway.

As a note, the ELF magic for the newly-built module (either the one that
didn't work, or the one that did) matched what was in the module shipped
by Novell.  The only difference I could see was around offset 050+, and
it looked like the version number, 230 versus 250.  (I did an "od -c"
command on both of them and diffed the output.)


Mark Post

-----Original Message-----
From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of
Rick Troth
Sent: Sunday, June 11, 2006 1:04 AM
To: [email protected]
Subject: trouble building a kernel module

I'm having trouble building a new CPINT on SLES9 (SP3)
and I wonder if someone else has seen these symptoms.
Maybe someone can tell me what I'm doing wrong.
It builds cleanly,  but refuses to load.  (64-bit)

DETAILS

We needed to upgrade CPINT (that story is for another note)
so I got the latest and greatest source from Dr. Ferguson.
It built just fine,  but when I tried to  'insmod',  I got

        insmod: error inserting './cpint_mod.ko': -1 Invalid module
format

I thought maybe I needed to play EXPLICITLY by the rules,
so I dropped it into  /lib/modules,  ran  'depmod'  and then
'modprobe',  and got

        FATAL: Error inserting cpint
        (/lib/modules/2.6.5-7.191-s390x/extra/cpint.ko):
        Invalid module format

I called Neale,  he considered what we were going through
and suggested making sure that the support level might be mis-matched
(between the kernel and 'insmod' and friends).  Sure enough,  we had
the SP2 modutils,  but this is an SP3 kernel.   So I upgraded modutils
... but got the same problem.

Finally,  running  'strace'  against an explicity  'insmod'  shows

        # strace insmod ./cpint_mod.ko
        init_module("^?ELF^B^B^A", 0x8edb7) = -1
        ENOEXEC (Exec format error)

The ELF magic looks ugly,  but I don't really know
if it is out of whack or if that is how it's supposed to look.

I did have to wrangle the kernel source into a state where I could
build kernel modules.  But that's not surprising.  And I have now
re-done  'make config'  and  'make modules'  numerous times.
(But it occurs to me as I send this note that I am NOT running a
home-built kernel.)

-- R;

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to