building modules

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

building modules

784 Views
albert_arquer
Contributor I

Hello, I'm affraid I have another issue....

 

I currently have installed the LTIB that belongs to the i.MX25 PDK and I need to compile modules on for the BSP. Last time I had to do this i did this:

 

1. I went to /opt/freescale/pkgs/

2. Extracted linux-2.6.31.tar.bz2

3. Modified the code I wanted in /drivers/....

4. Compress the fonder linux-2.6.31 into linux-2.6.31.tar.bz2 again

5. Recalculated md5 checksum: md5sum linux-2.6.31.tar.bz2 > linux-2.6.31.tar.bz2.md5

6. Went to LTIB's source directory and rebuildt the kernel.

 

This solution did work, however, you can see how tedious it is. I am sure that there is a better way to do this but I can't seem to get it to work properly.. I am running on a standard i386 with ubuntu and I know how to build modules for my own platform with the command "make -C /lib/modules/$(uname -r)/build/ M=`pwd` modules"

However, if I go to /ltib/rpm/BUILD/linux-2.6.31/drivers/net/wireless/libertas (for example) and I change the makefile strictly to make it independent from the kernel global build (changing the obj-($CONFIG_PARAMETER) to obj-m) and then type:

make -C LTIBSOURCEDIR/rpm/BUILD/linux-2.6.31/kernel/ M=`pwd` modules

I get an error telling me that there is no target "modules" and if I try with the path "LTIBSOURCEDIR/rpm/BUILD/linux-2.6.31" without going into the "kernel" folder I get a huge output full of errors.....

What am I doing wrong?¿? I am really desperate as this is a very important issue that is not allowing me to move forward.

 

I will appreciate anybodys help but I ask you please to explain things clearly as I am a newbie and get lost easily.

 

PS: I am attaching both Makefiles, the original and the modified one that I am using to try to compile the libertas driver so that you can see if I am doing it correctly.

 

Thanks again!!!

Tags (1)
0 Kudos
Reply
2 Replies

708 Views
albert_arquer
Contributor I
Thanks for your quick answer Rogerio. However, the process you describe still involves rebuilding the whole kernel (if i am not mistaken). There must be an easier way to build only a certain module and then loading it to the target platform with a memory device (like a USB stick) in order to test it without having to rebuild the kernel with the consequent re-programming of the device....
0 Kudos
Reply

708 Views
rogerio_silva
NXP Employee
NXP Employee

Using LTIB, you can:

 

1 - Unpack the package you want to work on (e.g. kernel):

./ltib -p kernel -m prep

2 - Modify the package (kernel) as you want at ltib/rpm/BUILD/linux

3 - Build the package:

./ltib -p kernel -m scbuild

4 - Install it:

./ltib -p kernel -m scdeploy

 

For every change on code you can do steps 3 and 4.

 

Rgds,

Rogerio

0 Kudos
Reply