<div dir="ltr">Apparently I didn't had to pass any additional parameters to the Makefile. Make with entering kernel source directory knows what architecture kernel was built so it built module for the same .... Smart<br>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 5, 2014 at 10:43 PM, Boris Borisov <span dir="ltr"><<a href="mailto:bugyatl@gmail.com" target="_blank">bugyatl@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">thank you for detailed answer ! Could not touch computer all afternoon<br>
so I'm checking now. Today manually add line before 79. KERNDIR :=<br>
/user/linux-2.6.24.3 dirty way but worked. so far got driver but for<br>
x86. In the morning will try to pass parameters to compiler ARCH=mips<br>
and CROSS_COMPILE=mips-linux- and should work. Now is too late can put<br>
my thoughts together :)<br>
<br>
Thanks again<br>
<div class="HOEnZb"><div class="h5"><br>
On 5/5/14, Ed Cashin <<a href="mailto:ecashin@noserose.net">ecashin@noserose.net</a>> wrote:<br>
> Responses will interleave with selected quotes below.<br>
><br>
> On Mon, May 5, 2014 at 11:00 AM, Boris Borisov <<a href="mailto:bugyatl@gmail.com">bugyatl@gmail.com</a>> wrote:<br>
>> I'm trying to get my way around cross-compiling. I have host Debian 7.5<br>
>> and<br>
>> the toolchain for mips. I'm working with patched 2.6.24.3 kernel because<br>
>> that is what runs on my device. So far I got how to compile the kernel<br>
>> for<br>
>> mips.<br>
><br>
> Congratulations. It isn't always easy to build old kernels. I used<br>
> to use VMs running old versions of RHEL to build old kernels. It also<br>
> isn't always easy to cross compile!<br>
><br>
>> My question is how you are compiling module that is not in kernel tree.<br>
><br>
> I have some experience with that. I checked out the rt73 sources from<br>
> sourceforge.<br>
><br>
> ...<br>
>> Since the module package has its own Makefile: do you make changes in<br>
>> this<br>
>> Makefile or you start make with extra parameters?<br>
><br>
> Maybe it's helpful to break down how the parts of the build relate.<br>
> Sorry if you know all this, but the Module/Makefile inside rt73 looks<br>
> for the kernel sources via the expected "build" symlink:<br>
><br>
> 79 ifdef KERNDIR<br>
> 80 KERNEL_SOURCES := $(KERNDIR)<br>
> 81 else<br>
> 82 KERNEL_SOURCES := /lib/modules/$(shell uname -r)/build<br>
> 83 endif<br>
><br>
> ... so you can do 'make KERNDIR=/path/to/my/sources' ... to specify your<br>
> own.<br>
><br>
> It uses the KERNEL_SOURCES to build parameters for the build command:<br>
><br>
> 115 KBUILD_PARAMS := -C $(KERNEL_SOURCES) SUBDIRS=$(CURDIR)<br>
> $(KERNEL_OUTPUT)<br>
><br>
> Notice the "-C" option. That's going to cause make to change<br>
> directories to the kernel sources and to use the Makefile there. So<br>
> this is a recursive make, where it starts out in the rt73 sources but<br>
> quickly changes to the kernel sources.<br>
><br>
> When it's (the child) make running on the Makefile in the kernel<br>
> sources, it's being told to build the modules in the subdirectories<br>
> $(SUBDIRS), which is set to be rt73's Module/ subdirectory.<br>
><br>
> Back when rt73 invoked this child make, it passed on the EXTRA_CFLAGS:<br>
><br>
> 127 module:<br>
> 128 @$(MAKE) $(KBUILD_PARAMS)<br>
> 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' modules; \<br>
> 129 $(MODULE_CHECK)<br>
><br>
> ... and that suggests that you can supply EXTRA_CFLAGS from your<br>
> invocation inside rt73's Module/ subdirectory. You can also edit<br>
> Module/Makefile if you like.<br>
><br>
> With that example, you can probably think of ways to get other<br>
> variables to show up in the kernel build as well.<br>
><br>
> --<br>
> Ed Cashin <<a href="mailto:ecashin@noserose.net">ecashin@noserose.net</a>><br>
> _______________________________________________<br>
> Ale mailing list<br>
> <a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
> <a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
> See JOBS, ANNOUNCE and SCHOOLS lists at<br>
> <a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
><br>
</div></div></blockquote></div><br></div>