maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   [Pending] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T) (https://talk.maemo.org/showthread.php?t=67995)

BluesLee 2011-01-07 07:30

[Pending] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
Hello,

i am trying to run my old DVB-T Stick (Yakumo Quickstick) on
the N900, unfortunately without success so far. On my linux
desktop everything is fine. What i did:

N900: Installed kernel power (uname -r gives 2.6.28.10power46)
and h.e.n. from extras-devel.

Scratchbox: I used the following two instructions

http://wiki.maemo.org/Documentation/...Kernel_Modules

http://psfreedom.com/wiki/Nokia_N900...9_maemo_kernel

Within FREMANTLE_ARMEL:

1. I added extras and extras-devel to /etc/apt/sources.list
2. fakeroot apt-get update
3. apt-get source kernel-power and apt-get install kernel-power-headers
4. In /usr/src: cp kernel-power-headers/Module.symvers kernel-power-2.6.28/
5. In /usr/src/kernel-power-2.6.28: cp debian/rx51power_defconfig arch/arm/configs/
6. make EXTRAVERSION=-omap1 r51power_defconfig modules_prepare
7. "make EXTRAVERSION=-omap1 oldconfig" (several times)
gives me a config file .config with the following lines uncommented

CONFIG_DVB_CORE=m
CONFIG_DVB_USB=m
CONFIG_DVB_USB_DTT200U=m

8. Finally, "make EXTRAVERSION=-omap1 modules" compiles
the above modules dvb-core.ko, dvb-usb.ko and dvb-usb-dtt200u.ko

9. I copied those 3 ko's to /lib/modules/current on my N900

10. depmod -a

11. insmod ./dvb-core.ko gives the error message

"insmod: error inserting './dvb-core.ko': -1 invalid module format"

12. I also tried "objcopy --strip-debug -R .modinfo -R __versions dvb-core.ko" which results in another error message:

"insmod: error inserting './dvb-core.ko': -1 Unknow symbol in module"

Hints to solve this mismatch are welcome. Thank you.


Blues

epitaph 2011-01-07 07:40

Re: [Unsolved yet] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
Did you tried those kernel-config with mismatch module version? AFAIK an unknown symbole is only a warning? But it is long away my compiler time :p.

MastaG 2011-01-07 08:24

Re: [Unsolved yet] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
I think you need also need to boot the updated zImage kernel image.
The kernel image contains some extra symbols for dvb-support.
Try this on your N900:
1. enable extras, extras-testing, extras-devel
2. apt-get install multiboot multiboot-kernel-maemo kernel-power kernel-power-config kernel-power-modules
3. Create an entry for kernel power: /etc/multiboot.d/00-kernel-power.item:
ITEM_NAME="Kernel Power DVB"
ITEM_KERNEL=2.6.28.10power46
ITEM_MODULES=ext3
4. Now copy your modules: dvb-core.ko, dvb-usb.ko and dvb-usb-dtt200u.ko onto your N900 (into the right directories).
5. Issue a: depmod -a
6. Now in your scratchbox enviroment go into your kernel dir and type: make make EXTRAVERSION=-omap1 zImage
There should be a file called "zImage" in arch/armel/boot or something (just look for it:P), copy this file to your N900 in /boot/multiboot and rename it to: "vmlinuz-2.6.28.10power46"
8. Reboot your phone and select: "Kernel Power DVB"

Now some notes.
1. Be sure that your scratchbox enviroment is set to ARM and not X86 (you cant run the graphical emulator in ARM-mode but you dont need it anyways).
2. I think EXTRAVERSION should be set to "power46" instead of "-omap1", so it matches the kernel and modules installed on your N900.

Bernard 2011-01-07 10:25

Re: [Unsolved yet] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
I'm going to try it also tonight. I was having the exact same problem.

I previously also tried compiling a kernel image of the kernel-power, but that gave me an error:

Code:

In file included from arch/arm/mach-omap2/pm.c:37:
arch/arm/plat-omap/include/mach/pm.h:111:2: error: #error "Power management for this processor not implemented yet"
make[1]: *** [arch/arm/mach-omap2/pm.o] Error 1
make: *** [arch/arm/mach-omap2] Error 2

compiling the default default maemo kernel image works fine, but maybe I missed a step, I'll try that again tonight.

I also noticed that the compiled modules using scratchbox are a lot larger than the ones in default installed ones. I did some searching and found this post on the maemo mailing list
that addresses that issue, but I;m not entirely sure what that does yet.

MohammadAG 2011-01-07 14:18

Re: [Unsolved yet] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
Compile against headers instead of the whole kernel.
EXTRAVERSION should actually be .10power46, not power46 alone.

hackru 2011-01-12 14:58

Re: [Unsolved yet] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
Same problem.
Trying to build kernel module for usb-lan adapter.

>insmod mcs7830.ko
insmod: error inserting 'mcs7830.ko': -1 Invalid module format

> dmesg | tail -1
[19219.022216] mcs7830: no symbol version for struct_module

self-compiled module:
>modinfo mcs7830.ko
filename: mcs7830.ko
license: GPL
description: USB to network adapter MCS7830)
srcversion: C2F18B78D3F943388815966
alias: usb:v0DF6p0021d*dc*dsc*dp*ic*isc*ip*
alias: usb:v9710p7730d*dc*dsc*dp*ic*isc*ip*
alias: usb:v9710p7830d*dc*dsc*dp*ic*isc*ip*
depends: usbnet,mii
vermagic: 2.6.28.10power46 preempt mod_unload modversions ARMv7

installed kernel's module:
>modinfo /lib/modules/2.6.28.10power46/mii.ko
filename: /lib/modules/2.6.28.10power46/mii.ko
license: GPL
description: MII hardware support library
author: Jeff Garzik <jgarzik@pobox.com>
srcversion: 16DCEDEE4B5629C222C352D
vermagic: 2.6.28.10power46 preempt mod_unload modversions ARMv7

What i've missed?

Bernard 2011-01-12 15:21

Re: [Unsolved yet] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
I haven't had time to test it, but what I wanted to try is to change the CPU transparency setting in the scratchbox target to an actual N900 (not the QEMU emulator that is selected by default).
I think I read in the scratchbox documentation that it is advised to do so when compiling complicated programs, but I can't find that particular part in the scratchbox documentation at the moment.
http://www.scratchbox.org/

hackru 2011-01-13 07:57

Re: [Unsolved yet] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
not sure if i correctly understand you. do you mean i must compile kernel modules on device itself?

Bernard 2011-01-13 09:45

Re: [Unsolved yet] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
no. you still compile in scratchbox. But if you read the documentation on how scratchbox works you will find out that an ARM scratchbox target is a lot more than an image running in the emulator QEMU. It is a rather beautiful mesh of a crosscompiler, local tools (run on host CPU) and a basic maemo image run on an emulated ARM environment (QEMU). scratchbox combines those things and gives the appearance of a local ARM environment. But if you compile a binary in an ARM scratchbox target you do not compile using a gcc compiler running in a QEMU image (that would be too slow), but you use a cross compiler on the host. But if you try to run an arm binary, that is run on a QEMU emulator (by default). That is what scratchbox calls CPU transparency: it automatically switches from host tools and ARM tools as needed. In the target setting you can also set scratchbox to use a real N900 device to run ARM binaries, using a network connection. Compiling will still be done using crosscompilers on the host, but calls to ARM binaries (in for example config scripts) will be put through to the N900.

At least that is how I understand it. :)

sconf 2011-01-13 17:52

Re: [Unsolved yet] Scratchbox + Kernel Power 2.6.28 Maemo V46 + Compiling kernel modules (DVB-T)
 
Did you compile against kernel-headers like MohammadAG suggested?

make EXTRAVERSION=.10power46 -C /usr/src/kernel-power-headers/ M=your_module_directory modules

or something like that...


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

vBulletin® Version 3.8.8