LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-27-2007, 03:58 AM   #1
darthfoolish
Member
 
Registered: May 2006
Posts: 52

Rep: Reputation: 15
Unhappy Building nfs module for pre exisiting kernel


Hi all

I have a project at work where I am building nfs.ko, nfs_acl.ko, sunrpc.ko and lockd.ko to insert into a pre existing kernel.

It is for a pxelinux kernel and initrd. I have 3 options, add modules to this kernel, install cli PHP on the pxe initrd that comes with the Altiris Deployment server, or start from scratch.

It was decided that adding the nfs kernel modules and deps to the pre existing kernel would be the easiest option, but I am beginning to have doubts.

doing uname -m at the console when the pxelinux image is booted yields 2.6.20.7, PREEMPT and i686, so I've downloaded that kernel, and in menuconfig, I've set smp off, preemptible kernel (low latency desktop) on, and processor family to Pentium-Pro

When my modules are compiled and I run modinfo on them, the vermagic line reads "2.6.20.7 preempt mod_unload 686", which is the same as the pre existing modules.

Now, when I do depmod -a, followed by modprobe sunrpc, (I do that first as it doesn't appear to have any deps) I get a ton of;

nfs: Unknown symbol xxxxxx

where xxxxxx is the following list;

list_add
add_preempt_count
list_del
debug_smp_processor_id
__list_add
__might_sleep
sub_preempt_count

Could sunrpc have dependencies modinfo isn't telling me about?

Why do I get debug_smp_processor_id, if I have compiled with smp switched off?

If I try to modprobe the other modules, I get longer lists of unknown sybols.

Can anyone help please?

TIA
 
Old 10-27-2007, 05:58 AM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 361Reputation: 361Reputation: 361Reputation: 361
I am not sure I understand the situation 100% here, but it sounds like you are trying to build modules for this kernel from another source tree; which simply won't work.

Even though they are the same kernel version, the kernel won't load modules that were not built against itself. You need to build your kernel modules from the exact same kernel source as the running kernel was. If this is not possible (I.E. you only have access to a binary kernel, and not the source it was built from) then the entire kernel needs to be rebuilt and replaced. Hopefully there is a .config file for the current kernel stored along with it, to make the process a little less painful.
 
Old 10-27-2007, 06:36 AM   #3
darthfoolish
Member
 
Registered: May 2006
Posts: 52

Original Poster
Rep: Reputation: 15
Yes, thats what I was trying to do.

As a test, I found a small innocuous looking module with no deps that I just built (linux/drivers/net/dummy.ko), and the kernel accepted that.

So how does that work?

Alas, there is no .config included with the binary kernel.

How can I find out what is compiled into it, if I wanted to recreate the whole thing from scratch?

What other considerations would I have to take into account?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Building a new module into a Kernel dsylvester Slackware 4 10-03-2006 04:16 PM
Building kernel module from multiple source file in 2.6 kernel yogeshwar_s Programming 1 12-20-2004 09:31 AM
Problems building a simple kernel module for kernel 2.6.7 atticman Linux - Software 2 12-13-2004 03:35 PM
Slackware 10- Please confirm my steps used to remove a module from a pre-built kernel jtp51 Slackware 7 11-03-2004 05:02 PM
Building a module within a kernel brianvdc Linux - General 1 12-11-2003 08:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration