Reply
Thread Tools
Posts: 5 | Thanked: 0 times | Joined on Dec 2009
#1
Hi all,

I have been trying to build custom kernel following these instructions:
Maemo Kernel Guide
Jebba compile custom kernel

After successfult compilation I was shocked when found out that new kernel modules takes ~50Mb !
Code:
du -hs /lib/modules/2.6.28-omap1-fln
48M            /lib/modules/2.6.28-omap1-fln/
The modules on the N900 takes no more than ~3Mb
Code:
du -hs /lib/modules/2.6.28-omap1
3.3M            /lib/modules/2.6.28-omap1/
Also module sizes at Jebba costom kernel modules pages http://www.freemoe.org/users/jebba/k.../2.6.28-omap1/ seems the same size as the original ones.

Issuing strip reduces module size drastically.
However file reports that booth original modules and Jebba modules are unstripped.

Is it safe to fully strip all modules? Has anyone tried?

Or should i use objcopy --strip-debug -R .modinfo -R __versions hello.ko from the Maemo Kernel Guide?

Sizes comparison:
From phone wl12xx.ko - 100K
Jebba wl12xx.ko - 100K
Just compiled wl12xx.ko - 1.5M
stripped wl12xx.ko - 68K
objcopy --strip-debug -R .modinfo -R __versions wl12xx.ko - 104K

Thanks in advance.
 
Posts: 355 | Thanked: 566 times | Joined on Nov 2009 @ Redstone Canyon, Colorado
#2
I'm not manually doing any stripping or anything like that. When the .deb gets built it takes care of such things in debian/rules. You can look at my build scripts here:
http://www.freemoe.org/users/jebba/scratchbox/kernel/

If you are just changing the .config, I suggest trying out my scripts and replacing my debian/2.6.28/rx51-custom_defconfig with your .config.

Have fun.
 

The Following 2 Users Say Thank You to jebba For This Useful Post:
Posts: 5 | Thanked: 0 times | Joined on Dec 2009
#3
Originally Posted by jebba View Post
You can look at my build scripts here:
http://www.freemoe.org/users/jebba/scratchbox/kernel/
Thanks.
strip --remove-section=.comment --remove-section=.note --strip-unneeded module.ko is what I have been looking for.

I am not really comfortable with debian packaging system yet. So for a while I'll try everything manually.

Your page and build scripts are really great resources.
 
Posts: 19 | Thanked: 16 times | Joined on Sep 2010
#4
I'm trying to compile a custom kernel, but I have a doubt on compile of modules. After make modules, I need to reduce the size of the module but with strip or objcopy my modules don't work.
I tried with my zImage and original modules the mobile computer N900 start without problems, but when I tried to copy my recompiled modules the N900 is bricked.
Where can I find a wiki which explain to me the procedure for recompile the modules?

Thank you

EDIT:
I found a solution to my problem.
After make EXTRAVERSION=XXXX modules
strip with command:
for FILE in $(find . -name '*.ko'); do strip --remove-section=.comment --remove-section=.note --strip-unneeded $FILE; done
cp $(find . -name '*.ko') /lib/modules/2.6.28-omap1-mytest
/sbin/depmod -ae -F System.map 2.6.28-omap1-mytest
scp -r /lib/modules/2.6.28-omap1-mytest <to my N900>

without files modules.dep the load of the modules don't work.

there is also make EXTRAVERSION=XXX modules_install
but this command make many directories in lib/modules. I don't like when there is few modules.

Last edited by peppino; 2010-10-03 at 15:35.
 
Reply


 
Forum Jump


All times are GMT. The time now is 20:23.