Cross Compile Module for armv7

Hi A variation on a previous query: Can anyone make sense - or better still a process - out of this thread: http://www.cubieforums.com/index.php?topic=2427.0 My responses are authored CarryOnRewardless. The DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master folder contains source files for a module I need rtl2832.ko and some other related ones. I need to compile it for a 3.4 kernel on a sun4i armv7 platform so I get the kernel source from github sunxi. But running make ARCH=arm -C /home/user/linux-sunxi/ M=$PWD from folder /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master gives errors suggesting it could find no Makefile in the linux-sunxi folder but it is clearly present. make: Entering directory `/home/user/linux-sunxi' scripts/Makefile.build:44: /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile: No such file or directory make[1]: *** No rule to make target `/home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile'. Stop. make: *** [_module_/home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master] Error 2 make: Leaving directory `/home/user/linux-sunxi' I am obviously doing something fundamentally wrong but I cannot see it atm. Any ideas?

On 08.05.14 20:49, Robert Brown wrote:
make: Entering directory `/home/user/linux-sunxi' scripts/Makefile.build:44: /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile: No such file or directory make[1]: *** No rule to make target `/home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile'.
Could you please show us: $ ls -l \ /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile Then it could be "clearly present" here as well. ;-) While it's usually fine to run make as an ordinary user, then run make install (if required) as root, until we see the permissions on the makefile, we can't know if that would succeed. The "ls -l" will also test the navigability of the full path, which is also needed. Erik -- Rising levels of CO2 around the world will significantly impact the nutrient content of crops according to a new study. Experiments show levels of zinc, iron and protein are likely to be reduced by up to 10% in wheat and rice by 2050. - http://www.bbc.com/news/science-environment-27308720

Hi Erik Thanks for your reply. On 08/05/14 21:48, Erik Christiansen wrote:
On 08.05.14 20:49, Robert Brown wrote:
make: Entering directory `/home/user/linux-sunxi' scripts/Makefile.build:44: /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile: No such file or directory make[1]: *** No rule to make target `/home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile'. Could you please show us:
$ ls -l \ e This is what is puzzling me. The folder is
/home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master and not /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefil e The Makefile is in this folder and I expected that the make command would find and run this Makefile. The output of ls -la is attached. I note that there is a sub-folder folder inside this one with another Makefile and the *2832* source files. So maybe I need to cd to that folder and run the command there. The second attachment is the ls -la output for the sub-folder.
Then it could be "clearly present" here as well. ;-)
While it's usually fine to run make as an ordinary user, then run make install (if required) as root, until we see the permissions on the makefile, we can't know if that would succeed. The "ls -l" will also test the navigability of the full path, which is also needed.
I have been running this command as root and the permissions suggest that is what I need to be doing.
Erik
Thanks again.

On 08.05.14 22:17, Robert Brown wrote:
On 08/05/14 21:48, Erik Christiansen wrote:
On 08.05.14 20:49, Robert Brown wrote:
make: Entering directory `/home/user/linux-sunxi' scripts/Makefile.build:44: /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile: No such file or directory make[1]: *** No rule to make target `/home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile'. Could you please show us:
$ ls -l \ e This is what is puzzling me. The folder is
/home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master
and not /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile The Makefile is in this folder and I expected that the make command would find and run this Makefile.
If you had done a "cd" into the directory, then yes, a simple "make" should work like a "./make". Were you in the directory?
The output of ls -la is attached.
Actually, all I was after was:
-rw-r--r-- 1 root root 1675 Jan 17 16:53 Makefile
The ls needed to be run as an ordinary user, if that is how "make" was run. It is all moot if you're running "make" as root.
I note that there is a sub-folder folder inside this one with another Makefile and the *2832* source files. So maybe I need to cd to that folder and run the command there.
No. Running "make" in the top directory will recurse through the subdirectories, under direction from the "Makefile" in that directory, so long as you are in that directory when running "make". Erik -- You can't have everything. Where would you put it? - Steven Wright

I ran the make command from the sub-folder mentioned below and got somewhere but with errors - so some progress:- make: Entering directory `/home/debian/linux-sunxi-pat-3.4.67' CC [M] /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o In file included from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h:19:0, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/foundation.h:19, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/dvbt_demod_base.h:289, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.h:72, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.c:13: /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb_frontend.h:49:33: error: field 'parameters' has incomplete type /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb_frontend.h:312:28: error: array type has incomplete element type make[1]: *** [/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o] Error 1 make: *** [_module_/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0] Error 2 make: Leaving directory `/home/debian/linux-sunxi-pat-3.4.67' So I can try drilling down through those errors. I think I need a switch somewhere to select the include-320 sub-folder. Rob On 08/05/14 21:48, Erik Christiansen wrote:
On 08.05.14 20:49, Robert Brown wrote:
make: Entering directory `/home/user/linux-sunxi' scripts/Makefile.build:44: /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile: No such file or directory make[1]: *** No rule to make target `/home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile'. Could you please show us:
$ ls -l \ /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile
Then it could be "clearly present" here as well. ;-)
While it's usually fine to run make as an ordinary user, then run make install (if required) as root, until we see the permissions on the makefile, we can't know if that would succeed. The "ls -l" will also test the navigability of the full path, which is also needed.
Erik

Ok I find that I need a |INCLUDE_EXTRA_DVB := include-340 in the Makefile for the 3.4 kernel but there is no include-340 sub-directory. So I get these errors: make: Entering directory `/home/debian/linux-sunxi-pat-3.4.67' CC [M] /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o In file included from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/dvbt_demod_base.h:289:0, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.h:72, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.c:13: /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/foundation.h:19:21: fatal error: dvb-usb.h: No such file or directory compilation terminated. make[1]: *** [/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o] Error 1 make: *** [_module_/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0] Error 2 make: Leaving directory `/home/debian/linux-sunxi-pat-3.4.67' | Not sure where to go from here. -------- Original Message -------- Subject: Re: Cross Compile Module for armv7 Date: Thu, 08 May 2014 22:28:17 +1000 From: Robert Brown <rebrown@exemail.com.au> To: luv-main@luv.asn.au I ran the make command from the sub-folder mentioned below and got somewhere but with errors - so some progress:- make: Entering directory `/home/debian/linux-sunxi-pat-3.4.67' CC [M] /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o In file included from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h:19:0, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/foundation.h:19, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/dvbt_demod_base.h:289, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.h:72, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.c:13: /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb_frontend.h:49:33: error: field 'parameters' has incomplete type /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb_frontend.h:312:28: error: array type has incomplete element type make[1]: *** [/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o] Error 1 make: *** [_module_/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0] Error 2 make: Leaving directory `/home/debian/linux-sunxi-pat-3.4.67' So I can try drilling down through those errors. I think I need a switch somewhere to select the include-320 sub-folder. Rob On 08/05/14 21:48, Erik Christiansen wrote:
On 08.05.14 20:49, Robert Brown wrote:
make: Entering directory `/home/user/linux-sunxi' scripts/Makefile.build:44: /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile: No such file or directory make[1]: *** No rule to make target `/home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile'. Could you please show us:
$ ls -l \ /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile
Then it could be "clearly present" here as well. ;-)
While it's usually fine to run make as an ordinary user, then run make install (if required) as root, until we see the permissions on the makefile, we can't know if that would succeed. The "ls -l" will also test the navigability of the full path, which is also needed.
Erik

On 08.05.14 22:28, Robert Brown wrote:
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb_frontend.h:49:33: error: field 'parameters' has incomplete type
Here you're using include-300, which matches kernel-3.0.0, as far as I can guess without ever having tried any of this stuff. On 08.05.14 22:53, Robert Brown wrote:
I find that I need a
|INCLUDE_EXTRA_DVB := include-340 in the Makefile for the 3.4 kernel but there is no include-340 sub-directory. So I get these errors:
...
/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/foundation.h:19:21: fatal error: dvb-usb.h: No such file or directory
Yup, looking for dvb-usb.h in a directory which doesn't exist will do that.
Not sure where to go from here.
We see "kernel-3.0.0" twice in the path, so why would kernel-3.4 headers be appropriate, especially when they're also not provided? I'd expect that include-300/dvb-usb.h is as good as it gets for kernel-3.0.0. (As a first-round guess.) Erik -- Another such victory over the Romans, and we are undone. - Pyrrhus

On 08.05.14 22:28, Robert Brown wrote:
I ran the make command from the sub-folder mentioned below and got somewhere but with errors
I'll take a look at the other post, because it's odd for a cd to make a lot of difference in finding files specified with a full path.
- so some progress:- make: Entering directory `/home/debian/linux-sunxi-pat-3.4.67' CC [M] /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o In file included from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h:19:0, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/foundation.h:19, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/dvbt_demod_base.h:289, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.h:72, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.c:13: /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb_frontend.h:49:33: error: field 'parameters' has incomplete type
Any following errors may be due to the first one, so it needs to be fixed first. The chain of headers included from the .c file is being found. That is indeed progress. Can you show us the vicinity of line 19 in include-300/dvb-usb.h ? Gcc is not complaining about a missing header, so the incomplete definition may be due to it pulling in the wrong header somewhere, due to the include path not being what you think it is. (Assuming the code builds OK in the right environment.) You'll probably have advice from guys with more kernel building experience tomorrow. Mine is more from decades of building other stuff, but the few times I've seen broken definitions while kernel building, it's due to pulling in the wrong headers. Those listed above all seem to be local to the source bundle you're compiling, so we need to see more. I'd try adding "-v" to the CFLAGS definition in the makefile, since that should "report the final form of the include path" as each file is compiled. If that's showing anything other than your ARCH=arm7 stuff, then it's an include path issue. Erik -- It's always sad when the fleas leave, because that means your dog is dead. - Wesley T. Williams

On 08/05/14 23:17, Erik Christiansen wrote:
On 08.05.14 22:28, Robert Brown wrote:
I ran the make command from the sub-folder mentioned below and got somewhere but with errors I'll take a look at the other post, because it's odd for a cd to make a lot of difference in finding files specified with a full path.
- so some progress:- make: Entering directory `/home/debian/linux-sunxi-pat-3.4.67' CC [M] /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o In file included from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h:19:0, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/foundation.h:19, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/dvbt_demod_base.h:289, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.h:72, from /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.c:13: /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb_frontend.h:49:33: error: field 'parameters' has incomplete type Any following errors may be due to the first one, so it needs to be fixed first. The chain of headers included from the .c file is being found. That is indeed progress.
Can you show us the vicinity of line 19 in include-300/dvb-usb.h ? Gcc is not complaining about a missing header, so the incomplete definition may be due to it pulling in the wrong header somewhere, due to the include path not being what you think it is. (Assuming the code builds OK in the right environment.) #ifndef __DVB_USB_H__ #define __DVB_USB_H__
#include <linux/input.h> #include <linux/usb.h> #include <linux/firmware.h> #include <linux/mutex.h> #include <media/rc-core.h> #include "dvb_frontend.h" #include "dvb_demux.h" #include "dvb_net.h" #include "dmxdev.h" #include "dvb-pll.h" #include "dvb-usb-ids.h"
You'll probably have advice from guys with more kernel building experience tomorrow. Mine is more from decades of building other stuff, but the few times I've seen broken definitions while kernel building, it's due to pulling in the wrong headers. Those listed above all seem to be local to the source bundle you're compiling, so we need to see more.
I'd try adding "-v" to the CFLAGS definition in the makefile, since that should "report the final form of the include path" as each file is compiled. If that's showing anything other than your ARCH=arm7 stuff, then it's an include path issue. I only have this like CFLAGS in the Makefile: EXTRA_CFLAGS += -I$(KBUILD_SRC)/drivers/media/dvb/dvb-usb/ \ -I$(KBUILD_SRC)/drivers/media/dvb/dvb-core/ \ -I$(KBUILD_SRC)/drivers/media/dvb/frontends/ \ -I$(KBUILD_SRC)/drivers/media/common/tuners/ \ -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) Should I tack a -v on the end of this?
BTW uname -ra shows Linux debian 3.4.67-sun4i+ #10 PREEMPT Sun Nov 24 17:13:58 EST 2013 armv7l GNU/Linux which is why I was looking for a directory include-340
Erik

First, harking back to your OP, whose introductory scene-setting I didn't read closely enough last night before jumping to the make errors: On 08.05.14 20:49, Robert Brown wrote:
The DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master folder contains source files for a module I need rtl2832.ko and some other related ones.
I need to compile it for a 3.4 kernel on a sun4i armv7 platform so I get the kernel source from github sunxi.
Is there a "did" missing between "I" and "get"? Since later posts show that no dvb-usb.h exists for kernel 3.4, you still need kernel 3.4 headers, AFAICT. Have you looked for a separate headers source package? That's how native headers are provided, so it would be unsurprising for that ARM kernel to be similarly packaged. (See also end of this post) On 09.05.14 08:05, Robert Brown wrote:
I only have this like CFLAGS in the Makefile: EXTRA_CFLAGS += -I$(KBUILD_SRC)/drivers/media/dvb/dvb-usb/ \ -I$(KBUILD_SRC)/drivers/media/dvb/dvb-core/ \ -I$(KBUILD_SRC)/drivers/media/dvb/frontends/ \ -I$(KBUILD_SRC)/drivers/media/common/tuners/ \ -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) Should I tack a -v on the end of this?
That would do, or since it's only temporary, for debugging, it would be easier and more visible if just tacked onto the "GCC =" definition. The effect is the same. (It is stuffed somewhere in the gcc invocation, as a command-line option.) That is to find the include path actually used at compile time, and here you've serendipitously provided an explicitly specified include path for dvb-usb headers. There's no guarantee that that's the only (or first) place it'll look, but you could already check what $(KBUILD_SRC) is set to, and check whether $(KBUILD_SRC)/drivers/media/dvb/dvb-usb/ exists. Once you set include-340, that would appear to point to stuff you don't have, or is my visualisation of what I can't see from here inaccurate?
BTW uname -ra shows Linux debian 3.4.67-sun4i+ #10 PREEMPT Sun Nov 24 17:13:58 EST 2013 armv7l GNU/Linux which is why I was looking for a directory include-340
OK, that's on the target, not the build machine, right? ('cos if that's the build machine, then a native compile would do, and life would be much simpler. Just checkin') When you run: $ locate dvb-usb.h on the target, does it show anything? (Or "find" if the target lacks "locate".) If so, you have a copy of the required header, just not where you need it. (I won't ask whether that kernel 3.0 stuff can build with kernel 3.4 headers, after all, it just might. You don't know till you try.) Happy header hunting. Erik -- Animals can be driven crazy by putting too many in too small a pen. Homo sapiens is the only animal that voluntarily does this to himself. - Lazarus Long

On 09/05/14 17:35, Erik Christiansen wrote:
First, harking back to your OP, whose introductory scene-setting I didn't read closely enough last night before jumping to the make errors:
On 08.05.14 20:49, Robert Brown wrote:
The DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master folder contains source files for a module I need rtl2832.ko and some other related ones.
I need to compile it for a 3.4 kernel on a sun4i armv7 platform so I get the kernel source from github sunxi. Typo there. I _got_ the kernel source from github sunxi. It's a Pat Wood creation. Is there a "did" missing between "I" and "get"? Since later posts show that no dvb-usb.h exists for kernel 3.4, you still need kernel 3.4 headers, AFAICT. Have you looked for a separate headers source package? That's how native headers are provided, so it would be unsurprising for that ARM kernel to be similarly packaged. (See also end of this post)
On 09.05.14 08:05, Robert Brown wrote:
I only have this like CFLAGS in the Makefile: EXTRA_CFLAGS += -I$(KBUILD_SRC)/drivers/media/dvb/dvb-usb/ \ -I$(KBUILD_SRC)/drivers/media/dvb/dvb-core/ \ -I$(KBUILD_SRC)/drivers/media/dvb/frontends/ \ -I$(KBUILD_SRC)/drivers/media/common/tuners/ \ -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) Should I tack a -v on the end of this? That would do, or since it's only temporary, for debugging, it would be easier and more visible if just tacked onto the "GCC =" definition. The effect is the same. (It is stuffed somewhere in the gcc invocation, as a command-line option.)
That is to find the include path actually used at compile time, and here you've serendipitously provided an explicitly specified include path for dvb-usb headers. There's no guarantee that that's the only (or first) place it'll look, but you could already check what $(KBUILD_SRC) is set to, and check whether $(KBUILD_SRC)/drivers/media/dvb/dvb-usb/ exists. Once you set include-340, that would appear to point to stuff you don't have, or is my visualisation of what I can't see from here inaccurate? No you are right there is nothing in an include-340 directory. From what I had read it seems like that is what it needs for a 3.4 kernel but it does not appear available on the web. I will insert the -v and report back with results.
BTW uname -ra shows Linux debian 3.4.67-sun4i+ #10 PREEMPT Sun Nov 24 17:13:58 EST 2013 armv7l GNU/Linux which is why I was looking for a directory include-340 OK, that's on the target, not the build machine, right? ('cos if that's the build machine, then a native compile would do, and life would be much simpler. Just checkin') Yes that is uname from the target arm machine. That was to point out that the module is required for a 3.4 kernel. Its still the case that the 'make' doesn't get to first base when not run from the sub-directory. I have tried CROSS-COMPILEing on my laptop as well where it also falls over unless I cd to the sub-directory. When you run:
$ locate dvb-usb.h
on the target, does it show anything? (Or "find" if the target lacks "locate".) If so, you have a copy of the required header, just not where you need it.
You will be able to see from the following that I have had numerous attempts and various methods to get this going. The one in bold is probably the one I need? debian@debian:~$ sudo find / -iname dvb-usb.h [sudo] password for debian: /home/debian/rtl2832u/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /home/debian/rtl2832u/media_build/v4l/dvb-usb.h /home/debian/rtl2832u/dvb-usb.h /home/debian/drivers/media/dvb/dvb-usb/dvb-usb.h /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/dvb-usb.h /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320/dvb-usb.h /home/debian/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /home/debian/media_build/v4l/dvb-usb.h* **/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/dvb-usb.h* /home/debian/Desktop/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /home/debian/Desktop/media_build/v4l/dvb-usb.h /home/debian/rtl2832u1/dvb-usb.h /robskernel/rtl2832u/dvb-usb.h /robskernel/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h /robskernel/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320/dvb-usb.h /robskernel/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /robskernel/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/dvb-usb.h /robskernel/rtl/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h /robskernel/rtl/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/RTL2832-2.2.2_kernel-3.0.0/include-320/dvb-usb.h /robskernel/themagicpudding-rtl2832_2836_2840-f9ab69bf2eee/media_build/linux/drivers/media/dvb/dvb-usb/dvb-usb.h /robskernel/themagicpudding-rtl2832_2836_2840-f9ab69bf2eee/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /robskernel/themagicpudding-rtl2832_2836_2840-f9ab69bf2eee/media_build/v4l/dvb-usb.h I notice that there's an include directory in /home/debian/linux-sunxi-pat-3.4.67/ .. Does this indicate that I have kernel headers (or should I say kernel sources?)?
(I won't ask whether that kernel 3.0 stuff can build with kernel 3.4 headers, after all, it just might. You don't know till you try.)
I have read confirmations that the modules have built successfully on kernels 3.0 through to 3.3 (using include-300 through to include-330) and then on 3.6 but am yet to find some-one who has done this on 3.4 other than the guy mcct on this link: http://www.cubieforums.com/index.php?topic=2427.0 This is where I started as I could not make full sense of his process. If I can't get this to work with 3.4 I will have to wait an unknown length of time until the Allwinner kernel development hits the mainline kernel in release 3.15 - could be another 6 months.
Happy header hunting.
Erik
Really appreciate that you have taken some time to digest this. Regards Rob

With a CFLAGS -v set I get the text shown in the attached. Thanks -------- Original Message -------- Subject: Re: Cross Compile Module for armv7 Date: Fri, 09 May 2014 18:33:57 +1000 From: Robert Brown <rebrown@exemail.com.au> To: luv-main@luv.asn.au On 09/05/14 17:35, Erik Christiansen wrote:
First, harking back to your OP, whose introductory scene-setting I didn't read closely enough last night before jumping to the make errors:
On 08.05.14 20:49, Robert Brown wrote:
The DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master folder contains source files for a module I need rtl2832.ko and some other related ones.
I need to compile it for a 3.4 kernel on a sun4i armv7 platform so I get the kernel source from github sunxi. Typo there. I _got_ the kernel source from github sunxi. It's a Pat Wood creation. Is there a "did" missing between "I" and "get"? Since later posts show that no dvb-usb.h exists for kernel 3.4, you still need kernel 3.4 headers, AFAICT. Have you looked for a separate headers source package? That's how native headers are provided, so it would be unsurprising for that ARM kernel to be similarly packaged. (See also end of this post)
On 09.05.14 08:05, Robert Brown wrote:
I only have this like CFLAGS in the Makefile: EXTRA_CFLAGS += -I$(KBUILD_SRC)/drivers/media/dvb/dvb-usb/ \ -I$(KBUILD_SRC)/drivers/media/dvb/dvb-core/ \ -I$(KBUILD_SRC)/drivers/media/dvb/frontends/ \ -I$(KBUILD_SRC)/drivers/media/common/tuners/ \ -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) Should I tack a -v on the end of this? That would do, or since it's only temporary, for debugging, it would be easier and more visible if just tacked onto the "GCC =" definition. The effect is the same. (It is stuffed somewhere in the gcc invocation, as a command-line option.)
That is to find the include path actually used at compile time, and here you've serendipitously provided an explicitly specified include path for dvb-usb headers. There's no guarantee that that's the only (or first) place it'll look, but you could already check what $(KBUILD_SRC) is set to, and check whether $(KBUILD_SRC)/drivers/media/dvb/dvb-usb/ exists. Once you set include-340, that would appear to point to stuff you don't have, or is my visualisation of what I can't see from here inaccurate? No you are right there is nothing in an include-340 directory. From what I had read it seems like that is what it needs for a 3.4 kernel but it does not appear available on the web. I will insert the -v and report back with results.
BTW uname -ra shows Linux debian 3.4.67-sun4i+ #10 PREEMPT Sun Nov 24 17:13:58 EST 2013 armv7l GNU/Linux which is why I was looking for a directory include-340 OK, that's on the target, not the build machine, right? ('cos if that's the build machine, then a native compile would do, and life would be much simpler. Just checkin') Yes that is uname from the target arm machine. That was to point out that the module is required for a 3.4 kernel. Its still the case that the 'make' doesn't get to first base when not run from the sub-directory. I have tried CROSS-COMPILEing on my laptop as well where it also falls over unless I cd to the sub-directory. When you run:
$ locate dvb-usb.h
on the target, does it show anything? (Or "find" if the target lacks "locate".) If so, you have a copy of the required header, just not where you need it.
You will be able to see from the following that I have had numerous attempts and various methods to get this going. The one in bold is probably the one I need? debian@debian:~$ sudo find / -iname dvb-usb.h [sudo] password for debian: /home/debian/rtl2832u/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /home/debian/rtl2832u/media_build/v4l/dvb-usb.h /home/debian/rtl2832u/dvb-usb.h /home/debian/drivers/media/dvb/dvb-usb/dvb-usb.h /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/dvb-usb.h /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320/dvb-usb.h /home/debian/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /home/debian/media_build/v4l/dvb-usb.h* **/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/dvb-usb.h* /home/debian/Desktop/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /home/debian/Desktop/media_build/v4l/dvb-usb.h /home/debian/rtl2832u1/dvb-usb.h /robskernel/rtl2832u/dvb-usb.h /robskernel/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h /robskernel/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320/dvb-usb.h /robskernel/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /robskernel/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/dvb-usb.h /robskernel/rtl/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/RTL2832-2.2.2_kernel-3.0.0/include-300/dvb-usb.h /robskernel/rtl/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/RTL2832-2.2.2_kernel-3.0.0/include-320/dvb-usb.h /robskernel/themagicpudding-rtl2832_2836_2840-f9ab69bf2eee/media_build/linux/drivers/media/dvb/dvb-usb/dvb-usb.h /robskernel/themagicpudding-rtl2832_2836_2840-f9ab69bf2eee/media_build/linux/drivers/media/usb/dvb-usb/dvb-usb.h /robskernel/themagicpudding-rtl2832_2836_2840-f9ab69bf2eee/media_build/v4l/dvb-usb.h I notice that there's an include directory in /home/debian/linux-sunxi-pat-3.4.67/ .. Does this indicate that I have kernel headers (or should I say kernel sources?)?
(I won't ask whether that kernel 3.0 stuff can build with kernel 3.4 headers, after all, it just might. You don't know till you try.) I have read confirmations that the modules have built successfully on kernels 3.0 through to 3.3 (using include-300 through to include-330) and then on 3.6 but am yet to find some-one who has done this on 3.4 other than the guy mcct on this link: http://www.cubieforums.com/index.php?topic=2427.0 This is where I started as I could not make full sense of his process.
If I can't get this to work with 3.4 I will have to wait an unknown length of time until the Allwinner kernel development hits the mainline kernel in release 3.15 - could be another 6 months.
Happy header hunting.
Erik Really appreciate that you have taken some time to digest this.
Regards Rob

On 09.05.14 20:21, Robert Brown wrote:
I have read confirmations that the modules have built successfully on kernels 3.0 through to 3.3 (using include-300 through to include-330) and then on 3.6 but am yet to find some-one who has done this on 3.4 other than the guy mcct on this link: http://www.cubieforums.com/index.php?topic=2427.0 This is where I started as I could not make full sense of his process.
I'm not not surprised. To me it looks like a monkey trap. I'd rather debug your issues than his.
make: Entering directory `/home/debian/linux-sunxi-pat-3.4.67' CC [M] /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/demod_rtl2832.o ...
This is what we're looking for:
ignoring nonexistent directory "/drivers/media/dvb/dvb-usb/"
IIRC, you have dvb-usb/ for 3.2, but not for 3.4.
ignoring nonexistent directory "/drivers/media/dvb/dvb-core/" ignoring nonexistent directory "/drivers/media/dvb/frontends/" ignoring nonexistent directory "/drivers/media/common/tuners/" #include "..." search starts here: #include <...> search starts here: /home/debian/linux-sunxi-pat-3.4.67/arch/arm/include arch/arm/include/generated include arch/arm/mach-sun4i/include arch/arm/plat-sunxi/include /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320
A 3.2 include directory is being used here, FWIW. But if you have nothing later, then let's not quibble. (And if you've set that "include-340" thing, then it probably won't be used anyway.)
/usr/lib/gcc/arm-linux-gnueabihf/4.6/include End of search list.
Try extending the EXTRA_CFLAGS in the Makefile thus: ... -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) \ -I/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/ I.e. The "\" extends from the pre-existing last line, adding one new. Now it has somewhere to find dvb-usb.h, and anything could happen after that. Erik -- The northeast coast of Tasmania is a climate-change hotspot. There's been a sea surface temperature monitor on Maria island for 30 years and in that time the sea has warmed 4°C [bringing] the long-spined sea urchin, which was first seen around Flinders Island in the late 70s. - Dave Allen, in Weekly Times 02.04.14.

On 09/05/14 23:30, Erik Christiansen wrote:
On 09.05.14 20:21, Robert Brown wrote: This is what we're looking for:
ignoring nonexistent directory "/drivers/media/dvb/dvb-usb/" IIRC, you have dvb-usb/ for 3.2, but not for 3.4. Yes I have the pointer set to include-320 as the include-340 is empty atm.
ignoring nonexistent directory "/drivers/media/dvb/dvb-core/" ignoring nonexistent directory "/drivers/media/dvb/frontends/" ignoring nonexistent directory "/drivers/media/common/tuners/" #include "..." search starts here: #include <...> search starts here: /home/debian/linux-sunxi-pat-3.4.67/arch/arm/include arch/arm/include/generated include arch/arm/mach-sun4i/include arch/arm/plat-sunxi/include /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/include-320 A 3.2 include directory is being used here, FWIW. But if you have nothing later, then let's not quibble. (And if you've set that "include-340" thing, then it probably won't be used anyway.)
/usr/lib/gcc/arm-linux-gnueabihf/4.6/include End of search list. Try extending the EXTRA_CFLAGS in the Makefile thus:
... -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) \ -I/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/
I.e. The "\" extends from the pre-existing last line, adding one new.
Now it has somewhere to find dvb-usb.h, and anything could happen after that.
Erik
The result is in the attached compile2.txt and have also attached dvb_frontend.h A bit of searching on the error led me to: https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0... which suggests this: https://github.com/tmair/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0... which I am about to d/l and try. Beats me why all of my previous searches for "rtl2832 and kernel 3.4" have not taken me to this possibly vital link. Rob

On 10/05/14 08:11, Robert Brown wrote:
Try extending the EXTRA_CFLAGS in the Makefile thus:
... -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) \ -I/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/
I.e. The "\" extends from the pre-existing last line, adding one new.
Now it has somewhere to find dvb-usb.h, and anything could happen after that.
Erik
The result is in the attached compile2.txt and have also attached dvb_frontend.h A bit of searching on the error led me to: https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0...
which suggests this: https://github.com/tmair/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0...
which I am about to d/l and try. Beats me why all of my previous searches for "rtl2832 and kernel 3.4" have not taken me to this possibly vital link.
Rob
Ok this compile works without errors. Yay (have you any idea how long I have been at this?) and creates a dvb-usb-rtl2832u.ko but not a rtl2832u.ko despite there being a bunch of files like rtl2832u.c and rtl2832u.o and dmesg complains of no frontend: dvb-usb: found a 'RTL2832U DVB-T USB DEVICE' in warm state. [ 2040.777066] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 2040.793621] DVB: registering new adapter (RTL2832U DVB-T USB DEVICE) [ 2040.833115] RTL2832U usb_init_bulk_setting : USB2.0 HIGH SPEED (480Mb/s) [ 2041.153012] RTL2832U check_tuner_type : ERROR Unknown tuner on board... [ 2041.166512] dvb-usb: no frontend was attached by 'RTL2832U DVB-T USB DEVICE' [ 2041.190209] input: IR-receiver inside an USB DVB receiver as /devices/platform/sw-ehci.1/usb2/2-1/input/input3 [ 2041.226625] dvb-usb: schedule remote query interval to 287 msecs. [ 2041.251663] dvb-usb: RTL2832U DVB-T USB DEVICE successfully initialized and connected. [ 2041.267826] usbcore: registered new interface driver dvb_usb_rtl2832u [ 2548.427451] rtl2832: disagrees about version of symbol module_layout so I will attach -v in the Makefile and run it again. Getting there!
_______________________________________________ luv-main mailing list luv-main@luv.asn.au http://lists.luv.asn.au/listinfo/luv-main

On 10/05/14 08:44, Robert Brown wrote:
On 10/05/14 08:11, Robert Brown wrote:
Try extending the EXTRA_CFLAGS in the Makefile thus:
... -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) \ -I/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/
I.e. The "\" extends from the pre-existing last line, adding one new.
Now it has somewhere to find dvb-usb.h, and anything could happen after that.
Erik
The result is in the attached compile2.txt and have also attached dvb_frontend.h A bit of searching on the error led me to: https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0...
which suggests this: https://github.com/tmair/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0...
which I am about to d/l and try. Beats me why all of my previous searches for "rtl2832 and kernel 3.4" have not taken me to this possibly vital link.
Rob
Ok this compile works without errors. Yay (have you any idea how long I have been at this?) and creates a dvb-usb-rtl2832u.ko but not a rtl2832u.ko despite there being a bunch of files like rtl2832u.c and rtl2832u.o and dmesg complains of no frontend: dvb-usb: found a 'RTL2832U DVB-T USB DEVICE' in warm state. [ 2040.777066] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 2040.793621] DVB: registering new adapter (RTL2832U DVB-T USB DEVICE) [ 2040.833115] RTL2832U usb_init_bulk_setting : USB2.0 HIGH SPEED (480Mb/s) [ 2041.153012] RTL2832U check_tuner_type : ERROR Unknown tuner on board...
[ 2041.166512] dvb-usb: no frontend was attached by 'RTL2832U DVB-T USB DEVICE'
[ 2041.190209] input: IR-receiver inside an USB DVB receiver as /devices/platform/sw-ehci.1/usb2/2-1/input/input3 [ 2041.226625] dvb-usb: schedule remote query interval to 287 msecs. [ 2041.251663] dvb-usb: RTL2832U DVB-T USB DEVICE successfully initialized and connected. [ 2041.267826] usbcore: registered new interface driver dvb_usb_rtl2832u [ 2548.427451] rtl2832: disagrees about version of symbol module_layout
so I will attach -v in the Makefile and run it again. Getting there!
So the make is running: CC [M] /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/rtl2832u.o without errors and similar so should produce a rtl2832u.ko IMHO. It says : ignoring nonexistent directory "/drivers/media/dvb/frontends/" and 3 others like it but those directories exist e.g. ~/linux-sunxi-pat-3.4.67/drivers/media/dvb/frontends so it must be looking in a different place. Not sure if that's why I don't get a rtl2832u.ko but I notice that the install part of the makefile doesn't seem to expect such a .ko file. Maybe I could try mkdir /drivers/media/dvb/frontends/ in directory DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0 from where I run make? Thanks

On 10/05/14 09:49, Robert Brown wrote:
On 10/05/14 08:44, Robert Brown wrote:
On 10/05/14 08:11, Robert Brown wrote:
Try extending the EXTRA_CFLAGS in the Makefile thus:
... -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) \ -I/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/
I.e. The "\" extends from the pre-existing last line, adding one new.
Now it has somewhere to find dvb-usb.h, and anything could happen after that.
Erik
The result is in the attached compile2.txt and have also attached dvb_frontend.h A bit of searching on the error led me to: https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0...
which suggests this: https://github.com/tmair/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0...
which I am about to d/l and try. Beats me why all of my previous searches for "rtl2832 and kernel 3.4" have not taken me to this possibly vital link.
Rob
Ok this compile works without errors. Yay (have you any idea how long I have been at this?) and creates a dvb-usb-rtl2832u.ko but not a rtl2832u.ko despite there being a bunch of files like rtl2832u.c and rtl2832u.o and dmesg complains of no frontend: dvb-usb: found a 'RTL2832U DVB-T USB DEVICE' in warm state. [ 2040.777066] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 2040.793621] DVB: registering new adapter (RTL2832U DVB-T USB DEVICE) [ 2040.833115] RTL2832U usb_init_bulk_setting : USB2.0 HIGH SPEED (480Mb/s) [ 2041.153012] RTL2832U check_tuner_type : ERROR Unknown tuner on board...
[ 2041.166512] dvb-usb: no frontend was attached by 'RTL2832U DVB-T USB DEVICE'
[ 2041.190209] input: IR-receiver inside an USB DVB receiver as /devices/platform/sw-ehci.1/usb2/2-1/input/input3 [ 2041.226625] dvb-usb: schedule remote query interval to 287 msecs. [ 2041.251663] dvb-usb: RTL2832U DVB-T USB DEVICE successfully initialized and connected. [ 2041.267826] usbcore: registered new interface driver dvb_usb_rtl2832u [ 2548.427451] rtl2832: disagrees about version of symbol module_layout
so I will attach -v in the Makefile and run it again. Getting there!
So the make is running: CC [M] /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/rtl2832u.o
without errors and similar so should produce a rtl2832u.ko IMHO. It says : ignoring nonexistent directory "/drivers/media/dvb/frontends/" and 3 others like it but those directories exist e.g. ~/linux-sunxi-pat-3.4.67/drivers/media/dvb/frontends so it must be looking in a different place. Not sure if that's why I don't get a rtl2832u.ko but I notice that the install part of the makefile doesn't seem to expect such a .ko file. Maybe I could try mkdir /drivers/media/dvb/frontends/ in directory DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0 from where I run make?
Ok so that doesn't help. I decided that makefile was missing the instructions to create rtl2832u.ko so added this: rtl2832u-objs := rtl2832u.o rtl2832u_fe.o rtl2832u_io.o \ rtl2832u_rc.o obj-m += rtl2832u.o but got errors: make[1]: Circular /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/rtl2832u.o <- /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/rtl2832u.o dependency dropped. make[1]: *** No rule to make target `/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/rtl2832u_rc.o', needed by `/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/rtl2832u.o'. Stop. make: *** [_module_/home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0] Error 2 make: Leaving directory `/home/debian/linux-sunxi-pat-3.4.67' confirming that I was only guessing at what to do.

On 10/05/14 14:07, Robert Brown wrote:
On 10/05/14 09:49, Robert Brown wrote:
On 10/05/14 08:44, Robert Brown wrote:
On 10/05/14 08:11, Robert Brown wrote:
Try extending the EXTRA_CFLAGS in the Makefile thus:
... -I$(SOURCEDIR)/$(INCLUDE_EXTRA_DVB) \ -I/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/
I.e. The "\" extends from the pre-existing last line, adding one new.
Now it has somewhere to find dvb-usb.h, and anything could happen after that.
Erik
The result is in the attached compile2.txt and have also attached dvb_frontend.h A bit of searching on the error led me to: https://github.com/ambrosa/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0...
which suggests this: https://github.com/tmair/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0...
which I am about to d/l and try. Beats me why all of my previous searches for "rtl2832 and kernel 3.4" have not taken me to this possibly vital link.
Rob
Ok this compile works without errors. Yay (have you any idea how long I have been at this?) and creates a dvb-usb-rtl2832u.ko but not a rtl2832u.ko despite there being a bunch of files like rtl2832u.c and rtl2832u.o and dmesg complains of no frontend: dvb-usb: found a 'RTL2832U DVB-T USB DEVICE' in warm state. [ 2040.777066] dvb-usb: will pass the complete MPEG2 transport stream to the software demuxer. [ 2040.793621] DVB: registering new adapter (RTL2832U DVB-T USB DEVICE) [ 2040.833115] RTL2832U usb_init_bulk_setting : USB2.0 HIGH SPEED (480Mb/s) [ 2041.153012] RTL2832U check_tuner_type : ERROR Unknown tuner on board...
[ 2041.166512] dvb-usb: no frontend was attached by 'RTL2832U DVB-T USB DEVICE'
[ 2041.190209] input: IR-receiver inside an USB DVB receiver as /devices/platform/sw-ehci.1/usb2/2-1/input/input3 [ 2041.226625] dvb-usb: schedule remote query interval to 287 msecs. [ 2041.251663] dvb-usb: RTL2832U DVB-T USB DEVICE successfully initialized and connected. [ 2041.267826] usbcore: registered new interface driver dvb_usb_rtl2832u [ 2548.427451] rtl2832: disagrees about version of symbol module_layout
so I will attach -v in the Makefile and run it again. Getting there!
So the make is running: CC [M] /home/debian/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0/rtl2832u.o
without errors and similar so should produce a rtl2832u.ko IMHO. It says : ignoring nonexistent directory "/drivers/media/dvb/frontends/" and 3 others like it but those directories exist e.g. ~/linux-sunxi-pat-3.4.67/drivers/media/dvb/frontends so it must be looking in a different place. Not sure if that's why I don't get a rtl2832u.ko but I notice that the install part of the makefile doesn't seem to expect such a .ko file. Maybe I could try mkdir /drivers/media/dvb/frontends/ in directory DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0/RTL2832-2.2.2_kernel-3.0.0 from where I run make?
The attached Makefile seems to suggest that only one module is created dvb_usb_rtl2832u.ko which it does successfully but I reckon I need at least one other module rtl2838u.ko which would be the frontend that's missing. Any thoughts anyone?

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, 10 May 2014 09:12:08 PM Robert Brown wrote:
The attached Makefile seems to suggest that only one module is created dvb_usb_rtl2832u.ko which it does successfully but I reckon I need at least one other module rtl2838u.ko which would be the frontend that's missing. Any thoughts anyone?
I just had a look and it appears there was a driver for the RTL2832U merged into the staging tree for 3.15-rc1. drivers/staging/media/rtl2832u_sdr It *might* be easier for you to cross-compile an entire kernel for your target with the various frontends configured in too, if you can live with an RC kernel. :-) All the best, Chris - -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEVAwUBU24P8Y1yjaOTJg85AQKSzAgAsWhtA7XCsufsm0r6UQFoxNVH068Ka9f5 jqERcul4JJKkgnK46VBUaZgTdvhMKrmorlQP3tkgnN4WBkFnTAC+0o2TOv6eSuhg L6wgaLgRia82G6LO1gCQQY21bHReCI1m67jhIXvCCFhStKbKblvFmYRGP7lV/ggi MN/LKLck6UCA1gm5yoFxFLMXvjJ2nsOusya0Kp9meTpHtQ9AqBE+3h1RMQN11mwl +iCwQSiEjxvQ8zfRV+rbPACfNEQwYIyZmXcVlGz6OaScYZHzl6T5+knhVsBlr/OZ 2bloWGXrTf30RSDlaM5NnWhyfmkdrTaIIhPtpy946EivpVbareNt/A== =KGfQ -----END PGP SIGNATURE-----

Hi Chris Thanks for the reply. I am certainly open to this option but as far as I am aware, for the Allwinner series of SoCs including my A10, the 3.15 kernel is still some way off. I had a few attempts at doing this on various earlier kernels so happy to have a go when it comes around. Regards Rob On 10/05/14 21:39, Chris Samuel wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Sat, 10 May 2014 09:12:08 PM Robert Brown wrote:
The attached Makefile seems to suggest that only one module is created dvb_usb_rtl2832u.ko which it does successfully but I reckon I need at least one other module rtl2838u.ko which would be the frontend that's missing. Any thoughts anyone? I just had a look and it appears there was a driver for the RTL2832U merged into the staging tree for 3.15-rc1.
drivers/staging/media/rtl2832u_sdr
It *might* be easier for you to cross-compile an entire kernel for your target with the various frontends configured in too, if you can live with an RC kernel. :-)
All the best, Chris - -- Chris Samuel : http://www.csamuel.org/ : Melbourne, VIC
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux)
iQEVAwUBU24P8Y1yjaOTJg85AQKSzAgAsWhtA7XCsufsm0r6UQFoxNVH068Ka9f5 jqERcul4JJKkgnK46VBUaZgTdvhMKrmorlQP3tkgnN4WBkFnTAC+0o2TOv6eSuhg L6wgaLgRia82G6LO1gCQQY21bHReCI1m67jhIXvCCFhStKbKblvFmYRGP7lV/ggi MN/LKLck6UCA1gm5yoFxFLMXvjJ2nsOusya0Kp9meTpHtQ9AqBE+3h1RMQN11mwl +iCwQSiEjxvQ8zfRV+rbPACfNEQwYIyZmXcVlGz6OaScYZHzl6T5+knhVsBlr/OZ 2bloWGXrTf30RSDlaM5NnWhyfmkdrTaIIhPtpy946EivpVbareNt/A== =KGfQ -----END PGP SIGNATURE-----
_______________________________________________ luv-main mailing list luv-main@luv.asn.au http://lists.luv.asn.au/listinfo/luv-main

On 10.05.14 08:44, Robert Brown wrote:
Ok this compile works without errors. Yay (have you any idea how long I have been at this?)
ISTR related posts many weeks back. ;-)
and creates a dvb-usb-rtl2832u.ko but not a rtl2832u.ko despite there being a bunch of files like rtl2832u.c and rtl2832u.o
It appears that dvb-usb-rtl2832u.ko is just rtl2832u.ko with a prefix of "dvb-usb-" tacked on by the makefile. Here: http://forum.stmlabs.com/showthread.php?tid=6780 we see others doing: sudo chown root:root /tmp/dvb-usb-rtl2832.ko sudo mv /tmp/dvb-usb-rtl2832.ko /lib/modules/3.6.11/kernel/drivers/media/dvb/dvb-usb/ sudo depmod -a so the name prefix appears to be no biggie.
and dmesg complains of no frontend: dvb-usb: found a 'RTL2832U DVB-T USB DEVICE' in warm state. ... [ 2041.251663] dvb-usb: RTL2832U DVB-T USB DEVICE successfully initialized and connected.
OK, the module has been loaded, and runs. The problem now is to make it run as desired, AIUI. Googling for "dvb-usb: no frontend was attached", the first hit discusses the need for a device ID with "dc02", rather than "dc01". What does lsusb show? It seems to be time to pat yourself on the back for succeeding in building the module for the newer kernel, before moving on to tickling it into performing as desired. The "no frontend" seems to have multiple possible causes, all only vaguely alluded to, if a quick google scan is indicative. (I don't know anything about this stuff.) Erik -- All we have to decide is what to do with the time that is given us. - Gandalf the Grey

On 09.05.14 18:33, Robert Brown wrote:
On 09/05/14 17:35, Erik Christiansen wrote:
On 08.05.14 20:49, Robert Brown wrote:
BTW uname -ra shows Linux debian 3.4.67-sun4i+ #10 PREEMPT Sun Nov 24 17:13:58 EST 2013 armv7l GNU/Linux which is why I was looking for a directory include-340
OK, that's on the target, not the build machine, right? ('cos if that's the build machine, then a native compile would do, and life would be much simpler. Just checkin')
Yes that is uname from the target arm machine. That was to point out that the module is required for a 3.4 kernel. Its still the case that the 'make' doesn't get to first base when not run from the sub-directory.
OK, the "-C /home/user/linux-sunxi/" changes to that directory, and since you do not specify a "-f", it'll use the makefile there. Your OP shows it finding one in /home/user/linux-sunxi/scripts/, IIUC:
make: Entering directory `/home/user/linux-sunxi' scripts/Makefile.build:44: /home/user/DVB-Realtek-RTL2832U-2.2.2-10tuner-mod_kernel-3.0.0-master/Makefile: No such file or directory
I.e. Makefile.build has apparently used the M=$PWD (Look for a $M in Makefile.build) to partially undo the effect of your "-C". Since there is no makefile at that $PWD, Makefile.build clearly expects you to be in the subdirectory. Is there no "README" or "BUILD" in the top directory to explain this requirement? (Or some release notes?)
I have tried CROSS-COMPILEing on my laptop as well where it also falls over unless I cd to the sub-directory.
Ah, then many of the upthread builds were done on the target? (Where suitable system headers ought to be available close to hand.)
When you run:
$ locate dvb-usb.h
on the target, does it show anything? (Or "find" if the target lacks "locate".) If so, you have a copy of the required header, just not where you need it.
You will be able to see from the following that I have had numerous attempts and various methods to get this going. The one in bold is probably the one I need?
Having over the last few decades only moved from the venerable unix "mail" program to "mutt", I still eschew html, so can't see bold. I did open your post in edit mode, to see if I could find something like <bold>, but no go. Ah, I see two asterisks on the prime candidate:
**/home/debian/linux-sunxi-pat-3.4.67/drivers/media/dvb/dvb-usb/dvb-usb.h*
I notice that there's an include directory in /home/debian/linux-sunxi-pat-3.4.67/ .. Does this indicate that I have kernel headers (or should I say kernel sources?)?
Well the whole tree is module source, I figure, if there are .c files in there. ...
Really appreciate that you have taken some time to digest this.
No worries. Have to respect you for diving in the deep end without a snorkel, and not giving up. Things are quiet on most of the other lists I'm on, and your problem is relaxing so far, requiring only dusting off of some memory cobwebs, and trying to read carefully. Since neither of us knows that it can't be done, who's to say you won't succeed? Erik -- A computer is like an air conditioner, it works poorly when you open Windows.
participants (3)
-
Chris Samuel
-
Erik Christiansen
-
Robert Brown