Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
jps1974
Old
#1  
Senior Member - OP
Thanks Meter 46
Posts: 108
Join Date: Nov 2009
Location: Vienna
Default [HOWTO] Compile modules for stock kernels

I couldn't figure out how to compile a module for stock kernel - I kept getting the following in dmesg:

Code:
<module>: disagrees about version of symbol module_layout
I sent a message to Samsung Open Source Release Center on Friday and received a very helpful response yesterday. Basically, c1_rev02_defconfig contains some debug options that are not set in the actual kernel. These are the options that should not be set in the config:

Code:
CONFIG_DEBUG_PREEMPT
CONFIG_DEBUG_RT_MUTEXES
CONFIG_DEBUG_SPINLOCK
CONFIG_DEBUG_MUTEXES
CONFIG_PROFILING
CONFIG_PERF_EVENTS
CONFIG_PERF_COUNTERS
CONFIG_LATENCYTOP
CONFIG_FTRACE
You can use the attached script to modify all these values (the script was also supplied by Samsung, although it was syntactically incorrect and a couple of modifications were necessary to make it work). I have included a copy of the c1_rev02_defconfig with these modifications.

Using this config, I was finally able to compile modules that can actually be loaded on the device

Kudos to Samsung for sending me this information.
Attached Files
File Type: zip config.zip - [Click for QR Code] (15.9 KB, 722 views)
Devices: Motorola Xoom | Point Of View Mobii Tegra 3G Tablet (P10AN01 / Advent Vega clone) | Samsung Galaxy S GT-I9000 | Samsung Galaxy S II GT-I9100 | Google Galaxy Nexus
 
pulser_g2
Old
#2  
pulser_g2's Avatar
Developer Admin / Elite Recognized Developer
Thanks Meter 8059
Posts: 18,419
Join Date: Nov 2009
Location: United Kingdom Likes: Galaxy Note 2 Dislikes: Noobs
Nice info I guess that will help out the people who had issues with kernel modules on stock ROMs...


Having trouble getting an answer? | What is XDA about? | How to ask for help?

if [ $PM.incoming.type = $type.question.ROM.how_to_use ] || [ $PM.incoming.type = $type.question.ROM.silly_question ]; then mv $PM.incoming /.trash; PM.response($responsetype.ignore); $PM.sender.ignore_in_future=true; init.sequence($boy_who_cried_wolf); fi;


If you wish to apply for one of the Recognized Themer/Contributor titles, or have a question, please DO NOT send me a PM about it. Instead please contact your device's forum moderator, or a senior moderator, who will deal with your application. Thanks
 
sgstwo
Old
(Last edited by sgstwo; 15th June 2011 at 01:32 AM.)
#3  
Member
Thanks Meter 9
Posts: 67
Join Date: May 2011
Quote:
Originally Posted by jps1974 View Post
Kudos to Samsung for sending me this information.
No, that is the stuff they should put on their server. Makes you wonder what else they haven't released. Every time they make modifications to the GPL open source code (eg. kernel) and release a new version, they must release the code, and the exact same files they used to build it.
 
richyy74
Old
#4  
Senior Member
Thanks Meter 28
Posts: 153
Join Date: Dec 2010
Location: Budapest
Thanks

That was the info I missed. I have successfully compiled cifs for kf1.

Sent from my GT-I9100 using XDA App
 
hiperjp
Old
#5  
Member
Thanks Meter 1
Posts: 70
Join Date: Jan 2007
Location: Santiago
You know guys if there is a basic tutorial available online?.

Thank you!
 
utp
Old
#6  
Senior Member
Thanks Meter 26
Posts: 179
Join Date: Jan 2007
Hi, I am new to compile modules for android (new to compile kernel anyway)

thanks for your info and config, I am now able to compile modules.

I had a problem on the compiled modules tho, wonder can anyone please point me some direction?

when I insmod the ko, dmesg gives me:
xyz.ko : no symbol version for module_layout

Any hint?

more info, I am compiling like:
I am aiming on compiling to for stock ROM, uname -r > 2.6.35.7-I9100XWKDD-CL161513
- I read, and follow base on http://forum.xda-developers.com/show....php?t=1113191
- kernel source from: SHW-M250L kernel source from OSRC, https://opensource.samsung.com/
- .config file of this post, select my wanted modules using make menuconfig
- then make ARCH=arm CROSS_COMPILE=__MYPATH__/bin/arm-none-eabi- modules

Thanks!
The Following User Says Thank You to utp For This Useful Post: [ Click to Expand ]
 
alx5962
Old
#7  
Senior Member
Thanks Meter 89
Posts: 241
Join Date: Jun 2007
Location: Lille
Hi,
I'm using insecure kernel :
Code:
#uname -r
2.6.35.7-I9100XWKE2-CL187606
I cross compiled modules using your config file but each time I'm trying to insmod it, I have: failed (Exec format error)
and busybox insmod gives me a invalid module format error

I use the commands :
Code:
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- menuconfig

make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- modules
So I don't really know where I'm wrong here
Samsung Galaxy S II
Acer Iconia A700

I don't ask for donation, but at least fill my thanks meter
 
utp
Old
#8  
Senior Member
Thanks Meter 26
Posts: 179
Join Date: Jan 2007
Quote:
Originally Posted by alx5962 View Post
Hi,
I'm using insecure kernel :
Code:
#uname -r
2.6.35.7-I9100XWKE2-CL187606
I cross compiled modules using your config file but each time I'm trying to insmod it, I have: failed (Exec format error)
and busybox insmod gives me a invalid module format error

I use the commands :
Code:
make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- menuconfig

make ARCH=arm CROSS_COMPILE=/opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi- modules
So I don't really know where I'm wrong here
can you do a dmesg here?
I "think" I am on a same boat as you are on the error tho.....
 
alx5962
Old
#9  
Senior Member
Thanks Meter 89
Posts: 241
Join Date: Jun 2007
Location: Lille
I didn't checked dmesg, shame on me !
so the error is :
joydev: no symbol version for module_layout

I used your config file, do I need to fix config each time I update with menuconfig ?
Samsung Galaxy S II
Acer Iconia A700

I don't ask for donation, but at least fill my thanks meter
 
utp
Old
#10  
Senior Member
Thanks Meter 26
Posts: 179
Join Date: Jan 2007
Quote:
Originally Posted by alx5962 View Post
I didn't checked dmesg, shame on me !
so the error is :
joydev: no symbol version for module_layout

I used your config file, do I need to fix config each time I update with menuconfig ?

dmesg is good to read, we are both compiling the same module (joydev)

the config file is not from me, is from jps1974.
no I don't think you need to fix unless you uses the build_kernel.sh unmod, since it cp the defconfig everytime, still I face the same problem...

 
Post Reply+
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Go to top of page...