Re: N900 kernel module recompile

2010-03-15 Thread Eero Tamminen

Hi,

ext Nils Faerber wrote:

Frantisek Dufka schrieb:

Nils Faerber wrote:

Then kernel config:
cp arch/arm/configs/rx51_defconfig ./.config
make oldconfig
A "make modules" does cleanly compile the modules. Fine so far (except
for that te modules are *huge* and a "arm-none-linux-gnueabi-strip -R
.not -R .comment --strip-unneeded" seems reasonable).

Looks like this strips module version symbols too. Tried similar
approach with same result before.


Just tried it - works like a charm ;)
And the module shrinks from ~200k to ~20k.


I think the kernel debian source package should be using dh_strip to
automatically separate the debug symbols to a separate (kernel-debug?)
package.  Debug symbol package is handy for debugging if you get any
issues


- Eero
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N900 kernel module recompile

2010-02-21 Thread Nils Faerber
Frantisek Dufka schrieb:
> Nils Faerber wrote:
>> Then kernel config:
>> cp arch/arm/configs/rx51_defconfig ./.config
>> make oldconfig
>> A "make modules" does cleanly compile the modules. Fine so far (except
>> for that te modules are *huge* and a "arm-none-linux-gnueabi-strip -R
>> .not -R .comment --strip-unneeded" seems reasonable).
> 
> Looks like this strips module version symbols too. Tried similar
> approach with same result before.

Just tried it - works like a charm ;)
And the module shrinks from ~200k to ~20k.

Cheers
  nils

-- 
kernel concepts GbR  Tel: +49-271-771091-12
Sieghuetter Hauptweg 48  Fax: +49-271-771091-19
D-57072 Siegen   Mob: +49-176-21024535
http://www.kernelconcepts.de
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N900 kernel module recompile

2010-02-19 Thread Frantisek Dufka

Nils Faerber wrote:

Then kernel config:
cp arch/arm/configs/rx51_defconfig ./.config
make oldconfig

A "make modules" does cleanly compile the modules. Fine so far (except
for that te modules are *huge* and a "arm-none-linux-gnueabi-strip -R
.not -R .comment --strip-unneeded" seems reasonable).


Looks like this strips module version symbols too. Tried similar 
approach with same result before.




But when I try to load one of the new modules I get:
-1 Invalid module format
And dmesg shows:
"no symbol version for struct_module"


In addition I got hit by message saying that the version does not match. 
I did some 'harmless' changes to kernel configuration before and found 
them not to be so harmless wrt symbol versions :-(


Even when copying original config back and recompiling kernel and 
modules (trying also with make clean, make mrproper) they were still 
different. I had to restore Module.symvers file from kernel source.

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N900 kernel module recompile

2010-02-18 Thread Nils Faerber
Following exactly the steps from

http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Kernel_and_Debugging_Guide/Maemo_Kernel_Guide

did the trick and the module loads fine now!
Very cool!
Though the process seem too complicated to me so after I did my hacking
I will look into simplyfying that.

Anyway, many thanks to all for pointing me in the right direction!

Cheers
  nils


Jeff Moe schrieb:
> On Thursday 18 February 2010 10:18:48 Nils Faerber wrote:
>> Hi all!
>> After all that RPM vs DEB debate I thought I could bring up something
>> more productive ;)
>>
>> I would like to hack on some drivers on the N900, so I need to be able
>> to recompile kernel modules. Ideally I would like only to replace
>> modules, not the whole kernel+modules package.
>>
>> So what I did was I installed the Maemo5 SDK first in order to get the
>> proper toolchain.
>> Then I took a vanilla 2.6.28 Linux kernel archive and applied the kernel
>> patch from
>>  http://repository.maemo.org/pool/fremantle/free/k/kernel/
>>  kernel_2.6.28-20094803.3+0m5.diff.gz
>>
>> Then I setup my comile environment:
>>
>> export PATH=/scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/:$PATH
>> export CROSS_COMPILE=arm-none-linux-gnueabi-
>> export ARCH=arm
>>
>> Then kernel config:
>> cp arch/arm/configs/rx51_defconfig ./.config
>> make oldconfig
>>
>> A "make modules" does cleanly compile the modules. Fine so far (except
>> for that te modules are *huge* and a "arm-none-linux-gnueabi-strip -R
>> .not -R .comment --strip-unneeded" seems reasonable).
>>
>> But when I try to load one of the new modules I get:
>>  -1 Invalid module format
>> And dmesg shows:
>>  "no symbol version for struct_module"
>>
>> This usually means that CONFIG_MODVERSIONS is not set but I double
>> checked that and I do have "CONFIG_MODVERSIONS=y" in ".config".
>>
>> I also changed the extra version name in the kernel toplevel Makefile,
>> which should be correct (to my knowledge):
>>
>> #NAME = Erotic Pickled Herring
>> NAME = maemo
>>
>> There is an older page about recompiling kernel for Diablo in the Wiki:
>>  http://wiki.maemo.org/Compiling_the_kenrel
>> Would that still apply (of course replacing Diablo with Freemantle and
>> N810 with N900 or RX51 respectively)?
>>
>> Again, I just want to hack on one single module. So I would like to
>> avoid having to flash a completely home-grown kernel+modules set
>> (frankly that scares me a little ;)
>>
>>
>> Any hint would be really appreciated ;)
>> Some N900 kernel hackers around here?
>>
>> Ideally I would like to make my changes available again so that others
>> can also play with them by just replacing a single .ko-module...
> 
> This isn't exactly what you want, but should provide some hints:
> 
> http://wiki.maemo.org/User:Jebba/Kernel
> 
> This dir has my live scratchbox with some scriptlets which may help you see 
> the procedure:
> http://www.freemoe.org/users/jebba/scratchbox/kernel/
> 
> Have fun,
> 
> -Jeff Moe
> ___
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers
> 


-- 
kernel concepts GbR  Tel: +49-271-771091-12
Sieghuetter Hauptweg 48  Fax: +49-271-771091-19
D-57072 Siegen   Mob: +49-176-21024535
http://www.kernelconcepts.de
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N900 kernel module recompile

2010-02-18 Thread Jeff Moe
On Thursday 18 February 2010 10:18:48 Nils Faerber wrote:
> Hi all!
> After all that RPM vs DEB debate I thought I could bring up something
> more productive ;)
> 
> I would like to hack on some drivers on the N900, so I need to be able
> to recompile kernel modules. Ideally I would like only to replace
> modules, not the whole kernel+modules package.
> 
> So what I did was I installed the Maemo5 SDK first in order to get the
> proper toolchain.
> Then I took a vanilla 2.6.28 Linux kernel archive and applied the kernel
> patch from
>   http://repository.maemo.org/pool/fremantle/free/k/kernel/
>   kernel_2.6.28-20094803.3+0m5.diff.gz
> 
> Then I setup my comile environment:
> 
> export PATH=/scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/:$PATH
> export CROSS_COMPILE=arm-none-linux-gnueabi-
> export ARCH=arm
> 
> Then kernel config:
> cp arch/arm/configs/rx51_defconfig ./.config
> make oldconfig
> 
> A "make modules" does cleanly compile the modules. Fine so far (except
> for that te modules are *huge* and a "arm-none-linux-gnueabi-strip -R
> .not -R .comment --strip-unneeded" seems reasonable).
> 
> But when I try to load one of the new modules I get:
>   -1 Invalid module format
> And dmesg shows:
>   "no symbol version for struct_module"
> 
> This usually means that CONFIG_MODVERSIONS is not set but I double
> checked that and I do have "CONFIG_MODVERSIONS=y" in ".config".
> 
> I also changed the extra version name in the kernel toplevel Makefile,
> which should be correct (to my knowledge):
> 
> #NAME = Erotic Pickled Herring
> NAME = maemo
> 
> There is an older page about recompiling kernel for Diablo in the Wiki:
>   http://wiki.maemo.org/Compiling_the_kenrel
> Would that still apply (of course replacing Diablo with Freemantle and
> N810 with N900 or RX51 respectively)?
> 
> Again, I just want to hack on one single module. So I would like to
> avoid having to flash a completely home-grown kernel+modules set
> (frankly that scares me a little ;)
> 
> 
> Any hint would be really appreciated ;)
> Some N900 kernel hackers around here?
> 
> Ideally I would like to make my changes available again so that others
> can also play with them by just replacing a single .ko-module...

This isn't exactly what you want, but should provide some hints:

http://wiki.maemo.org/User:Jebba/Kernel

This dir has my live scratchbox with some scriptlets which may help you see the 
procedure:
http://www.freemoe.org/users/jebba/scratchbox/kernel/

Have fun,

-Jeff Moe
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N900 kernel module recompile

2010-02-18 Thread Kees Jongenburger
Hi Nils

On Thu, Feb 18, 2010 at 6:18 PM, Nils Faerber
 wrote:
> Hi all!
> After all that RPM vs DEB debate I thought I could bring up something
> more productive ;)

Thanks!

>
> I would like to hack on some drivers on the N900, so I need to be able
> to recompile kernel modules. Ideally I would like only to replace
> modules, not the whole kernel+modules package.
>
> So what I did was I installed the Maemo5 SDK first in order to get the
> proper toolchain.

The best to start with is to follow the Maemo Kernel Guide. If you
follow that and
dont' forget to use the extra version trick make EXTRAVERSION=-omap1 bzImage
you can indeed scp modules to the device and probe them
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N900 kernel module recompile

2010-02-18 Thread Thomas Tanner
On 18.02.10 19:40, Nils Faerber wrote:
> OK, I will try - never compiled a kernel using the debian build system :)

it's almost trivial :)
I suggest to take a look at my custom kernel source in
extras-devel/non-free (due to non-free fiasco-gen).
I have converted it to use quilt which makes integration of other
community matches much easier.

-- 
Thomas Tanner --
email: tan...@gmx.de
GnuPG: 1024/5924D4DD
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N900 kernel module recompile

2010-02-18 Thread Nils Faerber
Thomas Tanner schrieb:
> On 18.02.10 18:18, Nils Faerber wrote:
>> I would like to hack on some drivers on the N900, so I need to be able
>> to recompile kernel modules. Ideally I would like only to replace
>> modules, not the whole kernel+modules package.
>>
>> So what I did was I installed the Maemo5 SDK first in order to get the
>> proper toolchain.
>> Then I took a vanilla 2.6.28 Linux kernel archive and applied the kernel
>> patch from
> 
> "apt-get source kernel" would be easier

That is inside scratchbox having selected the armel target?
I can try that, sure!

> Do you plan to provide the extra modules as a package
> in extras-devel or just as individual files?

I would like to later redistribute the changed driver (it is a change in
an existing driver I am planning). A package would be great so that
users can seamlessly upgrade.

> You could disable building and packaging of the kernel
> in the debian/rules and control file and only generate a modules
> package. Please make sure to also rename the source package and the
> generate packages to avoid conflict with the stock kernel.
> 
> For indidivual files just extracting the output of the first solution
> could be the simplest approach.

OK, I will try - never compiled a kernel using the debian build system :)

Many thanks!

Cheers
  nils

-- 
kernel concepts GbRTel: +49-271-771091-12
Sieghuetter Hauptweg 48Fax: +49-271-771091-19
D-57072 Siegen Mob: +49-176-21024535
http://www.kernelconcepts.de
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N900 kernel module recompile

2010-02-18 Thread Thomas Tanner
On 18.02.10 18:18, Nils Faerber wrote:
> I would like to hack on some drivers on the N900, so I need to be able
> to recompile kernel modules. Ideally I would like only to replace
> modules, not the whole kernel+modules package.
> 
> So what I did was I installed the Maemo5 SDK first in order to get the
> proper toolchain.
> Then I took a vanilla 2.6.28 Linux kernel archive and applied the kernel
> patch from

"apt-get source kernel" would be easier

Do you plan to provide the extra modules as a package
in extras-devel or just as individual files?

You could disable building and packaging of the kernel
in the debian/rules and control file and only generate a modules
package. Please make sure to also rename the source package and the
generate packages to avoid conflict with the stock kernel.

For indidivual files just extracting the output of the first solution
could be the simplest approach.

-- 
Thomas Tanner --
email: tan...@gmx.de
GnuPG: 1024/5924D4DD
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


N900 kernel module recompile

2010-02-18 Thread Nils Faerber
Hi all!
After all that RPM vs DEB debate I thought I could bring up something
more productive ;)

I would like to hack on some drivers on the N900, so I need to be able
to recompile kernel modules. Ideally I would like only to replace
modules, not the whole kernel+modules package.

So what I did was I installed the Maemo5 SDK first in order to get the
proper toolchain.
Then I took a vanilla 2.6.28 Linux kernel archive and applied the kernel
patch from
http://repository.maemo.org/pool/fremantle/free/k/kernel/
kernel_2.6.28-20094803.3+0m5.diff.gz

Then I setup my comile environment:

export PATH=/scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/:$PATH
export CROSS_COMPILE=arm-none-linux-gnueabi-
export ARCH=arm

Then kernel config:
cp arch/arm/configs/rx51_defconfig ./.config
make oldconfig

A "make modules" does cleanly compile the modules. Fine so far (except
for that te modules are *huge* and a "arm-none-linux-gnueabi-strip -R
.not -R .comment --strip-unneeded" seems reasonable).

But when I try to load one of the new modules I get:
-1 Invalid module format
And dmesg shows:
"no symbol version for struct_module"

This usually means that CONFIG_MODVERSIONS is not set but I double
checked that and I do have "CONFIG_MODVERSIONS=y" in ".config".

I also changed the extra version name in the kernel toplevel Makefile,
which should be correct (to my knowledge):

#NAME = Erotic Pickled Herring
NAME = maemo

There is an older page about recompiling kernel for Diablo in the Wiki:
http://wiki.maemo.org/Compiling_the_kenrel
Would that still apply (of course replacing Diablo with Freemantle and
N810 with N900 or RX51 respectively)?

Again, I just want to hack on one single module. So I would like to
avoid having to flash a completely home-grown kernel+modules set
(frankly that scares me a little ;)


Any hint would be really appreciated ;)
Some N900 kernel hackers around here?

Ideally I would like to make my changes available again so that others
can also play with them by just replacing a single .ko-module...

Cheers
  nils

-- 
kernel concepts GbR  Tel: +49-271-771091-12
Sieghuetter Hauptweg 48  Fax: +49-271-771091-19
D-57072 Siegen   Mob: +49-176-21024535
http://www.kernelconcepts.de
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers