PDA

View Full Version : kernel development for the 770


nicolai
04-07-2009, 12:58 PM
Hello,

can someone give me advice on how to setup kernel development
environment for the 770 device.

I already searched, but only found howtos for the n800/n810 devices
or special howtos for bora and diablo. Correct me if I am wrong, but
I think I cannot take the diablo source and environment for the 770 device. I suppose I have to use the gregale sources. My device current firmware version is 3.2006.49-2.

So far I set up scratchbox target as describe in a tutorial from here:
http://test.maemo.org/platform/docs/howto/howto_kernel_guide_bora.html
with:
sb-conf setup MaemoKernel -c cs2005q3.2-glibc-arm -t /scratchbox/devkits/cputransp/bin/qemu-arm-0.8.1-sb2
sb-conf select MaemoKernel
sb-conf rs MaemoKernel /scratchbox/packages/Maemo_Dev_Platform_v2.2_armel-rootstrap.tgz
sb-conf in MaemoKernel -e -d -F

I set my source.list for gregale instead of bora, but cannot do apt-get update. I get this error:
Failed to fetch http://repository.maemo.org/dists/gregale/Release.gpg Temporary failure resolving 'repository.maemo.org'
apt-get only works if I add debian-sarge devkit when setup the target.
By the way, why do some howtos use fakeroot apt-get, instead of just apt-get?

The next question is, where to find the kernel source. The maemo wiki entry for kernel developing only deals with diablo and the kernel source is named kernel-source-diable. But in the gregale repository is no package named kernel-source-gregal.

My primary goal is to rebuild some kernel modules, but I would like to rebuild the whole kernel too.

thanks in advance.

penguinbait
04-07-2009, 01:47 PM
Hello,

can someone give me advice on how to setup kernel development
environment for the 770 device.

I already searched, but only found howtos for the n800/n810 devices
or special howtos for bora and diablo. Correct me if I am wrong, but
I think I cannot take the diablo source and environment for the 770 device. I suppose I have to use the gregale sources. My device current firmware version is 3.2006.49-2.

So far I set up scratchbox target as describe in a tutorial from here:
http://test.maemo.org/platform/docs/howto/howto_kernel_guide_bora.html
with:
sb-conf setup MaemoKernel -c cs2005q3.2-glibc-arm -t /scratchbox/devkits/cputransp/bin/qemu-arm-0.8.1-sb2
sb-conf select MaemoKernel
sb-conf rs MaemoKernel /scratchbox/packages/Maemo_Dev_Platform_v2.2_armel-rootstrap.tgz
sb-conf in MaemoKernel -e -d -F

I set my source.list for gregale instead of bora, but cannot do apt-get update. I get this error:
Failed to fetch http://repository.maemo.org/dists/gregale/Release.gpg Temporary failure resolving 'repository.maemo.org'
apt-get only works if I add debian-sarge devkit when setup the target.
By the way, why do some howtos use fakeroot apt-get, instead of just apt-get?

The next question is, where to find the kernel source. The maemo wiki entry for kernel developing only deals with diablo and the kernel source is named kernel-source-diable. But in the gregale repository is no package named kernel-source-gregal.

My primary goal is to rebuild some kernel modules, but I would like to rebuild the whole kernel too.

thanks in advance.



Check your DNS servers /scratchbox/etc/resolv.conf

Sounds like they are empty so no name resolution is happening

fanoush
04-07-2009, 01:51 PM
You can use normal bora or diablo SDK scratchbox target, all of them use same compiler so it doesn't matter. Creating new target is not needed.

kernel source is here
http://repository.maemo.org/pool/gregale/free/source/k/kernel-source-2.6.16/ just unpack it somewhere inside the target

nicolai
04-08-2009, 03:55 AM
Thanks for this clarification. Now I can build the kernel.

nicolai

fast1
04-08-2009, 06:51 AM
sorry but what is a kernel?

spock128
09-22-2009, 02:06 AM
How do I set up the development environment for compiling the kernel? I've set up scratchbox following these instructions: http://scratchbox.org/documentation/user/scratchbox-1.0/html/installdoc.html, and created a maemo 2.2 target (http://maemo.org/development/documentation/tutorials/Maemo_2_2_Tutorial/). I can build and run arm programs, but when I unpack the kernel sources and run "make menuconfig", I get a ton of linking errors (curses, apparently).

Is there a default .config I can modify for my needs? (need nat and/or bridge modules) and is there an easier way of configuring it than plain "make config"?

Thanks.

fanoush
09-22-2009, 02:59 AM
edit scripts/kconfig/lxdialog/check-lxdialog.sh to always return -lncurses

ldflags()
{
$cc -print-file-name=libncursesw.so | grep -q /
if [ $? -eq 0 ]; then
echo '-lncursesw'
exit
fi
$cc -print-file-name=libncurses.so | grep -q /
# if [ $? -eq 0 ]; then
echo '-lncurses'
exit
# fi
$cc -print-file-name=libcurses.so | grep -q /
if [ $? -eq 0 ]; then
echo '-lcurses'
exit
fi
exit 1
}



Is there a default .config I can modify for my needs?
make n770_defconfig
make menuconfig

spock128
09-26-2009, 02:18 AM
Thanks, fanoush. I got the kernel & modules to compile and run on the 770. The only problem now is that the wifi corruption bugfix (http://talk.maemo.org/showthread.php?t=11824) module will cause the new kernel to crash whenever the wifi is used. Does this module's source exist anywhere? Even if it's a binary-only driver, isn't there an open-source wrapper that could be recompiled (like nVidia's Linux graphics driver)?

Thanks.

lma
09-26-2009, 06:41 AM
See bug 2006 (https://bugs.maemo.org/show_bug.cgi?id=2006).

fanoush
09-26-2009, 07:23 AM
link to sources is in the bug too https://bugs.maemo.org/show_bug.cgi?id=2006#c14
however recompiling the wrapper may or may not help, see this https://garage.maemo.org/pipermail/cx3110x-devel/2007-December/000006.html
umac.ko uses some linux kernel structures too and some kernel config parameters may enlarge these structures making umac.ko using wrong data (offset to structure fields are changed). As we don't have sources to umac.ko described solution is to redefine those structures (sk_buff) to have new data in the end.